Depends on a core change that changes the ABI of the completeFunction().
Change-Id: I27daf31d49347c4a308518e14a9b8b97f3b48991
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93667
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
(cherry picked from commit 870a7ec5620eb742bd8fb2a9680ff67101a37dd7)
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93541
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
This patch allows the lok core to know about the device form facor of
the client requesting the creation of a new view, immediately instead
of a later time.
When a request for a new view is sent a 'deviceFormFactor' parameter
is appended to the message.
This parameter can have one of the following values: 'desktop',
'tablet','mobile' and is forwarded to the lok core.
Change-Id: I21739ddb8c43c960164b3c625e4cf0a80f4616a4
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92691
Tested-by: Marco Cecchetti <marco.cecchetti@collabora.com>
Reviewed-by: Marco Cecchetti <marco.cecchetti@collabora.com>
is a follow up of 217dd2de54
"Do not broadcast view-cursor invalidation messages"
But this change is implicitly Calc specific because
LOK_CALLBACK_CELL_VIEW_CURSOR is used only in Calc.
This patch fixes the following bug:
Suppose there are at least three clients each with a different zoom and the
all client's cursors are placed in same tab-view and away from A1. Now
it can be seen at once that the cursors of other clients in each client
are rendered incorrectly.
The commit c6b18508aec0e609b4c3c000faf89c21e93620bd in core.git
"lok: send other views our cursor position in their view co-ordinates"
does the right thing by sending view specific cell-cursor positions.
But the broadcast of these messages in Kit.cpp means every client will
get the messages intended for others and possibly end up using the
wrong messages to draw the cell-cursors.
Change-Id: I6e9534c2e562f34b5c1fe37242b36e076b9319c8
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92916
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Dennis Francis <dennis.francis@collabora.com>
Sometimes kit process goes into a heavy processing state (or even hangs)
and is not able to report its memory usage. Thus we can't implement cleanup
of problematic kit processes based on memory information reported by kit.
By moving memory reporting to admin module we avoid this problem.
Change-Id: Icf274e3a3a97b33623a93f9d2dc1e640ad9b7d99
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92752
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
But it is insecure, so warn about that.
Change-Id: I151be64f53521e217a5498c0531c9ef2ff8db818
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92822
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
This is needed in case the original template
directory itself is linked, which after setting
the FTW_PHYS flag to nftw skips them.
Change-Id: I63141b64ca486e6e2e979cdf1d80fe0fd0f3990c
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92104
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
And some formatting, but no functional changes.
Reduced the maximum time before logging all
link/copy activity of jail files, which typically
takes < 200ms.
Change-Id: Ie48072314471195a5f156cb45c616a5e57d2a287
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92103
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Poco's File::linkTo was added in version 1.8.1 and
we still support older versions. Also, symlink(2) is
far more transparent and simpler here.
Change-Id: If537cc77cd1388f3c0e2a6b16b1edcf46a60e357
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92102
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
in kit as these are sent by core to specific view(s) by ultimately calling either
(as seen from the usages of LOK_CALLBACK_INVALIDATE_VIEW_CURSOR in core)
1. SfxLokHelper::notifyOtherView() where it sends to particular view.
or
2. SfxLokHelper::notifyOtherViews() where it sends to all views except
the current view.
The core makes the decision to broadcast or not, and if it does, then
the kit's broadcast of broadcasted messages can only cause a blowup of messaging
complexiity w.r.t number of views. It also does not make sense to send
view-cursor messages meant for a view to be sent to others in Calc
with clients of hetrogeneous zooms.
Change-Id: Ib07c5fbba9bb05c59048561d2c26aed00f3be598
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92633
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
It was made static in ea2b77ce07 for
Android's sake, so returning it to be per-instance is not a big thing.
Keep a separate static just for the Android app's use for now, while
the Android app supports just one open document at a time anyway. (It
is for the iOS app that I am moving towards supporting multiple open
documents at a time.)
Change-Id: I7fabeb21883eb7cd7155e880eb4cc0413124d1f8
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92625
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
It is not a problem in the multi-process web-based Online, where the
variable exists separately in each KIT process (which handles exactly
one document). But in a mobile app, when we want to be able to handle
multiple document in the single process, we can't have such variables.
Change-Id: I1d3da48316eb3a8c72ff4957cc3fcba8f6870f16
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92582
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
It just causes confusion with the name "DocumentBroker".
DocumentBroker objects exist only in the WSD process. Instead just use
"kit".
Change-Id: I3d9915c4759899ea6ed9084cf3ec6dc0f3b88ee5
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92474
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
LibreOffice core uses that, too, and we support an even more
restricted set of compilers.
Change-Id: I0d0e2c8608e323eb5ef0f35ee8c46d02ab49a745
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92467
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
gdb will take it from the system anyway, so it's just amazingly
excessive weight wrapped in a performance problem.
Change-Id: Ie8d7d2be97da64233a6d7cb4864d6ee88ea8c337
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92207
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Handle LOK_CALLBACK_TAB_STOP_LIST and send the payload to the
loleaflet side under "tabstoplistupdate" identifier.
Change-Id: I4bf8c48bd825dec81ef766b7bce536dd399e8b86
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92141
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
We need to catch the downloadas message already in
-[DocumentViewController
userContentController:didReceiveScriptMessage:] and use an
UIDocumentPickerViewController to let the user choose where to
download (or export) the document. The iOS-specific code in
ChildSession::downloadAs() can go away.
Change-Id: I626b9986ec6156f7e83bda02b04e65f7819f8017
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92112
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
The switch away from LOOLWebSocket and the use of a websocket
for talking to forkit removes the need for the pipe code.
Change-Id: Ifb0c6c88681289e7a1709d9bc3281532935c7be4
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92033
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
This mends several problems from commit
5710c86323.
Change-Id: I1b29f29ca81679608a2692488fa1ef22b2e62dfd
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92032
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Now, finally, I think it works as it should, knock on wood. After an
auto-save (or explicit save by tapping the button), the edited
document does show up with its auto-saved contents if you open it from
iCloud Drive or Nextcloud while it is still open in the iOS app.
What I was missing was that the document hadn't actually been saved by
the core (to the temporary copy) until we get the
LOK_CALLBACK_UNO_COMMAND_RESULT for the .uno:Save. We must call the
-[UIDocumentsaveToURL:forSaveOperation:completionHandler:] only upon
receiving that callback.
Change-Id: I10486f3bc587c871ee2644a0c097493f33baf420
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91880
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
In linkOrCopy, the nftw() function is used without the FTW_PHYS flag to
populate child roots from systemplate. From man nftw:
FTW_PHYS
If set, do not follow symbolic links. (This is what you want.)
If not set, symbolic links are followed, but no file is reported twice.
Because the order in which directory entries are visited is not defined,
having multiple symlinks to a file results in only one of the paths
being created in the chroot.
This is not really a problem because loolwsd-systemplate-setup creates
systemplate without symlinks. Fixing it might prevent unpleasant
surprises in the future though, and might possibly allow to make
systemplate and chroots smaller (also the manpage says that you want
it:)).
The commit adds FTW_PHYS flag to the call as well as symlink handling.
Change-Id: I01354f529b5d340185988ed026f266caf17a6881
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/87749
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Kept in #if 0 in case some similar experimentation needed in the
future.
It might be interesting to be able to tweak behaviour based on knowing
on what kind of storage the doument is located, but alas, that seems
not possible.
Change-Id: I877c96fcea3a350faa58a934485714d15b01141d
So that it is easy to find it in the log.
Change-Id: I1b367db9e97d7215c46e824998e99048531acb07
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91413
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Now one can open another document after closing the first one. Turns
out that throwing an exception to return through the call stack to
SocketPoll::poll() is not necessary after all. But doing
document.reset() as before a86508d815 is
essential.
Change-Id: I248df78bd9b0d3f0962df2126ca394cb746542b8
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90456
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
But opening a second document now hangs.
Sigh, the plumbing in the mobile apps is so extremely fragile. But
that is to be expected when turning a multi-process structure (where
one class of processes exit as soon as they have done their job) into
a single process running forever.
Change-Id: I0fdb751f44e16efb42843189969e049bf14816f0
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90443
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Downloading pdf file does not work because the kit process is not jailed
Change-Id: I1e67840eb58997f6de10948c8d8e260888abe326
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90338
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Henry Castro <hcastro@collabora.com>
The 'exit' command from DocBroker to Kit is processed
immediately. It set the termination flag and destroyed
the Document instance in Kit. Unfortunately, this is
highly problematic. There are a number of races here.
Normal disconnection procedure from DocBroker is to
first send 'disconnect'. This tells Kit to unload
and close the view in question, and when 0 views
are left, it simply exits the process.
However, since 'disconnect' is processed in the
message queue, the 'exit' (and indeed the socket
disconnection that follows 'exit') may be handled
before the message queue is drained, and so the
'disconnect' wouldn't have been processed yet.
The end result of these two races is that Kit
tries to exit the Core main loop, which fails
a number of assertion (f.e. that no LOK Windows
remain, which is presumably a leak check, which
we care not about as we don't attempt to cleanup
the sidebar).
The fix here is to process 'exit' immediately,
because DocBroker is gone, there is absolutely
nothing for Kit to do anymore.
Change-Id: I5c09fcfdb1713f4e0b56b717c747d919d0c6728f
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90356
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
Essentially we want to be able to separate low-level socket code
for eg. TCP vs. UDS, from Protocol handling: eg. WebSocketHandler
and client sessions themselves which handle and send messages
which now implement the simple MessageHandlerInterface.
Some helpful renaming too:
s/SocketHandlerInterface/ProtocolHandlerInterface/
Change-Id: I58092b5e0b5792fda47498fb2c875851eada461d
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90138
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Open Writer, insert a multi-MP JPEG, select it.
Before:
ChildSession::renderShapeSelection: finished in 74.67 ms
After:
ChildSession::renderShapeSelection: finished in 67.33 ms (90.17% of baseline)
Change-Id: I495e9fcf0c42b0bcfc7987a402a13f5d8664b1e1
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90291
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Open Writer, insert a multi-MP JPEG, select it.
Before:
ChildSession::renderShapeSelection: finished in 81.33 ms
After:
ChildSession::renderShapeSelection: finished in 74.67 ms (91.81% of baseline)
This is with an --enable-symbols core with a -O2 online, with libstdc++.
The cost on the Android profile with its libc++ looked even more,
spending time in the std::vector dtor.
Change-Id: I50af2e13fd24569dc32304420b8f3e70d15803eb
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90262
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Allows comparing tokens with C strings without a heap allocation. Do the
same when comparing two tokens from two different StringVectors.
And use it at all places where operator ==() has an argument, which is a
StringVector::operator []() result.
Change-Id: Id36eff96767ab99b235ecbd12fb14446a3efa869
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90201
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>