loolwsd: MasterProcessSession splitting: move edit lock

Change-Id: I8339f28cb9ed0ed1a5b1f4cf38d6083450cb4fdc
Reviewed-on: https://gerrit.libreoffice.org/25045
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
This commit is contained in:
Ashod Nakashian 2016-05-16 19:44:15 -04:00 committed by Ashod Nakashian
parent 8acc293af5
commit 1e84102aae
4 changed files with 5 additions and 22 deletions

View file

@ -225,7 +225,7 @@ bool ClientSession::getStatus(const char *buffer, int length)
forwardToPeer(buffer, length);
return true;
}
/*
void ClientSession::setEditLock(const bool value)
{
// Update the sate and forward to child.
@ -233,7 +233,7 @@ void ClientSession::setEditLock(const bool value)
const auto msg = std::string("editlock: ") + (value ? "1" : "0");
forwardToPeer(msg.data(), msg.size());
}
*/
bool ClientSession::getCommandValues(const char *buffer, int length, StringTokenizer& tokens)
{
std::string command;

View file

@ -28,9 +28,9 @@ public:
virtual ~ClientSession();
//void setEditLock(const bool value);
//void markEditLock(const bool value) { _bEditLock = value; }
//bool isEditLocked() const { return _bEditLock; }
void setEditLock(const bool value);
void markEditLock(const bool value) { _bEditLock = value; }
bool isEditLocked() const { return _bEditLock; }
void setPeer(const std::shared_ptr<PrisonerSession>& peer) { MasterProcessSession::_peer = _peer = peer; }

View file

@ -49,14 +49,6 @@ MasterProcessSession::~MasterProcessSession()
{
}
void MasterProcessSession::setEditLock(const bool value)
{
// Update the sate and forward to child.
_bEditLock = value;
const auto msg = std::string("editlock: ") + (value ? "1" : "0");
forwardToPeer(msg.data(), msg.size());
}
void MasterProcessSession::dispatchChild()
{
std::ostringstream oss;

View file

@ -33,10 +33,6 @@ class MasterProcessSession : public LOOLSession, public std::enable_shared_from_
std::shared_ptr<BasicTileQueue> getQueue() const { return _queue; }
void setEditLock(const bool value);
void markEditLock(const bool value) { _bEditLock = value; }
bool isEditLocked() const { return _bEditLock; }
bool shutdownPeer(Poco::UInt16 statusCode, const std::string& message);
protected:
@ -56,11 +52,6 @@ class MasterProcessSession : public LOOLSession, public std::enable_shared_from_
int _loadPart;
std::shared_ptr<DocumentBroker> _docBroker;
std::shared_ptr<BasicTileQueue> _queue;
// If this document holds the edit lock.
// An edit lock will only allow the current session to make edits,
// while other session opening the same document can only see
bool _bEditLock = false;
};
#endif