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

Unified Diff: remoting/host/chromoting_host_context.h

Issue 10829467: [Chromoting] Introducing refcount-based life time management of the message loops in the service (d… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Destructors of ref-counted objects should not be public. Created 8 years, 4 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
Index: remoting/host/chromoting_host_context.h
diff --git a/remoting/host/chromoting_host_context.h b/remoting/host/chromoting_host_context.h
index 2e3480d69d3a1c50f59421615d2aad0d494ce494..3abac0a907a0f8e50e72268f9b7eeecaa5f30d3f 100644
--- a/remoting/host/chromoting_host_context.h
+++ b/remoting/host/chromoting_host_context.h
@@ -5,30 +5,23 @@
#ifndef REMOTING_HOST_CHROMOTING_HOST_CONTEXT_H_
#define REMOTING_HOST_CHROMOTING_HOST_CONTEXT_H_
-#include <string>
-
#include "base/gtest_prod_util.h"
#include "base/memory/ref_counted.h"
-#include "base/threading/platform_thread.h"
-#include "base/threading/thread.h"
-
-namespace base {
-class SingleThreadTaskRunner;
-} // namespace base
+#include "base/single_thread_task_runner.h"
namespace net {
class URLRequestContextGetter;
} // namespace net
namespace remoting {
+class AutoThread;
// A class that manages threads and running context for the chromoting host
// process. This class is virtual only for testing purposes (see below).
class ChromotingHostContext {
public:
// Create a context.
- ChromotingHostContext(
- scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner);
+ ChromotingHostContext(base::SingleThreadTaskRunner* ui_task_runner);
virtual ~ChromotingHostContext();
// TODO(ajwong): Move the Start method out of this class. Then
@@ -72,19 +65,19 @@ class ChromotingHostContext {
FRIEND_TEST_ALL_PREFIXES(ChromotingHostContextTest, StartAndStop);
// A thread that hosts all network operations.
- base::Thread network_thread_;
+ scoped_refptr<AutoThread> network_thread_;
// A thread that hosts screen capture.
- base::Thread capture_thread_;
+ scoped_refptr<AutoThread> capture_thread_;
// A thread that hosts all encode operations.
- base::Thread encode_thread_;
+ scoped_refptr<AutoThread> encode_thread_;
// A thread that hosts input injection.
- base::Thread desktop_thread_;
+ scoped_refptr<AutoThread> desktop_thread_;
// Thread for blocking IO operations.
- base::Thread file_thread_;
+ scoped_refptr<AutoThread> file_thread_;
scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_;

Powered by Google App Engine
This is Rietveld 408576698