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

Unified Diff: remoting/host/chromoting_host.h

Issue 13466014: Made the ChromotingHost class not ref-counted. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cosmetic Created 7 years, 9 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 | « no previous file | remoting/host/chromoting_host.cc » ('j') | remoting/host/chromoting_host.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/chromoting_host.h
diff --git a/remoting/host/chromoting_host.h b/remoting/host/chromoting_host.h
index b1cd128ff929ab99f422acc66c4b9a4421f6b264..6e5a76a15dd5ecc841622806b04927501b7e01b4 100644
--- a/remoting/host/chromoting_host.h
+++ b/remoting/host/chromoting_host.h
@@ -12,6 +12,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
+#include "base/threading/non_thread_safe.h"
#include "base/threading/thread.h"
#include "net/base/backoff_entry.h"
#include "remoting/host/client_session.h"
@@ -59,7 +60,7 @@ class DesktopEnvironmentFactory;
// all pending tasks to complete. After all of that completed we
// return to the idle state. We then go to step (2) if there a new
// incoming connection.
-class ChromotingHost : public base::RefCountedThreadSafe<ChromotingHost>,
+class ChromotingHost : public base::NonThreadSafe,
public ClientSession::EventHandler,
public protocol::SessionManager::Listener,
public HostStatusMonitor {
@@ -77,6 +78,7 @@ class ChromotingHost : public base::RefCountedThreadSafe<ChromotingHost>,
scoped_refptr<base::SingleThreadTaskRunner> video_encode_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> network_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner);
+ virtual ~ChromotingHost();
// Asynchronously start the host process.
//
@@ -86,9 +88,8 @@ class ChromotingHost : public base::RefCountedThreadSafe<ChromotingHost>,
// This method can only be called once during the lifetime of this object.
void Start(const std::string& xmpp_login);
- // Asynchronously shutdown the host process. |shutdown_task| is
- // called after shutdown is completed.
- void Shutdown(const base::Closure& shutdown_task);
+ // Shuts down the host process.
+ void Shutdown();
Wez 2013/04/02 19:58:33 Rename this Stop() to match Start().
alexeypa (please no reviews) 2013/04/08 23:28:17 I moved the logic to the destructor.
// HostStatusMonitor interface.
virtual void AddStatusObserver(HostStatusObserver* observer) OVERRIDE;
@@ -134,10 +135,7 @@ class ChromotingHost : public base::RefCountedThreadSafe<ChromotingHost>,
// Sets desired configuration for the protocol. Must be called before Start().
void set_protocol_config(scoped_ptr<protocol::CandidateSessionConfig> config);
- // Disconnects all active clients. Clients are disconnected
- // asynchronously when this method is called on a thread other than
- // the network thread. Potentically this may cause disconnection of
- // clients that were not connected when this method is called.
+ // Disconnects all active clients.
Wez 2013/04/02 19:58:33 Clarify the semantics, e.g. might sub-components a
alexeypa (please no reviews) 2013/04/08 23:28:17 Done.
void DisconnectAllClients();
base::WeakPtr<ChromotingHost> AsWeakPtr() {
@@ -145,7 +143,6 @@ class ChromotingHost : public base::RefCountedThreadSafe<ChromotingHost>,
}
private:
- friend class base::RefCountedThreadSafe<ChromotingHost>;
friend class ChromotingHostTest;
typedef std::list<ClientSession*> ClientList;
@@ -157,8 +154,6 @@ class ChromotingHost : public base::RefCountedThreadSafe<ChromotingHost>,
kStopped,
};
- virtual ~ChromotingHost();
-
// Called from Shutdown() to finish shutdown.
void ShutdownFinish();
@@ -197,10 +192,6 @@ class ChromotingHost : public base::RefCountedThreadSafe<ChromotingHost>,
bool authenticating_client_;
bool reject_authenticating_client_;
- // Stores list of tasks that should be executed when we finish
- // shutdown. Used only while |state_| is set to kStopping.
- std::vector<base::Closure> shutdown_tasks_;
-
// The maximum duration of any session.
base::TimeDelta max_session_duration_;
« no previous file with comments | « no previous file | remoting/host/chromoting_host.cc » ('j') | remoting/host/chromoting_host.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698