зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 9c7364b4579d (bug 1308615) for suspicion that this caused pgo windows test crashes
This commit is contained in:
Родитель
fed18a42c0
Коммит
e90a683f18
|
@ -261,8 +261,8 @@ function forgetPendingListsEventually(aContentWindow) {
|
|||
}
|
||||
|
||||
function updateIndicators() {
|
||||
let contentWindowArray = MediaManagerService.activeMediaCaptureWindows;
|
||||
let count = contentWindowArray.length;
|
||||
let contentWindowSupportsArray = MediaManagerService.activeMediaCaptureWindows;
|
||||
let count = contentWindowSupportsArray.Count();
|
||||
|
||||
let state = {
|
||||
showGlobalIndicator: count > 0,
|
||||
|
@ -280,7 +280,7 @@ function updateIndicators() {
|
|||
// sending duplicate notifications.
|
||||
let contentWindows = new Set();
|
||||
for (let i = 0; i < count; ++i) {
|
||||
contentWindows.add(contentWindowArray.queryElementAt(i, Ci.nsISupports).top);
|
||||
contentWindows.add(contentWindowSupportsArray.GetElementAt(i).top);
|
||||
}
|
||||
|
||||
for (let contentWindow of contentWindows) {
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
#include "mozilla/dom/MediaStreamTrack.h"
|
||||
#include "GetUserMediaRequest.h"
|
||||
#include "MediaStreamListener.h"
|
||||
#include "nsArray.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsHashPropertyBag.h"
|
||||
#ifdef MOZ_WIDGET_GONK
|
||||
|
@ -3134,11 +3133,14 @@ MediaManager::Observe(nsISupports* aSubject, const char* aTopic,
|
|||
}
|
||||
|
||||
nsresult
|
||||
MediaManager::GetActiveMediaCaptureWindows(nsIArray** aArray)
|
||||
MediaManager::GetActiveMediaCaptureWindows(nsISupportsArray** aArray)
|
||||
{
|
||||
MOZ_ASSERT(aArray);
|
||||
|
||||
nsCOMPtr<nsIMutableArray> array = nsArray::Create();
|
||||
nsISupportsArray* array;
|
||||
nsresult rv = NS_NewISupportsArray(&array); // AddRefs
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
for (auto iter = mActiveWindows.Iter(); !iter.Done(); iter.Next()) {
|
||||
const uint64_t& id = iter.Key();
|
||||
|
@ -3169,11 +3171,11 @@ MediaManager::GetActiveMediaCaptureWindows(nsIArray** aArray)
|
|||
}
|
||||
}
|
||||
if (capturing) {
|
||||
array->AppendElement(window, /*weak =*/ false);
|
||||
array->AppendElement(window);
|
||||
}
|
||||
}
|
||||
|
||||
array.forget(aArray);
|
||||
*aArray = array;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -3332,14 +3334,14 @@ MediaManager::IterateWindowListeners(nsPIDOMWindowInner* aWindow,
|
|||
void
|
||||
MediaManager::StopMediaStreams()
|
||||
{
|
||||
nsCOMPtr<nsIArray> array;
|
||||
nsCOMPtr<nsISupportsArray> array;
|
||||
GetActiveMediaCaptureWindows(getter_AddRefs(array));
|
||||
uint32_t len;
|
||||
array->GetLength(&len);
|
||||
array->Count(&len);
|
||||
for (uint32_t i = 0; i < len; i++) {
|
||||
nsCOMPtr<nsPIDOMWindowInner> win;
|
||||
array->QueryElementAt(i, NS_GET_IID(nsPIDOMWindowInner),
|
||||
getter_AddRefs(win));
|
||||
nsCOMPtr<nsISupports> window;
|
||||
array->GetElementAt(i, getter_AddRefs(window));
|
||||
nsCOMPtr<nsPIDOMWindowInner> win(do_QueryInterface(window));
|
||||
if (win) {
|
||||
OnNavigation(win->WindowID());
|
||||
}
|
||||
|
@ -3351,14 +3353,14 @@ MediaManager::IsActivelyCapturingOrHasAPermission(uint64_t aWindowId)
|
|||
{
|
||||
// Does page currently have a gUM stream active?
|
||||
|
||||
nsCOMPtr<nsIArray> array;
|
||||
nsCOMPtr<nsISupportsArray> array;
|
||||
GetActiveMediaCaptureWindows(getter_AddRefs(array));
|
||||
uint32_t len;
|
||||
array->GetLength(&len);
|
||||
array->Count(&len);
|
||||
for (uint32_t i = 0; i < len; i++) {
|
||||
nsCOMPtr<nsPIDOMWindowInner> win;
|
||||
array->QueryElementAt(i, NS_GET_IID(nsPIDOMWindowInner),
|
||||
getter_AddRefs(win));
|
||||
nsCOMPtr<nsISupports> window;
|
||||
array->GetElementAt(i, getter_AddRefs(window));
|
||||
nsCOMPtr<nsPIDOMWindowInner> win(do_QueryInterface(window));
|
||||
if (win && win->WindowID() == aWindowId) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
interface nsIArray;
|
||||
interface nsISupportsArray;
|
||||
interface nsIDOMWindow;
|
||||
|
||||
%{C++
|
||||
|
@ -16,7 +16,7 @@ interface nsIDOMWindow;
|
|||
interface nsIMediaManagerService : nsISupports
|
||||
{
|
||||
/* return a array of inner windows that have active captures */
|
||||
readonly attribute nsIArray activeMediaCaptureWindows;
|
||||
readonly attribute nsISupportsArray activeMediaCaptureWindows;
|
||||
|
||||
/* Get the capture state for the given window and all descendant windows (iframes, etc) */
|
||||
void mediaCaptureWindowState(in nsIDOMWindow aWindow, out boolean aVideo, out boolean aAudio,
|
||||
|
|
|
@ -58,7 +58,7 @@ var WebrtcUI = {
|
|||
|
||||
notify: function() {
|
||||
let windows = MediaManagerService.activeMediaCaptureWindows;
|
||||
let count = windows.length;
|
||||
let count = windows.Count();
|
||||
let msg = {};
|
||||
if (count == 0) {
|
||||
if (this._notificationId) {
|
||||
|
@ -76,7 +76,7 @@ var WebrtcUI = {
|
|||
let cameraActive = false;
|
||||
let audioActive = false;
|
||||
for (let i = 0; i < count; i++) {
|
||||
let win = windows.queryElementAt(i, Ci.nsIDOMWindow);
|
||||
let win = windows.GetElementAt(i);
|
||||
let hasAudio = {};
|
||||
let hasVideo = {};
|
||||
MediaManagerService.mediaCaptureWindowState(win, hasVideo, hasAudio);
|
||||
|
|
Загрузка…
Ссылка в новой задаче