diff --git a/browser/base/content/test/webrtc/browser_devices_get_user_media_in_frame.js b/browser/base/content/test/webrtc/browser_devices_get_user_media_in_frame.js index 3f56a532d968..32f8bba32751 100644 --- a/browser/base/content/test/webrtc/browser_devices_get_user_media_in_frame.js +++ b/browser/base/content/test/webrtc/browser_devices_get_user_media_in_frame.js @@ -130,15 +130,15 @@ var gTests = [ { desc: "getUserMedia audio+video: reloading a frame updates the sharing UI", run: async function checkUpdateWhenReloading() { - // We'll share only the mic in the first frame, then share both in the + // We'll share only the cam in the first frame, then share both in the // second frame, then reload the second frame. After each step, we'll check // the UI is in the correct state. let promise = promisePopupNotificationShown("webRTC-shareDevices"); - await promiseRequestDevice(true, false, "frame1"); + await promiseRequestDevice(false, true, "frame1"); await promise; await expectObserverCalled("getUserMedia:request"); - checkDeviceSelectors(true, false); + checkDeviceSelectors(false, true); let indicator = promiseIndicatorWindow(); await promiseMessage("ok", () => { @@ -146,11 +146,11 @@ var gTests = [ }); await expectObserverCalled("getUserMedia:response:allow"); await expectObserverCalled("recording-device-events"); - Assert.deepEqual((await getMediaCaptureState()), {audio: true}, - "expected microphone to be shared"); + Assert.deepEqual((await getMediaCaptureState()), {video: true}, + "expected camera to be shared"); await indicator; - await checkSharingUI({video: false, audio: true}); + await checkSharingUI({video: true, audio: false}); await expectNoObserverCalled(); promise = promisePopupNotificationShown("webRTC-shareDevices"); @@ -176,7 +176,7 @@ var gTests = [ await promise; await expectObserverCalled("recording-window-ended"); - await checkSharingUI({video: false, audio: true}); + await checkSharingUI({video: true, audio: false}); await expectNoObserverCalled(); await closeStream(false, "frame1"); diff --git a/dom/ipc/TabParent.cpp b/dom/ipc/TabParent.cpp index ed5f870a5d1a..d84976072367 100644 --- a/dom/ipc/TabParent.cpp +++ b/dom/ipc/TabParent.cpp @@ -164,7 +164,7 @@ TabParent::TabParent(nsIContentParent* aManager, , mInitedByParent(false) , mTabId(aTabId) , mCreatingWindow(false) - , mCursor(nsCursor(-1)) + , mCursor(eCursorInvalid) , mTabSetsCursor(false) , mHasContentOpener(false) #ifdef DEBUG @@ -1131,7 +1131,7 @@ TabParent::SendRealMouseEvent(WidgetMouseEvent& aEvent) if (mCustomCursor) { widget->SetCursor(mCustomCursor, mCustomCursorHotspotX, mCustomCursorHotspotY); - } else if (mCursor != nsCursor(-1)) { + } else if (mCursor != eCursorInvalid) { widget->SetCursor(mCursor); } } else if (eMouseExitFromWidget == aEvent.mMessage) { @@ -1787,7 +1787,7 @@ TabParent::RecvSetCustomCursor(const nsCString& aCursorData, const uint32_t& aHotspotY, const bool& aForce) { - mCursor = nsCursor(-1); + mCursor = eCursorInvalid; nsCOMPtr widget = GetWidget(); if (widget) { diff --git a/dom/media/MediaManager.cpp b/dom/media/MediaManager.cpp index 7e3ed762360d..a06296086a28 100644 --- a/dom/media/MediaManager.cpp +++ b/dom/media/MediaManager.cpp @@ -1232,8 +1232,13 @@ public: self->mSourceListener->GetPrincipalHandle()); if (NS_FAILED(rv)) { nsString log; - log.AssignASCII("Starting audio failed"); - error = new MediaMgrError(NS_LITERAL_STRING("InternalError"), log); + if (rv == NS_ERROR_NOT_AVAILABLE) { + log.AssignASCII("Concurrent mic process limit."); + error = new MediaMgrError(NS_LITERAL_STRING("NotReadableError"), log); + } else { + log.AssignASCII("Starting audio failed"); + error = new MediaMgrError(NS_LITERAL_STRING("InternalError"), log); + } } } diff --git a/dom/media/webrtc/MediaEngineWebRTCAudio.cpp b/dom/media/webrtc/MediaEngineWebRTCAudio.cpp index 3f3b6074fd4b..ff77065b09fa 100644 --- a/dom/media/webrtc/MediaEngineWebRTCAudio.cpp +++ b/dom/media/webrtc/MediaEngineWebRTCAudio.cpp @@ -474,6 +474,13 @@ MediaEngineWebRTCMicrophoneSource::Start(SourceMediaStream *aStream, return NS_ERROR_FAILURE; } + // Until we fix bug 1400488 we need to block a second tab (OuterWindow) + // from opening an already-open device. If it's the same tab, they + // will share a Graph(), and we can allow it. + if (!mSources.IsEmpty() && aStream->Graph() != mSources[0]->Graph()) { + return NS_ERROR_NOT_AVAILABLE; + } + { MonitorAutoLock lock(mMonitor); mSources.AppendElement(aStream); diff --git a/dom/workers/RuntimeService.cpp b/dom/workers/RuntimeService.cpp index 526008df5406..e294ca6db05e 100644 --- a/dom/workers/RuntimeService.cpp +++ b/dom/workers/RuntimeService.cpp @@ -885,9 +885,9 @@ InitJSContextForWorker(WorkerPrivate* aWorkerPrivate, JSContext* aWorkerCx) // This is the real place where we set the max memory for the runtime. for (uint32_t index = 0; index < ArrayLength(gcSettings); index++) { const JSSettings::JSGCSetting& setting = gcSettings[index]; - if (setting.IsSet()) { + if (setting.key.isSome()) { NS_ASSERTION(setting.value, "Can't handle 0 values!"); - JS_SetGCParameter(aWorkerCx, setting.key, setting.value); + JS_SetGCParameter(aWorkerCx, *setting.key, setting.value); } } @@ -1935,7 +1935,7 @@ RuntimeService::Init() } // Initialize JSSettings. - if (!sDefaultJSSettings.gcSettings[0].IsSet()) { + if (sDefaultJSSettings.gcSettings[0].key.isNothing()) { sDefaultJSSettings.contextOptions = JS::ContextOptions(); sDefaultJSSettings.chrome.maxScriptRuntime = -1; sDefaultJSSettings.chrome.compartmentOptions.behaviors().setVersion(JSVERSION_DEFAULT); diff --git a/dom/workers/Workers.h b/dom/workers/Workers.h index aa25ccffd578..fbcccd293f91 100644 --- a/dom/workers/Workers.h +++ b/dom/workers/Workers.h @@ -9,6 +9,7 @@ #include "jsapi.h" #include "mozilla/Attributes.h" +#include "mozilla/Maybe.h" #include "mozilla/Mutex.h" #include #include "nsAutoPtr.h" @@ -102,25 +103,12 @@ struct JSSettings struct JSGCSetting { - JSGCParamKey key; + mozilla::Maybe key; uint32_t value; JSGCSetting() - : key(static_cast(-1)), value(0) + : key(), value(0) { } - - bool - IsSet() const - { - return key != static_cast(-1); - } - - void - Unset() - { - key = static_cast(-1); - value = 0; - } }; // There are several settings that we know we need so it makes sense to @@ -166,11 +154,11 @@ struct JSSettings for (uint32_t index = 0; index < ArrayLength(gcSettings); index++) { JSSettings::JSGCSetting& setting = gcSettings[index]; - if (setting.key == aKey) { + if (setting.key.isSome() && *setting.key == aKey) { foundSetting = &setting; break; } - if (!firstEmptySetting && !setting.IsSet()) { + if (!firstEmptySetting && setting.key.isNothing()) { firstEmptySetting = &setting; } } @@ -183,13 +171,13 @@ struct JSSettings return false; } } - foundSetting->key = aKey; + foundSetting->key = mozilla::Some(aKey); foundSetting->value = aValue; return true; } if (foundSetting) { - foundSetting->Unset(); + foundSetting->key.reset(); return true; } diff --git a/media/libcubeb/README_MOZILLA b/media/libcubeb/README_MOZILLA index d449c51794e9..29a1468c5028 100644 --- a/media/libcubeb/README_MOZILLA +++ b/media/libcubeb/README_MOZILLA @@ -5,4 +5,4 @@ Makefile.in build files for the Mozilla build system. The cubeb git repository is: git://github.com/kinetiknz/cubeb.git -The git commit ID used was 09a90a7817bc3d76723065fdc6b53c542fbed402 (2017-09-13 18:39:50 +0200) +The git commit ID used was ac532ad4f0defaf7a397db64c2c42d2665cd06e9 (2017-09-17 08:23:45 +1200) diff --git a/media/libcubeb/src/cubeb_audiounit.cpp b/media/libcubeb/src/cubeb_audiounit.cpp index 1ac430671275..979a577305f3 100644 --- a/media/libcubeb/src/cubeb_audiounit.cpp +++ b/media/libcubeb/src/cubeb_audiounit.cpp @@ -733,7 +733,12 @@ audiounit_property_listener_callback(AudioObjectID id, UInt32 address_count, break; case kAudioDevicePropertyDataSource: { LOG("Event[%u] - mSelector == kAudioHardwarePropertyDataSource for id=%d", (unsigned int) i, id); - switch_side |= DEV_INPUT; + if (stm->input_unit) { + switch_side |= DEV_INPUT; + } + if (stm->output_unit) { + switch_side |= DEV_OUTPUT; + } } break; default: diff --git a/testing/mozharness/scripts/release/generate-checksums.py b/testing/mozharness/scripts/release/generate-checksums.py index f6a8f5c99d0e..796f57fa2698 100644 --- a/testing/mozharness/scripts/release/generate-checksums.py +++ b/testing/mozharness/scripts/release/generate-checksums.py @@ -72,6 +72,7 @@ class ChecksumsGenerator(BaseScript, VirtualenvMixin, SigningMixin, VCSMixin, Bu require_config_file=False, config={ "virtualenv_modules": [ + "pip==1.5.5", "boto", ], "virtualenv_path": "venv", diff --git a/widget/PuppetWidget.cpp b/widget/PuppetWidget.cpp index 3f0e6e49f9a6..40070f5fb11d 100644 --- a/widget/PuppetWidget.cpp +++ b/widget/PuppetWidget.cpp @@ -1012,7 +1012,7 @@ PuppetWidget::SetCursor(imgIContainer* aCursor, return NS_ERROR_FAILURE; } - mCursor = nsCursor(-1); + mCursor = eCursorInvalid; mCustomCursor = aCursor; mCursorHotspotX = aHotspotX; mCursorHotspotY = aHotspotY; diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp index dcb9a3fc9756..37b6aae4c3d0 100644 --- a/widget/gtk/nsWindow.cpp +++ b/widget/gtk/nsWindow.cpp @@ -1623,7 +1623,7 @@ nsWindow::SetCursor(imgIContainer* aCursor, return window->SetCursor(aCursor, aHotspotX, aHotspotY); } - mCursor = nsCursor(-1); + mCursor = eCursorInvalid; // Get the image's current frame GdkPixbuf* pixbuf = nsImageToPixbuf::ImageToPixbuf(aCursor); diff --git a/widget/nsIWidget.h b/widget/nsIWidget.h index 73851ac64137..7b8cdcc97608 100644 --- a/widget/nsIWidget.h +++ b/widget/nsIWidget.h @@ -211,8 +211,12 @@ enum nsCursor { ///(normal cursor, usually rendered as an arrow) eCursor_ns_resize, eCursor_ew_resize, eCursor_none, - // This one better be the last one in this list. - eCursorCount + // This one is used for array sizing, and so better be the last + // one in this list... + eCursorCount, + + // ...except for this one. + eCursorInvalid = eCursorCount + 1 }; enum nsTopLevelWidgetZPlacement { // for PlaceBehind() diff --git a/widget/windows/nsWindow.cpp b/widget/windows/nsWindow.cpp index 1e658c99e07f..b4d915014a18 100644 --- a/widget/windows/nsWindow.cpp +++ b/widget/windows/nsWindow.cpp @@ -3020,7 +3020,7 @@ nsWindow::SetCursor(imgIContainer* aCursor, rv = nsWindowGfx::CreateIcon(aCursor, true, aHotspotX, aHotspotY, size, &cursor); NS_ENSURE_SUCCESS(rv, rv); - mCursor = nsCursor(-1); + mCursor = eCursorInvalid; ::SetCursor(cursor); NS_IF_RELEASE(sCursorImgContainer); @@ -7179,7 +7179,7 @@ void nsWindow::OnDestroy() } // Destroy any custom cursor resources. - if (mCursor == -1) + if (mCursor == eCursorInvalid) SetCursor(eCursor_standard); if (mCompositorWidgetDelegate) {