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