зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1145403 - Don't open MediaManager on shutdown. r=jesup
This commit is contained in:
Родитель
3dc26340ad
Коммит
e9cc1b61ab
|
@ -1982,8 +1982,8 @@ Navigator::OnNavigation()
|
|||
}
|
||||
|
||||
#ifdef MOZ_MEDIA_NAVIGATOR
|
||||
// Inform MediaManager in case there are live streams or pending callbacks.
|
||||
MediaManager *manager = MediaManager::Get();
|
||||
// If MediaManager is open let it inform any live streams or pending callbacks
|
||||
MediaManager *manager = MediaManager::GetIfExists();
|
||||
if (manager) {
|
||||
manager->OnNavigation(mWindow->WindowID());
|
||||
}
|
||||
|
|
|
@ -1418,7 +1418,11 @@ NS_IMPL_ISUPPORTS(MediaManager, nsIMediaManagerService, nsIObserver)
|
|||
MediaManager::Get() {
|
||||
if (!sSingleton) {
|
||||
NS_ASSERTION(NS_IsMainThread(), "Only create MediaManager on main thread");
|
||||
|
||||
#ifdef DEBUG
|
||||
static int timesCreated = 0;
|
||||
timesCreated++;
|
||||
MOZ_ASSERT(timesCreated == 1);
|
||||
#endif
|
||||
sSingleton = new MediaManager();
|
||||
|
||||
sSingleton->mMediaThread = new base::Thread("MediaManager");
|
||||
|
@ -1454,6 +1458,11 @@ MediaManager::Get() {
|
|||
return sSingleton;
|
||||
}
|
||||
|
||||
/* static */ MediaManager*
|
||||
MediaManager::GetIfExists() {
|
||||
return sSingleton;
|
||||
}
|
||||
|
||||
/* static */ already_AddRefed<MediaManager>
|
||||
MediaManager::GetInstance()
|
||||
{
|
||||
|
|
|
@ -554,6 +554,7 @@ public:
|
|||
// thread from the MainThread, as we NS_DISPATCH_SYNC to MainThread
|
||||
// from MediaManager thread.
|
||||
static MediaManager* Get();
|
||||
static MediaManager* GetIfExists();
|
||||
static MessageLoop* GetMessageLoop();
|
||||
|
||||
static bool Exists()
|
||||
|
|
Загрузка…
Ссылка в новой задаче