loolwsd/DocumentBroker.cpp  |   11 +++++++++++
 loolwsd/DocumentBroker.hpp  |    1 +
 loolwsd/PrisonerSession.cpp |    2 +-
 3 files changed, 13 insertions(+), 1 deletion(-)

New commits:
commit 9640fd1e78475b00554b8f8972f8433128d95a1c
Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk>
Date:   Tue Sep 20 22:19:52 2016 -0400

    loolwsd: handle invalidatetiles in DocumentBroker
    
    Change-Id: I05e70f82af9b5c8bdb590a64688ffa70c6ba2034
    Reviewed-on: https://gerrit.libreoffice.org/29124
    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 a30b371..55ecbfa 100644
--- a/loolwsd/DocumentBroker.cpp
+++ b/loolwsd/DocumentBroker.cpp
@@ -463,6 +463,17 @@ bool DocumentBroker::handleInput(const std::vector<char>& 
payload)
     return true;
 }
 
+void DocumentBroker::invalidateTiles(const std::string& tiles)
+{
+    std::unique_lock<std::mutex> lock(_mutex);
+
+    // Remove from cache.
+    _tileCache->invalidateTiles(tiles);
+
+    //TODO: Re-issue the tiles again to avoid races.
+
+}
+
 void DocumentBroker::handleTileRequest(TileDesc& tile,
                                        const std::shared_ptr<ClientSession>& 
session)
 {
diff --git a/loolwsd/DocumentBroker.hpp b/loolwsd/DocumentBroker.hpp
index 7e7bc97..a547a32 100644
--- a/loolwsd/DocumentBroker.hpp
+++ b/loolwsd/DocumentBroker.hpp
@@ -210,6 +210,7 @@ public:
         _cursorHeight = h;
     }
 
+    void invalidateTiles(const std::string& tiles);
     void handleTileRequest(TileDesc& tile,
                            const std::shared_ptr<ClientSession>& session);
     void handleTileCombinedRequest(TileCombined& tileCombined,
diff --git a/loolwsd/PrisonerSession.cpp b/loolwsd/PrisonerSession.cpp
index 3844974..c2ea47f 100644
--- a/loolwsd/PrisonerSession.cpp
+++ b/loolwsd/PrisonerSession.cpp
@@ -216,7 +216,7 @@ bool PrisonerSession::_handleInput(const char *buffer, int 
length)
         else if (tokens[0] == "invalidatetiles:")
         {
             assert(firstLine.size() == 
static_cast<std::string::size_type>(length));
-            _docBroker->tileCache().invalidateTiles(firstLine);
+            _docBroker->invalidateTiles(firstLine);
         }
         else if (tokens[0] == "invalidatecursor:")
         {
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to