Commit graph

14 commits

Author SHA1 Message Date
Mihai Varga
1cfd1352ce loolwsd: renamed getStatus/saveStatus to getTextFile/saveTextFile
And added a getStyles method that uses the above methods to cache
document styles
2015-08-19 11:48:49 +03:00
Mihai Varga
3e0a3d9ed6 loolwsd: use a mutex when moving/removing tiles form the cache 2015-08-12 16:07:44 +03:00
Jan Holesovsky
527821597f Make the timestamps work also for non-file:// URLs. 2015-08-04 20:39:33 +02:00
Mihai Varga
c9fff5d8e3 loolwsd: updated tileCache::invalidateTiles 2015-07-21 14:53:53 +03:00
Jan Holesovsky
7c48ea1fe3 Change the tiles cache to 2-level cache.
Now we have 2 caching directories: 'persistent', and 'editing'.

The Persistent cache always represents the document as it is saved, the
Editing one caches the current edits.  The Editing state is copied to
Persistent on save.  The Editing state is destroyed on reload.
2015-06-24 22:07:58 +02:00
Tor Lillqvist
4303f1ee38 Improve tile cache handling for file: documents
Handle also documents specified with a file: URI. Move creating the
modtime.txt file to the constructor of the TileCache object for the document.
2015-05-29 12:26:54 +03:00
Tor Lillqvist
bf985624f1 Handle LOK_CALLBACK_INVALIDATE_TILES in the server too
Remove any intersecting cached tiles. It is the parent process that handles
the tile cache, so it must look for invalidatetiles: messages, too, before
passing them on to the client. To know for which part we should remove tiles,
add an "ephemeral" curpart: message that the child process sends to the parent
process before the invalidatetils: message.
2015-05-28 18:48:51 +03:00
Tor Lillqvist
09b261d57b Handle LOK_CALLBACK_DOCUMENT_SIZE_CHANGED even better
Just call the getStatus() function directly in the child process, which will
always cause a complete status: message to be sent to the client. No
documentsizechanged: messages now sent to the client at all.
2015-05-28 16:46:37 +03:00
Tor Lillqvist
0092414470 Handle LOK_CALLBACK_DOCUMENT_SIZE_CHANGED callbacks more cleverly
When a child process sends a documentsizechanged: message to the parent, to be
forwarded to the client, parse it and update a cached status of the doucment,
if available, and send an updated status: message to the client instead.

Note that clients should not rely on getting only status: messages and never
documentsizechanged: messages, though; the cache might be cleaned at any time
even while the server is running. If there is no cached status of the document
to update and re-use, we have to forward the documentsizechanged: message as
such to the client.
2015-05-28 12:53:14 +03:00
Tor Lillqvist
cb65bbbc36 Include <string> for completeness
Sure, it seems to get included indirectly already, but we can't be sure that
holds for all compilers.
2015-05-06 17:58:00 +03:00
Tor Lillqvist
1b06290d2b Add a part parameter to the tile messages
The JS code always passes in 0 for now. The server parses the parameter and
calls LibreOfficeKitDocument::setPart() before calling paintTile().

Probably also the status, key, mouse and selection messages will need a part
number. The intent is after all that the protocol is as stateless as
possible. (So maybe we should also pass the document URL in each message?)
2015-04-27 21:30:26 +03:00
Tor Lillqvist
ea01aa2002 Cache also document status 2015-03-13 14:17:51 +02:00
Tor Lillqvist
ad3fda27af Further hacking on tile cache 2015-03-13 01:34:42 +02:00
Tor Lillqvist
08583f8ebe Add first cut at caching of tiles 2015-03-12 17:26:35 +02:00