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

Unified Diff: remoting/host/chromoting_host_context.h

Issue 639233002: Remote assistance on Chrome OS Part IV - It2MeHost (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
Index: remoting/host/chromoting_host_context.h
diff --git a/remoting/host/chromoting_host_context.h b/remoting/host/chromoting_host_context.h
index e4638ffd3b7cec19d2483762aa349a24a8d5beac..10ab023f123afd6abbca685da8af2021051760f4 100644
--- a/remoting/host/chromoting_host_context.h
+++ b/remoting/host/chromoting_host_context.h
@@ -19,15 +19,14 @@ class AutoThreadTaskRunner;
// 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 {
+class ChromotingHostContext
+ : public base::RefCountedThreadSafe<ChromotingHostContext> {
public:
- ~ChromotingHostContext();
-
- // Create threads and URLRequestContextGetter for use by a host.
+ // Creates threads and URLRequestContextGetter for use by a host.
// During shutdown the caller should tear-down the ChromotingHostContext and
// then continue to run until |ui_task_runner| is no longer referenced.
// NULL is returned if any threads fail to start.
- static scoped_ptr<ChromotingHostContext> Create(
+ static scoped_refptr<ChromotingHostContext> Create(
scoped_refptr<AutoThreadTaskRunner> ui_task_runner);
// Task runner for the thread used for audio capture and encoding.
@@ -61,7 +60,10 @@ class ChromotingHostContext {
scoped_refptr<net::URLRequestContextGetter> url_request_context_getter();
- private:
+ protected:
+ friend class base::RefCountedThreadSafe<ChromotingHostContext>;
+ virtual ~ChromotingHostContext();
+
ChromotingHostContext(AutoThreadTaskRunner* ui_task_runner);
// Thread for audio capture and encoding.

Powered by Google App Engine
This is Rietveld 408576698