Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CONTENT_BROWSER_BROWSER_MAIN_LOOP_H_ | |
| 6 #define CONTENT_BROWSER_BROWSER_MAIN_LOOP_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include <vector> | |
| 10 | |
| 11 #include "base/basictypes.h" | |
| 12 #include "base/memory/scoped_ptr.h" | |
| 13 | |
| 14 class BrowserThread; | |
| 15 class CommandLine; | |
| 16 class HighResolutionTimerManager; | |
| 17 class MessageLoop; | |
| 18 | |
| 19 struct MainFunctionParams; | |
| 20 | |
| 21 namespace base { | |
| 22 class SystemMonitor; | |
| 23 } | |
| 24 | |
| 25 namespace net { | |
| 26 class NetworkChangeNotifier; | |
| 27 } | |
| 28 | |
| 29 namespace content { | |
| 30 | |
| 31 class BrowserMainParts; | |
| 32 | |
| 33 // Implements the main browser loop stages called from |BrowserMain()|. | |
| 34 // See comments in browser_main_parts.h for additional info. | |
| 35 class BrowserMainLoop { | |
| 36 public: | |
| 37 explicit BrowserMainLoop(const MainFunctionParams& parameters); | |
| 38 virtual ~BrowserMainLoop(); | |
| 39 | |
| 40 void Init(); | |
| 41 | |
| 42 // BrowserMainLoop implementation | |
|
jam
2011/10/25 19:43:32
nit: remove
| |
| 43 void EarlyInitialization(); | |
| 44 void InitializeToolkit(); | |
| 45 void MainMessageLoopStart(); | |
| 46 void RunMainMessageLoopParts(bool* completed_main_message_loop); | |
| 47 void MainMessageLoopRun(); | |
| 48 | |
| 49 int GetResultCode() const { return result_code_; } | |
| 50 | |
| 51 private: | |
| 52 void InitializeMainThread(); | |
| 53 | |
| 54 // Members initialized on construction --------------------------------------- | |
| 55 const MainFunctionParams& parameters_; | |
| 56 const CommandLine& parsed_command_line_; | |
| 57 int result_code_; | |
| 58 | |
| 59 // Vector of BrowserMainParts set by CreateBrowserMainParts ------------------ | |
| 60 // The BrowserParts fucntions for each part are called in the order added. | |
| 61 // They are released (destroyed) in the reverse order. | |
| 62 std::vector<BrowserMainParts*> parts_list_; | |
| 63 | |
| 64 // Members initialized in |MainMessageLoopStart()| --------------------------- | |
| 65 scoped_ptr<MessageLoop> main_message_loop_; | |
| 66 scoped_ptr<base::SystemMonitor> system_monitor_; | |
| 67 scoped_ptr<HighResolutionTimerManager> hi_res_timer_manager_; | |
| 68 scoped_ptr<net::NetworkChangeNotifier> network_change_notifier_; | |
| 69 scoped_ptr<BrowserThread> main_thread_; | |
| 70 | |
| 71 DISALLOW_COPY_AND_ASSIGN(BrowserMainLoop); | |
| 72 }; | |
| 73 | |
| 74 } // namespace content | |
| 75 | |
| 76 #endif // CONTENT_BROWSER_BROWSER_MAIN_LOOP_H_ | |
| OLD | NEW |