[Libreoffice-commits] online.git: loolwsd/DocumentBroker.cpp loolwsd/DocumentBroker.hpp loolwsd/LOOLWSD.cpp

Ashod Nakashian ashod.nakashian at collabora.co.uk
Tue May 17 03:13:25 UTC 2016


 loolwsd/DocumentBroker.cpp |    3 ++-
 loolwsd/DocumentBroker.hpp |    5 +++--
 loolwsd/LOOLWSD.cpp        |    6 +++---
 3 files changed, 8 insertions(+), 6 deletions(-)

New commits:
commit 7c76e4b6bcdd7da3e6985a77445c1db668c11734
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Mon May 16 07:46:27 2016 -0400

    loolwsd: MasterProcessSession splitting: using ClientSession
    
    Change-Id: I2ee089c04d2e5fbdae91cfc5cada437f5aae8e5b
    Reviewed-on: https://gerrit.libreoffice.org/25038
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/loolwsd/DocumentBroker.cpp b/loolwsd/DocumentBroker.cpp
index e3735f9..19eaa5b 100644
--- a/loolwsd/DocumentBroker.cpp
+++ b/loolwsd/DocumentBroker.cpp
@@ -18,6 +18,7 @@
 #include "Storage.hpp"
 #include "TileCache.hpp"
 #include "LOOLProtocol.hpp"
+#include "ClientSession.hpp"
 #include "PrisonerSession.hpp"
 
 using namespace LOOLProtocol;
@@ -314,7 +315,7 @@ void DocumentBroker::takeEditLock(const std::string& id)
     }
 }
 
-size_t DocumentBroker::addSession(std::shared_ptr<MasterProcessSession>& session)
+size_t DocumentBroker::addSession(std::shared_ptr<ClientSession>& session)
 {
     const auto id = session->getId();
     const std::string aMessage = "session " + id + " " + _docKey + "\n";
diff --git a/loolwsd/DocumentBroker.hpp b/loolwsd/DocumentBroker.hpp
index 20b9761..a41778d 100644
--- a/loolwsd/DocumentBroker.hpp
+++ b/loolwsd/DocumentBroker.hpp
@@ -117,6 +117,7 @@ private:
 };
 
 class PrisonerSession;
+class ClientSession;
 
 /// DocumentBroker is responsible for setting up a document
 /// in jail and brokering loading it from Storage
@@ -193,7 +194,7 @@ public:
     void takeEditLock(const std::string& id);
 
     /// Add a new session. Returns the new number of sessions.
-    size_t addSession(std::shared_ptr<MasterProcessSession>& session);
+    size_t addSession(std::shared_ptr<ClientSession>& session);
     /// Connect a prison session to its client peer.
     bool connectPeers(std::shared_ptr<PrisonerSession>& session);
     /// Removes a session by ID. Returns the new number of sessions.
@@ -229,7 +230,7 @@ private:
     std::string _filename;
     std::chrono::steady_clock::time_point _lastSaveTime;
     Poco::Timestamp _lastFileModifiedTime;
-    std::map<std::string, std::shared_ptr<MasterProcessSession>> _sessions;
+    std::map<std::string, std::shared_ptr<ClientSession>> _sessions;
     std::unique_ptr<StorageBase> _storage;
     std::unique_ptr<TileCache> _tileCache;
     std::atomic<bool> _markToDestroy;
diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp
index 358c152..f6a6fe6 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -384,7 +384,7 @@ private:
 
                     // Load the document.
                     std::shared_ptr<WebSocket> ws;
-                    auto session = std::make_shared<MasterProcessSession>(id, LOOLSession::Kind::ToClient, ws, docBroker, nullptr);
+                    auto session = std::make_shared<ClientSession>(id, LOOLSession::Kind::ToClient, ws, docBroker, nullptr);
 
                     // Request the child to connect to us and add this session.
                     auto sessionsCount = docBroker->addSession(session);
@@ -610,13 +610,13 @@ private:
 
         // Above this point exceptions are safe and will auto-cleanup.
         // Below this, we need to cleanup internal references.
-        std::shared_ptr<MasterProcessSession> session;
+        std::shared_ptr<ClientSession> session;
         try
         {
             // For ToClient sessions, we store incoming messages in a queue and have a separate
             // thread to pump them. This is to empty the queue when we get a "canceltiles" message.
             auto queue = std::make_shared<BasicTileQueue>();
-            session = std::make_shared<MasterProcessSession>(id, LOOLSession::Kind::ToClient, ws, docBroker, queue);
+            session = std::make_shared<ClientSession>(id, LOOLSession::Kind::ToClient, ws, docBroker, queue);
 
             // Request the child to connect to us and add this session.
             auto sessionsCount = docBroker->addSession(session);


More information about the Libreoffice-commits mailing list