OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 CONTENT_BROWSER_BROWSER_MAIN_LOOP_H_ | 5 #ifndef CONTENT_BROWSER_BROWSER_MAIN_LOOP_H_ |
6 #define CONTENT_BROWSER_BROWSER_MAIN_LOOP_H_ | 6 #define CONTENT_BROWSER_BROWSER_MAIN_LOOP_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
| 9 #include <vector> |
| 10 |
9 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
10 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
11 | 13 |
12 class CommandLine; | 14 class CommandLine; |
13 class HighResolutionTimerManager; | 15 class HighResolutionTimerManager; |
14 class MessageLoop; | 16 class MessageLoop; |
15 class SystemMessageWindowWin; | 17 class SystemMessageWindowWin; |
16 | 18 |
17 namespace base { | 19 namespace base { |
18 class SystemMonitor; | 20 class SystemMonitor; |
(...skipping 27 matching lines...) Expand all Loading... |
46 int GetResultCode() const { return result_code_; } | 48 int GetResultCode() const { return result_code_; } |
47 | 49 |
48 private: | 50 private: |
49 void InitializeMainThread(); | 51 void InitializeMainThread(); |
50 | 52 |
51 // Members initialized on construction --------------------------------------- | 53 // Members initialized on construction --------------------------------------- |
52 const content::MainFunctionParams& parameters_; | 54 const content::MainFunctionParams& parameters_; |
53 const CommandLine& parsed_command_line_; | 55 const CommandLine& parsed_command_line_; |
54 int result_code_; | 56 int result_code_; |
55 | 57 |
| 58 // Vector of BrowserMainParts set by CreateBrowserMainParts ------------------ |
| 59 // The BrowserParts fucntions for each part are called in the order added. |
| 60 // They are released (destroyed) in the reverse order. |
| 61 std::vector<BrowserMainParts*> parts_list_; |
| 62 |
56 // Members initialized in |MainMessageLoopStart()| --------------------------- | 63 // Members initialized in |MainMessageLoopStart()| --------------------------- |
57 scoped_ptr<MessageLoop> main_message_loop_; | 64 scoped_ptr<MessageLoop> main_message_loop_; |
58 scoped_ptr<base::SystemMonitor> system_monitor_; | 65 scoped_ptr<base::SystemMonitor> system_monitor_; |
59 scoped_ptr<HighResolutionTimerManager> hi_res_timer_manager_; | 66 scoped_ptr<HighResolutionTimerManager> hi_res_timer_manager_; |
60 scoped_ptr<net::NetworkChangeNotifier> network_change_notifier_; | 67 scoped_ptr<net::NetworkChangeNotifier> network_change_notifier_; |
61 #if defined(OS_WIN) | 68 #if defined(OS_WIN) |
62 scoped_ptr<SystemMessageWindowWin> system_message_window_; | 69 scoped_ptr<SystemMessageWindowWin> system_message_window_; |
63 #endif | 70 #endif |
64 scoped_ptr<BrowserThreadImpl> main_thread_; | 71 scoped_ptr<BrowserThreadImpl> main_thread_; |
65 | 72 |
66 // Parts are created in BrowserMainLoop::Init() and released/destroyed in | |
67 // the destructor before anything else. | |
68 scoped_ptr<BrowserMainParts> parts_; | |
69 | |
70 DISALLOW_COPY_AND_ASSIGN(BrowserMainLoop); | 73 DISALLOW_COPY_AND_ASSIGN(BrowserMainLoop); |
71 }; | 74 }; |
72 | 75 |
73 } // namespace content | 76 } // namespace content |
74 | 77 |
75 #endif // CONTENT_BROWSER_BROWSER_MAIN_LOOP_H_ | 78 #endif // CONTENT_BROWSER_BROWSER_MAIN_LOOP_H_ |
OLD | NEW |