loolwsd/DocumentBroker.cpp | 35 ++++++++++++++--------------------- 1 file changed, 14 insertions(+), 21 deletions(-)
New commits: commit fedb3f520a5841ac946a5283a4a8193f08c7bd18 Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk> Date: Wed May 4 21:14:39 2016 -0400 loolwsd: factored out common tile message Change-Id: I39600821e3c9c40f3a63343b167cddb3e42b7072 Reviewed-on: https://gerrit.libreoffice.org/24667 Reviewed-by: Ashod Nakashian <ashnak...@gmail.com> Tested-by: Ashod Nakashian <ashnak...@gmail.com> diff --git a/loolwsd/DocumentBroker.cpp b/loolwsd/DocumentBroker.cpp index 9f5c0a3..e3b2b0e 100644 --- a/loolwsd/DocumentBroker.cpp +++ b/loolwsd/DocumentBroker.cpp @@ -397,26 +397,27 @@ void DocumentBroker::handleTileRequest(int part, int width, int height, int tile << ", tilePosX: " << tilePosX << ", tilePosY: " << tilePosY << ", tileWidth: " << tileWidth << ", tileHeight: " << tileHeight << Log::end; + std::ostringstream oss; + oss << " part=" << part + << " width=" << width + << " height=" << height + << " tileposx=" << tilePosX + << " tileposy=" << tilePosY + << " tilewidth=" << tileWidth + << " tileheight=" << tileHeight; + std::string tileMsg = oss.str(); + std::unique_lock<std::mutex> lock(_mutex); std::unique_ptr<std::fstream> cachedTile = tileCache().lookupTile(part, width, height, tilePosX, tilePosY, tileWidth, tileHeight); if (cachedTile) { - std::ostringstream oss; - oss << "tile: part=" << part - << " width=" << width - << " height=" << height - << " tileposx=" << tilePosX - << " tileposy=" << tilePosY - << " tilewidth=" << tileWidth - << " tileheight=" << tileHeight; - #if ENABLE_DEBUG - oss << " renderid=cached"; + std::string response = "tile:" + tileMsg + " renderid=cached\n"; +#else + std::string response = "tile:" + tileMsg + "\n"; #endif - oss << "\n"; - const auto response = oss.str(); std::vector<char> output; output.reserve(4 * width * height); @@ -442,15 +443,7 @@ void DocumentBroker::handleTileRequest(int part, int width, int height, int tile return; // Forward to child to render. - std::ostringstream oss; - oss << "tile part=" << part - << " width=" << width - << " height=" << height - << " tileposx=" << tilePosX - << " tileposy=" << tilePosY - << " tilewidth=" << tileWidth - << " tileheight=" << tileHeight; - const std::string request = oss.str(); + const std::string request = "tile " + tileMsg; _childProcess->getWebSocket()->sendFrame(request.data(), request.size()); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits