Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Side by Side Diff: content/browser/browser_main_loop.h

Issue 2784433002: Ensures that audio tasks cannot run after AudioManager is deleted. (Closed)
Patch Set: rebase Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/browser/audio_manager_thread.cc ('k') | content/browser/browser_main_loop.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <memory> 8 #include <memory>
9 9
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
13 #include "base/timer/timer.h" 13 #include "base/timer/timer.h"
14 #include "build/build_config.h" 14 #include "build/build_config.h"
15 #include "content/browser/browser_process_sub_thread.h" 15 #include "content/browser/browser_process_sub_thread.h"
16 #include "content/public/browser/browser_main_runner.h" 16 #include "content/public/browser/browser_main_runner.h"
17 #include "media/audio/audio_manager.h"
18 #include "services/resource_coordinator/memory/coordinator/coordinator_impl.h" 17 #include "services/resource_coordinator/memory/coordinator/coordinator_impl.h"
19 18
20 #if defined(USE_AURA) 19 #if defined(USE_AURA)
21 namespace aura { 20 namespace aura {
22 class Env; 21 class Env;
23 } 22 }
24 #endif 23 #endif
25 24
26 namespace base { 25 namespace base {
27 class CommandLine; 26 class CommandLine;
28 class FilePath; 27 class FilePath;
29 class HighResolutionTimerManager; 28 class HighResolutionTimerManager;
30 class MemoryPressureMonitor; 29 class MemoryPressureMonitor;
31 class MessageLoop; 30 class MessageLoop;
32 class PowerMonitor; 31 class PowerMonitor;
33 class SystemMonitor; 32 class SystemMonitor;
34 namespace trace_event { 33 namespace trace_event {
35 class TraceEventSystemStatsMonitor; 34 class TraceEventSystemStatsMonitor;
36 } // namespace trace_event 35 } // namespace trace_event
37 } // namespace base 36 } // namespace base
38 37
39 namespace discardable_memory { 38 namespace discardable_memory {
40 class DiscardableSharedMemoryManager; 39 class DiscardableSharedMemoryManager;
41 } 40 }
42 41
43 namespace media { 42 namespace media {
43 class AudioManager;
44 class AudioSystem; 44 class AudioSystem;
45 #if defined(OS_WIN) 45 #if defined(OS_WIN)
46 class SystemMessageWindowWin; 46 class SystemMessageWindowWin;
47 #elif defined(OS_LINUX) && defined(USE_UDEV) 47 #elif defined(OS_LINUX) && defined(USE_UDEV)
48 class DeviceMonitorLinux; 48 class DeviceMonitorLinux;
49 #endif 49 #endif
50 class UserInputMonitor; 50 class UserInputMonitor;
51 #if defined(OS_MACOSX) 51 #if defined(OS_MACOSX)
52 class DeviceMonitorMac; 52 class DeviceMonitorMac;
53 #endif 53 #endif
(...skipping 13 matching lines...) Expand all
67 class NetworkChangeNotifier; 67 class NetworkChangeNotifier;
68 } // namespace net 68 } // namespace net
69 69
70 #if defined(USE_OZONE) 70 #if defined(USE_OZONE)
71 namespace gfx { 71 namespace gfx {
72 class ClientNativePixmapFactory; 72 class ClientNativePixmapFactory;
73 } // namespace gfx 73 } // namespace gfx
74 #endif 74 #endif
75 75
76 namespace content { 76 namespace content {
77 class AudioManagerThread;
78 class BrowserMainParts; 77 class BrowserMainParts;
79 class BrowserOnlineStateObserver; 78 class BrowserOnlineStateObserver;
80 class BrowserThreadImpl; 79 class BrowserThreadImpl;
81 class LoaderDelegateImpl; 80 class LoaderDelegateImpl;
82 class MediaStreamManager; 81 class MediaStreamManager;
83 class ResourceDispatcherHostImpl; 82 class ResourceDispatcherHostImpl;
84 class SaveFileManager; 83 class SaveFileManager;
85 class ServiceManagerContext; 84 class ServiceManagerContext;
86 class SpeechRecognitionManagerImpl; 85 class SpeechRecognitionManagerImpl;
87 class StartupTaskRunner; 86 class StartupTaskRunner;
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 184
186 void MainMessageLoopRun(); 185 void MainMessageLoopRun();
187 186
188 void InitializeMojo(); 187 void InitializeMojo();
189 base::FilePath GetStartupTraceFileName( 188 base::FilePath GetStartupTraceFileName(
190 const base::CommandLine& command_line) const; 189 const base::CommandLine& command_line) const;
191 void InitStartupTracingForDuration(const base::CommandLine& command_line); 190 void InitStartupTracingForDuration(const base::CommandLine& command_line);
192 void EndStartupTracing(); 191 void EndStartupTracing();
193 192
194 void CreateAudioManager(); 193 void CreateAudioManager();
194
195 bool UsingInProcessGpu() const; 195 bool UsingInProcessGpu() const;
196 196
197 void InitializeMemoryManagementComponent(); 197 void InitializeMemoryManagementComponent();
198 198
199 // Quick reference for initialization order: 199 // Quick reference for initialization order:
200 // Constructor 200 // Constructor
201 // Init() 201 // Init()
202 // EarlyInitialization() 202 // EarlyInitialization()
203 // InitializeToolkit() 203 // InitializeToolkit()
204 // PreMainMessageLoopStart() 204 // PreMainMessageLoopStart()
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 std::unique_ptr<BrowserProcessSubThread> cache_thread_; 282 std::unique_ptr<BrowserProcessSubThread> cache_thread_;
283 std::unique_ptr<BrowserProcessSubThread> io_thread_; 283 std::unique_ptr<BrowserProcessSubThread> io_thread_;
284 284
285 // Members initialized in |BrowserThreadsStarted()| -------------------------- 285 // Members initialized in |BrowserThreadsStarted()| --------------------------
286 std::unique_ptr<base::Thread> indexed_db_thread_; 286 std::unique_ptr<base::Thread> indexed_db_thread_;
287 std::unique_ptr<ServiceManagerContext> service_manager_context_; 287 std::unique_ptr<ServiceManagerContext> service_manager_context_;
288 std::unique_ptr<mojo::edk::ScopedIPCSupport> mojo_ipc_support_; 288 std::unique_ptr<mojo::edk::ScopedIPCSupport> mojo_ipc_support_;
289 289
290 // |user_input_monitor_| has to outlive |audio_manager_|, so declared first. 290 // |user_input_monitor_| has to outlive |audio_manager_|, so declared first.
291 std::unique_ptr<media::UserInputMonitor> user_input_monitor_; 291 std::unique_ptr<media::UserInputMonitor> user_input_monitor_;
292 // AudioThread needs to outlive |audio_manager_|. 292 std::unique_ptr<media::AudioManager> audio_manager_;
293 std::unique_ptr<AudioManagerThread> audio_thread_;
294 media::ScopedAudioManagerPtr audio_manager_;
295 // Calls to |audio_system_| must not be posted to the audio thread if it 293 // Calls to |audio_system_| must not be posted to the audio thread if it
296 // differs from the UI one. See http://crbug.com/705455. 294 // differs from the UI one. See http://crbug.com/705455.
297 std::unique_ptr<media::AudioSystem> audio_system_; 295 std::unique_ptr<media::AudioSystem> audio_system_;
298 296
299 std::unique_ptr<midi::MidiService> midi_service_; 297 std::unique_ptr<midi::MidiService> midi_service_;
300 298
301 #if defined(OS_WIN) 299 #if defined(OS_WIN)
302 std::unique_ptr<media::SystemMessageWindowWin> system_message_window_; 300 std::unique_ptr<media::SystemMessageWindowWin> system_message_window_;
303 #elif defined(OS_LINUX) && defined(USE_UDEV) 301 #elif defined(OS_LINUX) && defined(USE_UDEV)
304 std::unique_ptr<media::DeviceMonitorLinux> device_monitor_linux_; 302 std::unique_ptr<media::DeviceMonitorLinux> device_monitor_linux_;
(...skipping 15 matching lines...) Expand all
320 memory_instrumentation_coordinator_; 318 memory_instrumentation_coordinator_;
321 319
322 // DO NOT add members here. Add them to the right categories above. 320 // DO NOT add members here. Add them to the right categories above.
323 321
324 DISALLOW_COPY_AND_ASSIGN(BrowserMainLoop); 322 DISALLOW_COPY_AND_ASSIGN(BrowserMainLoop);
325 }; 323 };
326 324
327 } // namespace content 325 } // namespace content
328 326
329 #endif // CONTENT_BROWSER_BROWSER_MAIN_LOOP_H_ 327 #endif // CONTENT_BROWSER_BROWSER_MAIN_LOOP_H_
OLDNEW
« no previous file with comments | « content/browser/audio_manager_thread.cc ('k') | content/browser/browser_main_loop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698