Commit graph

3688 commits

Author SHA1 Message Date
Pranav Kant
5ba6360a8b loleaflet: Factor out generation of .json
... so that one can use the factored-out rule, build-l10n, to
install these translation .json files in dist/ and start using
them, without having to do 'make dist' first and then extract the
package.

Change-Id: Ie2814a9f2596246b487799968f3027aa48475e7b
2016-09-21 13:57:14 +05:30
Katarina Behrens
8dfa3a49c7 Silence lintian: there are no init.d-style scripts here
Change-Id: Idae03c6ad015d5f09ce012117e6ffb88b7c7abb8
Reviewed-on: https://gerrit.libreoffice.org/29037
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2016-09-21 08:26:05 +00:00
Pranav Kant
c2f0b84dd1 loleaflet: Don't try to delete .pot files
The behavior has changed to include .pot files in git as well in
7839aecac6

So, don't try to delete these .pot files now

Change-Id: I6f5d015596ff1f2d98adca426b1458f66bc7d4b4
Reviewed-on: https://gerrit.libreoffice.org/29130
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2016-09-21 08:14:42 +00:00
Katarina Behrens
7424bfd11e Add dependency on 'adduser', postinst script needs it
Change-Id: I41c6b2d6ef9191db3a07bfaf55530659bc06a1d0
Reviewed-on: https://gerrit.libreoffice.org/29017
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2016-09-21 08:11:08 +00:00
Pranav Kant
ede173201f loleaflet: Fix admin l10n strings file location
Location was changed in 6c69b63be5
in an effort to modularize everything including these l10n
strings.

Change-Id: I4d7538a6e6d1370a45326bc163a496cf7c681259
2016-09-21 13:05:52 +05:30
Pranav Kant
ed860594a1 loleaflet: Guard against null
This helps in preventing some of many warnings in the browser
console.

Change-Id: I568b9a20e7cecfddaffd7309271fae4f6c265b46
2016-09-21 13:00:39 +05:30
Pranav Kant
a9946c59c0 loleaflet: cleanup
Change-Id: Ia61402f5e0d650d7de606b1d8c8a548453972475
2016-09-21 12:46:49 +05:30
Pranav Kant
0991924a59 loleaflet: Cleanup internal view list after socket close
Change-Id: Ic18bc0f3efcd7cf68d5291305e4f0bcff9d48fdb
2016-09-21 12:02:27 +05:30
Pranav Kant
626eab255a loleaflet: Handle new message, 'viewinfo:'
Change-Id: I82d886e3450439bbfd2e4b381cc8f9336bcdd57e
2016-09-21 12:02:27 +05:30
Pranav Kant
46107dd0c8 loolwsd: Always send the updated view info to clients
This replaces addview/remview/remallview messages in the protocol
with 'viewinfo' message which is sent whenever there is any
change in the view information.

Let the client deal with what information is redundant to it.

Change-Id: Ic470ea88a94ff281a0ae021014a9fba1b876f648
2016-09-21 12:02:27 +05:30
Ashod Nakashian
5cbc1f10a4 loolwsd: TileCacheTests cleanup
Change-Id: I88b84e9eb8d8b4e38354132c5875a26cacde9dca
Reviewed-on: https://gerrit.libreoffice.org/29128
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-21 05:19:43 +00:00
Ashod Nakashian
40f23677ee loolwsd: assume loading new view in unittests by default
...and prepare to removing view/non-view flags.

Change-Id: I464a71fa0e73abc577644170cb17309e5c8c252f
Reviewed-on: https://gerrit.libreoffice.org/29127
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-21 05:19:07 +00:00
Ashod Nakashian
ae4a9f7110 loolwsd: always request newer tile version
And accept any version newer than expected.

Since we have proper de-duplication of tiles
requesting newer versions reduces changes of
races between client and the renderer.

