OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "content/browser/browser_process_sub_thread.h" | 10 #include "content/browser/browser_process_sub_thread.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 struct MainFunctionParams; | 41 struct MainFunctionParams; |
42 | 42 |
43 #if defined(OS_LINUX) | 43 #if defined(OS_LINUX) |
44 class DeviceMonitorLinux; | 44 class DeviceMonitorLinux; |
45 #elif defined(OS_MACOSX) | 45 #elif defined(OS_MACOSX) |
46 class DeviceMonitorMac; | 46 class DeviceMonitorMac; |
47 #endif | 47 #endif |
48 | 48 |
49 // Implements the main browser loop stages called from BrowserMainRunner. | 49 // Implements the main browser loop stages called from BrowserMainRunner. |
50 // See comments in browser_main_parts.h for additional info. | 50 // See comments in browser_main_parts.h for additional info. |
51 class BrowserMainLoop { | 51 class CONTENT_EXPORT BrowserMainLoop { |
52 public: | 52 public: |
53 // Returns the current instance. This is used to get access to the getters | 53 // Returns the current instance. This is used to get access to the getters |
54 // that return objects which are owned by this class. | 54 // that return objects which are owned by this class. |
55 static BrowserMainLoop* GetInstance(); | 55 static BrowserMainLoop* GetInstance(); |
56 | 56 |
57 explicit BrowserMainLoop(const MainFunctionParams& parameters); | 57 explicit BrowserMainLoop(const MainFunctionParams& parameters); |
58 virtual ~BrowserMainLoop(); | 58 virtual ~BrowserMainLoop(); |
59 | 59 |
60 void Init(); | 60 void Init(); |
61 | 61 |
(...skipping 14 matching lines...) Expand all Loading... |
76 int GetResultCode() const { return result_code_; } | 76 int GetResultCode() const { return result_code_; } |
77 | 77 |
78 media::AudioManager* audio_manager() const { return audio_manager_.get(); } | 78 media::AudioManager* audio_manager() const { return audio_manager_.get(); } |
79 AudioMirroringManager* audio_mirroring_manager() const { | 79 AudioMirroringManager* audio_mirroring_manager() const { |
80 return audio_mirroring_manager_.get(); | 80 return audio_mirroring_manager_.get(); |
81 } | 81 } |
82 MediaStreamManager* media_stream_manager() const { | 82 MediaStreamManager* media_stream_manager() const { |
83 return media_stream_manager_.get(); | 83 return media_stream_manager_.get(); |
84 } | 84 } |
85 media::MIDIManager* midi_manager() const { return midi_manager_.get(); } | 85 media::MIDIManager* midi_manager() const { return midi_manager_.get(); } |
| 86 base::Thread* indexed_db_thread() const { return indexed_db_thread_.get(); } |
86 | 87 |
87 private: | 88 private: |
88 class MemoryObserver; | 89 class MemoryObserver; |
89 // For ShutdownThreadsAndCleanUp. | 90 // For ShutdownThreadsAndCleanUp. |
90 friend class BrowserShutdownImpl; | 91 friend class BrowserShutdownImpl; |
91 | 92 |
92 void InitializeMainThread(); | 93 void InitializeMainThread(); |
93 | 94 |
94 // Called right after the browser threads have been started. | 95 // Called right after the browser threads have been started. |
95 void BrowserThreadsStarted(); | 96 void BrowserThreadsStarted(); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 // Members initialized in |RunMainMessageLoopParts()| ------------------------ | 137 // Members initialized in |RunMainMessageLoopParts()| ------------------------ |
137 scoped_ptr<BrowserProcessSubThread> db_thread_; | 138 scoped_ptr<BrowserProcessSubThread> db_thread_; |
138 #if !defined(OS_IOS) | 139 #if !defined(OS_IOS) |
139 scoped_ptr<WebKitThread> webkit_thread_; | 140 scoped_ptr<WebKitThread> webkit_thread_; |
140 #endif | 141 #endif |
141 scoped_ptr<BrowserProcessSubThread> file_user_blocking_thread_; | 142 scoped_ptr<BrowserProcessSubThread> file_user_blocking_thread_; |
142 scoped_ptr<BrowserProcessSubThread> file_thread_; | 143 scoped_ptr<BrowserProcessSubThread> file_thread_; |
143 scoped_ptr<BrowserProcessSubThread> process_launcher_thread_; | 144 scoped_ptr<BrowserProcessSubThread> process_launcher_thread_; |
144 scoped_ptr<BrowserProcessSubThread> cache_thread_; | 145 scoped_ptr<BrowserProcessSubThread> cache_thread_; |
145 scoped_ptr<BrowserProcessSubThread> io_thread_; | 146 scoped_ptr<BrowserProcessSubThread> io_thread_; |
| 147 scoped_ptr<base::Thread> indexed_db_thread_; |
146 scoped_ptr<MemoryObserver> memory_observer_; | 148 scoped_ptr<MemoryObserver> memory_observer_; |
147 | 149 |
148 DISALLOW_COPY_AND_ASSIGN(BrowserMainLoop); | 150 DISALLOW_COPY_AND_ASSIGN(BrowserMainLoop); |
149 }; | 151 }; |
150 | 152 |
151 } // namespace content | 153 } // namespace content |
152 | 154 |
153 #endif // CONTENT_BROWSER_BROWSER_MAIN_LOOP_H_ | 155 #endif // CONTENT_BROWSER_BROWSER_MAIN_LOOP_H_ |
OLD | NEW |