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. |