[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-4-0' - wsd/DocumentBroker.hpp

Ashod Nakashian (via logerrit) logerrit at kemper.freedesktop.org
Sat Oct 19 18:56:10 UTC 2019


 wsd/DocumentBroker.hpp |   42 ++++++++++++++++++++++--------------------
 1 file changed, 22 insertions(+), 20 deletions(-)

New commits:
commit 46bdda0186f98eb27d15507ce3cc63b64a106942
Author:     Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Sun Sep 29 23:32:12 2019 -0400
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Sat Oct 19 20:55:52 2019 +0200

    wsd: reduce public surface area of DocumentBroker
    
    Change-Id: If74bd1967f3725e81a6e381e883eac86104f9f40
    Reviewed-on: https://gerrit.libreoffice.org/80323
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Tested-by: Andras Timar <andras.timar at collabora.com>

diff --git a/wsd/DocumentBroker.hpp b/wsd/DocumentBroker.hpp
index 858e80658..b358dba80 100644
--- a/wsd/DocumentBroker.hpp
+++ b/wsd/DocumentBroker.hpp
@@ -237,9 +237,6 @@ public:
     /// Thread safe termination of this broker if it has a lingering thread
     void joinThread();
 
-    /// Loads a document from the public URI into the jail.
-    bool load(const std::shared_ptr<ClientSession>& session, const std::string& jailId);
-    bool isLoaded() const { return _isLoaded; }
     void setLoaded();
 
     bool isDocumentChangedInStorage() { return _documentChangedInStorage; }
@@ -308,14 +305,10 @@ public:
     void invalidateTiles(const std::string& tiles, int normalizedViewId);
     void handleTileRequest(TileDesc& tile,
                            const std::shared_ptr<ClientSession>& session);
-    void handleDialogRequest(const std::string& dialogCmd);
     void handleTileCombinedRequest(TileCombined& tileCombined,
                                    const std::shared_ptr<ClientSession>& session);
     void sendRequestedTiles(const std::shared_ptr<ClientSession>& session);
     void cancelTileRequests(const std::shared_ptr<ClientSession>& session);
-    void handleTileResponse(const std::vector<char>& payload);
-    void handleDialogPaintResponse(const std::vector<char>& payload, bool child);
-    void handleTileCombinedResponse(const std::vector<char>& payload);
 
     bool isMarkedToDestroy() const { return _markToDestroy || _stop; }
 
@@ -329,26 +322,13 @@ public:
     /// Ask the document broker to close. Makes sure that the document is saved.
     void closeDocument(const std::string& reason);
 
-    /// Called by the ChildProcess object to notify
-    /// that it has terminated on its own.
-    /// This happens either when the child exists
-    /// or upon failing to process an incoming message.
-    void childSocketTerminated();
-
     /// Get the PID of the associated child process
     Poco::Process::PID getPid() const { return _childProcess->getPid(); }
 
     std::unique_lock<std::mutex> getLock() { return std::unique_lock<std::mutex>(_mutex); }
-    std::unique_lock<std::mutex> getDeferredLock() { return std::unique_lock<std::mutex>(_mutex, std::defer_lock); }
 
     void updateLastActivityTime();
 
-    std::size_t getIdleTimeSecs() const
-    {
-        const auto duration = (std::chrono::steady_clock::now() - _lastActivityTime);
-        return std::chrono::duration_cast<std::chrono::seconds>(duration).count();
-    }
-
     /// Sends the .uno:Save command to LoKit.
     bool sendUnoSave(const std::string& sessionId, bool dontTerminateEdit = true,
                      bool dontSaveIfUnmodified = true, bool isAutosave = false,
@@ -365,6 +345,28 @@ public:
 
 private:
 
+    /// Loads a document from the public URI into the jail.
+    bool load(const std::shared_ptr<ClientSession>& session, const std::string& jailId);
+    bool isLoaded() const { return _isLoaded; }
+
+    std::size_t getIdleTimeSecs() const
+    {
+        const auto duration = (std::chrono::steady_clock::now() - _lastActivityTime);
+        return std::chrono::duration_cast<std::chrono::seconds>(duration).count();
+    }
+
+    std::unique_lock<std::mutex> getDeferredLock() { return std::unique_lock<std::mutex>(_mutex, std::defer_lock); }
+
+    /// Called by the ChildProcess object to notify
+    /// that it has terminated on its own.
+    /// This happens either when the child exists
+    /// or upon failing to process an incoming message.
+    void childSocketTerminated();
+    void handleTileResponse(const std::vector<char>& payload);
+    void handleDialogPaintResponse(const std::vector<char>& payload, bool child);
+    void handleTileCombinedResponse(const std::vector<char>& payload);
+    void handleDialogRequest(const std::string& dialogCmd);
+
     /// Shutdown all client connections with the given reason.
     void shutdownClients(const std::string& closeReason);
 


More information about the Libreoffice-commits mailing list