merge mozilla-central to autoland. r=merge a=merge

This commit is contained in:
Sebastian Hengst 2017-09-18 11:36:27 +02:00
Родитель ecf86690e7 7dba57e6b9
Коммит 6b897a9aab
13 изменённых файлов: 52 добавлений и 42 удалений

Просмотреть файл

@ -130,15 +130,15 @@ var gTests = [
{ {
desc: "getUserMedia audio+video: reloading a frame updates the sharing UI", desc: "getUserMedia audio+video: reloading a frame updates the sharing UI",
run: async function checkUpdateWhenReloading() { 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 // second frame, then reload the second frame. After each step, we'll check
// the UI is in the correct state. // the UI is in the correct state.
let promise = promisePopupNotificationShown("webRTC-shareDevices"); let promise = promisePopupNotificationShown("webRTC-shareDevices");
await promiseRequestDevice(true, false, "frame1"); await promiseRequestDevice(false, true, "frame1");
await promise; await promise;
await expectObserverCalled("getUserMedia:request"); await expectObserverCalled("getUserMedia:request");
checkDeviceSelectors(true, false); checkDeviceSelectors(false, true);
let indicator = promiseIndicatorWindow(); let indicator = promiseIndicatorWindow();
await promiseMessage("ok", () => { await promiseMessage("ok", () => {
@ -146,11 +146,11 @@ var gTests = [
}); });
await expectObserverCalled("getUserMedia:response:allow"); await expectObserverCalled("getUserMedia:response:allow");
await expectObserverCalled("recording-device-events"); await expectObserverCalled("recording-device-events");
Assert.deepEqual((await getMediaCaptureState()), {audio: true}, Assert.deepEqual((await getMediaCaptureState()), {video: true},
"expected microphone to be shared"); "expected camera to be shared");
await indicator; await indicator;
await checkSharingUI({video: false, audio: true}); await checkSharingUI({video: true, audio: false});
await expectNoObserverCalled(); await expectNoObserverCalled();
promise = promisePopupNotificationShown("webRTC-shareDevices"); promise = promisePopupNotificationShown("webRTC-shareDevices");
@ -176,7 +176,7 @@ var gTests = [
await promise; await promise;
await expectObserverCalled("recording-window-ended"); await expectObserverCalled("recording-window-ended");
await checkSharingUI({video: false, audio: true}); await checkSharingUI({video: true, audio: false});
await expectNoObserverCalled(); await expectNoObserverCalled();
await closeStream(false, "frame1"); await closeStream(false, "frame1");

Просмотреть файл

@ -164,7 +164,7 @@ TabParent::TabParent(nsIContentParent* aManager,
, mInitedByParent(false) , mInitedByParent(false)
, mTabId(aTabId) , mTabId(aTabId)
, mCreatingWindow(false) , mCreatingWindow(false)
, mCursor(nsCursor(-1)) , mCursor(eCursorInvalid)
, mTabSetsCursor(false) , mTabSetsCursor(false)
, mHasContentOpener(false) , mHasContentOpener(false)
#ifdef DEBUG #ifdef DEBUG
@ -1131,7 +1131,7 @@ TabParent::SendRealMouseEvent(WidgetMouseEvent& aEvent)
if (mCustomCursor) { if (mCustomCursor) {
widget->SetCursor(mCustomCursor, widget->SetCursor(mCustomCursor,
mCustomCursorHotspotX, mCustomCursorHotspotY); mCustomCursorHotspotX, mCustomCursorHotspotY);
} else if (mCursor != nsCursor(-1)) { } else if (mCursor != eCursorInvalid) {
widget->SetCursor(mCursor); widget->SetCursor(mCursor);
} }
} else if (eMouseExitFromWidget == aEvent.mMessage) { } else if (eMouseExitFromWidget == aEvent.mMessage) {
@ -1787,7 +1787,7 @@ TabParent::RecvSetCustomCursor(const nsCString& aCursorData,
const uint32_t& aHotspotY, const uint32_t& aHotspotY,
const bool& aForce) const bool& aForce)
{ {
mCursor = nsCursor(-1); mCursor = eCursorInvalid;
nsCOMPtr<nsIWidget> widget = GetWidget(); nsCOMPtr<nsIWidget> widget = GetWidget();
if (widget) { if (widget) {

Просмотреть файл

@ -1232,8 +1232,13 @@ public:
self->mSourceListener->GetPrincipalHandle()); self->mSourceListener->GetPrincipalHandle());
if (NS_FAILED(rv)) { if (NS_FAILED(rv)) {
nsString log; nsString log;
log.AssignASCII("Starting audio failed"); if (rv == NS_ERROR_NOT_AVAILABLE) {
error = new MediaMgrError(NS_LITERAL_STRING("InternalError"), log); 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);
}
} }
} }

Просмотреть файл

@ -474,6 +474,13 @@ MediaEngineWebRTCMicrophoneSource::Start(SourceMediaStream *aStream,
return NS_ERROR_FAILURE; 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); MonitorAutoLock lock(mMonitor);
mSources.AppendElement(aStream); mSources.AppendElement(aStream);

Просмотреть файл

@ -885,9 +885,9 @@ InitJSContextForWorker(WorkerPrivate* aWorkerPrivate, JSContext* aWorkerCx)
// This is the real place where we set the max memory for the runtime. // This is the real place where we set the max memory for the runtime.
for (uint32_t index = 0; index < ArrayLength(gcSettings); index++) { for (uint32_t index = 0; index < ArrayLength(gcSettings); index++) {
const JSSettings::JSGCSetting& setting = gcSettings[index]; const JSSettings::JSGCSetting& setting = gcSettings[index];
if (setting.IsSet()) { if (setting.key.isSome()) {
NS_ASSERTION(setting.value, "Can't handle 0 values!"); 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. // Initialize JSSettings.
if (!sDefaultJSSettings.gcSettings[0].IsSet()) { if (sDefaultJSSettings.gcSettings[0].key.isNothing()) {
sDefaultJSSettings.contextOptions = JS::ContextOptions(); sDefaultJSSettings.contextOptions = JS::ContextOptions();
sDefaultJSSettings.chrome.maxScriptRuntime = -1; sDefaultJSSettings.chrome.maxScriptRuntime = -1;
sDefaultJSSettings.chrome.compartmentOptions.behaviors().setVersion(JSVERSION_DEFAULT); sDefaultJSSettings.chrome.compartmentOptions.behaviors().setVersion(JSVERSION_DEFAULT);

Просмотреть файл

@ -9,6 +9,7 @@
#include "jsapi.h" #include "jsapi.h"
#include "mozilla/Attributes.h" #include "mozilla/Attributes.h"
#include "mozilla/Maybe.h"
#include "mozilla/Mutex.h" #include "mozilla/Mutex.h"
#include <stdint.h> #include <stdint.h>
#include "nsAutoPtr.h" #include "nsAutoPtr.h"
@ -102,25 +103,12 @@ struct JSSettings
struct JSGCSetting struct JSGCSetting
{ {
JSGCParamKey key; mozilla::Maybe<JSGCParamKey> key;
uint32_t value; uint32_t value;
JSGCSetting() JSGCSetting()
: key(static_cast<JSGCParamKey>(-1)), value(0) : key(), value(0)
{ } { }
bool
IsSet() const
{
return key != static_cast<JSGCParamKey>(-1);
}
void
Unset()
{
key = static_cast<JSGCParamKey>(-1);
value = 0;
}
}; };
// There are several settings that we know we need so it makes sense to // 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++) { for (uint32_t index = 0; index < ArrayLength(gcSettings); index++) {
JSSettings::JSGCSetting& setting = gcSettings[index]; JSSettings::JSGCSetting& setting = gcSettings[index];
if (setting.key == aKey) { if (setting.key.isSome() && *setting.key == aKey) {
foundSetting = &setting; foundSetting = &setting;
break; break;
} }
if (!firstEmptySetting && !setting.IsSet()) { if (!firstEmptySetting && setting.key.isNothing()) {
firstEmptySetting = &setting; firstEmptySetting = &setting;
} }
} }
@ -183,13 +171,13 @@ struct JSSettings
return false; return false;
} }
} }
foundSetting->key = aKey; foundSetting->key = mozilla::Some(aKey);
foundSetting->value = aValue; foundSetting->value = aValue;
return true; return true;
} }
if (foundSetting) { if (foundSetting) {
foundSetting->Unset(); foundSetting->key.reset();
return true; return true;
} }

Просмотреть файл

@ -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 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)

Просмотреть файл

@ -733,7 +733,12 @@ audiounit_property_listener_callback(AudioObjectID id, UInt32 address_count,
break; break;
case kAudioDevicePropertyDataSource: { case kAudioDevicePropertyDataSource: {
LOG("Event[%u] - mSelector == kAudioHardwarePropertyDataSource for id=%d", (unsigned int) i, id); 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; break;
default: default:

Просмотреть файл

@ -72,6 +72,7 @@ class ChecksumsGenerator(BaseScript, VirtualenvMixin, SigningMixin, VCSMixin, Bu
require_config_file=False, require_config_file=False,
config={ config={
"virtualenv_modules": [ "virtualenv_modules": [
"pip==1.5.5",
"boto", "boto",
], ],
"virtualenv_path": "venv", "virtualenv_path": "venv",

Просмотреть файл

@ -1012,7 +1012,7 @@ PuppetWidget::SetCursor(imgIContainer* aCursor,
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
} }
mCursor = nsCursor(-1); mCursor = eCursorInvalid;
mCustomCursor = aCursor; mCustomCursor = aCursor;
mCursorHotspotX = aHotspotX; mCursorHotspotX = aHotspotX;
mCursorHotspotY = aHotspotY; mCursorHotspotY = aHotspotY;

Просмотреть файл

@ -1623,7 +1623,7 @@ nsWindow::SetCursor(imgIContainer* aCursor,
return window->SetCursor(aCursor, aHotspotX, aHotspotY); return window->SetCursor(aCursor, aHotspotX, aHotspotY);
} }
mCursor = nsCursor(-1); mCursor = eCursorInvalid;
// Get the image's current frame // Get the image's current frame
GdkPixbuf* pixbuf = nsImageToPixbuf::ImageToPixbuf(aCursor); GdkPixbuf* pixbuf = nsImageToPixbuf::ImageToPixbuf(aCursor);

Просмотреть файл

@ -211,8 +211,12 @@ enum nsCursor { ///(normal cursor, usually rendered as an arrow)
eCursor_ns_resize, eCursor_ns_resize,
eCursor_ew_resize, eCursor_ew_resize,
eCursor_none, eCursor_none,
// This one better be the last one in this list. // This one is used for array sizing, and so better be the last
eCursorCount // one in this list...
eCursorCount,
// ...except for this one.
eCursorInvalid = eCursorCount + 1
}; };
enum nsTopLevelWidgetZPlacement { // for PlaceBehind() enum nsTopLevelWidgetZPlacement { // for PlaceBehind()

Просмотреть файл

@ -3020,7 +3020,7 @@ nsWindow::SetCursor(imgIContainer* aCursor,
rv = nsWindowGfx::CreateIcon(aCursor, true, aHotspotX, aHotspotY, size, &cursor); rv = nsWindowGfx::CreateIcon(aCursor, true, aHotspotX, aHotspotY, size, &cursor);
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
mCursor = nsCursor(-1); mCursor = eCursorInvalid;
::SetCursor(cursor); ::SetCursor(cursor);
NS_IF_RELEASE(sCursorImgContainer); NS_IF_RELEASE(sCursorImgContainer);
@ -7179,7 +7179,7 @@ void nsWindow::OnDestroy()
} }
// Destroy any custom cursor resources. // Destroy any custom cursor resources.
if (mCursor == -1) if (mCursor == eCursorInvalid)
SetCursor(eCursor_standard); SetCursor(eCursor_standard);
if (mCompositorWidgetDelegate) { if (mCompositorWidgetDelegate) {