| 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> | 9 #include <utility> |
| 10 | 10 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/message_loop/message_loop.h" | 14 #include "base/message_loop/message_loop.h" |
| 15 #include "base/metrics/histogram.h" | 15 #include "base/metrics/histogram.h" |
| 16 #include "base/path_service.h" | 16 #include "base/path_service.h" |
| 17 #include "base/power_monitor/power_monitor.h" | 17 #include "base/power_monitor/power_monitor.h" |
| 18 #include "base/power_monitor/power_monitor_device_source.h" | 18 #include "base/power_monitor/power_monitor_device_source.h" |
| 19 #include "base/process/process_metrics.h" | 19 #include "base/process/process_metrics.h" |
| 20 #include "base/system_monitor/system_monitor.h" | 20 #include "base/system_monitor/system_monitor.h" |
| 21 #include "base/threading/thread_restrictions.h" | 21 #include "base/threading/thread_restrictions.h" |
| 22 #include "ios/web/net/cookie_notification_bridge.h" | 22 #include "ios/web/net/cookie_notification_bridge.h" |
| 23 #include "ios/web/public/app/web_main_parts.h" | 23 #include "ios/web/public/app/web_main_parts.h" |
| 24 #include "ios/web/public/web_client.h" | 24 #include "ios/web/public/web_client.h" |
| 25 #include "ios/web/web_thread_impl.h" | 25 #include "ios/web/web_thread_impl.h" |
| 26 #include "ios/web/webui/url_data_manager_ios.h" | 26 #include "ios/web/webui/url_data_manager_ios.h" |
| 27 #include "net/base/network_change_notifier.h" | 27 #include "net/base/network_change_notifier.h" |
| 28 | 28 |
| 29 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 30 #error "This file requires ARC support." |
| 31 #endif |
| 32 |
| 29 namespace web { | 33 namespace web { |
| 30 | 34 |
| 31 // The currently-running WebMainLoop. There can be one or zero. | 35 // The currently-running WebMainLoop. There can be one or zero. |
| 32 // TODO(rohitrao): Desktop uses this to implement | 36 // TODO(rohitrao): Desktop uses this to implement |
| 33 // ImmediateShutdownAndExitProcess. If we don't need that functionality, we can | 37 // ImmediateShutdownAndExitProcess. If we don't need that functionality, we can |
| 34 // remove this. | 38 // remove this. |
| 35 WebMainLoop* g_current_web_main_loop = nullptr; | 39 WebMainLoop* g_current_web_main_loop = nullptr; |
| 36 | 40 |
| 37 WebMainLoop::WebMainLoop() : result_code_(0), created_threads_(false) { | 41 WebMainLoop::WebMainLoop() : result_code_(0), created_threads_(false) { |
| 38 DCHECK(!g_current_web_main_loop); | 42 DCHECK(!g_current_web_main_loop); |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 main_thread_.reset( | 264 main_thread_.reset( |
| 261 new WebThreadImpl(WebThread::UI, base::MessageLoop::current())); | 265 new WebThreadImpl(WebThread::UI, base::MessageLoop::current())); |
| 262 } | 266 } |
| 263 | 267 |
| 264 int WebMainLoop::WebThreadsStarted() { | 268 int WebMainLoop::WebThreadsStarted() { |
| 265 cookie_notification_bridge_.reset(new CookieNotificationBridge); | 269 cookie_notification_bridge_.reset(new CookieNotificationBridge); |
| 266 return result_code_; | 270 return result_code_; |
| 267 } | 271 } |
| 268 | 272 |
| 269 } // namespace web | 273 } // namespace web |
| OLD | NEW |