[Libreoffice-commits] online.git: loolwsd/DocumentBroker.cpp loolwsd/DocumentBroker.hpp
Miklos Vajna
vmiklos at collabora.co.uk
Wed Apr 13 08:05:31 UTC 2016
loolwsd/DocumentBroker.cpp | 8 ++++----
loolwsd/DocumentBroker.hpp | 9 ++++-----
2 files changed, 8 insertions(+), 9 deletions(-)
New commits:
commit 4fac6c012654e6475c9a6162eb3dac2fdc8ad6ff
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Wed Apr 13 10:05:00 2016 +0200
DocumentBroker: can pass these by reference
Change-Id: I327e515e39671239b8699cfadcf61e088af68b13
diff --git a/loolwsd/DocumentBroker.cpp b/loolwsd/DocumentBroker.cpp
index 7a9fe20..0ec21ea 100644
--- a/loolwsd/DocumentBroker.cpp
+++ b/loolwsd/DocumentBroker.cpp
@@ -33,7 +33,7 @@ std::string getCachePath(const std::string& uri)
}
-Poco::URI DocumentBroker::sanitizeURI(std::string uri)
+Poco::URI DocumentBroker::sanitizeURI(const std::string& uri)
{
// The URI of the document should be url-encoded.
std::string decodedUri;
@@ -229,7 +229,7 @@ std::string DocumentBroker::getJailRoot() const
return Poco::Path(_childRoot, _jailId).toString();
}
-void DocumentBroker::takeEditLock(const std::string id)
+void DocumentBroker::takeEditLock(const std::string& id)
{
std::lock_guard<std::mutex> sessionsLock(_wsSessionsMutex);
for (auto& it: _wsSessions)
@@ -247,7 +247,7 @@ void DocumentBroker::takeEditLock(const std::string id)
}
}
-void DocumentBroker::addWSSession(const std::string id, std::shared_ptr<MasterProcessSession>& ws)
+void DocumentBroker::addWSSession(const std::string& id, std::shared_ptr<MasterProcessSession>& ws)
{
std::lock_guard<std::mutex> sessionsLock(_wsSessionsMutex);
@@ -269,7 +269,7 @@ void DocumentBroker::addWSSession(const std::string id, std::shared_ptr<MasterPr
_childProcess->getWebSocket()->sendFrame(aMessage.data(), aMessage.size());
}
-void DocumentBroker::removeWSSession(const std::string id)
+void DocumentBroker::removeWSSession(const std::string& id)
{
std::lock_guard<std::mutex> sessionsLock(_wsSessionsMutex);
diff --git a/loolwsd/DocumentBroker.hpp b/loolwsd/DocumentBroker.hpp
index 27a527a..6e260d9 100644
--- a/loolwsd/DocumentBroker.hpp
+++ b/loolwsd/DocumentBroker.hpp
@@ -105,8 +105,7 @@ class DocumentBroker
{
public:
- static
- Poco::URI sanitizeURI(std::string uri);
+ static Poco::URI sanitizeURI(const std::string& uri);
/// Returns a document-specific key based
/// on the URI of the document.
@@ -164,11 +163,11 @@ public:
/// Ignore input events from all web socket sessions
/// except this one
- void takeEditLock(const std::string id);
+ void takeEditLock(const std::string& id);
- void addWSSession(const std::string id, std::shared_ptr<MasterProcessSession>& ws);
+ void addWSSession(const std::string& id, std::shared_ptr<MasterProcessSession>& ws);
- void removeWSSession(const std::string id);
+ void removeWSSession(const std::string& id);
unsigned getWSSessionsCount() { return _wsSessions.size(); }
More information about the Libreoffice-commits
mailing list