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

Ashod Nakashian ashod.nakashian at collabora.co.uk
Sun Mar 26 05:04:42 UTC 2017


 wsd/DocumentBroker.cpp |    5 ++---
 wsd/DocumentBroker.hpp |    4 ++--
 2 files changed, 4 insertions(+), 5 deletions(-)

New commits:
commit a57b9e6917c6d1a80eb4d800d63dfde7f40f79f2
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Sat Mar 25 13:56:17 2017 -0400

    wsd: const correctness
    
    Change-Id: I2bba04ccba9fd97e10ecc56f7db1f62a66a8f5f0
    Reviewed-on: https://gerrit.libreoffice.org/35702
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index d3934d1b..2f7ab961 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -300,7 +300,7 @@ DocumentBroker::~DocumentBroker()
     _childProcess.reset();
 }
 
-bool DocumentBroker::load(std::shared_ptr<ClientSession>& session, const std::string& jailId)
+bool DocumentBroker::load(const std::shared_ptr<ClientSession>& session, const std::string& jailId)
 {
     Util::assertIsLocked(_mutex);
 
@@ -743,7 +743,7 @@ size_t DocumentBroker::queueSession(std::shared_ptr<ClientSession>& session)
     return _sessions.size() + _newSessions.size();
 }
 
-size_t DocumentBroker::addSession(std::shared_ptr<ClientSession>& session)
+size_t DocumentBroker::addSession(const std::shared_ptr<ClientSession>& session)
 {
     Util::assertIsLocked(_mutex);
 
@@ -864,7 +864,6 @@ size_t DocumentBroker::removeSessionInternal(const std::string& id)
     return _sessions.size();
 }
 
-
 void DocumentBroker::addCallback(SocketPoll::CallbackFn fn)
 {
     _poll->addCallback(fn);
diff --git a/wsd/DocumentBroker.hpp b/wsd/DocumentBroker.hpp
index 526f873d..13acb9bb 100644
--- a/wsd/DocumentBroker.hpp
+++ b/wsd/DocumentBroker.hpp
@@ -225,7 +225,7 @@ public:
     void startThread();
 
     /// Loads a document from the public URI into the jail.
-    bool load(std::shared_ptr<ClientSession>& session, const std::string& jailId);
+    bool load(const std::shared_ptr<ClientSession>& session, const std::string& jailId);
     bool isLoaded() const { return _isLoaded; }
     void setLoaded();
 
@@ -354,7 +354,7 @@ private:
     bool forwardToClient(const std::shared_ptr<Message>& payload);
 
     /// Add a new session. Returns the new number of sessions.
-    size_t addSession(std::shared_ptr<ClientSession>& session);
+    size_t addSession(const std::shared_ptr<ClientSession>& session);
 
     /// The thread function that all of the I/O for all sessions
     /// associated with this document.


More information about the Libreoffice-commits mailing list