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

Unified Diff: content/browser/browser_main_loop.cc

Issue 9433006: Remove GetAudioManager and GetMediaStreamManager from ResourceContext. The reason is the content mo… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: review comments Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/browser_main_loop.h ('k') | content/browser/mock_resource_context.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/browser_main_loop.cc
===================================================================
--- content/browser/browser_main_loop.cc (revision 123165)
+++ content/browser/browser_main_loop.cc (working copy)
@@ -32,6 +32,7 @@
#include "content/public/common/main_function_params.h"
#include "content/public/common/result_codes.h"
#include "crypto/nss_util.h"
+#include "media/audio/audio_manager.h"
#include "net/base/network_change_notifier.h"
#include "net/base/ssl_config_service.h"
#include "net/socket/client_socket_factory.h"
@@ -169,16 +170,15 @@
namespace content {
// The currently-running BrowserMainLoop. There can be one or zero.
-// This is stored to enable immediate shutdown when needed.
-BrowserMainLoop* current_browser_main_loop = NULL;
+BrowserMainLoop* g_current_browser_main_loop = NULL;
// This is just to be able to keep ShutdownThreadsAndCleanUp out of
// the public interface of BrowserMainLoop.
class BrowserShutdownImpl {
public:
static void ImmediateShutdownAndExitProcess() {
- DCHECK(current_browser_main_loop);
- current_browser_main_loop->ShutdownThreadsAndCleanUp();
+ DCHECK(g_current_browser_main_loop);
+ g_current_browser_main_loop->ShutdownThreadsAndCleanUp();
#if defined(OS_WIN)
// At this point the message loop is still running yet we've shut everything
@@ -196,22 +196,27 @@
BrowserShutdownImpl::ImmediateShutdownAndExitProcess();
}
+// static
+AudioManager* BrowserMainLoop::GetAudioManager() {
+ return g_current_browser_main_loop->audio_manager_.get();
+}
+
// BrowserMainLoop construction / destructione =============================
BrowserMainLoop::BrowserMainLoop(const content::MainFunctionParams& parameters)
: parameters_(parameters),
parsed_command_line_(parameters.command_line),
result_code_(content::RESULT_CODE_NORMAL_EXIT) {
- DCHECK(!current_browser_main_loop);
- current_browser_main_loop = this;
+ DCHECK(!g_current_browser_main_loop);
+ g_current_browser_main_loop = this;
#if defined(OS_WIN)
OleInitialize(NULL);
#endif
}
BrowserMainLoop::~BrowserMainLoop() {
- DCHECK_EQ(this, current_browser_main_loop);
- current_browser_main_loop = NULL;
+ DCHECK_EQ(this, g_current_browser_main_loop);
+ g_current_browser_main_loop = NULL;
#if defined(OS_WIN)
OleUninitialize();
#endif
@@ -316,6 +321,7 @@
hi_res_timer_manager_.reset(new HighResolutionTimerManager);
network_change_notifier_.reset(net::NetworkChangeNotifier::Create());
+ audio_manager_.reset(AudioManager::Create());
#if defined(OS_WIN)
system_message_window_.reset(new SystemMessageWindowWin);
« no previous file with comments | « content/browser/browser_main_loop.h ('k') | content/browser/mock_resource_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698