Change-Id: I30bb53f98ef6f1461b53c1cf527d315dc35f7f26
Reviewed-on: https://gerrit.libreoffice.org/29125
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-21 05:18:09 +00:00
Ashod Nakashian
9640fd1e78 loolwsd: handle invalidatetiles in DocumentBroker
Change-Id: I05e70f82af9b5c8bdb590a64688ffa70c6ba2034
Reviewed-on: https://gerrit.libreoffice.org/29124
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-21 05:17:27 +00:00
Ashod Nakashian
87a9f6e166 loolwsd: don't remove subscriptions on invalidation
Tile invalidation is a hint to the clients to request
fresh tiles and replace the existing ones. However
any outstanding tile request will be rendered anew.
So no need to remove those.

Nonetheless, we should issue new versions to avoid
race between old tile and invalidate. This can
happen when a tile rendered just before invalidate
reaches the client after the invalidate. The client
will think the tile is a new one when it was rendered
just before the invalidate.

Change-Id: Ieb2ffab1214dd904da8e532e7d9d20e6ad783b78
Reviewed-on: https://gerrit.libreoffice.org/29123
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-21 05:16:57 +00:00
Ashod Nakashian
14f11460b6 loolwsd: new multi-view canceltiles unittest
Change-Id: Ia7fdc2c64c96e3edeb82ef48d3621b70ca958b5d
Reviewed-on: https://gerrit.libreoffice.org/29122
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-21 05:16:21 +00:00
Ashod Nakashian
d4a8177803 loolwsd: better timeout handling in unittests
Change-Id: Ib9a002cb25eda12335727bef56f7e2d48d682438
Reviewed-on: https://gerrit.libreoffice.org/29121
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-21 05:15:55 +00:00
Ashod Nakashian
0326aa4304 loolwsd: cancel individual tiles
Change-Id: I18faee319fc12de2151460afbb054b8509578579
Reviewed-on: https://gerrit.libreoffice.org/29120
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-21 05:15:30 +00:00
Ashod Nakashian
9e5df31cbb loolwsd: make sure to combine all contiguous tiles
Change-Id: If65e2ff53f593015ba7df23b6943a711c36550de
Reviewed-on: https://gerrit.libreoffice.org/29119
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-21 05:14:41 +00:00
Ashod Nakashian
6bf643183e loolwsd: cancel subscriber tiles only
Change-Id: I207f2332520f29308a2994769aa3a12ea5178477
Reviewed-on: https://gerrit.libreoffice.org/29118
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-21 05:14:03 +00:00
Ashod Nakashian
8f213bc170 loolwsd: canceltiles re-designed using tilecache instead of queue
Reviewed-on: https://gerrit.libreoffice.org/28526
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
(cherry picked from commit 571ff06906)

Change-Id: Ie8f2c87a705aac14dd6f139c384f000df98db909
Reviewed-on: https://gerrit.libreoffice.org/29117
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-21 05:13:18 +00:00
Ashod Nakashian
836219d269 loolwsd: unittests for combined rendering
Change-Id: I164942c1b14727c2f1707341d625c3b4bfc3f672
Reviewed-on: https://gerrit.libreoffice.org/29116
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-21 05:10:31 +00:00
Ashod Nakashian
e9f37433d7 loolwsd: combine tiles before rendering to reduce latency
Change-Id: I5af2d2a9ddf3b5a3db5bc5f0835687d7cae5b17c
Reviewed-on: https://gerrit.libreoffice.org/29115
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-21 04:59:49 +00:00
Ashod Nakashian
cdafb34b53 loolwsd: added impress tiles unittest
Change-Id: I25036f6a9ad77ebd06991866245e89c1045fbea3
Reviewed-on: https://gerrit.libreoffice.org/29114
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-21 04:48:35 +00:00
Tor Lillqvist
b7aa479120 Add configure options to use a self-built cppunit
I wanted to try loolwsd built with _GLIBCXX_DEBUG defined and thus
needed cppunit built like that, too. (And Poco, but we already had
configury to point to a self-built Poco.)
2016-09-20 20:32:30 +03:00
Ashod Nakashian
3b2055a0a8 loolwsd: remove the callback descriptor after destroyView
On destroyView Core must flush the events queue, otherwise
by the next idle the descriptor will be gone and we'll
be using freed memory.

