summaryrefslogtreecommitdiffstats
path: root/kit
Commit message (Collapse)AuthorAgeFilesLines
* wsd: re-create the jail directory when mounting failsAshod Nakashian2022-09-231-4/+5
| | | | | | | | | | | | This guarantees that the jail directory is always created, especially in case mounting fails and we cleanup and fallback. Also, move the directory creation and setting the perms into a helper, and reuse. Change-Id: If6e9ef86afa5107638aa27050554e94c0af22b6e Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
* masterpage: get & set optional mode parameter for tiles (server side)Szymon Kłos2022-09-192-3/+30
| | | | | Signed-off-by: Szymon Kłos <szymon.klos@collabora.com> Change-Id: I756e3d515c86a635cfa9db81106848ee3dcf684a
* Add a dummy handler (for now) for LOK_CALLBACK_FONTS_MISSINGTor Lillqvist2022-09-191-0/+3
| | | | | | | | | Avoids logging an ERR. Proper handling of that functionality is still a work in progress. Signed-off-by: Tor Lillqvist <tml@collabora.com> Change-Id: Id6bd985ee62e6cb76641d6f866f6318868b9b2b3
* wsd: fix multi-part loggingAshod Nakashian2022-09-132-2/+2
| | | | | | | | | | | | This was a regression introduced in 14d96957cdae7c49cf91000002c20ee37ee69fa2. The result was that multi-part logs were not flushed and therefore not written to the output. Change-Id: Ib22a1da83209b00872d91ca05a940226cbb4552d Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
* Embed images to exported HTMLAndras Timar2022-09-081-0/+6
| | | | | Signed-off-by: Andras Timar <andras.timar@collabora.com> Change-Id: I0e42bf2efcc2aa6ecf3f6705aab621cc1ea18774
* Split config.h into separate headers to avoid extensive rebuildAron Budea2022-09-052-0/+2
| | | | | | | | | | | | | | | | | Eg. if only the version was changed, config.h was updated, and everything was recompiled. New structure, maintain these manually: config.h.in - for configured variables that are stable if configuration parameters are unchanged config_version.h.in - for version/hash related variables ---- config_unused.h.in - still generated by autoheader with all variables, don't use it Signed-off-by: Aron Budea <aron.budea@collabora.com> Change-Id: Id9a50a9f1e798a3b3814778d8683b7d7cb57bb29
* Fix typos in commentsAndras Timar2022-08-231-1/+1
| | | | | Signed-off-by: Andras Timar <andras.timar@collabora.com> Change-Id: I813f652b516c79f350b46317e589b91e0ef39a1a
* wsd: fuzzer: fix buildAshod Nakashian2022-08-171-1/+1
| | | | | Change-Id: Ib52e32de04e7af230ed21eed11e0855050e97c74 Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
* Remove residual callback codeNickWingate2022-08-051-8/+1
| | | | | | | | | 'callback except-' is unused anywhere anymore. Implemented in 68e597b Removed in 986bcce Signed-off-by: NickWingate <nicholas.wingate03@gmail.com> Change-Id: Ib620e6a33639f510c8f2415cf009e4d183a353fd
* Replace #ifdef-s with #if-s, and enable -WundefAron Budea2022-08-032-5/+5
| | | | | | | ...for variables coming from configure.ac. Signed-off-by: Aron Budea <aron.budea@collabora.com> Change-Id: I39ebd21c4cb56d2a3bd38fdc35dc59b5f1fd4b49
* wsd: support code-coverage report via --with-coverageAshod Nakashian2022-08-022-1/+110
| | | | | | | | | | | | | | | | This adds support for code-coverage HTML reporting. To achieve this, we must use file-linking in jails so that we can update the coverage data (.gcda files) from the jails. This means that creating jails is slower than with bind-mounting and we need to account for that in our timeouts. We also can't kill child processes with SIGKILL, which is un-catchable. Instead, we use SIGTERM and dump the profile data before exiting. Change-Id: I16fa534f6ed42f7133014d841bb024423315e0a4 Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
* wsd: mark copied jails earlyAshod Nakashian2022-08-021-3/+3
| | | | | | | | | | This avoids the case where we fail to create the jail completely, get killed, or crash. All of which might leave the jail unremoved. Change-Id: I4c6b6a038110186af7be9f358a42902b224188e0 Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
* wsd: always use Util::forcedExit to properly cleanupAshod Nakashian2022-08-022-36/+18
| | | | | | | | | | | We need to flush and shutdown logging before exiting, so we can't use _exit/_Exit directly. In addition, with profiling (e.g. code-coverage) we must flush the profile data, lest it's all for naught. Change-Id: I726c5a2f4e699c17dd0d7d5b1c86d856e0118b3c Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
* wsd: improve logging when kit disconnectsAshod Nakashian2022-07-291-5/+9
| | | | | Change-Id: I65d18aea265e5e68ee823676028266fa543e0667 Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
* Add the ability to dump internal LOK core state / details.Michael Meeks2022-07-291-0/+7
| | | | | | | Requires an updated core. Signed-off-by: Michael Meeks <michael.meeks@collabora.com> Change-Id: Ie000e86851d7dfbc1e70a3f1631d427a3d18188f
* delta: fix delta cache sizing.Michael Meeks2022-07-281-1/+1
| | | | | Change-Id: Ia6ed98534f87006ba5ffcffc8b928f16cfc892cd Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
* tracing: re-work code, improve thread safety.Michael Meeks2022-07-191-32/+40
| | | | | | | | | We shouldn't write to the socket outside the main thread ever or we'll get memory corruption; cf. a number of suspicious traces around this code. Change-Id: Ibeb36fffbecce960012a55b3ab4fd40c9996ae68 Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
* wsd: fix warnings on GCC 12Ashod Nakashian2022-07-132-9/+11
| | | | | Change-Id: Ia61f45d83223a65d1f7c444250230006a4ac098f Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
* wsd: sig: dump backtrace with USR2Ashod Nakashian2022-07-121-0/+1
| | | | | | | | | | | | | | SIGUSR2 can now be used to dump the stacktrace of coolwsd, forkit, and the kit processes. Also, support writing signalLog to files. Although we write to stderr, we normalize the interface used for signal logging and allow for writing to any file descriptor. Change-Id: If6366bb6ddbd9f8863baca52e4f65ebb468dc1f1 Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
* wsd: sig: merge setTerminationSignals with setFatalSignalsAshod Nakashian2022-07-122-2/+0
| | | | | | | This simplifies the signal handling setup. Change-Id: Id121a9df45fc11bfdea627f9828e0b624b1b2284 Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
* wsd: jail: add Poco namespace where missing in LinkOrCopyAshod Nakashian2022-07-121-9/+13
| | | | | Change-Id: I9490ff29b48763130e5477525a96b987a4b79cf7 Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
* wsd: jail: no need to pass loSubPath between processesAshod Nakashian2022-07-123-24/+8
| | | | | | | | | Since the value of the loSubPath (i.e. the directory name of lo within the jail) is a compile-time constant, there is no reason to pass it around at runtime. Change-Id: If7457ea7f3e3fe5c42215eed3ce1ce4c8f328f16 Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
* wsd: uninitialized localsAshod Nakashian2022-07-091-1/+1
| | | | | | | | | Without initialization, gcc12 complains that these values may be uninitialized at the usage site (in the Kit API). Change-Id: I06df9d69977b1f89bfa2e0a3ca7404c026b570ed Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
* writer: fix: cannot add picture using picture contentcontrolRash4192022-07-062-8/+40
| | | | | | | | | use sendContentControlEvent to set picture instead of InsertGraphic uno command since InsertGraphic is not allowed for a protected content control (like picture), only sendContentControlEvent(); Signed-off-by: Rash419 <rashesh.padia@collabora.com> Change-Id: I5f70919d995c51456056a8be2aa1e596df7bedc2
* TileLocation::hash(): shift when the input size_t alreadyMiklos Vajna2022-06-301-2/+7
| | | | | Signed-off-by: Miklos Vajna <vmiklos@collabora.com> Change-Id: If4b18b96f3188489f1e5a027e08523722a2d85dc
* delta: include canonical-view-id into the TileLocation.Michael Meeks2022-06-222-5/+11
| | | | | | | This avoids problems with watermarking cross-talking betwene view. Change-Id: Ifecf098423451bf7de3827dfdf9fdc078a06c5c9 Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
* re-factor TileLocation into its own struct.Michael Meeks2022-06-221-32/+37
| | | | | Change-Id: Iaef52359114c14dbfbca683393ea91d09635be72 Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
* deltas: debug dump the state.Michael Meeks2022-06-162-0/+9
| | | | | Change-Id: Id35f68a108c151de5d2c27800510d17de60faa4c Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
* delta: have own delta cache mutex, and size cache for session count.Michael Meeks2022-06-164-13/+30
| | | | | Change-Id: I1f970a5f9045df11444f6fec8ce7e8eeb0a71bf5 Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
* deltas: switch cache to unordered_set and manage size & lifecycle.Michael Meeks2022-06-161-13/+41
| | | | | | | We should have a larger delta-cache with more users eg. Change-Id: Idc3075636df2e7705950fcf6762e40546792a285 Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
* Delta: add checks for bad memory usage across threads.Michael Meeks2022-06-101-1/+26
| | | | | Change-Id: I09f5ad5b0af44399f92ccc0b62056172f1a0b220 Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
* wsd: consistent logging of session nameAshod Nakashian2022-06-071-12/+14
| | | | | Change-Id: I1f41fb33d5f550da52d43267a8387577acaeaa59 Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
* wsd: cosmetics and assertionAshod Nakashian2022-06-071-0/+2
| | | | | Change-Id: Ib89d1cb684250e0ebc3455423cbd991d8eecef56 Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
* use the more efficient getSelectionTypeAndText()Luboš Luňák2022-06-021-4/+5
| | | | | | | | | | | | | | Otherwise calling getSelectionType() first and then getTextSelection() creates the XTransferable2 twice, and then possibly converts it to the text format twice, which may be expensive. Also some cypress tests use selectEntireSheet() and then check the clipboard contents, which with the switch to 16k columns in Calc may be slow enough in debug builds when done twice to time out the test, and this helps a bit there. Signed-off-by: Luboš Luňák <l.lunak@centrum.cz> Change-Id: If166f67c216281d32dbb1d3e10b51177b42a9668
* browser: contentcontrol: added dropdown typeRash4192022-06-012-1/+24
| | | | | | | - added a new menu button 'form' in classic and tab button in notebookbar for content control Signed-off-by: Rash419 <rashesh.padia@collabora.com> Change-Id: Ibe06667de39199fd2541fa70ced3ff879274366d
* perf: better identical run copying while un-pre-multiplying.Michael Meeks2022-05-311-4/+1
| | | | | Change-Id: I8958e9a072026e8c06c820dc1ab74b44bf12d87b Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
* deltas: 64bit copy & CRC for twice the construction speed.Michael Meeks2022-05-311-13/+23
| | | | | Change-Id: I568abed80c1e571e7a65370b7b4b1049f52ab0b4 Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
* deltas: allocate a single chunk of pixels, instead of lots of rows.Michael Meeks2022-05-311-27/+36
| | | | | | | | Avoid std::vector and its peculiarities, also store the crc so that we get the perf. win from it. Change-Id: If39ab01b5b987d707d1712076ae9a5beb32b36c2 Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
* deltas: re-factor deltaToDataDelta into DeltaData constructor.Michael Meeks2022-05-311-60/+50
| | | | | | | cleanup accessor too. Change-Id: I7db28780cc3394bc74f9967a1e2c2bbe0e01089c Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
* perf: deflate optimize for speed not size for full tiles.Michael Meeks2022-05-301-1/+1
| | | | | | | | We have many fewer full tiles to compress - so we can trade a bit of space for some speed. Really should use zstd. Change-Id: I7c310608173c924f175154bf6f7abb43d5e6f08d Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
* Enable deltas by default.Michael Meeks2022-05-251-1/+1
| | | | | | | | | | Cleanup some debugging, distinguish wsd/viewport delta fetches from client-side tilecombines. Update tests for deltas where they are expected. Change-Id: I3dca09e4ceb094abf03db2aed2618f19351f3e28 Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
* deltas: track, transmit and cache deltas (disabled for now)Michael Meeks2022-05-243-44/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Squashed from feature/deltas-expanded. TileCache changes: + add montonic sequence (wid) numbers to TileData + account for sizes of TileData with multiple blobs + simplify saving and notifying of tiles Sends updates (via appendChanges) based on the sequence the right mix of keyframes and/or deltas required as a single message, and parse and apply those on the JS side. We continue to use PNG for slide previews and dialogs, but remove PngCache - used by document tiles only. Annotates delta: properly as a binary package for the websocket. Distinguishes between deltas and keyframes we get from the Kit based on an initial un-compressed prefix character which we then discard. kit can be forced to render a keyframe by oldWid=0 Track invalidity on tiles themselves - to keep the keyframe around. We need to be able to track that a tile is invalid, and so subscribe to the updated version as/when it is ready - but we also want to store the keyframe underneath any deltas. force rendering of a keyframe for an empty slot in the TileCache. force tile sequence to be zero for combinedtiles - so the client can always request standalone tiles with explicit combinedtiles, or tile requests. move Blob to Common.hpp use zero size for un-changed tiles. remove obsolete render-id, and color deltas in debug mode. cleanup unit tests for non-png tile results. Change-Id: I987f84ac4e58004758a243c233b19a6f0d60f8c2 Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
* calc: new callback LOK_CALLBACK_PRINT_RANGESDennis Francis2022-05-201-0/+3
| | | | | | Signed-off-by: Dennis Francis <dennisfrancis.in@gmail.com> Change-Id: Ia136c0675dbba51a53424916910219e8330764ac (cherry picked from commit 817a4cd3f1f219a0d9caba129cbb3eca4fe31514)
* introduce content control in onlineRash4192022-05-131-0/+3
| | | | | | | | | added unocommand to enter rich text in classic, NB and mobile created a new section to draw rich text rectangles handle the callback for content control Signed-off-by: Rash419 <rashesh.padia@collabora.com> Change-Id: If9912b3598729c26014519c4e1c3c65000b973a4
* deltas: promote width before multiplication.Michael Meeks2022-05-101-1/+1
| | | | | Change-Id: Iddbb2b29bb39f091d891faf02642953da563e31a Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
* delta: add return image sizeHenry Castro2022-05-101-4/+6
| | | | | | | It will be used to instrument the return output size Change-Id: I9f779ff5532d2181da6d6c98060859842e145c0b Signed-off-by: Henry Castro <hcastro@collabora.com>
* kit: simplify initialization delta dataHenry Castro2022-05-101-7/+13
| | | | | Change-Id: Icd7e8d2614eb97790f6e2533db3cd7eec5511a4d Signed-off-by: Henry Castro <hcastro@collabora.com>
* delta: optimize un-premultiplying identical runs.Michael Meeks2022-05-101-4/+18
| | | | | Change-Id: I67baab6c6378385da65cac0090923d6abbb44382 Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
* Un-pre-multiply pixels in deltas and BGRA -> RGBA swap.Michael Meeks2022-05-101-2/+42
| | | | | Change-Id: I31eaf0580cfb9d43df3e85a5f15ae0443b6941f0 Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
* Compress raw images too directly with zlib.Michael Meeks2022-05-101-0/+72
| | | | | Change-Id: Idb54db1c3a3d6970db0782b2a7a2eebbad27f153 Signed-off-by: Michael Meeks <michael.meeks@collabora.com>