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

Unified Diff: remoting/protocol/connection_to_client.h

Issue 8495035: Make ConnectionToClient and ClientSession not ref-counted. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 1 month 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/host/screen_recorder_unittest.cc ('k') | remoting/protocol/connection_to_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/connection_to_client.h
diff --git a/remoting/protocol/connection_to_client.h b/remoting/protocol/connection_to_client.h
index 87230457f14d9928b26180138ba1684d765a6dae..c59c8f39faea842480a55791713e8255db391b64 100644
--- a/remoting/protocol/connection_to_client.h
+++ b/remoting/protocol/connection_to_client.h
@@ -8,9 +8,9 @@
#include <deque>
#include <vector>
-#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/synchronization/lock.h"
+#include "base/threading/non_thread_safe.h"
#include "remoting/protocol/session.h"
#include "remoting/protocol/video_writer.h"
@@ -27,13 +27,10 @@ class HostStub;
class InputStub;
class HostMessageDispatcher;
-// This class represents a remote viewer connected to the chromoting host
-// through a libjingle connection. A viewer object is responsible for sending
-// screen updates and other messages to the remote viewer. It is also
-// responsible for receiving and parsing data from the remote viewer and
-// delegating events to the event handler.
-class ConnectionToClient :
- public base::RefCountedThreadSafe<ConnectionToClient> {
+// This class represents a remote viewer connection to the chromoting
+// host. It sets up all protocol channels and connects them to the
+// stubs.
+class ConnectionToClient : public base::NonThreadSafe {
public:
class EventHandler {
public:
@@ -53,10 +50,10 @@ class ConnectionToClient :
int64 sequence_number) = 0;
};
- // Constructs a ConnectionToClient object for the
- // |session|. |message_loop| is the message loop that this object
- // runs on.
- ConnectionToClient(base::MessageLoopProxy* message_loop, Session* session);
+ // Constructs a ConnectionToClient object for the |session|. Takes
+ // ownership of |session|.
+ ConnectionToClient(Session* session);
+ virtual ~ConnectionToClient();
// Set |event_handler| for connection events. |event_handler| is
// guaranteed to be used only on the network thread. Must be called
@@ -83,10 +80,6 @@ class ConnectionToClient :
virtual void set_host_stub(HostStub* host_stub);
virtual void set_input_stub(InputStub* input_stub);
- protected:
- friend class base::RefCountedThreadSafe<ConnectionToClient>;
- virtual ~ConnectionToClient();
-
private:
// Callback for protocol Session.
void OnSessionStateChange(Session::State state);
@@ -101,9 +94,6 @@ class ConnectionToClient :
// Stops writing in the channels.
void CloseChannels();
- // The message loop that this object runs on.
- scoped_refptr<base::MessageLoopProxy> message_loop_;
-
// Event handler for handling events sent from this object.
EventHandler* handler_;
« no previous file with comments | « remoting/host/screen_recorder_unittest.cc ('k') | remoting/protocol/connection_to_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698