OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/client/chromoting_client_runtime.h" | 5 #include "remoting/client/chromoting_client_runtime.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 } // namespace | 21 } // namespace |
22 | 22 |
23 namespace remoting { | 23 namespace remoting { |
24 | 24 |
25 // static | 25 // static |
26 ChromotingClientRuntime* ChromotingClientRuntime::GetInstance() { | 26 ChromotingClientRuntime* ChromotingClientRuntime::GetInstance() { |
27 return base::Singleton<ChromotingClientRuntime>::get(); | 27 return base::Singleton<ChromotingClientRuntime>::get(); |
28 } | 28 } |
29 | 29 |
30 ChromotingClientRuntime::ChromotingClientRuntime() { | 30 ChromotingClientRuntime::ChromotingClientRuntime() { |
31 base::TaskScheduler::CreateAndSetSimpleTaskScheduler("Remoting"); | 31 base::TaskScheduler::CreateAndStartWithDefaultParams("Remoting"); |
32 | 32 |
33 if (!base::MessageLoop::current()) { | 33 if (!base::MessageLoop::current()) { |
34 VLOG(1) << "Starting main message loop"; | 34 VLOG(1) << "Starting main message loop"; |
35 ui_loop_.reset(new base::MessageLoopForUI()); | 35 ui_loop_.reset(new base::MessageLoopForUI()); |
36 #if defined(OS_ANDROID) | 36 #if defined(OS_ANDROID) |
37 // On Android, the UI thread is managed by Java, so we need to attach and | 37 // On Android, the UI thread is managed by Java, so we need to attach and |
38 // start a special type of message loop to allow Chromium code to run tasks. | 38 // start a special type of message loop to allow Chromium code to run tasks. |
39 ui_loop_->Start(); | 39 ui_loop_->Start(); |
40 #elif defined(OS_IOS) | 40 #elif defined(OS_IOS) |
41 base::MessageLoopForUI::current()->Attach(); | 41 base::MessageLoopForUI::current()->Attach(); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 } | 110 } |
111 } | 111 } |
112 | 112 |
113 ChromotingEventLogWriter* ChromotingClientRuntime::log_writer() { | 113 ChromotingEventLogWriter* ChromotingClientRuntime::log_writer() { |
114 DCHECK(network_task_runner()->BelongsToCurrentThread()); | 114 DCHECK(network_task_runner()->BelongsToCurrentThread()); |
115 return log_writer_.get(); | 115 return log_writer_.get(); |
116 } | 116 } |
117 | 117 |
118 | 118 |
119 } // namespace remoting | 119 } // namespace remoting |
OLD | NEW |