[Libreoffice-commits] online.git: wsd/DocumentBroker.hpp

Ashod Nakashian (via logerrit) logerrit at kemper.freedesktop.org
Mon Oct 28 09:47:28 UTC 2019


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

New commits:
commit ae8d28478b11b9228201f5157038c7632dc0086f
Author:     Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Sun Sep 29 23:32:12 2019 -0400
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Mon Oct 28 10:47:10 2019 +0100

    wsd: reduce public surface area of DocumentBroker
    
    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>
    (cherry picked from commit 46bdda0186f98eb27d15507ce3cc63b64a106942)
    
    Change-Id: If74bd1967f3725e81a6e381e883eac86104f9f40
    Reviewed-on: https://gerrit.libreoffice.org/81561
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    Tested-by: Michael Meeks <michael.meeks at collabora.com>

diff --git a/wsd/DocumentBroker.hpp b/wsd/DocumentBroker.hpp
index 5ab980a75..4d66ffae3 100644
--- a/wsd/DocumentBroker.hpp
+++ b/wsd/DocumentBroker.hpp
@@ -240,9 +240,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; }
@@ -317,8 +314,6 @@ public:
                                    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 handleTileCombinedResponse(const std::vector<char>& payload);
 
     enum ClipboardRequest {
         CLIP_REQUEST_SET,
@@ -343,26 +338,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 ? _childProcess->getPid() : 0; }
 
     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,
@@ -382,6 +364,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