OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ios/web/app/web_main_loop.h" | 5 #include "ios/web/app/web_main_loop.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
| 9 #include <utility> |
| 10 |
9 #include "base/bind.h" | 11 #include "base/bind.h" |
10 #include "base/command_line.h" | 12 #include "base/command_line.h" |
11 #include "base/logging.h" | 13 #include "base/logging.h" |
12 #include "base/message_loop/message_loop.h" | 14 #include "base/message_loop/message_loop.h" |
13 #include "base/metrics/histogram.h" | 15 #include "base/metrics/histogram.h" |
14 #include "base/path_service.h" | 16 #include "base/path_service.h" |
15 #include "base/power_monitor/power_monitor.h" | 17 #include "base/power_monitor/power_monitor.h" |
16 #include "base/power_monitor/power_monitor_device_source.h" | 18 #include "base/power_monitor/power_monitor_device_source.h" |
17 #include "base/process/process_metrics.h" | 19 #include "base/process/process_metrics.h" |
18 #include "base/system_monitor/system_monitor.h" | 20 #include "base/system_monitor/system_monitor.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 | 74 |
73 InitializeMainThread(); | 75 InitializeMainThread(); |
74 | 76 |
75 #if 0 | 77 #if 0 |
76 // TODO(crbug.com/228014): SystemMonitor is not working properly on iOS. | 78 // TODO(crbug.com/228014): SystemMonitor is not working properly on iOS. |
77 system_monitor_.reset(new base::SystemMonitor); | 79 system_monitor_.reset(new base::SystemMonitor); |
78 #endif | 80 #endif |
79 // TODO(rohitrao): Do we need PowerMonitor on iOS, or can we get rid of it? | 81 // TODO(rohitrao): Do we need PowerMonitor on iOS, or can we get rid of it? |
80 scoped_ptr<base::PowerMonitorSource> power_monitor_source( | 82 scoped_ptr<base::PowerMonitorSource> power_monitor_source( |
81 new base::PowerMonitorDeviceSource()); | 83 new base::PowerMonitorDeviceSource()); |
82 power_monitor_.reset(new base::PowerMonitor(power_monitor_source.Pass())); | 84 power_monitor_.reset(new base::PowerMonitor(std::move(power_monitor_source))); |
83 network_change_notifier_.reset(net::NetworkChangeNotifier::Create()); | 85 network_change_notifier_.reset(net::NetworkChangeNotifier::Create()); |
84 | 86 |
85 if (parts_) { | 87 if (parts_) { |
86 parts_->PostMainMessageLoopStart(); | 88 parts_->PostMainMessageLoopStart(); |
87 } | 89 } |
88 } | 90 } |
89 | 91 |
90 void WebMainLoop::CreateStartupTasks() { | 92 void WebMainLoop::CreateStartupTasks() { |
91 int result = 0; | 93 int result = 0; |
92 result = PreCreateThreads(); | 94 result = PreCreateThreads(); |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 main_thread_.reset( | 268 main_thread_.reset( |
267 new WebThreadImpl(WebThread::UI, base::MessageLoop::current())); | 269 new WebThreadImpl(WebThread::UI, base::MessageLoop::current())); |
268 } | 270 } |
269 | 271 |
270 int WebMainLoop::WebThreadsStarted() { | 272 int WebMainLoop::WebThreadsStarted() { |
271 cookie_notification_bridge_.reset(new CookieNotificationBridge); | 273 cookie_notification_bridge_.reset(new CookieNotificationBridge); |
272 return result_code_; | 274 return result_code_; |
273 } | 275 } |
274 | 276 |
275 } // namespace web | 277 } // namespace web |
OLD | NEW |