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

Unified Diff: remoting/host/client_session.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/chromoting_host_unittest.cc ('k') | remoting/host/client_session.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/client_session.h
diff --git a/remoting/host/client_session.h b/remoting/host/client_session.h
index fe67773414a1abd3aa1cc5923f7d4b528758cfde..2ed080ffe23e035346da041e53269fedf19f1fd2 100644
--- a/remoting/host/client_session.h
+++ b/remoting/host/client_session.h
@@ -9,6 +9,7 @@
#include <set>
#include "base/time.h"
+#include "base/threading/non_thread_safe.h"
#include "remoting/protocol/connection_to_client.h"
#include "remoting/protocol/host_stub.h"
#include "remoting/protocol/input_stub.h"
@@ -23,7 +24,7 @@ class Capturer;
class ClientSession : public protocol::HostStub,
public protocol::InputStub,
public protocol::ConnectionToClient::EventHandler,
- public base::RefCountedThreadSafe<ClientSession> {
+ public base::NonThreadSafe {
public:
// Callback interface for passing events to the ChromotingHost.
class EventHandler {
@@ -36,12 +37,13 @@ class ClientSession : public protocol::HostStub,
int64 sequence_number) = 0;
};
- // Takes ownership of |user_authenticator|. Does not take ownership of
+ // Takes ownership of |connection|. Does not take ownership of
// |event_handler|, |input_stub| or |capturer|.
ClientSession(EventHandler* event_handler,
- scoped_refptr<protocol::ConnectionToClient> connection,
+ protocol::ConnectionToClient* connection,
protocol::InputStub* input_stub,
Capturer* capturer);
+ virtual ~ClientSession();
// protocol::InputStub interface.
virtual void InjectKeyEvent(const protocol::KeyEvent& event);
@@ -86,9 +88,7 @@ class ClientSession : public protocol::HostStub,
bool ShouldIgnoreRemoteKeyboardInput(const protocol::KeyEvent& event) const;
private:
- friend class base::RefCountedThreadSafe<ClientSession>;
friend class ClientSessionTest_RestoreEventState_Test;
- virtual ~ClientSession();
// Keep track of input state so that we can clean up the event queue when
// the user disconnects.
@@ -102,7 +102,7 @@ class ClientSession : public protocol::HostStub,
EventHandler* event_handler_;
// The connection to the client.
- scoped_refptr<protocol::ConnectionToClient> connection_;
+ scoped_ptr<protocol::ConnectionToClient> connection_;
std::string client_jid_;
« no previous file with comments | « remoting/host/chromoting_host_unittest.cc ('k') | remoting/host/client_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698