[Libreoffice-commits] online.git: wsd/Admin.cpp wsd/Admin.hpp
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Wed Jan 9 07:46:13 UTC 2019
wsd/Admin.cpp | 8 ++++----
wsd/Admin.hpp | 10 +++++++++-
2 files changed, 13 insertions(+), 5 deletions(-)
New commits:
commit 8244726d3970db0d2b868c9c37179a3243bb6bc8
Author: Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Wed Jan 9 08:45:46 2019 +0100
Commit: Miklos Vajna <vmiklos at collabora.com>
CommitDate: Wed Jan 9 08:45:53 2019 +0100
MonitorConnectRecord: make members private
Change-Id: I485ed48bca0e5c2c0be15f44f553fc48651c59c9
diff --git a/wsd/Admin.cpp b/wsd/Admin.cpp
index 8cb2aa389..650429af4 100644
--- a/wsd/Admin.cpp
+++ b/wsd/Admin.cpp
@@ -451,10 +451,10 @@ void Admin::pollingThread()
if (_pendingConnects.size())
{
MonitorConnectRecord rec = _pendingConnects[0];
- if (rec._when < now)
+ if (rec.getWhen() < now)
{
_pendingConnects.erase(_pendingConnects.begin());
- connectToMonitorSync(rec._uri);
+ connectToMonitorSync(rec.getUri());
}
}
@@ -688,8 +688,8 @@ void Admin::scheduleMonitorConnect(const std::string &uri, std::chrono::steady_c
assertCorrectThread();
MonitorConnectRecord todo;
- todo._when = when;
- todo._uri = uri;
+ todo.setWhen(when);
+ todo.setUri(uri);
_pendingConnects.push_back(todo);
}
diff --git a/wsd/Admin.hpp b/wsd/Admin.hpp
index eb2f97c79..d818a6cea 100644
--- a/wsd/Admin.hpp
+++ b/wsd/Admin.hpp
@@ -155,7 +155,15 @@ private:
size_t _totalSysMemKb;
size_t _totalAvailMemKb;
- struct MonitorConnectRecord {
+ struct MonitorConnectRecord
+ {
+ void setWhen(std::chrono::steady_clock::time_point when) { _when = when; }
+ std::chrono::steady_clock::time_point getWhen() const { return _when; }
+
+ void setUri(const std::string& uri) { _uri = uri; }
+ std::string getUri() const { return _uri; }
+
+ protected:
std::chrono::steady_clock::time_point _when;
std::string _uri;
};
More information about the Libreoffice-commits
mailing list