OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "remoting/host/chromoting_host_context.h" | 5 #include "remoting/host/chromoting_host_context.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "remoting/base/auto_thread.h" | 10 #include "remoting/base/auto_thread.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 } | 44 } |
45 | 45 |
46 ChromotingHostContext::~ChromotingHostContext() { | 46 ChromotingHostContext::~ChromotingHostContext() { |
47 } | 47 } |
48 | 48 |
49 scoped_ptr<ChromotingHostContext> ChromotingHostContext::Create( | 49 scoped_ptr<ChromotingHostContext> ChromotingHostContext::Create( |
50 scoped_refptr<AutoThreadTaskRunner> ui_task_runner) { | 50 scoped_refptr<AutoThreadTaskRunner> ui_task_runner) { |
51 DCHECK(ui_task_runner->BelongsToCurrentThread()); | 51 DCHECK(ui_task_runner->BelongsToCurrentThread()); |
52 | 52 |
53 scoped_ptr<ChromotingHostContext> context( | 53 scoped_ptr<ChromotingHostContext> context( |
54 new ChromotingHostContext(ui_task_runner)); | 54 new ChromotingHostContext(ui_task_runner.get())); |
55 if (!context->audio_task_runner_ || | 55 if (!context->audio_task_runner_.get() || !context->file_task_runner_.get() || |
56 !context->file_task_runner_ || | 56 !context->input_task_runner_.get() || |
57 !context->input_task_runner_ || | 57 !context->network_task_runner_.get() || |
58 !context->network_task_runner_ || | 58 !context->video_capture_task_runner_.get() || |
59 !context->video_capture_task_runner_ || | 59 !context->video_encode_task_runner_.get() || |
60 !context->video_encode_task_runner_ || | 60 !context->url_request_context_getter_.get()) { |
61 !context->url_request_context_getter_) { | |
62 context.reset(); | 61 context.reset(); |
63 } | 62 } |
64 | 63 |
65 return context.Pass(); | 64 return context.Pass(); |
66 } | 65 } |
67 | 66 |
68 scoped_refptr<AutoThreadTaskRunner> | 67 scoped_refptr<AutoThreadTaskRunner> |
69 ChromotingHostContext::audio_task_runner() { | 68 ChromotingHostContext::audio_task_runner() { |
70 return audio_task_runner_; | 69 return audio_task_runner_; |
71 } | 70 } |
(...skipping 27 matching lines...) Expand all Loading... |
99 ChromotingHostContext::video_encode_task_runner() { | 98 ChromotingHostContext::video_encode_task_runner() { |
100 return video_encode_task_runner_; | 99 return video_encode_task_runner_; |
101 } | 100 } |
102 | 101 |
103 scoped_refptr<net::URLRequestContextGetter> | 102 scoped_refptr<net::URLRequestContextGetter> |
104 ChromotingHostContext::url_request_context_getter() { | 103 ChromotingHostContext::url_request_context_getter() { |
105 return url_request_context_getter_; | 104 return url_request_context_getter_; |
106 } | 105 } |
107 | 106 |
108 } // namespace remoting | 107 } // namespace remoting |
OLD | NEW |