Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Privatize KitQueue member of Document.
Browse files Browse the repository at this point in the history
It is no longer used externally, also remove un-used
KitQueue reference, and constify session accessor for later.

Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I69ca1d6b01a4ca97b6d4815c21c76c5ce8c939e6
mmeeks committed Dec 7, 2024
1 parent 6c12477 commit f77b67b
Showing 4 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion kit/ChildSession.hpp
Original file line number Diff line number Diff line change
@@ -144,7 +144,7 @@ class ChildSession final : public Session
// Only called by kit.
void setCanonicalViewId(int viewId) { _canonicalViewId = viewId; }

int getCanonicalViewId() { return _canonicalViewId; }
int getCanonicalViewId() const { return _canonicalViewId; }

void setViewRenderState(const std::string& state) { _viewRenderState = state; }

4 changes: 2 additions & 2 deletions kit/Kit.cpp
Original file line number Diff line number Diff line change
@@ -748,7 +748,7 @@ Document::Document(const std::shared_ptr<lok::Office>& loKit, const std::string&
, _docId(docId)
, _url(url)
, _obfuscatedFileId(Uri::getFilenameFromURL(docKey))
, _queue(std::make_shared<KitQueue>())
, _queue(new KitQueue())
, _websocketHandler(websocketHandler)
, _modified(ModifiedState::UnModified)
, _isBgSaveProcess(false)
@@ -1145,7 +1145,7 @@ void Document::trimAfterInactivity()
assert(descriptor && "Null callback data.");
assert(descriptor->getDoc() && "Null Document instance.");

std::shared_ptr<KitQueue> queue = descriptor->getDoc()->_queue;
std::unique_ptr<KitQueue> &queue = descriptor->getDoc()->_queue;
assert(queue && "Null KitQueue.");

const std::string payload = p ? p : "(nil)";
4 changes: 1 addition & 3 deletions kit/Kit.hpp
Original file line number Diff line number Diff line change
@@ -393,8 +393,6 @@ class Document final : public std::enable_shared_from_this<Document>
/// Are we currently performing a load ?
bool isLoadOngoing() const { return _duringLoad > 0; }

std::shared_ptr<KitQueue> getQueue() const { return _queue; }

LogUiCmd& getLogUiCmd() { return logUiCmd; }

private:
@@ -419,7 +417,7 @@ class Document final : public std::enable_shared_from_this<Document>
#ifdef __ANDROID__
static std::shared_ptr<lok::Document> _loKitDocumentForAndroidOnly;
#endif
std::shared_ptr<KitQueue> _queue;
std::unique_ptr<KitQueue> _queue;

// Connection to the coolwsd process
std::shared_ptr<WebSocketHandler> _websocketHandler;
1 change: 0 additions & 1 deletion kit/KitWebSocket.hpp
Original file line number Diff line number Diff line change
@@ -21,7 +21,6 @@ class KitSocketPoll;

class KitWebSocketHandler final : public WebSocketHandler
{
std::shared_ptr<KitQueue> _queue;
std::string _socketName;
std::shared_ptr<lok::Office> _loKit;
std::string _jailId;

0 comments on commit f77b67b

Please sign in to comment.