Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(131)

Unified Diff: remoting/client/chromoting_client.h

Issue 3305001: Move decoder into separate thread, clean up API layering, and redo update protocl (Closed)
Patch Set: Fix compile error. Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/base/tracer.h ('k') | remoting/client/chromoting_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/chromoting_client.h
diff --git a/remoting/client/chromoting_client.h b/remoting/client/chromoting_client.h
index c7026e327cf97eac3cc1d3f7349daf69749626a7..31870edeb5a782d0b6acd6d005ae1d220d333286 100644
--- a/remoting/client/chromoting_client.h
+++ b/remoting/client/chromoting_client.h
@@ -18,6 +18,9 @@ namespace remoting {
class ChromotingView;
class ClientContext;
class InputHandler;
+class ChromotingHostMessage;
+class InitClientMessage;
+class RectangleUpdateDecoder;
class ChromotingClient : public HostConnection::HostEventCallback {
public:
@@ -26,6 +29,7 @@ class ChromotingClient : public HostConnection::HostEventCallback {
ClientContext* context,
HostConnection* connection,
ChromotingView* view,
+ RectangleUpdateDecoder* rectangle_decoder,
InputHandler* input_handler,
CancelableTask* client_done);
virtual ~ChromotingClient();
@@ -64,17 +68,21 @@ class ChromotingClient : public HostConnection::HostEventCallback {
// Convenience method for modifying the state on this object's message loop.
void SetState(State s);
+ // If a message is not being processed, dispatches a single message from the
+ // |received_messages_| queue.
+ void DispatchMessage();
+
+ void OnMessageDone(ChromotingHostMessage* msg);
+
// Handles for chromotocol messages.
- void InitClient(ChromotingHostMessage* msg);
- void BeginUpdate(ChromotingHostMessage* msg);
- void HandleUpdate(ChromotingHostMessage* msg);
- void EndUpdate(ChromotingHostMessage* msg);
+ void InitClient(const InitClientMessage& msg, Task* done);
// The following are not owned by this class.
ClientConfig config_;
ClientContext* context_;
HostConnection* connection_;
ChromotingView* view_;
+ RectangleUpdateDecoder* rectangle_decoder_;
InputHandler* input_handler_;
// If non-NULL, this is called when the client is done.
@@ -82,6 +90,16 @@ class ChromotingClient : public HostConnection::HostEventCallback {
State state_;
+ // Contains all messages that have been received, but have not yet been
+ // processed.
+ //
+ // Used to serialize sending of messages to the client.
+ HostMessageList received_messages_;
+
+ // True if a message is being processed. Can be used to determine if it is
+ // safe to dispatch another message.
+ bool message_being_processed_;
+
DISALLOW_COPY_AND_ASSIGN(ChromotingClient);
};
« no previous file with comments | « remoting/base/tracer.h ('k') | remoting/client/chromoting_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698