[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3' - 2 commits - wsd/ClientSession.cpp wsd/ClientSession.hpp wsd/DocumentBroker.cpp wsd/TestStubs.cpp
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Aug 28 08:43:10 UTC 2018
wsd/ClientSession.cpp | 5 +++--
wsd/ClientSession.hpp | 22 ++++++++++------------
wsd/DocumentBroker.cpp | 4 ++++
wsd/TestStubs.cpp | 2 +-
4 files changed, 18 insertions(+), 15 deletions(-)
New commits:
commit 05d8d8667fa0c70d670048702172b7a860c9ee01
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Wed Aug 22 23:20:27 2018 +0200
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Aug 28 10:43:04 2018 +0200
Updated deduplicated tiles wireID
Change-Id: Ia901d8831792de1bee6b21017be02fa1e744e2ee
(cherry picked from commit 3ca4421eb73d17d8dc84fb46284d1746db078988)
Reviewed-on: https://gerrit.libreoffice.org/59647
Reviewed-by: Andras Timar <andras.timar at collabora.com>
Tested-by: Andras Timar <andras.timar at collabora.com>
diff --git a/wsd/ClientSession.cpp b/wsd/ClientSession.cpp
index 35732eb94..9ed10cf30 100644
--- a/wsd/ClientSession.cpp
+++ b/wsd/ClientSession.cpp
@@ -1195,7 +1195,7 @@ void ClientSession::resetWireIdMap()
_oldWireIds.clear();
}
-void ClientSession::traceTileBySend(const TileDesc& tile)
+void ClientSession::traceTileBySend(const TileDesc& tile, bool deduplicated)
{
const std::string tileID = generateTileID(tile);
@@ -1217,7 +1217,8 @@ void ClientSession::traceTileBySend(const TileDesc& tile)
}
// Record that the tile is sent
- addTileOnFly(tile);
+ if (!deduplicated)
+ addTileOnFly(tile);
}
void ClientSession::traceSubscribeToTile(const std::string& cacheName)
diff --git a/wsd/ClientSession.hpp b/wsd/ClientSession.hpp
index 04241d91b..13f0b141c 100644
--- a/wsd/ClientSession.hpp
+++ b/wsd/ClientSession.hpp
@@ -86,15 +86,13 @@ public:
LOG_TRC(getName() << " enqueueing client message " << data->id());
size_t sizeBefore = _senderQueue.size();
size_t newSize = _senderQueue.enqueue(data);
- if(sizeBefore != newSize)
+
+ // Track sent tile
+ const std::string command = data->firstToken();
+ if (command == "tile:")
{
- // Track sent tile
- const std::string command = data->firstToken();
- if (command == "tile:")
- {
- const TileDesc tile = TileDesc::parse(data->firstLine());
- traceTileBySend(tile);
- }
+ const TileDesc tile = TileDesc::parse(data->firstLine());
+ traceTileBySend(tile, sizeBefore == newSize);
}
}
@@ -134,7 +132,7 @@ public:
/// This method updates internal data related to sent tiles (wireID and tiles-on-fly)
/// Call this method anytime when a new tile is sent to the client
- void traceTileBySend(const TileDesc& tile);
+ void traceTileBySend(const TileDesc& tile, bool deduplicated = false);
/// Trask tiles what we a subscription to
void traceSubscribeToTile(const std::string& tileCacheName);
diff --git a/wsd/TestStubs.cpp b/wsd/TestStubs.cpp
index d5407c11b..9a56e0a67 100644
--- a/wsd/TestStubs.cpp
+++ b/wsd/TestStubs.cpp
@@ -20,7 +20,7 @@
void DocumentBroker::assertCorrectThread() const {}
-void ClientSession::traceTileBySend(const TileDesc& /*tile*/) {}
+void ClientSession::traceTileBySend(const TileDesc& /*tile*/, bool /*deduplicated = false*/) {}
void ClientSession::traceSubscribeToTile(const std::string& /*tileCacheName*/) {};
commit 12a7d0df0dbcf29307f2ed92ef217c4024be5b66
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Wed Aug 22 16:19:04 2018 +0200
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Aug 28 10:42:51 2018 +0200
Reset also the wireId map by canceltiles
(cherry picked from commit 54596dbcf9db8d3aa415734988e15390e4133830)
Change-Id: Ic9589363612d06a8d5d940ba5e5cbff796577c15
Reviewed-on: https://gerrit.libreoffice.org/59646
Reviewed-by: Andras Timar <andras.timar at collabora.com>
Tested-by: Andras Timar <andras.timar at collabora.com>
diff --git a/wsd/ClientSession.hpp b/wsd/ClientSession.hpp
index ff5975f1e..04241d91b 100644
--- a/wsd/ClientSession.hpp
+++ b/wsd/ClientSession.hpp
@@ -143,6 +143,9 @@ public:
void clearTileSubscription();
size_t getTilesBeingRenderedCount() const {return _tilesBeingRendered.size();}
+
+ /// Clear wireId map anytime when client visible area changes (visible area, zoom, part number)
+ void resetWireIdMap();
private:
/// SocketHandler: disconnection event.
@@ -184,9 +187,6 @@ private:
void handleTileInvalidation(const std::string& message,
const std::shared_ptr<DocumentBroker>& docBroker);
- /// Clear wireId map anytime when client visible area changes (visible area, zoom, part number)
- void resetWireIdMap();
-
/// Generate a unique id for a tile
std::string generateTileID(const TileDesc& tile);
diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index 874d1c587..913510064 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -1473,6 +1473,10 @@ void DocumentBroker::cancelTileRequests(const std::shared_ptr<ClientSession>& se
session->getRequestedTiles().clear();
+ session->clearTileSubscription();
+
+ session->resetWireIdMap();
+
const auto canceltiles = tileCache().cancelTiles(session);
if (!canceltiles.empty())
{
More information about the Libreoffice-commits
mailing list