Change-Id: I6d3d8f9461bc156383a7294e9c65c535d79f2e7a
Reviewed-on: https://gerrit.libreoffice.org/29088
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-20 11:58:20 +00:00
László Németh
fb351f2c1a add client-side tile debugging mode
Extending the document URL with debug=1 option will switch

- visible tile boundaries
- update numbers over tiles

and invalidated tiles will be blue during waiting for an update.
2016-09-20 13:22:36 +02:00
Tor Lillqvist
90c7b553ed Don't erase the CallbackDescriptor record before turning off callbacks
Seems to fix the deadlock problem, or at least makes it very much
rarer. (I am not entirely certain that a callback might not be in
progress already (in another thread) when we turn off callbacks, and
in that case the callback might still then access freed memory?)
2016-09-20 13:32:43 +03:00
Tor Lillqvist
8207412c02 Poco::Thread::current() is not reliable for logging
It can return null for no obvious reason, leading to misleading
logging where the same thread is identified as numer zero at one place
and non-zero at another. So use the actual Linux thread id in logging.

Sure, thread ids are somewhat less convenient, as they are larger
numbers, from the same number space as process ids.
2016-09-20 13:32:43 +03:00
Pranav Kant
f84cad1e8d loleaflet: Fix some cases of leaked connecting spinner
Change-Id: If694e8f699a2a087dad1e36fc3b67960ac294560
2016-09-20 15:18:10 +05:30
Andras Timar
7465853d34 l10n: add src/control/Control.DocumentRepair.js for string extraction to pot file 2016-09-20 09:52:24 +02:00
Miklos Vajna
ef4ca0507a loolwsd: remove takeedit and editlock commands
As a follow-up to commit 77e219ceff
(loleaflet: Kill editlock code, completely, 2016-09-20).

Change-Id: I48a58bb738c0939f99d220eca7a8fd3f4c3debe4
2016-09-20 09:47:25 +02:00
Pranav Kant
77e219ceff loleaflet: Kill editlock code, completely
Editlock buttons have already been removed; most of this code is
unreachable/useless anyways.

Don't listen to editlock messages anymore, and always set the map
permission to edit unless specified.

Change-Id: I2ee672e72beaa48a7c6cd0bbd1c548ff10a251d1
2016-09-20 11:17:20 +05:30
Ashod Nakashian
faf6cf7ce4 loolwsd: better logging in subscribeToTileRendering
Change-Id: I5b94cda02e4f0e1154de81fc7bb4380332f2eeeb
Reviewed-on: https://gerrit.libreoffice.org/29070
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-20 03:34:59 +00:00
Ashod Nakashian
454b2b71c1 loolwsd: don't generate imgsize in tile when 0
Change-Id: I469bdbfbb5efd8230808e6c68f58f505acef3993
Reviewed-on: https://gerrit.libreoffice.org/29069
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-20 03:33:41 +00:00
Ashod Nakashian
ec4b489885 loolwsd: remove unused priority flag from saveTileAndNotify
Change-Id: I49309bb80a6b9e9e8265da8f8db966b98e362f0a
Reviewed-on: https://gerrit.libreoffice.org/29068
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-20 03:32:48 +00:00
Ashod Nakashian
a9fbfe8d8a loolwsd: remove queue thread from child socket handler
Change-Id: Ib6b4890db1f331b2e2cdcfafb57366ff62e3a13d
Reviewed-on: https://gerrit.libreoffice.org/29067
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-20 03:31:31 +00:00
Ashod Nakashian
e7272019dc loolwsd: remove tile queue and simplify tile response
Tile queue was used to process canceltiles commands.
Since those are handled by TileCache, there is no need
for queues and the threads that pump them.

But because these queues were also used to buffer between
WSD internals and clients, such that a slow client wouldn't
block WSD while sending back tiles, it is necessary
to reword that logic.
In subsequent commits that will change as well.

With this change not only do we save a thread per client,
but we also reduce latency of tile, and improve typing
responsiveness, by almost 3x or more! Latencies are
down to ~15ms from almost 50ms.

