| 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 #ifndef IOS_WEB_APP_WEB_MAIN_LOOP_H_ | 5 #ifndef IOS_WEB_APP_WEB_MAIN_LOOP_H_ |
| 6 #define IOS_WEB_APP_WEB_MAIN_LOOP_H_ | 6 #define IOS_WEB_APP_WEB_MAIN_LOOP_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 9 |
| 8 #include "base/macros.h" | 10 #include "base/macros.h" |
| 9 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" | |
| 11 | 12 |
| 12 namespace base { | 13 namespace base { |
| 13 class CommandLine; | 14 class CommandLine; |
| 14 class FilePath; | 15 class FilePath; |
| 15 class MessageLoop; | 16 class MessageLoop; |
| 16 class PowerMonitor; | 17 class PowerMonitor; |
| 17 class SystemMonitor; | 18 class SystemMonitor; |
| 18 } // namespace base | 19 } // namespace base |
| 19 | 20 |
| 20 namespace net { | 21 namespace net { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 | 62 |
| 62 // Called just before attaching to the main message loop. | 63 // Called just before attaching to the main message loop. |
| 63 int PreMainMessageLoopRun(); | 64 int PreMainMessageLoopRun(); |
| 64 | 65 |
| 65 // Members initialized on construction --------------------------------------- | 66 // Members initialized on construction --------------------------------------- |
| 66 int result_code_; | 67 int result_code_; |
| 67 // True if the non-UI threads were created. | 68 // True if the non-UI threads were created. |
| 68 bool created_threads_; | 69 bool created_threads_; |
| 69 | 70 |
| 70 // Members initialized in |MainMessageLoopStart()| --------------------------- | 71 // Members initialized in |MainMessageLoopStart()| --------------------------- |
| 71 scoped_ptr<base::MessageLoop> main_message_loop_; | 72 std::unique_ptr<base::MessageLoop> main_message_loop_; |
| 72 scoped_ptr<base::SystemMonitor> system_monitor_; | 73 std::unique_ptr<base::SystemMonitor> system_monitor_; |
| 73 scoped_ptr<base::PowerMonitor> power_monitor_; | 74 std::unique_ptr<base::PowerMonitor> power_monitor_; |
| 74 scoped_ptr<net::NetworkChangeNotifier> network_change_notifier_; | 75 std::unique_ptr<net::NetworkChangeNotifier> network_change_notifier_; |
| 75 | 76 |
| 76 // Destroy parts_ before main_message_loop_ (required) and before other | 77 // Destroy parts_ before main_message_loop_ (required) and before other |
| 77 // classes constructed in web (but after main_thread_). | 78 // classes constructed in web (but after main_thread_). |
| 78 scoped_ptr<WebMainParts> parts_; | 79 std::unique_ptr<WebMainParts> parts_; |
| 79 | 80 |
| 80 // Members initialized in |InitializeMainThread()| --------------------------- | 81 // Members initialized in |InitializeMainThread()| --------------------------- |
| 81 // This must get destroyed before other threads that are created in parts_. | 82 // This must get destroyed before other threads that are created in parts_. |
| 82 scoped_ptr<WebThreadImpl> main_thread_; | 83 std::unique_ptr<WebThreadImpl> main_thread_; |
| 83 | 84 |
| 84 // Members initialized in |RunMainMessageLoopParts()| ------------------------ | 85 // Members initialized in |RunMainMessageLoopParts()| ------------------------ |
| 85 scoped_ptr<WebThreadImpl> db_thread_; | 86 std::unique_ptr<WebThreadImpl> db_thread_; |
| 86 scoped_ptr<WebThreadImpl> file_user_blocking_thread_; | 87 std::unique_ptr<WebThreadImpl> file_user_blocking_thread_; |
| 87 scoped_ptr<WebThreadImpl> file_thread_; | 88 std::unique_ptr<WebThreadImpl> file_thread_; |
| 88 scoped_ptr<WebThreadImpl> cache_thread_; | 89 std::unique_ptr<WebThreadImpl> cache_thread_; |
| 89 scoped_ptr<WebThreadImpl> io_thread_; | 90 std::unique_ptr<WebThreadImpl> io_thread_; |
| 90 | 91 |
| 91 // Members initialized in |WebThreadsStarted()| -------------------------- | 92 // Members initialized in |WebThreadsStarted()| -------------------------- |
| 92 scoped_ptr<CookieNotificationBridge> cookie_notification_bridge_; | 93 std::unique_ptr<CookieNotificationBridge> cookie_notification_bridge_; |
| 93 | 94 |
| 94 DISALLOW_COPY_AND_ASSIGN(WebMainLoop); | 95 DISALLOW_COPY_AND_ASSIGN(WebMainLoop); |
| 95 }; | 96 }; |
| 96 | 97 |
| 97 } // namespace web | 98 } // namespace web |
| 98 | 99 |
| 99 #endif // IOS_WEB_APP_WEB_MAIN_LOOP_H_ | 100 #endif // IOS_WEB_APP_WEB_MAIN_LOOP_H_ |
| OLD | NEW |