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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 // Performs the shutdown sequence, starting with PostMainMessageLoopRun | 77 // Performs the shutdown sequence, starting with PostMainMessageLoopRun |
78 // through stopping threads to PostDestroyThreads. | 78 // through stopping threads to PostDestroyThreads. |
79 void ShutdownThreadsAndCleanUp(); | 79 void ShutdownThreadsAndCleanUp(); |
80 | 80 |
81 int GetResultCode() const { return result_code_; } | 81 int GetResultCode() const { return result_code_; } |
82 | 82 |
83 // Can be called on any thread. | 83 // Can be called on any thread. |
84 static media::AudioManager* GetAudioManager(); | 84 static media::AudioManager* GetAudioManager(); |
85 static media_stream::MediaStreamManager* GetMediaStreamManager(); | 85 static media_stream::MediaStreamManager* GetMediaStreamManager(); |
86 | 86 |
| 87 // Should be called before RunMainMessageLoopParts (on the thread that calls |
| 88 // that method). |
| 89 static void UseFakeMediaStreamDevice(); |
87 private: | 90 private: |
88 // For ShutdownThreadsAndCleanUp. | 91 // For ShutdownThreadsAndCleanUp. |
89 friend class BrowserShutdownImpl; | 92 friend class BrowserShutdownImpl; |
90 | 93 |
91 void InitializeMainThread(); | 94 void InitializeMainThread(); |
92 | 95 |
93 // Called right after the browser threads have been started. | 96 // Called right after the browser threads have been started. |
94 void BrowserThreadsStarted(); | 97 void BrowserThreadsStarted(); |
95 | 98 |
96 void MainMessageLoopRun(); | 99 void MainMessageLoopRun(); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 | 134 |
132 // Members initialized in |RunMainMessageLoopParts()| ------------------------ | 135 // Members initialized in |RunMainMessageLoopParts()| ------------------------ |
133 scoped_ptr<BrowserProcessSubThread> db_thread_; | 136 scoped_ptr<BrowserProcessSubThread> db_thread_; |
134 scoped_ptr<WebKitThread> webkit_thread_; | 137 scoped_ptr<WebKitThread> webkit_thread_; |
135 scoped_ptr<BrowserProcessSubThread> file_user_blocking_thread_; | 138 scoped_ptr<BrowserProcessSubThread> file_user_blocking_thread_; |
136 scoped_ptr<BrowserProcessSubThread> file_thread_; | 139 scoped_ptr<BrowserProcessSubThread> file_thread_; |
137 scoped_ptr<BrowserProcessSubThread> process_launcher_thread_; | 140 scoped_ptr<BrowserProcessSubThread> process_launcher_thread_; |
138 scoped_ptr<BrowserProcessSubThread> cache_thread_; | 141 scoped_ptr<BrowserProcessSubThread> cache_thread_; |
139 scoped_ptr<BrowserProcessSubThread> io_thread_; | 142 scoped_ptr<BrowserProcessSubThread> io_thread_; |
140 | 143 |
| 144 // Static members. |
| 145 static bool use_fake_media_stream_device_; |
| 146 |
141 #if defined(OS_WIN) | 147 #if defined(OS_WIN) |
142 ui::ScopedOleInitializer ole_initializer_; | 148 ui::ScopedOleInitializer ole_initializer_; |
143 #endif | 149 #endif |
144 | 150 |
145 DISALLOW_COPY_AND_ASSIGN(BrowserMainLoop); | 151 DISALLOW_COPY_AND_ASSIGN(BrowserMainLoop); |
146 }; | 152 }; |
147 | 153 |
148 } // namespace content | 154 } // namespace content |
149 | 155 |
150 #endif // CONTENT_BROWSER_BROWSER_MAIN_LOOP_H_ | 156 #endif // CONTENT_BROWSER_BROWSER_MAIN_LOOP_H_ |
OLD | NEW |