Reviewed-on: https://gerrit.libreoffice.org/28575
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
(cherry picked from commit 59eaacd2f8)

Change-Id: I77813267a95a724491165792ec020ae00953c05e
Reviewed-on: https://gerrit.libreoffice.org/29066
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-20 03:30:43 +00:00
Ashod Nakashian
1255cc11d8 loolwsd: version each tile and simplify tilecombine request handling
Change-Id: I369b05a747182cb387141d09ecb5098e1dd16901
Reviewed-on: https://gerrit.libreoffice.org/29065
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-20 03:27:34 +00:00
Ashod Nakashian
7a8248875d loolwsd: don't combine tiles by row to allow for better culling
Reviewed-on: https://gerrit.libreoffice.org/28615
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
(cherry picked from commit 99d0ee2ac1)

Change-Id: Ibfe6b7430cbdf78bc13b42d19789ce23226a5a5a
Reviewed-on: https://gerrit.libreoffice.org/29064
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-20 03:26:22 +00:00
Ashod Nakashian
23ef612970 loolwsd: ensure that the connection thread is running
If the connection thread is not running when loading a
document, the callback will drop events. This can happen
when the thread is too slow to spawn, but we return from
the createSession function and process client messages.

This should solve the race where we lose notifications of
other views when a new view is created.

Change-Id: Ia79739889b2f01fbb374d48eb33620084f4ed1c1
Reviewed-on: https://gerrit.libreoffice.org/29063
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-20 03:25:16 +00:00
Ashod Nakashian
53ba8a1307 loolwsd: use std sleep_for rather than POSIX or Poco
Change-Id: Icce28f2ee61035534431bb8b5d7df93b00ad2fc3
Reviewed-on: https://gerrit.libreoffice.org/29062
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-20 03:23:00 +00:00
Ashod Nakashian
bad8ae9ed9 loolwsd: one anonymous namespace per file is enough
Change-Id: I12b4967a321de45fc50ad314775d01499b5edd80
Reviewed-on: https://gerrit.libreoffice.org/29061
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-20 03:21:18 +00:00
Ashod Nakashian
74f796d91a loolwsd: flush trace file on events
This reduces chances of data loss and gives
more up-to-date data to the user.

Also include tile messages in the trace recording,
since they are useful for debugging. Should be
disabled to reduce excessive trace generation.

Change-Id: I223144660698843f4e94564e049883db898c0064
Reviewed-on: https://gerrit.libreoffice.org/29060
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-20 03:20:10 +00:00
Ashod Nakashian
b0f20ea35f loolwsd: proper tracing of outgoing tile messages
Change-Id: I875743cac144bd4bc357038aa58c9cfe7a3988aa
Reviewed-on: https://gerrit.libreoffice.org/29059
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-20 03:18:41 +00:00
Ashod Nakashian
6f7115ebc6 loolwsd: added config for logging to file
Change-Id: Ib4942af2e9875018fbb27e1666912ca8f8b4e901
Reviewed-on: https://gerrit.libreoffice.org/29058
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-20 03:16:45 +00:00
Miklos Vajna
21f8b072f3 Add EMPTY cell cursor testcase
Change-Id: I8d1e86a72eb3383d8d012d884a24233f8ee3079c
2016-09-19 16:58:02 +02:00
Miklos Vajna
ea274bcf6b Document::ViewCallback: don't fail on EMPTY cell cursor
Change-Id: I67bee2a1f1332bfb82963e0fb3a0e761054f826e
2016-09-19 16:04:23 +02:00
Ashod Nakashian
e1cd116abd loolwsd: duplicate command name removed
Change-Id: Iad7b440ec4ab30e832cf3ae2d4c64760fcb1db5d
Reviewed-on: https://gerrit.libreoffice.org/29022
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-19 12:13:35 +00:00
Ashod Nakashian
7fff960391 loolwsd: stop the tile-queue when exiting
Change-Id: I49276c9639e8826d145a31eb476b41eb64baf88a
Reviewed-on: https://gerrit.libreoffice.org/29009
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-19 12:03:57 +00:00