Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Set normalized view id for broadcast (ie. slide preview) thumbnails.
Change-Id: Ica5312ae9c7147c8dc969523e28d460348ba2e76
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
  • Loading branch information
mmeeks authored and merttumer committed Nov 14, 2020
1 parent 04139d3 commit 0d10c2c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 1 addition & 3 deletions wsd/ClientSession.cpp
Expand Up @@ -894,9 +894,7 @@ bool ClientSession::sendTile(const char * /*buffer*/, int /*length*/, const Stri
{
try
{
TileDesc tileDesc = TileDesc::parse(tokens);
tileDesc.setNormalizedViewId(getCanonicalViewId());
docBroker->handleTileRequest(tileDesc, client_from_this());
docBroker->handleTileRequest(tokens, client_from_this());
}
catch (const std::exception& exc)
{
Expand Down
8 changes: 7 additions & 1 deletion wsd/DocumentBroker.cpp
Expand Up @@ -1755,12 +1755,15 @@ size_t DocumentBroker::getMemorySize() const
}

// Expected to be legacy, ~all new requests are tilecombinedRequests
void DocumentBroker::handleTileRequest(TileDesc& tile,
void DocumentBroker::handleTileRequest(const StringVector &tokens,
const std::shared_ptr<ClientSession>& session)
{
assertCorrectThread();
std::unique_lock<std::mutex> lock(_mutex);

TileDesc tile = TileDesc::parse(tokens);
tile.setNormalizedViewId(session->getCanonicalViewId());

tile.setVersion(++_tileVersion);
const std::string tileMsg = tile.serialize();
LOG_TRC("Tile request for " << tileMsg);
Expand All @@ -1785,7 +1788,10 @@ void DocumentBroker::handleTileRequest(TileDesc& tile,
for (auto& it: _sessions)
{
if (!it.second->inWaitDisconnected())
{
tile.setNormalizedViewId(it.second->getCanonicalViewId());
tileCache().subscribeToTileRendering(tile, it.second, now);
}
}
}
else
Expand Down
2 changes: 1 addition & 1 deletion wsd/DocumentBroker.hpp
Expand Up @@ -243,7 +243,7 @@ class DocumentBroker : public std::enable_shared_from_this<DocumentBroker>
_tileCache->invalidateTiles(tiles, normalizedViewId);
}

void handleTileRequest(TileDesc& tile,
void handleTileRequest(const StringVector &tokens,
const std::shared_ptr<ClientSession>& session);
void handleTileCombinedRequest(TileCombined& tileCombined,
const std::shared_ptr<ClientSession>& session);
Expand Down

0 comments on commit 0d10c2c

Please sign in to comment.