From cf9816beca9c562b460a336f01b25fc65898db21 Mon Sep 17 00:00:00 2001 From: Chris Pearce Date: Mon, 21 Jul 2014 14:00:32 +1200 Subject: [PATCH 01/84] Bug 1041346 - Don't limit number of samples stagefright mp4 demuxer can output. r=kentuckyfriedtakahe --- .../media/libstagefright/MPEG4Extractor.cpp | 31 +++++-------------- 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/media/libstagefright/frameworks/av/media/libstagefright/MPEG4Extractor.cpp b/media/libstagefright/frameworks/av/media/libstagefright/MPEG4Extractor.cpp index 0e524523cca..6a6c8c272ce 100644 --- a/media/libstagefright/frameworks/av/media/libstagefright/MPEG4Extractor.cpp +++ b/media/libstagefright/frameworks/av/media/libstagefright/MPEG4Extractor.cpp @@ -98,8 +98,6 @@ private: bool mStarted; - MediaBufferGroup *mGroup; - MediaBuffer *mBuffer; bool mWantsNALFragments; @@ -2392,7 +2390,6 @@ MPEG4Source::MPEG4Source( mIsAVC(false), mNALLengthSize(0), mStarted(false), - mGroup(NULL), mBuffer(NULL), mWantsNALFragments(false), mSrcBuffer(NULL) { @@ -2459,13 +2456,9 @@ status_t MPEG4Source::start(MetaData *params) { mWantsNALFragments = false; } - mGroup = new MediaBufferGroup; - int32_t max_size; CHECK(mFormat->findInt32(kKeyMaxInputSize, &max_size)); - mGroup->add_buffer(new MediaBuffer(max_size)); - mSrcBuffer = new uint8_t[max_size]; mStarted = true; @@ -2486,9 +2479,6 @@ status_t MPEG4Source::stop() { delete[] mSrcBuffer; mSrcBuffer = NULL; - delete mGroup; - mGroup = NULL; - mStarted = false; mCurrentSampleIndex = 0; @@ -3169,12 +3159,10 @@ status_t MPEG4Source::read( return err; } - err = mGroup->acquire_buffer(&mBuffer); - - if (err != OK) { - CHECK(mBuffer == NULL); - return err; - } + int32_t max_size; + CHECK(mFormat->findInt32(kKeyMaxInputSize, &max_size)); + mBuffer = new MediaBuffer(max_size); + assert(mBuffer); } if (!mIsAVC || mWantsNALFragments) { @@ -3439,13 +3427,10 @@ status_t MPEG4Source::fragmentedRead( mCurrentTime += smpl->duration; isSyncSample = (mCurrentSampleIndex == 0); // XXX - status_t err = mGroup->acquire_buffer(&mBuffer); - - if (err != OK) { - CHECK(mBuffer == NULL); - ALOGV("acquire_buffer returned %d", err); - return err; - } + int32_t max_size; + CHECK(mFormat->findInt32(kKeyMaxInputSize, &max_size)); + mBuffer = new MediaBuffer(max_size); + assert(mBuffer); } const Sample *smpl = &mCurrentSamples[mCurrentSampleIndex]; From 98d143db738c1cdadd6998cb4aae6c2f7916ef4f Mon Sep 17 00:00:00 2001 From: Chris Pearce Date: Mon, 21 Jul 2014 14:00:42 +1200 Subject: [PATCH 02/84] Bug 1041346 - Remove MediaBufferGroup from libstagefright, since it's no longer used. r=kentuckyfriedtakahe --- media/libstagefright/additional_headers | 1 - .../include/media/stagefright/MediaBuffer.h | 4 +- .../media/stagefright/MediaBufferGroup.h | 58 ------------ .../media/libstagefright/MPEG4Extractor.cpp | 1 - .../media/libstagefright/MediaBufferGroup.cpp | 89 ------------------- media/libstagefright/moz.build | 1 - 6 files changed, 2 insertions(+), 152 deletions(-) delete mode 100644 media/libstagefright/frameworks/av/include/media/stagefright/MediaBufferGroup.h delete mode 100644 media/libstagefright/frameworks/av/media/libstagefright/MediaBufferGroup.cpp diff --git a/media/libstagefright/additional_headers b/media/libstagefright/additional_headers index 8cccd87e152..fd1cefb6467 100644 --- a/media/libstagefright/additional_headers +++ b/media/libstagefright/additional_headers @@ -6,7 +6,6 @@ frameworks/av/include/media/stagefright/foundation/ADebug.h frameworks/av/include/media/stagefright/foundation/AHandler.h frameworks/av/include/media/stagefright/foundation/AString.h frameworks/av/include/media/stagefright/foundation/hexdump.h -frameworks/av/include/media/stagefright/MediaBufferGroup.h frameworks/av/include/media/stagefright/MediaDefs.h frameworks/av/include/media/stagefright/MediaErrors.h frameworks/av/include/media/stagefright/MediaExtractor.h diff --git a/media/libstagefright/frameworks/av/include/media/stagefright/MediaBuffer.h b/media/libstagefright/frameworks/av/include/media/stagefright/MediaBuffer.h index 41727390752..681490188c6 100644 --- a/media/libstagefright/frameworks/av/include/media/stagefright/MediaBuffer.h +++ b/media/libstagefright/frameworks/av/include/media/stagefright/MediaBuffer.h @@ -54,8 +54,8 @@ public: MediaBuffer(const sp &buffer); - // Decrements the reference count and returns the buffer to its - // associated MediaBufferGroup if the reference count drops to 0. + // Decrements the reference count and deletes it if the reference + // count drops to 0. void release(); // Increments the reference count. diff --git a/media/libstagefright/frameworks/av/include/media/stagefright/MediaBufferGroup.h b/media/libstagefright/frameworks/av/include/media/stagefright/MediaBufferGroup.h deleted file mode 100644 index 4a513513d1a..00000000000 --- a/media/libstagefright/frameworks/av/include/media/stagefright/MediaBufferGroup.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef MEDIA_BUFFER_GROUP_H_ - -#define MEDIA_BUFFER_GROUP_H_ - -#include -#include -#include - -namespace stagefright { - -class MediaBuffer; -class MetaData; - -class MediaBufferGroup : public MediaBufferObserver { -public: - MediaBufferGroup(); - ~MediaBufferGroup(); - - void add_buffer(MediaBuffer *buffer); - - // Blocks until a buffer is available and returns it to the caller, - // the returned buffer will have a reference count of 1. - status_t acquire_buffer(MediaBuffer **buffer); - -protected: - virtual void signalBufferReturned(MediaBuffer *buffer); - -private: - friend class MediaBuffer; - - Mutex mLock; - Condition mCondition; - - MediaBuffer *mFirstBuffer, *mLastBuffer; - - MediaBufferGroup(const MediaBufferGroup &); - MediaBufferGroup &operator=(const MediaBufferGroup &); -}; - -} // namespace stagefright - -#endif // MEDIA_BUFFER_GROUP_H_ diff --git a/media/libstagefright/frameworks/av/media/libstagefright/MPEG4Extractor.cpp b/media/libstagefright/frameworks/av/media/libstagefright/MPEG4Extractor.cpp index 6a6c8c272ce..dd16d91d8ff 100644 --- a/media/libstagefright/frameworks/av/media/libstagefright/MPEG4Extractor.cpp +++ b/media/libstagefright/frameworks/av/media/libstagefright/MPEG4Extractor.cpp @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include diff --git a/media/libstagefright/frameworks/av/media/libstagefright/MediaBufferGroup.cpp b/media/libstagefright/frameworks/av/media/libstagefright/MediaBufferGroup.cpp deleted file mode 100644 index 17dc08aa646..00000000000 --- a/media/libstagefright/frameworks/av/media/libstagefright/MediaBufferGroup.cpp +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#undef LOG_TAG -#define LOG_TAG "MediaBufferGroup" -#include - -#include -#include -#include - -namespace stagefright { - -MediaBufferGroup::MediaBufferGroup() - : mFirstBuffer(NULL), - mLastBuffer(NULL) { -} - -MediaBufferGroup::~MediaBufferGroup() { - MediaBuffer *next; - for (MediaBuffer *buffer = mFirstBuffer; buffer != NULL; - buffer = next) { - next = buffer->nextBuffer(); - - CHECK_EQ(buffer->refcount(), 0); - - buffer->setObserver(NULL); - buffer->release(); - } -} - -void MediaBufferGroup::add_buffer(MediaBuffer *buffer) { - Mutex::Autolock autoLock(mLock); - - buffer->setObserver(this); - - if (mLastBuffer) { - mLastBuffer->setNextBuffer(buffer); - } else { - mFirstBuffer = buffer; - } - - mLastBuffer = buffer; -} - -status_t MediaBufferGroup::acquire_buffer(MediaBuffer **out) { - Mutex::Autolock autoLock(mLock); - - for (;;) { - for (MediaBuffer *buffer = mFirstBuffer; - buffer != NULL; buffer = buffer->nextBuffer()) { - if (buffer->refcount() == 0) { - buffer->add_ref(); - buffer->reset(); - - *out = buffer; - goto exit; - } - } - - // All buffers are in use. Block until one of them is returned to us. - mCondition.wait(mLock); - } - -exit: - return OK; -} - -void MediaBufferGroup::signalBufferReturned(MediaBuffer *) { - Mutex::Autolock autoLock(mLock); - mCondition.signal(); -} - -} // namespace stagefright - -#undef LOG_TAG diff --git a/media/libstagefright/moz.build b/media/libstagefright/moz.build index 5f156616d1f..267f8de38fa 100644 --- a/media/libstagefright/moz.build +++ b/media/libstagefright/moz.build @@ -75,7 +75,6 @@ UNIFIED_SOURCES += [ 'frameworks/av/media/libstagefright/foundation/AString.cpp', 'frameworks/av/media/libstagefright/id3/ID3.cpp', 'frameworks/av/media/libstagefright/MediaBuffer.cpp', - 'frameworks/av/media/libstagefright/MediaBufferGroup.cpp', 'frameworks/av/media/libstagefright/MediaDefs.cpp', 'frameworks/av/media/libstagefright/MediaSource.cpp', 'frameworks/av/media/libstagefright/MPEG4Extractor.cpp', From 5861c7b72698a1226d8d2c0cd26d7497ad4204e1 Mon Sep 17 00:00:00 2001 From: Chris Pearce Date: Mon, 21 Jul 2014 14:02:20 +1200 Subject: [PATCH 03/84] Bug 1041368 - Make MP4 demuxer correctly store the size of plain_sizes data. r=kentuckyfriedtakahe --- .../frameworks/av/media/libstagefright/MPEG4Extractor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/media/libstagefright/frameworks/av/media/libstagefright/MPEG4Extractor.cpp b/media/libstagefright/frameworks/av/media/libstagefright/MPEG4Extractor.cpp index dd16d91d8ff..00279ff6829 100644 --- a/media/libstagefright/frameworks/av/media/libstagefright/MPEG4Extractor.cpp +++ b/media/libstagefright/frameworks/av/media/libstagefright/MPEG4Extractor.cpp @@ -3438,7 +3438,7 @@ status_t MPEG4Source::fragmentedRead( if (smpl->encryptedsizes.size()) { // store clear/encrypted lengths in metadata bufmeta->setData(kKeyPlainSizes, 0, - smpl->clearsizes.array(), smpl->clearsizes.size() * 4); + smpl->clearsizes.array(), smpl->clearsizes.size() * 2); bufmeta->setData(kKeyEncryptedSizes, 0, smpl->encryptedsizes.array(), smpl->encryptedsizes.size() * 4); bufmeta->setData(kKeyCryptoIV, 0, smpl->iv, 16); // use 16 or the actual size? From de52023c1817c2b49034bae511505277be6d924f Mon Sep 17 00:00:00 2001 From: Botond Ballo Date: Thu, 17 Jul 2014 14:45:57 -0400 Subject: [PATCH 04/84] Bug 1030803 - Account for floating-point error in Axis::ScaleWillOverscrollAmount(). r=kats --- gfx/layers/apz/src/Axis.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gfx/layers/apz/src/Axis.cpp b/gfx/layers/apz/src/Axis.cpp index 22ae7cb68dd..87275e788c4 100644 --- a/gfx/layers/apz/src/Axis.cpp +++ b/gfx/layers/apz/src/Axis.cpp @@ -272,8 +272,8 @@ float Axis::ScaleWillOverscrollAmount(float aScale, float aFocus) { float originAfterScale = (GetOrigin() + aFocus) - (aFocus / aScale); bool both = ScaleWillOverscrollBothSides(aScale); - bool minus = originAfterScale < GetPageStart(); - bool plus = (originAfterScale + (GetCompositionLength() / aScale)) > GetPageEnd(); + bool minus = GetPageStart() - originAfterScale > COORDINATE_EPSILON; + bool plus = (originAfterScale + (GetCompositionLength() / aScale)) - GetPageEnd() > COORDINATE_EPSILON; if ((minus && plus) || both) { // If we ever reach here it's a bug in the client code. @@ -330,7 +330,7 @@ bool Axis::ScaleWillOverscrollBothSides(float aScale) { CSSToParentLayerScale scale(metrics.GetZoomToParent().scale * aScale); CSSRect cssCompositionBounds = metrics.mCompositionBounds / scale; - return GetRectLength(metrics.GetExpandedScrollableRect()) < GetRectLength(cssCompositionBounds); + return GetRectLength(cssCompositionBounds) - GetRectLength(metrics.GetExpandedScrollableRect()) > COORDINATE_EPSILON; } const FrameMetrics& Axis::GetFrameMetrics() const { From d7fa58607a33415cb35345d13259887e046a1a73 Mon Sep 17 00:00:00 2001 From: Botond Ballo Date: Thu, 17 Jul 2014 16:08:33 -0400 Subject: [PATCH 05/84] Bug 1036119 - Have AsyncCompositionManager support layers which are both scrollable and fixed-position. r=Cwiiis --- .../composite/AsyncCompositionManager.cpp | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/gfx/layers/composite/AsyncCompositionManager.cpp b/gfx/layers/composite/AsyncCompositionManager.cpp index 11e6d308179..6a74dcb8c1d 100644 --- a/gfx/layers/composite/AsyncCompositionManager.cpp +++ b/gfx/layers/composite/AsyncCompositionManager.cpp @@ -141,8 +141,13 @@ static void TranslateShadowLayer2D(Layer* aLayer, const gfxPoint& aTranslation) { + // This layer might also be a scrollable layer and have an async transform. + // To make sure we don't clobber that, we start with the shadow transform. + // Any adjustments to the shadow transform made in this function in previous + // frames have been cleared in ClearAsyncTransforms(), so such adjustments + // will not compound over successive frames. Matrix layerTransform; - if (!GetBaseTransform2D(aLayer, &layerTransform)) { + if (!aLayer->GetLocalTransform().Is2D(&layerTransform)) { return; } @@ -894,6 +899,18 @@ AsyncCompositionManager::TransformScrollableLayer(Layer* aLayer) aLayer->GetLocalTransform(), fixedLayerMargins); } +void +ClearAsyncTransforms(Layer* aLayer) +{ + if (!aLayer->AsLayerComposite()->GetShadowTransformSetByAnimation()) { + aLayer->AsLayerComposite()->SetShadowTransform(aLayer->GetBaseTransform()); + } + for (Layer* child = aLayer->GetFirstChild(); + child; child = child->GetNextSibling()) { + ClearAsyncTransforms(child); + } +} + bool AsyncCompositionManager::TransformShadowTree(TimeStamp aCurrentFrame) { @@ -909,6 +926,12 @@ AsyncCompositionManager::TransformShadowTree(TimeStamp aCurrentFrame) // transforms. bool wantNextFrame = SampleAnimations(root, aCurrentFrame); + // Clear any async transforms (not due to animations) set in previous frames. + // This is necessary because some things called by + // ApplyAsyncContentTransformToTree (in particular, TranslateShadowLayer2D), + // add to the shadow transform rather than overwriting it. + ClearAsyncTransforms(root); + // FIXME/bug 775437: unify this interface with the ~native-fennec // derived code // From 5f5ae44de2e244cde8ad4a6c2582429951f2ac0a Mon Sep 17 00:00:00 2001 From: Nikhil Marathe Date: Sun, 20 Jul 2014 23:25:44 -0700 Subject: [PATCH 06/84] Bug 984048 - Part 7 - Documents register themselves with corresponding ServiceWorkerInfo. r=bz --HG-- extra : transplant_source : %FD%9BD%8C%E4a%A9%CB9%17L%EE%E38%11%A1t%8A%3Bs --- content/base/src/nsDocument.cpp | 24 ++++ content/base/src/nsDocument.h | 4 + .../base/nsIServiceWorkerManager.idl | 18 ++- dom/workers/ServiceWorkerManager.cpp | 116 ++++++++++++------ dom/workers/ServiceWorkerManager.h | 78 +++++++----- 5 files changed, 171 insertions(+), 69 deletions(-) diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp index 8d6f6a644db..ae4dd69c9c2 100644 --- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -69,6 +69,7 @@ #include "mozilla/dom/TreeWalker.h" #include "nsIServiceManager.h" +#include "nsIServiceWorkerManager.h" #include "nsContentCID.h" #include "nsError.h" @@ -4465,6 +4466,24 @@ nsDocument::SetScriptGlobalObject(nsIScriptGlobalObject *aScriptGlobalObject) if (mTemplateContentsOwner && mTemplateContentsOwner != this) { mTemplateContentsOwner->SetScriptGlobalObject(aScriptGlobalObject); } + + nsCOMPtr channel = GetChannel(); + if (!mMaybeServiceWorkerControlled && channel) { + nsLoadFlags loadFlags = 0; + channel->GetLoadFlags(&loadFlags); + // If we are shift-reloaded, don't associate with a ServiceWorker. + // FIXME(nsm): Bug 1041339. + if (loadFlags & nsIRequest::LOAD_BYPASS_CACHE) { + NS_WARNING("Page was shift reloaded, skipping ServiceWorker control"); + return; + } + + nsCOMPtr swm = do_GetService(SERVICEWORKERMANAGER_CONTRACTID); + if (swm) { + swm->MaybeStartControlling(this); + mMaybeServiceWorkerControlled = true; + } + } } nsIScriptGlobalObject* @@ -8483,6 +8502,11 @@ nsDocument::Destroy() mRegistry = nullptr; + nsCOMPtr swm = do_GetService(SERVICEWORKERMANAGER_CONTRACTID); + if (swm) { + swm->MaybeStopControlling(this); + } + // XXX We really should let cycle collection do this, but that currently still // leaks (see https://bugzilla.mozilla.org/show_bug.cgi?id=406684). ReleaseWrapper(static_cast(this)); diff --git a/content/base/src/nsDocument.h b/content/base/src/nsDocument.h index 60d70defbfa..13df36289bb 100644 --- a/content/base/src/nsDocument.h +++ b/content/base/src/nsDocument.h @@ -1742,6 +1742,10 @@ private: nsCOMPtr mMasterDocument; nsRefPtr mImportManager; + // Set to true when the document is possibly controlled by the ServiceWorker. + // Used to prevent multiple requests to ServiceWorkerManager. + bool mMaybeServiceWorkerControlled; + #ifdef DEBUG public: bool mWillReparent; diff --git a/dom/interfaces/base/nsIServiceWorkerManager.idl b/dom/interfaces/base/nsIServiceWorkerManager.idl index d741aeb1659..ba4a6487e2d 100644 --- a/dom/interfaces/base/nsIServiceWorkerManager.idl +++ b/dom/interfaces/base/nsIServiceWorkerManager.idl @@ -5,9 +5,10 @@ #include "domstubs.idl" +interface nsIDocument; interface nsIURI; -[uuid(6117cdf1-cb10-42a3-9901-4f1bab7ffa4d)] +[uuid(6e1382f4-3cbc-435f-8ce0-70175f6eb400)] interface nsIServiceWorkerManager : nsISupports { // Returns a Promise @@ -20,6 +21,21 @@ interface nsIServiceWorkerManager : nsISupports [noscript] void AddContainerEventListener(in nsIURI aPageURI, in nsIDOMEventTarget aTarget); [noscript] void RemoveContainerEventListener(in nsIURI aPageURI, in nsIDOMEventTarget aTarget); + /** + * Call this to request that document `aDoc` be controlled by a ServiceWorker + * if a registration exists for it's scope. + * + * This MUST only be called once per document! + */ + [notxpcom,nostdcall] void MaybeStartControlling(in nsIDocument aDoc); + + /** + * Documents that have called MaybeStartControlling() should call this when + * they are destroyed. This function may be called multiple times, and is + * idempotent. + */ + [notxpcom,nostdcall] void MaybeStopControlling(in nsIDocument aDoc); + // Testing DOMString getScopeForUrl(in DOMString path); }; diff --git a/dom/workers/ServiceWorkerManager.cpp b/dom/workers/ServiceWorkerManager.cpp index be38156f9d6..8b01ce2d01c 100644 --- a/dom/workers/ServiceWorkerManager.cpp +++ b/dom/workers/ServiceWorkerManager.cpp @@ -11,7 +11,6 @@ #include "jsapi.h" -#include "mozilla/Preferences.h" #include "mozilla/dom/BindingUtils.h" #include "mozilla/dom/DOMError.h" #include "mozilla/dom/ErrorEvent.h" @@ -299,12 +298,15 @@ FinishFetchOnMainThreadRunnable::Run() } ServiceWorkerRegistration::ServiceWorkerRegistration(const nsACString& aScope) - : mScope(aScope), + : mControlledDocumentsCounter(0), + mScope(aScope), mPendingUninstall(false) { } ServiceWorkerRegistration::~ServiceWorkerRegistration() -{ } +{ + MOZ_ASSERT(!IsControllingDocuments()); +} ////////////////////////// // ServiceWorkerManager // @@ -360,18 +362,16 @@ public: NS_IMETHODIMP Run() { - nsCString domain; - nsresult rv = mScriptURI->GetHost(domain); - if (NS_WARN_IF(NS_FAILED(rv))) { - mPromise->MaybeReject(rv); - return NS_OK; - } - nsRefPtr swm = ServiceWorkerManager::GetInstance(); - nsRefPtr domainInfo; - // XXXnsm: This pattern can be refactored if we end up using it - // often enough. - if (!swm->mDomainMap.Get(domain, getter_AddRefs(domainInfo))) { + nsRefPtr domainInfo = swm->GetDomainInfo(mScriptURI); + if (!domainInfo) { + nsCString domain; + nsresult rv = mScriptURI->GetHost(domain); + if (NS_WARN_IF(NS_FAILED(rv))) { + mPromise->MaybeReject(rv); + return NS_OK; + } + domainInfo = new ServiceWorkerManager::ServiceWorkerDomainInfo; swm->mDomainMap.Put(domain, domainInfo); } @@ -380,7 +380,7 @@ public: domainInfo->GetRegistration(mScope); nsCString spec; - rv = mScriptURI->GetSpec(spec); + nsresult rv = mScriptURI->GetSpec(spec); if (NS_WARN_IF(NS_FAILED(rv))) { mPromise->MaybeReject(rv); return NS_OK; @@ -399,12 +399,12 @@ public: // There is no update in progress and since SW updating is upto the UA, // we will not update right now. Simply resolve with whatever worker we // have. - ServiceWorkerInfo info = registration->Newest(); - if (info.IsValid()) { + nsRefPtr info = registration->Newest(); + if (info) { nsRefPtr serviceWorker; nsresult rv = swm->CreateServiceWorkerForWindow(mWindow, - info.GetScriptSpec(), + info->GetScriptSpec(), registration->mScope, getter_AddRefs(serviceWorker)); @@ -563,14 +563,14 @@ ServiceWorkerManager::Update(ServiceWorkerRegistration* aRegistration, aRegistration->mUpdateInstance = nullptr; } - if (aRegistration->mInstallingWorker.IsValid()) { + if (aRegistration->mInstallingWorker) { // FIXME(nsm): Terminate the worker. We still haven't figured out worker // instance ownership when not associated with a window, so let's wait on // this. // FIXME(nsm): We should be setting the state on the actual worker // instance. // FIXME(nsm): Fire "statechange" on installing worker instance. - aRegistration->mInstallingWorker.Invalidate(); + aRegistration->mInstallingWorker = nullptr; } aRegistration->mUpdatePromise = new UpdatePromise(); @@ -657,7 +657,7 @@ ServiceWorkerManager::FinishFetch(ServiceWorkerRegistration* aRegistration, ResolveRegisterPromises(aRegistration, aRegistration->mScriptSpec); - ServiceWorkerInfo info(aRegistration->mScriptSpec); + nsRefPtr info = new ServiceWorkerInfo(aRegistration->mScriptSpec); Install(aRegistration, info); } @@ -680,14 +680,8 @@ ServiceWorkerManager::HandleError(JSContext* aCx, return; } - nsCString domain; - rv = uri->GetHost(domain); - if (NS_WARN_IF(NS_FAILED(rv))) { - return; - } - - nsRefPtr domainInfo; - if (!mDomainMap.Get(domain, getter_AddRefs(domainInfo))) { + nsRefPtr domainInfo = GetDomainInfo(uri); + if (!domainInfo) { return; } @@ -760,7 +754,7 @@ public: AssertIsOnMainThread(); // FIXME(nsm): Change installing worker state to redundant. // FIXME(nsm): Fire statechange. - mRegistration->mInstallingWorker.Invalidate(); + mRegistration->mInstallingWorker = nullptr; return NS_OK; } }; @@ -881,7 +875,7 @@ private: void ServiceWorkerManager::Install(ServiceWorkerRegistration* aRegistration, - ServiceWorkerInfo aServiceWorkerInfo) + ServiceWorkerInfo* aServiceWorkerInfo) { AssertIsOnMainThread(); aRegistration->mInstallingWorker = aServiceWorkerInfo; @@ -891,12 +885,12 @@ ServiceWorkerManager::Install(ServiceWorkerRegistration* aRegistration, nsRefPtr serviceWorker; nsresult rv = - CreateServiceWorker(aServiceWorkerInfo.GetScriptSpec(), + CreateServiceWorker(aServiceWorkerInfo->GetScriptSpec(), aRegistration->mScope, getter_AddRefs(serviceWorker)); if (NS_WARN_IF(NS_FAILED(rv))) { - aRegistration->mInstallingWorker.Invalidate(); + aRegistration->mInstallingWorker = nullptr; return; } @@ -936,12 +930,11 @@ ServiceWorkerManager::FinishInstall(ServiceWorkerRegistration* aRegistration) { AssertIsOnMainThread(); - if (aRegistration->mWaitingWorker.IsValid()) { + if (aRegistration->mWaitingWorker) { // FIXME(nsm): Actually update the state of active ServiceWorker instances. } - aRegistration->mWaitingWorker = aRegistration->mInstallingWorker; - aRegistration->mInstallingWorker.Invalidate(); + aRegistration->mWaitingWorker = aRegistration->mInstallingWorker.forget(); // FIXME(nsm): Actually update state of active ServiceWorker instances to // installed. @@ -995,8 +988,8 @@ ServiceWorkerManager::CreateServiceWorkerForWindow(nsPIDOMWindow* aWindow, already_AddRefed ServiceWorkerManager::GetServiceWorkerRegistration(nsPIDOMWindow* aWindow) { - nsCOMPtr documentURI = aWindow->GetDocumentURI(); - return GetServiceWorkerRegistration(documentURI); + nsCOMPtr document = aWindow->GetExtantDoc(); + return GetServiceWorkerRegistration(document); } already_AddRefed @@ -1158,6 +1151,53 @@ ServiceWorkerManager::GetDomainInfo(const nsCString& aURL) return GetDomainInfo(uri); } +void +ServiceWorkerManager::MaybeStartControlling(nsIDocument* aDoc) +{ + AssertIsOnMainThread(); + if (!Preferences::GetBool("dom.serviceWorkers.enabled")) { + return; + } + + nsRefPtr domainInfo = GetDomainInfo(aDoc); + if (!domainInfo) { + return; + } + + nsRefPtr registration = + GetServiceWorkerRegistration(aDoc); + if (registration) { + MOZ_ASSERT(!domainInfo->mControlledDocuments.Contains(aDoc)); + registration->StartControllingADocument(); + // Use the already_AddRefed<> form of Put to avoid the addref-deref since + // we don't need the registration pointer in this function anymore. + domainInfo->mControlledDocuments.Put(aDoc, registration.forget()); + } +} + +void +ServiceWorkerManager::MaybeStopControlling(nsIDocument* aDoc) +{ + MOZ_ASSERT(aDoc); + if (!Preferences::GetBool("dom.serviceWorkers.enabled")) { + return; + } + + nsRefPtr domainInfo = GetDomainInfo(aDoc); + if (!domainInfo) { + return; + } + + nsRefPtr registration; + domainInfo->mControlledDocuments.Remove(aDoc, getter_AddRefs(registration)); + // A document which was uncontrolled does not maintain that state itself, so + // it will always call MaybeStopControlling() even if there isn't an + // associated registration. So this check is required. + if (registration) { + registration->StopControllingADocument(); + } +} + NS_IMETHODIMP ServiceWorkerManager::GetScopeForUrl(const nsAString& aUrl, nsAString& aScope) { diff --git a/dom/workers/ServiceWorkerManager.h b/dom/workers/ServiceWorkerManager.h index 98b4762371a..872f80c8001 100644 --- a/dom/workers/ServiceWorkerManager.h +++ b/dom/workers/ServiceWorkerManager.h @@ -10,6 +10,7 @@ #include "mozilla/Attributes.h" #include "mozilla/LinkedList.h" +#include "mozilla/Preferences.h" #include "mozilla/dom/BindingUtils.h" #include "mozilla/dom/Promise.h" #include "mozilla/dom/ServiceWorkerContainer.h" @@ -72,35 +73,22 @@ private: * _GetNewestWorker(serviceWorkerRegistration)", we represent the description * by this class and spawn a ServiceWorker in the right global when required. */ -class ServiceWorkerInfo +class ServiceWorkerInfo MOZ_FINAL { nsCString mScriptSpec; + + ~ServiceWorkerInfo() + { } + public: - - bool - IsValid() const - { - return !mScriptSpec.IsVoid(); - } - - void - Invalidate() - { - mScriptSpec.SetIsVoid(true); - } + NS_INLINE_DECL_REFCOUNTING(ServiceWorkerInfo) const nsCString& GetScriptSpec() const { - MOZ_ASSERT(IsValid()); return mScriptSpec; } - ServiceWorkerInfo() - { - Invalidate(); - } - explicit ServiceWorkerInfo(const nsACString& aScriptSpec) : mScriptSpec(aScriptSpec) { } @@ -110,6 +98,8 @@ public: // non-ISupports classes. class ServiceWorkerRegistration MOZ_FINAL : public nsISupports { + uint32_t mControlledDocumentsCounter; + virtual ~ServiceWorkerRegistration(); public: @@ -120,9 +110,9 @@ public: // the URLs of the following three workers. nsCString mScriptSpec; - ServiceWorkerInfo mCurrentWorker; - ServiceWorkerInfo mWaitingWorker; - ServiceWorkerInfo mInstallingWorker; + nsRefPtr mCurrentWorker; + nsRefPtr mWaitingWorker; + nsRefPtr mInstallingWorker; nsAutoPtr mUpdatePromise; nsRefPtr mUpdateInstance; @@ -147,16 +137,37 @@ public: explicit ServiceWorkerRegistration(const nsACString& aScope); - ServiceWorkerInfo - Newest() const + already_AddRefed + Newest() { - if (mInstallingWorker.IsValid()) { - return mInstallingWorker; - } else if (mWaitingWorker.IsValid()) { - return mWaitingWorker; + nsRefPtr newest; + if (mInstallingWorker) { + newest = mInstallingWorker; + } else if (mWaitingWorker) { + newest = mWaitingWorker; } else { - return mCurrentWorker; + newest = mCurrentWorker; } + + return newest.forget(); + } + + void + StartControllingADocument() + { + ++mControlledDocumentsCounter; + } + + void + StopControllingADocument() + { + --mControlledDocumentsCounter; + } + + bool + IsControllingDocuments() const + { + return mControlledDocumentsCounter > 0; } }; @@ -186,6 +197,11 @@ public: static ServiceWorkerManager* FactoryCreate() { + AssertIsOnMainThread(); + if (!Preferences::GetBool("dom.serviceWorkers.enabled")) { + return nullptr; + } + ServiceWorkerManager* res = new ServiceWorkerManager; NS_ADDREF(res); return res; @@ -216,6 +232,8 @@ public: // The containers inform the SWM on creation and destruction. nsTObserverArray mServiceWorkerContainers; + nsRefPtrHashtable mControlledDocuments; + ServiceWorkerDomainInfo() { } @@ -290,7 +308,7 @@ private: void Install(ServiceWorkerRegistration* aRegistration, - ServiceWorkerInfo aServiceWorkerInfo); + ServiceWorkerInfo* aServiceWorkerInfo); NS_IMETHOD CreateServiceWorkerForWindow(nsPIDOMWindow* aWindow, From 5558561bf9a13abdb4031fbc57900460abe574f0 Mon Sep 17 00:00:00 2001 From: JW Wang Date: Thu, 17 Jul 2014 18:50:00 +0200 Subject: [PATCH 07/84] Bug 668973 - enable test_playback.html on Android and B2G. r=cpearce --- content/media/test/mochitest.ini | 1 - content/media/test/test_playback.html | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/content/media/test/mochitest.ini b/content/media/test/mochitest.ini index b5219dc921e..5308add8c69 100644 --- a/content/media/test/mochitest.ini +++ b/content/media/test/mochitest.ini @@ -398,7 +398,6 @@ skip-if = true # bug 567954 and intermittent leaks # Seamonkey: Bug 598252, B2G: Bug 982100, Android: Bug 758476, bug 981086 skip-if = appname == "seamonkey" || toolkit == 'gonk' || toolkit == 'android' [test_playback.html] -skip-if = buildapp == 'b2g' || toolkit == 'android' # Disabled on Android & B2G due to bug 668973 [test_playback_errors.html] [test_playback_rate.html] [test_playback_rate_playpause.html] diff --git a/content/media/test/test_playback.html b/content/media/test/test_playback.html index 9f03fc033a4..af78ada6b32 100644 --- a/content/media/test/test_playback.html +++ b/content/media/test/test_playback.html @@ -10,13 +10,37 @@
 
 
diff --git a/dom/media/tests/mochitest/test_peerConnection_bug835370.html b/dom/media/tests/mochitest/test_peerConnection_bug835370.html index 8ace62dc81c..e6003f1d7b3 100644 --- a/dom/media/tests/mochitest/test_peerConnection_bug835370.html +++ b/dom/media/tests/mochitest/test_peerConnection_bug835370.html @@ -32,24 +32,15 @@ ok(!exception, "createOffer(step1, failed, {}) succeeds"); exception = null; try { - pconnect.createOffer(step1, failed, { mandatory: { FooBar: true } }); + pconnect.updateIce(); } catch (e) { - ok(e.message.indexOf("FooBar") > 0, "createOffer has readable exceptions"); + ok(e.message.indexOf("updateIce") >= 0, "PeerConnection.js has readable exceptions"); exception = e; } - ok(exception, "createOffer(step1, failed, { mandatory: { FooBar: true } }) throws"); + ok(exception, "updateIce not yet implemented and throws"); exception = null; - try { pconnects.createOffer(step1, failed, { optional: [] }); } catch (e) { exception = e; } - ok(!exception, "createOffer(step1, failed, { optional: [] }) succeeds"); - exception = null; - try { pconnect.createOffer(step1, failed, { optional: [1] }); } catch (e) { exception = e; } - ok(exception, "createOffer(step1, failed, { optional: [1] }) throws"); - exception = null; - try { pconnect.createOffer(step1, failed, { optional: [{ OfferToReceiveVideo: false, OfferToReceiveAudio: true, }] }); } catch (e) { exception = e; } - ok(exception, "createOffer(step1, failed, { optional: [{ OfferToReceiveVideo: false, OfferToReceiveAudio: true, }] }) throws"); - exception = null; - try { pconnects.createOffer(step1, failed, { mandatory: { OfferToReceiveVideo: false, OfferToReceiveAudio: true, MozDontOfferDataChannel: true}, optional: [{ VoiceActivityDetection: true }, { FooBar: "42" }] }); } catch (e) { exception = e; } - ok(!exception, "createOffer(step1, failed, { mandatory: { OfferToReceiveVideo: false, OfferToReceiveAudio: true, MozDontOfferDataChannel: true}, optional: [{ VoiceActivityDetection: true }, { FooBar: \"42\" }] }) succeeds"); + try { pconnects.createOffer(step1, failed, { offerToReceiveVideo: false, offerToReceiveAudio: true, MozDontOfferDataChannel: true }); } catch (e) { exception = e; } + ok(!exception, "createOffer(step1, failed, { offerToReceiveVideo: false, offerToReceiveAudio: true, MozDontOfferDataChannel: true }) succeeds"); pconnect.close(); pconnects.close(); pconnect = null; diff --git a/dom/media/tests/mochitest/test_peerConnection_offerRequiresReceiveAudio.html b/dom/media/tests/mochitest/test_peerConnection_offerRequiresReceiveAudio.html index c1044e02b04..66a88ee0530 100644 --- a/dom/media/tests/mochitest/test_peerConnection_offerRequiresReceiveAudio.html +++ b/dom/media/tests/mochitest/test_peerConnection_offerRequiresReceiveAudio.html @@ -1,4 +1,4 @@ - + @@ -18,7 +18,7 @@ runNetworkTest(function() { var test = new PeerConnectionTest(); - test.setOfferConstraints({ mandatory: { OfferToReceiveAudio: true } }); + test.setOfferOptions({ offerToReceiveAudio: true }); test.run(); }); diff --git a/dom/media/tests/mochitest/test_peerConnection_offerRequiresReceiveVideo.html b/dom/media/tests/mochitest/test_peerConnection_offerRequiresReceiveVideo.html index 80254cebe43..b265fb04e75 100644 --- a/dom/media/tests/mochitest/test_peerConnection_offerRequiresReceiveVideo.html +++ b/dom/media/tests/mochitest/test_peerConnection_offerRequiresReceiveVideo.html @@ -1,4 +1,4 @@ - + @@ -18,7 +18,7 @@ runNetworkTest(function() { var test = new PeerConnectionTest(); - test.setOfferConstraints({ mandatory: { OfferToReceiveVideo: true } }); + test.setOfferOptions({ offerToReceiveVideo: true }); test.run(); }); diff --git a/dom/media/tests/mochitest/test_peerConnection_offerRequiresReceiveVideoAudio.html b/dom/media/tests/mochitest/test_peerConnection_offerRequiresReceiveVideoAudio.html index 46b9248d1ae..65880476e87 100644 --- a/dom/media/tests/mochitest/test_peerConnection_offerRequiresReceiveVideoAudio.html +++ b/dom/media/tests/mochitest/test_peerConnection_offerRequiresReceiveVideoAudio.html @@ -1,4 +1,4 @@ - + @@ -18,10 +18,10 @@ runNetworkTest(function() { var test = new PeerConnectionTest(); - test.setOfferConstraints({ mandatory: { - OfferToReceiveVideo: true, - OfferToReceiveAudio: true - }}); + test.setOfferOptions({ + offerToReceiveVideo: true, + offerToReceiveAudio: true + }); test.run(); }); diff --git a/dom/webidl/PeerConnectionImpl.webidl b/dom/webidl/PeerConnectionImpl.webidl index 2e3507a0810..ab2a6777cae 100644 --- a/dom/webidl/PeerConnectionImpl.webidl +++ b/dom/webidl/PeerConnectionImpl.webidl @@ -25,9 +25,9 @@ interface PeerConnectionImpl { nsISupports thread); /* JSEP calls */ [Throws] - void createOffer(optional MediaConstraintsInternal constraints); + void createOffer(optional RTCOfferOptions options); [Throws] - void createAnswer(optional MediaConstraintsInternal constraints); + void createAnswer(); [Throws] void setLocalDescription(long action, DOMString sdp); [Throws] @@ -40,8 +40,7 @@ interface PeerConnectionImpl { /* Adds the stream created by GetUserMedia */ [Throws] - void addStream(MediaStream stream, - optional MediaConstraintsInternal constraints); + void addStream(MediaStream stream); [Throws] void removeStream(MediaStream stream); [Throws] diff --git a/dom/webidl/PeerConnectionObserver.webidl b/dom/webidl/PeerConnectionObserver.webidl index f81ee1e6463..a68ba9d9c58 100644 --- a/dom/webidl/PeerConnectionObserver.webidl +++ b/dom/webidl/PeerConnectionObserver.webidl @@ -39,9 +39,4 @@ interface PeerConnectionObserver void onRemoveStream(); void onAddTrack(); void onRemoveTrack(); - - /* Helper function to access supported constraints defined in webidl. Needs to - * be in a separate webidl object we hold, so putting it here was convenient. - */ - MediaConstraintSet getSupportedConstraints(optional MediaConstraintSet constraints); }; diff --git a/dom/webidl/RTCPeerConnection.webidl b/dom/webidl/RTCPeerConnection.webidl index 2c5e613d91b..c6345c0a850 100644 --- a/dom/webidl/RTCPeerConnection.webidl +++ b/dom/webidl/RTCPeerConnection.webidl @@ -52,33 +52,13 @@ dictionary RTCDataChannelInit { unsigned short stream; // now id }; -// Misnomer dictionaries housing PeerConnection-specific constraints. -// -// Important! Do not ever add members that might need tracing (e.g. object) -// to MediaConstraintSet or any dictionary marked XxxInternal here - -dictionary MediaConstraintSet { - boolean OfferToReceiveAudio; - boolean OfferToReceiveVideo; +dictionary RTCOfferOptions { + long offerToReceiveVideo; + long offerToReceiveAudio; boolean MozDontOfferDataChannel; boolean MozBundleOnly; }; -// MediaConstraint = single-property-subset of MediaConstraintSet -// Implemented as full set. Test Object.keys(pair).length == 1 - -// typedef MediaConstraintSet MediaConstraint; // TODO: Bug 913053 - -dictionary MediaConstraints { - object mandatory; // so we can see unknown + unsupported constraints - sequence _optional; // a.k.a. MediaConstraint -}; - -dictionary MediaConstraintsInternal { - MediaConstraintSet mandatory; // holds only supported constraints - sequence _optional; // a.k.a. MediaConstraint -}; - interface RTCDataChannel; [Pref="media.peerconnection.enabled", @@ -95,10 +75,9 @@ interface mozRTCPeerConnection : EventTarget { void getIdentityAssertion(); void createOffer (RTCSessionDescriptionCallback successCallback, RTCPeerConnectionErrorCallback failureCallback, - optional MediaConstraints constraints); + optional RTCOfferOptions options); void createAnswer (RTCSessionDescriptionCallback successCallback, - RTCPeerConnectionErrorCallback failureCallback, - optional MediaConstraints constraints); + RTCPeerConnectionErrorCallback failureCallback); void setLocalDescription (mozRTCSessionDescription description, optional VoidFunction successCallback, optional RTCPeerConnectionErrorCallback failureCallback); @@ -108,8 +87,7 @@ interface mozRTCPeerConnection : EventTarget { readonly attribute mozRTCSessionDescription? localDescription; readonly attribute mozRTCSessionDescription? remoteDescription; readonly attribute RTCSignalingState signalingState; - void updateIce (optional RTCConfiguration configuration, - optional MediaConstraints constraints); + void updateIce (optional RTCConfiguration configuration); void addIceCandidate (mozRTCIceCandidate candidate, optional VoidFunction successCallback, optional RTCPeerConnectionErrorCallback failureCallback); @@ -121,10 +99,11 @@ interface mozRTCPeerConnection : EventTarget { [ChromeOnly] readonly attribute DOMString id; + RTCConfiguration getConfiguration (); sequence getLocalStreams (); sequence getRemoteStreams (); MediaStream? getStreamById (DOMString streamId); - void addStream (MediaStream stream, optional MediaConstraints constraints); + void addStream (MediaStream stream); void removeStream (MediaStream stream); void close (); attribute EventHandler onnegotiationneeded; diff --git a/media/webrtc/signaling/include/CC_Call.h b/media/webrtc/signaling/include/CC_Call.h index 30f823ad13a..314f7c5a73a 100644 --- a/media/webrtc/signaling/include/CC_Call.h +++ b/media/webrtc/signaling/include/CC_Call.h @@ -278,9 +278,9 @@ namespace CSF */ virtual void originateP2PCall (cc_sdp_direction_t video_pref, const std::string & digits, const std::string & ip) = 0; - virtual void createOffer (cc_media_constraints_t* constraints, Timecard *) = 0; + virtual void createOffer (cc_media_options_t* options, Timecard *) = 0; - virtual void createAnswer(cc_media_constraints_t* constraints, Timecard *) = 0; + virtual void createAnswer(Timecard *) = 0; virtual void setLocalDescription(cc_jsep_action_t action, const std::string & sdp, Timecard *) = 0; @@ -290,8 +290,7 @@ namespace CSF virtual void addStream(cc_media_stream_id_t stream_id, cc_media_track_id_t track_id, - cc_media_type_t media_type, - cc_media_constraints_t *constraints) = 0; + cc_media_type_t media_type) = 0; virtual void removeStream(cc_media_stream_id_t stream_id, cc_media_track_id_t track_id, cc_media_type_t media_type) = 0; diff --git a/media/webrtc/signaling/src/peerconnection/PeerConnectionCtx.cpp b/media/webrtc/signaling/src/peerconnection/PeerConnectionCtx.cpp index 6ca2f35c350..3b817fd8800 100644 --- a/media/webrtc/signaling/src/peerconnection/PeerConnectionCtx.cpp +++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionCtx.cpp @@ -56,52 +56,48 @@ using namespace dom; #ifdef MOZILLA_INTERNAL_API static void -Apply(const Optional &aSrc, cc_boolean_constraint_t *aDst, - bool mandatory = false) { - if (aSrc.WasPassed() && (mandatory || !aDst->was_passed)) { +Apply(const Optional &aSrc, cc_boolean_option_t *aDst) { + if (aSrc.WasPassed()) { aDst->was_passed = true; aDst->value = aSrc.Value(); - aDst->mandatory = mandatory; + } +} + +static void +Apply(const Optional &aSrc, cc_boolean_option_t *aDst) { + if (aSrc.WasPassed()) { + aDst->was_passed = true; + aDst->value = !!aSrc.Value(); } } #endif -MediaConstraintsExternal::MediaConstraintsExternal() { - memset(&mConstraints, 0, sizeof(mConstraints)); +SipccOfferOptions::SipccOfferOptions() { + memset(&mOptions, 0, sizeof(mOptions)); } -MediaConstraintsExternal::MediaConstraintsExternal( - const MediaConstraintsInternal &aSrc) { - cc_media_constraints_t* c = &mConstraints; +SipccOfferOptions::SipccOfferOptions( + const RTCOfferOptions &aSrc) { + cc_media_options_t* c = &mOptions; memset(c, 0, sizeof(*c)); #ifdef MOZILLA_INTERNAL_API - Apply(aSrc.mMandatory.mOfferToReceiveAudio, &c->offer_to_receive_audio, true); - Apply(aSrc.mMandatory.mOfferToReceiveVideo, &c->offer_to_receive_video, true); + Apply(aSrc.mOfferToReceiveAudio, &c->offer_to_receive_audio); + Apply(aSrc.mOfferToReceiveVideo, &c->offer_to_receive_video); if (!Preferences::GetBool("media.peerconnection.video.enabled", true)) { c->offer_to_receive_video.was_passed = true; c->offer_to_receive_video.value = false; } - Apply(aSrc.mMandatory.mMozDontOfferDataChannel, &c->moz_dont_offer_datachannel, - true); - Apply(aSrc.mMandatory.mMozBundleOnly, &c->moz_bundle_only, true); - if (aSrc.mOptional.WasPassed()) { - const Sequence &array = aSrc.mOptional.Value(); - for (uint32_t i = 0; i < array.Length(); i++) { - Apply(array[i].mOfferToReceiveAudio, &c->offer_to_receive_audio); - Apply(array[i].mOfferToReceiveVideo, &c->offer_to_receive_video); - Apply(array[i].mMozDontOfferDataChannel, &c->moz_dont_offer_datachannel); - Apply(array[i].mMozBundleOnly, &c->moz_bundle_only); - } - } + Apply(aSrc.mMozDontOfferDataChannel, &c->moz_dont_offer_datachannel); + Apply(aSrc.mMozBundleOnly, &c->moz_bundle_only); #endif } -cc_media_constraints_t* -MediaConstraintsExternal::build() const { - cc_media_constraints_t* cc = (cc_media_constraints_t*) - cpr_malloc(sizeof(cc_media_constraints_t)); +cc_media_options_t* +SipccOfferOptions::build() const { + cc_media_options_t* cc = (cc_media_options_t*) + cpr_malloc(sizeof(cc_media_options_t)); if (cc) { - *cc = mConstraints; + *cc = mOptions; } return cc; } diff --git a/media/webrtc/signaling/src/peerconnection/PeerConnectionCtx.h b/media/webrtc/signaling/src/peerconnection/PeerConnectionCtx.h index 32effa9a3af..7ccc928af61 100644 --- a/media/webrtc/signaling/src/peerconnection/PeerConnectionCtx.h +++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionCtx.h @@ -29,15 +29,15 @@ namespace dom { class WebrtcGlobalInformation; } -// Unit-test helper, because cc_media_constraints_t is hard to forward-declare +// Unit-test helper, because cc_media_options_t is hard to forward-declare -class MediaConstraintsExternal { +class SipccOfferOptions { public: - MediaConstraintsExternal(); - MediaConstraintsExternal(const dom::MediaConstraintsInternal &aOther); - cc_media_constraints_t* build() const; + SipccOfferOptions(); + SipccOfferOptions(const dom::RTCOfferOptions &aOther); + cc_media_options_t* build() const; protected: - cc_media_constraints_t mConstraints; + cc_media_options_t mOptions; }; } diff --git a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp index b2e5ecb5b15..9f087b010b3 100644 --- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp +++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp @@ -1083,7 +1083,7 @@ PeerConnectionImpl::CreateDataChannel(const nsAString& aLabel, if (!mHaveDataStream) { // XXX stream_id of 0 might confuse things... - mInternal->mCall->addStream(0, 2, DATA, 0); + mInternal->mCall->addStream(0, 2, DATA); mHaveDataStream = true; } nsIDOMDataChannel *retval; @@ -1170,14 +1170,14 @@ PeerConnectionImpl::NotifyDataChannel(already_AddRefed aChannel) } NS_IMETHODIMP -PeerConnectionImpl::CreateOffer(const MediaConstraintsInternal& aConstraints) +PeerConnectionImpl::CreateOffer(const RTCOfferOptions& aOptions) { - return CreateOffer(MediaConstraintsExternal (aConstraints)); + return CreateOffer(SipccOfferOptions(aOptions)); } // Used by unit tests and the IDL CreateOffer. NS_IMETHODIMP -PeerConnectionImpl::CreateOffer(const MediaConstraintsExternal& aConstraints) +PeerConnectionImpl::CreateOffer(const SipccOfferOptions& aOptions) { PC_AUTO_ENTER_API_CALL(true); @@ -1185,20 +1185,14 @@ PeerConnectionImpl::CreateOffer(const MediaConstraintsExternal& aConstraints) mTimeCard = nullptr; STAMP_TIMECARD(tc, "Create Offer"); - cc_media_constraints_t* cc_constraints = aConstraints.build(); - NS_ENSURE_TRUE(cc_constraints, NS_ERROR_UNEXPECTED); - mInternal->mCall->createOffer(cc_constraints, tc); + cc_media_options_t* cc_options = aOptions.build(); + NS_ENSURE_TRUE(cc_options, NS_ERROR_UNEXPECTED); + mInternal->mCall->createOffer(cc_options, tc); return NS_OK; } NS_IMETHODIMP -PeerConnectionImpl::CreateAnswer(const MediaConstraintsInternal& aConstraints) -{ - return CreateAnswer(MediaConstraintsExternal (aConstraints)); -} - -NS_IMETHODIMP -PeerConnectionImpl::CreateAnswer(const MediaConstraintsExternal& aConstraints) +PeerConnectionImpl::CreateAnswer() { PC_AUTO_ENTER_API_CALL(true); @@ -1206,9 +1200,7 @@ PeerConnectionImpl::CreateAnswer(const MediaConstraintsExternal& aConstraints) mTimeCard = nullptr; STAMP_TIMECARD(tc, "Create Answer"); - cc_media_constraints_t* cc_constraints = aConstraints.build(); - NS_ENSURE_TRUE(cc_constraints, NS_ERROR_UNEXPECTED); - mInternal->mCall->createAnswer(cc_constraints, tc); + mInternal->mCall->createAnswer(tc); return NS_OK; } @@ -1426,15 +1418,7 @@ PeerConnectionImpl::PrincipalChanged(DOMMediaStream* aMediaStream) { #endif nsresult -PeerConnectionImpl::AddStream(DOMMediaStream &aMediaStream, - const MediaConstraintsInternal& aConstraints) -{ - return AddStream(aMediaStream, MediaConstraintsExternal(aConstraints)); -} - -nsresult -PeerConnectionImpl::AddStream(DOMMediaStream &aMediaStream, - const MediaConstraintsExternal& aConstraints) +PeerConnectionImpl::AddStream(DOMMediaStream &aMediaStream) { PC_AUTO_ENTER_API_CALL(true); @@ -1470,16 +1454,12 @@ PeerConnectionImpl::AddStream(DOMMediaStream &aMediaStream, // TODO(ekr@rtfm.com): these integers should be the track IDs if (hints & DOMMediaStream::HINT_CONTENTS_AUDIO) { - cc_media_constraints_t* cc_constraints = aConstraints.build(); - NS_ENSURE_TRUE(cc_constraints, NS_ERROR_UNEXPECTED); - mInternal->mCall->addStream(stream_id, 0, AUDIO, cc_constraints); + mInternal->mCall->addStream(stream_id, 0, AUDIO); mNumAudioStreams++; } if (hints & DOMMediaStream::HINT_CONTENTS_VIDEO) { - cc_media_constraints_t* cc_constraints = aConstraints.build(); - NS_ENSURE_TRUE(cc_constraints, NS_ERROR_UNEXPECTED); - mInternal->mCall->addStream(stream_id, 1, VIDEO, cc_constraints); + mInternal->mCall->addStream(stream_id, 1, VIDEO); mNumVideoStreams++; } diff --git a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h index 688663ad1a9..acf25e5a0d0 100644 --- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h +++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h @@ -73,7 +73,7 @@ class DOMMediaStream; namespace dom { struct RTCConfiguration; -struct MediaConstraintsInternal; +struct RTCOfferOptions; class MediaStreamTrack; #ifdef USE_FAKE_PCOBSERVER @@ -84,7 +84,7 @@ class PeerConnectionObserver; typedef NS_ConvertUTF8toUTF16 PCObserverString; #endif } -class MediaConstraintsExternal; +class SipccOfferOptions; } #if defined(__cplusplus) && __cplusplus >= 201103L @@ -108,8 +108,7 @@ namespace sipcc { using mozilla::dom::PeerConnectionObserver; using mozilla::dom::RTCConfiguration; -using mozilla::dom::MediaConstraintsInternal; -using mozilla::MediaConstraintsExternal; +using mozilla::dom::RTCOfferOptions; using mozilla::DOMMediaStream; using mozilla::NrIceCtx; using mozilla::NrIceMediaStream; @@ -214,13 +213,11 @@ public: enum Error { kNoError = 0, - kInvalidConstraintsType = 1, kInvalidCandidateType = 2, kInvalidMediastreamTrack = 3, kInvalidState = 4, kInvalidSessionDescription = 5, kIncompatibleSessionDescription = 6, - kIncompatibleConstraints = 7, kIncompatibleMediaStreamTrack = 8, kInternalError = 9 }; @@ -316,19 +313,18 @@ public: } NS_IMETHODIMP_TO_ERRORRESULT(CreateOffer, ErrorResult &rv, - const MediaConstraintsInternal& aConstraints) + const RTCOfferOptions& aOptions) { - rv = CreateOffer(aConstraints); + rv = CreateOffer(aOptions); } - NS_IMETHODIMP_TO_ERRORRESULT(CreateAnswer, ErrorResult &rv, - const MediaConstraintsInternal& aConstraints) + NS_IMETHODIMP CreateAnswer(); + void CreateAnswer(ErrorResult &rv) { - rv = CreateAnswer(aConstraints); + rv = CreateAnswer(); } - NS_IMETHODIMP CreateOffer(const MediaConstraintsExternal& aConstraints); - NS_IMETHODIMP CreateAnswer(const MediaConstraintsExternal& aConstraints); + NS_IMETHODIMP CreateOffer(const mozilla::SipccOfferOptions& aConstraints); NS_IMETHODIMP SetLocalDescription (int32_t aAction, const char* aSDP); @@ -368,15 +364,11 @@ public: } NS_IMETHODIMP_TO_ERRORRESULT(AddStream, ErrorResult &rv, - DOMMediaStream& aMediaStream, - const MediaConstraintsInternal& aConstraints) + DOMMediaStream& aMediaStream) { - rv = AddStream(aMediaStream, aConstraints); + rv = AddStream(aMediaStream); } - nsresult AddStream(DOMMediaStream &aMediaStream, - const MediaConstraintsExternal& aConstraints); - NS_IMETHODIMP_TO_ERRORRESULT(RemoveStream, ErrorResult &rv, DOMMediaStream& aMediaStream) { @@ -669,7 +661,7 @@ private: mozilla::RefPtr mIdentity; #ifdef MOZILLA_INTERNAL_API // The entity on the other end of the peer-to-peer connection; - // void if they are not yet identified, and no constraint has been set + // void if they are not yet identified, and no identity setting has been set nsAutoPtr mPeerIdentity; #endif // Whether an app should be prevented from accessing media produced by the PC diff --git a/media/webrtc/signaling/src/sipcc/core/ccapp/CCProvider.h b/media/webrtc/signaling/src/sipcc/core/ccapp/CCProvider.h index b23508c4e0e..e6c4fc0b63b 100755 --- a/media/webrtc/signaling/src/sipcc/core/ccapp/CCProvider.h +++ b/media/webrtc/signaling/src/sipcc/core/ccapp/CCProvider.h @@ -106,7 +106,7 @@ typedef struct cc_call_info_t_{ cc_string_t sdp; unsigned int media_stream_track_id; unsigned int media_stream_id; - cc_media_constraints_t* cc_constraints; + cc_media_options_t* cc_options; string_t candidate; Timecard * timecard; } session_data_t; diff --git a/media/webrtc/signaling/src/sipcc/core/ccapp/cc_call_feature.c b/media/webrtc/signaling/src/sipcc/core/ccapp/cc_call_feature.c index e8f9c66dd04..f5a2108933d 100644 --- a/media/webrtc/signaling/src/sipcc/core/ccapp/cc_call_feature.c +++ b/media/webrtc/signaling/src/sipcc/core/ccapp/cc_call_feature.c @@ -105,7 +105,7 @@ cc_return_t cc_invokeFeatureSDPMode(cc_call_handle_t call_handle, cc_media_track_id_t track_id, cc_media_type_t media_type, uint16_t level, - cc_media_constraints_t *constraints, + cc_media_options_t *options, string_t data, string_t data1, Timecard *tc) { @@ -118,7 +118,7 @@ cc_return_t cc_invokeFeatureSDPMode(cc_call_handle_t call_handle, callFeature.featData.ccData.stream_id = stream_id; callFeature.featData.ccData.track_id = track_id; callFeature.featData.ccData.level = level; - callFeature.featData.ccData.constraints = constraints; + callFeature.featData.ccData.options = options; callFeature.featData.ccData.timecard = tc; CCAPP_DEBUG(DEB_F_PREFIX"cc_invokeFeatureSDPMode:sid=%d, line=%d, cid=%d, fid=%d, data=%s", @@ -292,79 +292,73 @@ cc_return_t CC_CallFeature_dial(cc_call_handle_t call_handle, cc_sdp_direction_t } cc_return_t CC_CallFeature_CreateOffer(cc_call_handle_t call_handle, - cc_media_constraints_t *constraints, + cc_media_options_t *options, Timecard *tc) { CCAPP_DEBUG(DEB_L_C_F_PREFIX, DEB_L_C_F_PREFIX_ARGS(SIP_CC_PROV, GET_CALL_ID(call_handle), GET_LINE_ID(call_handle), __FUNCTION__)); return cc_invokeFeatureSDPMode(call_handle, CC_FEATURE_CREATEOFFER, JSEP_NO_ACTION, - 0, 0, NO_STREAM, 0, constraints, NULL, NULL, tc); + 0, 0, NO_STREAM, 0, options, NULL, NULL, tc); } cc_return_t CC_CallFeature_CreateAnswer(cc_call_handle_t call_handle, - cc_media_constraints_t *constraints, Timecard *tc) { CCAPP_DEBUG(DEB_L_C_F_PREFIX, DEB_L_C_F_PREFIX_ARGS(SIP_CC_PROV, GET_CALL_ID(call_handle), GET_LINE_ID(call_handle), __FUNCTION__)); return cc_invokeFeatureSDPMode(call_handle, CC_FEATURE_CREATEANSWER, JSEP_NO_ACTION, - 0, 0, NO_STREAM, 0, constraints, NULL, NULL, tc); + 0, 0, NO_STREAM, 0, NULL, NULL, NULL, tc); } cc_return_t CC_CallFeature_SetLocalDescription(cc_call_handle_t call_handle, cc_jsep_action_t action, string_t sdp, Timecard *tc) { - cc_media_constraints_t *constraints = NULL; CCAPP_DEBUG(DEB_L_C_F_PREFIX, DEB_L_C_F_PREFIX_ARGS(SIP_CC_PROV, GET_CALL_ID(call_handle), GET_LINE_ID(call_handle), __FUNCTION__)); return cc_invokeFeatureSDPMode(call_handle, CC_FEATURE_SETLOCALDESC, action, - 0, 0, NO_STREAM, 0, constraints, sdp, NULL, tc); + 0, 0, NO_STREAM, 0, NULL, sdp, NULL, tc); } cc_return_t CC_CallFeature_SetRemoteDescription(cc_call_handle_t call_handle, cc_jsep_action_t action, string_t sdp, Timecard *tc) { - cc_media_constraints_t *constraints = NULL; CCAPP_DEBUG(DEB_L_C_F_PREFIX, DEB_L_C_F_PREFIX_ARGS(SIP_CC_PROV, GET_CALL_ID(call_handle), GET_LINE_ID(call_handle), __FUNCTION__)); return cc_invokeFeatureSDPMode(call_handle, CC_FEATURE_SETREMOTEDESC, action, - 0, 0, NO_STREAM, 0, constraints, sdp, NULL, tc); + 0, 0, NO_STREAM, 0, NULL, sdp, NULL, tc); } cc_return_t CC_CallFeature_SetPeerConnection(cc_call_handle_t call_handle,cc_peerconnection_t pc) { - cc_media_constraints_t *constraints = NULL; CCAPP_DEBUG(DEB_L_C_F_PREFIX, DEB_L_C_F_PREFIX_ARGS(SIP_CC_PROV, GET_CALL_ID(call_handle), GET_LINE_ID(call_handle), __FUNCTION__)); return cc_invokeFeatureSDPMode(call_handle, CC_FEATURE_SETPEERCONNECTION, JSEP_NO_ACTION, - 0, 0, NO_STREAM, 0, constraints, pc, NULL, NULL); + 0, 0, NO_STREAM, 0, NULL, pc, NULL, NULL); } cc_return_t CC_CallFeature_AddStream(cc_call_handle_t call_handle, cc_media_stream_id_t stream_id, cc_media_track_id_t track_id, - cc_media_type_t media_type, - cc_media_constraints_t *constraints) { + cc_media_type_t media_type) { CCAPP_DEBUG(DEB_L_C_F_PREFIX, DEB_L_C_F_PREFIX_ARGS(SIP_CC_PROV, GET_CALL_ID(call_handle), GET_LINE_ID(call_handle), __FUNCTION__)); return cc_invokeFeatureSDPMode(call_handle, CC_FEATURE_ADDSTREAM, JSEP_NO_ACTION, - stream_id, track_id, media_type, 0, constraints, NULL, NULL, NULL); + stream_id, track_id, media_type, 0, NULL, NULL, NULL, NULL); } cc_return_t CC_CallFeature_RemoveStream(cc_call_handle_t call_handle, cc_media_stream_id_t stream_id, cc_media_track_id_t track_id, cc_media_type_t media_type) { - cc_media_constraints_t *constraints = NULL; CCAPP_DEBUG(DEB_L_C_F_PREFIX, DEB_L_C_F_PREFIX_ARGS(SIP_CC_PROV, GET_CALL_ID(call_handle), GET_LINE_ID(call_handle), __FUNCTION__)); return cc_invokeFeatureSDPMode(call_handle, CC_FEATURE_REMOVESTREAM, JSEP_NO_ACTION, - stream_id, track_id, media_type, 0, constraints, NULL, NULL, NULL); + stream_id, track_id, media_type, 0, NULL, NULL, NULL, NULL); } cc_return_t CC_CallFeature_AddICECandidate(cc_call_handle_t call_handle, @@ -372,12 +366,11 @@ cc_return_t CC_CallFeature_AddICECandidate(cc_call_handle_t call_handle, const char *mid, cc_level_t level, Timecard *tc) { - cc_media_constraints_t *constraints = NULL; CCAPP_DEBUG(DEB_L_C_F_PREFIX, DEB_L_C_F_PREFIX_ARGS(SIP_CC_PROV, GET_CALL_ID(call_handle), GET_LINE_ID(call_handle), __FUNCTION__)); return cc_invokeFeatureSDPMode(call_handle, CC_FEATURE_ADDICECANDIDATE, JSEP_NO_ACTION, - 0, 0, NO_STREAM, (uint16_t)level, constraints, candidate, mid, tc); + 0, 0, NO_STREAM, (uint16_t)level, NULL, candidate, mid, tc); } cc_return_t CC_CallFeature_FoundICECandidate(cc_call_handle_t call_handle, @@ -385,12 +378,11 @@ cc_return_t CC_CallFeature_FoundICECandidate(cc_call_handle_t call_handle, const char *mid, cc_level_t level, Timecard *tc) { - cc_media_constraints_t *constraints = NULL; CCAPP_DEBUG(DEB_L_C_F_PREFIX, DEB_L_C_F_PREFIX_ARGS(SIP_CC_PROV, GET_CALL_ID(call_handle), GET_LINE_ID(call_handle), __FUNCTION__)); return cc_invokeFeatureSDPMode(call_handle, CC_FEATURE_FOUNDICECANDIDATE, JSEP_NO_ACTION, - 0, 0, NO_STREAM, (uint16_t)level, constraints, candidate, mid, tc); + 0, 0, NO_STREAM, (uint16_t)level, NULL, candidate, mid, tc); } /** diff --git a/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_call.c b/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_call.c index 5d540dfac8e..a7deeeae660 100644 --- a/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_call.c +++ b/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_call.c @@ -92,15 +92,14 @@ cc_return_t CCAPI_Call_originateCall(cc_call_handle_t handle, cc_sdp_direction_t } cc_return_t CCAPI_CreateOffer(cc_call_handle_t handle, - cc_media_constraints_t *constraints, + cc_media_options_t *options, Timecard *tc) { - return CC_CallFeature_CreateOffer(handle, constraints, tc); + return CC_CallFeature_CreateOffer(handle, options, tc); } cc_return_t CCAPI_CreateAnswer(cc_call_handle_t handle, - cc_media_constraints_t *constraints, Timecard *tc) { - return CC_CallFeature_CreateAnswer(handle, constraints, tc); + return CC_CallFeature_CreateAnswer(handle, tc); } cc_return_t CCAPI_SetLocalDescription(cc_call_handle_t handle, @@ -124,10 +123,8 @@ cc_return_t CCAPI_SetPeerConnection(cc_call_handle_t handle, cc_peerconnection_t cc_return_t CCAPI_AddStream(cc_call_handle_t handle, cc_media_stream_id_t stream_id, cc_media_track_id_t track_id, - cc_media_type_t media_type, - cc_media_constraints_t *constraints) { - return CC_CallFeature_AddStream(handle, stream_id, track_id, media_type, - constraints); + cc_media_type_t media_type) { + return CC_CallFeature_AddStream(handle, stream_id, track_id, media_type); } cc_return_t CCAPI_RemoveStream(cc_call_handle_t handle, cc_media_stream_id_t stream_id, cc_media_track_id_t track_id, cc_media_type_t media_type) { diff --git a/media/webrtc/signaling/src/sipcc/core/ccapp/ccprovider.c b/media/webrtc/signaling/src/sipcc/core/ccapp/ccprovider.c index 4fcc3d158b1..0b0ef906b56 100755 --- a/media/webrtc/signaling/src/sipcc/core/ccapp/ccprovider.c +++ b/media/webrtc/signaling/src/sipcc/core/ccapp/ccprovider.c @@ -664,12 +664,12 @@ processSessionEvent (line_t line_id, callid_t call_id, unsigned int event, sdp_d break; case CC_FEATURE_CREATEOFFER: STAMP_TIMECARD(timecard, "Processing create offer event"); - featdata.session.constraints = ccData.constraints; + featdata.session.options = ccData.options; cc_createoffer (CC_SRC_UI, CC_SRC_GSM, call_id, (line_t)instance, CC_FEATURE_CREATEOFFER, &featdata, timecard); break; case CC_FEATURE_CREATEANSWER: STAMP_TIMECARD(timecard, "Processing create answer event"); - featdata.session.constraints = ccData.constraints; + featdata.session.options = ccData.options; cc_createanswer (CC_SRC_UI, CC_SRC_GSM, call_id, (line_t)instance, CC_FEATURE_CREATEANSWER, data, &featdata, timecard); break; case CC_FEATURE_SETLOCALDESC: @@ -695,7 +695,6 @@ processSessionEvent (line_t line_id, callid_t call_id, unsigned int event, sdp_d featdata.track.stream_id = ccData.stream_id; featdata.track.track_id = ccData.track_id; featdata.track.media_type = ccData.media_type; - featdata.track.constraints = ccData.constraints; cc_int_feature2(CC_MSG_ADDSTREAM, CC_SRC_UI, CC_SRC_GSM, call_id, (line_t)instance, CC_FEATURE_ADDSTREAM, &featdata, timecard); break; case CC_FEATURE_REMOVESTREAM: diff --git a/media/webrtc/signaling/src/sipcc/core/gsm/fsmdef.c b/media/webrtc/signaling/src/sipcc/core/gsm/fsmdef.c index d18956e9c7f..ee9728664a7 100755 --- a/media/webrtc/signaling/src/sipcc/core/gsm/fsmdef.c +++ b/media/webrtc/signaling/src/sipcc/core/gsm/fsmdef.c @@ -1100,17 +1100,17 @@ fsmdef_set_per_media_local_hold_sdp (fsmdef_dcb_t *dcb) } /** - * This function deallocates a constraints structure + * This function deallocates an options structure * - * @param[in]constraints - pointer to cc_media_constraints_t + * @param[in]options - pointer to cc_media_options_t * @return None */ void -fsmdef_free_constraints(cc_media_constraints_t *constraints) { - if (!constraints) { +fsmdef_free_options(cc_media_options_t *options) { + if (!options) { return; } - cpr_free(constraints); + cpr_free(options); } void @@ -3205,10 +3205,10 @@ fsmdef_ev_createoffer (sm_event_t *event) { dcb->inbound = FALSE; - if (msg->data.session.constraints) { - gsmsdp_process_cap_constraints(dcb, msg->data.session.constraints); - fsmdef_free_constraints(msg->data.session.constraints); - msg->data.session.constraints = 0; + if (msg->data.session.options) { + gsmsdp_process_cap_options(dcb, msg->data.session.options); + fsmdef_free_options(msg->data.session.options); + msg->data.session.options = 0; } if (dcb->media_cap_tbl->cap[CC_VIDEO_1].enabled || @@ -3369,12 +3369,6 @@ fsmdef_ev_createanswer (sm_event_t *event) { dcb->inbound = TRUE; - if (msg->data.session.constraints) { - gsmsdp_process_cap_constraints(dcb, msg->data.session.constraints); - fsmdef_free_constraints(msg->data.session.constraints); - msg->data.session.constraints = 0; - } - vcm_res = vcmGetIceParams(dcb->peerconnection, &ufrag, &ice_pwd); if (vcm_res) { FSM_DEBUG_SM(DEB_F_PREFIX"vcmGetIceParams returned an error", @@ -4023,20 +4017,7 @@ fsmdef_ev_addstream(sm_event_t *event) { dcb->media_cap_tbl->cap[cap_index].support_direction = SDP_DIRECTION_SENDRECV; dcb->media_cap_tbl->cap[cap_index].pc_stream = msg->data.track.stream_id; dcb->media_cap_tbl->cap[cap_index].pc_track = msg->data.track.track_id; - - if (msg->data.track.constraints && - msg->data.track.constraints->moz_bundle_only.was_passed) { - dcb->media_cap_tbl->cap[cap_index].bundle_only = - msg->data.track.constraints->moz_bundle_only.value; - } } - - /* Free the constraints structure */ - if (msg->data.track.constraints) { - fsmdef_free_constraints(msg->data.track.constraints); - msg->data.track.constraints = 0; - } - return (SM_RC_END); } diff --git a/media/webrtc/signaling/src/sipcc/core/gsm/gsm_sdp.c b/media/webrtc/signaling/src/sipcc/core/gsm/gsm_sdp.c index e17fad6bc03..f14ac430312 100644 --- a/media/webrtc/signaling/src/sipcc/core/gsm/gsm_sdp.c +++ b/media/webrtc/signaling/src/sipcc/core/gsm/gsm_sdp.c @@ -226,22 +226,22 @@ void gsmsdp_process_cap_constraint(cc_media_cap_t *cap, } /* - * Process constraints only related to media capabilities., i.e + * Process options only related to media capabilities., i.e * OfferToReceiveAudio, OfferToReceiveVideo */ -void gsmsdp_process_cap_constraints(fsmdef_dcb_t *dcb, - cc_media_constraints_t* constraints) { - if (constraints->offer_to_receive_audio.was_passed) { +void gsmsdp_process_cap_options(fsmdef_dcb_t *dcb, + cc_media_options_t* options) { + if (options->offer_to_receive_audio.was_passed) { gsmsdp_process_cap_constraint(&dcb->media_cap_tbl->cap[CC_AUDIO_1], - constraints->offer_to_receive_audio.value); + options->offer_to_receive_audio.value); } - if (constraints->offer_to_receive_video.was_passed) { + if (options->offer_to_receive_video.was_passed) { gsmsdp_process_cap_constraint(&dcb->media_cap_tbl->cap[CC_VIDEO_1], - constraints->offer_to_receive_video.value); + options->offer_to_receive_video.value); } - if (constraints->moz_dont_offer_datachannel.was_passed) { + if (options->moz_dont_offer_datachannel.was_passed) { /* Hack to suppress data channel */ - if (constraints->moz_dont_offer_datachannel.value) { + if (options->moz_dont_offer_datachannel.value) { dcb->media_cap_tbl->cap[CC_DATACHANNEL_1].enabled = FALSE; } } diff --git a/media/webrtc/signaling/src/sipcc/core/gsm/h/gsm_sdp.h b/media/webrtc/signaling/src/sipcc/core/gsm/h/gsm_sdp.h index 560dbc50ed4..132b2db3f8f 100644 --- a/media/webrtc/signaling/src/sipcc/core/gsm/h/gsm_sdp.h +++ b/media/webrtc/signaling/src/sipcc/core/gsm/h/gsm_sdp.h @@ -119,8 +119,7 @@ cc_causes_t gsmsdp_check_ice_attributes_exist(fsm_fcb_t *fcb_p); cc_causes_t gsmsdp_install_peer_ice_attributes(fsm_fcb_t *fcb_p); cc_causes_t gsmsdp_configure_dtls_data_attributes(fsm_fcb_t *fcb_p); cc_causes_t gsmsdp_find_level_from_mid(fsmdef_dcb_t * dcb, const char * mid, uint16_t *level); -void gsmsdp_process_cap_constraints(fsmdef_dcb_t *dcb, - cc_media_constraints_t* constraints); +void gsmsdp_process_cap_options(fsmdef_dcb_t *dcb, cc_media_options_t* options); cc_causes_t gsmsdp_get_offered_media_types (fsm_fcb_t *fcb_p, cc_sdp_t *sdp_p, boolean *has_audio, boolean *has_video, boolean *has_data); fsmdef_media_t* gsmsdp_find_media_by_media_type(fsmdef_dcb_t *dcb, sdp_media_e media_type); diff --git a/media/webrtc/signaling/src/sipcc/core/includes/ccapi.h b/media/webrtc/signaling/src/sipcc/core/includes/ccapi.h index 2f74d10f880..9835cee819c 100755 --- a/media/webrtc/signaling/src/sipcc/core/includes/ccapi.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/ccapi.h @@ -834,7 +834,6 @@ typedef struct cc_feature_data_track_t_ { cc_media_stream_id_t stream_id; cc_media_track_id_t track_id; cc_media_type_t media_type; - cc_media_constraints_t *constraints; } cc_feature_data_track_t; @@ -845,7 +844,7 @@ typedef struct cc_feature_candidate_t_ { } cc_feature_candidate_t; typedef struct cc_feature_session_t_ { - cc_media_constraints_t *constraints; + cc_media_options_t *options; } cc_feature_session_t; diff --git a/media/webrtc/signaling/src/sipcc/core/includes/sessionTypes.h b/media/webrtc/signaling/src/sipcc/core/includes/sessionTypes.h index f244a5416cc..48b0dab915e 100755 --- a/media/webrtc/signaling/src/sipcc/core/includes/sessionTypes.h +++ b/media/webrtc/signaling/src/sipcc/core/includes/sessionTypes.h @@ -53,7 +53,7 @@ typedef struct { cc_media_track_id_t track_id; cc_media_type_t media_type; cc_level_t level; - cc_media_constraints_t * constraints; + cc_media_options_t * options; Timecard * timecard; } ccSession_feature_t; diff --git a/media/webrtc/signaling/src/sipcc/include/cc_call_feature.h b/media/webrtc/signaling/src/sipcc/include/cc_call_feature.h index ae482ff9e30..3ef56453c5f 100644 --- a/media/webrtc/signaling/src/sipcc/include/cc_call_feature.h +++ b/media/webrtc/signaling/src/sipcc/include/cc_call_feature.h @@ -158,11 +158,10 @@ cc_return_t CC_CallFeature_backSpace(cc_call_handle_t call_handle); cc_return_t CC_CallFeature_dial(cc_call_handle_t call_handle, cc_sdp_direction_t video_pref, const cc_string_t numbers); cc_return_t CC_CallFeature_CreateOffer(cc_call_handle_t call_handle, - cc_media_constraints_t *constraints, + cc_media_options_t *options, Timecard *tc); cc_return_t CC_CallFeature_CreateAnswer(cc_call_handle_t call_handle, - cc_media_constraints_t *constraints, Timecard *tc); cc_return_t CC_CallFeature_SetLocalDescription(cc_call_handle_t call_handle, @@ -180,8 +179,7 @@ cc_return_t CC_CallFeature_SetPeerConnection(cc_call_handle_t call_handle, cc_pe cc_return_t CC_CallFeature_AddStream(cc_call_handle_t call_handle, cc_media_stream_id_t stream_id, cc_media_track_id_t id, - cc_media_type_t media_type, - cc_media_constraints_t *constraints); + cc_media_type_t media_type); cc_return_t CC_CallFeature_RemoveStream(cc_call_handle_t call_handle, cc_media_stream_id_t stream_id, cc_media_track_id_t id, cc_media_type_t media_type); diff --git a/media/webrtc/signaling/src/sipcc/include/cc_constants.h b/media/webrtc/signaling/src/sipcc/include/cc_constants.h index 32c72ef9aa8..57a66229b0b 100644 --- a/media/webrtc/signaling/src/sipcc/include/cc_constants.h +++ b/media/webrtc/signaling/src/sipcc/include/cc_constants.h @@ -578,15 +578,14 @@ typedef enum { typedef struct { cc_boolean was_passed; cc_boolean value; - cc_boolean mandatory; -} cc_boolean_constraint_t; +} cc_boolean_option_t; typedef struct { - cc_boolean_constraint_t offer_to_receive_audio; - cc_boolean_constraint_t offer_to_receive_video; - cc_boolean_constraint_t moz_dont_offer_datachannel; - cc_boolean_constraint_t moz_bundle_only; -} cc_media_constraints_t; + cc_boolean_option_t offer_to_receive_audio; + cc_boolean_option_t offer_to_receive_video; + cc_boolean_option_t moz_dont_offer_datachannel; + cc_boolean_option_t moz_bundle_only; +} cc_media_options_t; #endif /* _CC_CONSTANTS_H_ */ diff --git a/media/webrtc/signaling/src/sipcc/include/ccapi_call.h b/media/webrtc/signaling/src/sipcc/include/ccapi_call.h index f3bae70d3c9..2601167a508 100644 --- a/media/webrtc/signaling/src/sipcc/include/ccapi_call.h +++ b/media/webrtc/signaling/src/sipcc/include/ccapi_call.h @@ -55,11 +55,10 @@ cc_return_t CCAPI_Call_originateCall(cc_call_handle_t handle, cc_sdp_direction_t cc_return_t CCAPI_CreateOffer(cc_call_handle_t handle, - cc_media_constraints_t *constraints, + cc_media_options_t *options, Timecard *tc); cc_return_t CCAPI_CreateAnswer(cc_call_handle_t handle, - cc_media_constraints_t *constraints, Timecard *tc); cc_return_t CCAPI_SetLocalDescription(cc_call_handle_t handle, @@ -77,8 +76,7 @@ cc_return_t CCAPI_SetPeerConnection(cc_call_handle_t handle, cc_peerconnection_t cc_return_t CCAPI_AddStream(cc_call_handle_t handle, cc_media_stream_id_t stream_id, cc_media_track_id_t track_id, - cc_media_type_t media_type, - cc_media_constraints_t *constraints); + cc_media_type_t media_type); cc_return_t CCAPI_RemoveStream(cc_call_handle_t handle, cc_media_stream_id_t stream_id, cc_media_track_id_t track_id, cc_media_type_t media_type); diff --git a/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCCall.cpp b/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCCall.cpp index 7703aef8f4c..59329588739 100644 --- a/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCCall.cpp +++ b/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCCall.cpp @@ -532,16 +532,14 @@ void CC_SIPCCCall::originateP2PCall (cc_sdp_direction_t video_pref, const std::s /* * This method works asynchronously, is an onCallEvent with the resulting SDP */ -void CC_SIPCCCall::createOffer (cc_media_constraints_t *constraints, - Timecard *tc) { - CCAPI_CreateOffer(callHandle, constraints, tc); +void CC_SIPCCCall::createOffer (cc_media_options_t *options, Timecard *tc) { + CCAPI_CreateOffer(callHandle, options, tc); } /* * This method works asynchronously, there is onCallEvent with the resulting SDP */ -void CC_SIPCCCall::createAnswer (cc_media_constraints_t *constraints, - Timecard *tc) { - CCAPI_CreateAnswer(callHandle, constraints, tc); +void CC_SIPCCCall::createAnswer (Timecard *tc) { + CCAPI_CreateAnswer(callHandle, tc); } @@ -571,9 +569,8 @@ const std::string& CC_SIPCCCall::getPeerConnection() const { void CC_SIPCCCall::addStream(cc_media_stream_id_t stream_id, cc_media_track_id_t track_id, - cc_media_type_t media_type, - cc_media_constraints_t *constraints) { - CCAPI_AddStream(callHandle, stream_id, track_id, media_type, constraints); + cc_media_type_t media_type) { + CCAPI_AddStream(callHandle, stream_id, track_id, media_type); } void CC_SIPCCCall::removeStream(cc_media_stream_id_t stream_id, cc_media_track_id_t track_id, cc_media_type_t media_type) { diff --git a/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCCall.h b/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCCall.h index d08a92909fa..fb39c064649 100644 --- a/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCCall.h +++ b/media/webrtc/signaling/src/softphonewrapper/CC_SIPCCCall.h @@ -118,16 +118,15 @@ namespace CSF virtual void removeStream(int streamId); virtual bool setVolume(int volume); virtual void originateP2PCall (cc_sdp_direction_t video_pref, const std::string & digits, const std::string & ip); - virtual void createOffer(cc_media_constraints_t *constraints, Timecard *); - virtual void createAnswer(cc_media_constraints_t *constraints, Timecard *); + virtual void createOffer(cc_media_options_t *options, Timecard *); + virtual void createAnswer(Timecard *); virtual void setLocalDescription(cc_jsep_action_t action, const std::string & sdp, Timecard *); virtual void setRemoteDescription(cc_jsep_action_t action, const std::string & sdp, Timecard *); virtual void setPeerConnection(const std::string& handle); virtual const std::string& getPeerConnection() const; virtual void addStream(cc_media_stream_id_t stream_id, cc_media_track_id_t track_id, - cc_media_type_t media_type, - cc_media_constraints_t *constraints); + cc_media_type_t media_type); virtual void removeStream(cc_media_stream_id_t stream_id, cc_media_track_id_t track_id, cc_media_type_t media_type); virtual CC_SIPCCCallMediaDataPtr getMediaData(); virtual void addICECandidate(const std::string & candidate, const std::string & mid, unsigned short level, Timecard *); diff --git a/media/webrtc/signaling/test/signaling_unittests.cpp b/media/webrtc/signaling/test/signaling_unittests.cpp index 927e964c397..fc14ad32109 100644 --- a/media/webrtc/signaling/test/signaling_unittests.cpp +++ b/media/webrtc/signaling/test/signaling_unittests.cpp @@ -80,27 +80,26 @@ uint16_t kBogusSrflxPort(1001); namespace sipcc { -// We can't use mozilla/dom/MediaConstraintsBinding.h here because it uses -// nsString, so we pass constraints in using MediaConstraintsExternal instead +// We can't use webidl bindings here because it uses nsString, +// so we pass options in using SipccOfferOptions instead -class MediaConstraints : public MediaConstraintsExternal { + class OfferOptions : public mozilla::SipccOfferOptions { public: - void setBooleanConstraint(const char *namePtr, bool value, bool mandatory) { - cc_boolean_constraint_t &member (getMember(namePtr)); + void setBooleanOption(const char *namePtr, bool value) { + cc_boolean_option_t &member (getMember(namePtr)); member.was_passed = true; member.value = value; - member.mandatory = mandatory; } private: - cc_boolean_constraint_t &getMember(const char *namePtr) { + cc_boolean_option_t &getMember(const char *namePtr) { if (strcmp(namePtr, "OfferToReceiveAudio") == 0) { - return mConstraints.offer_to_receive_audio; + return mOptions.offer_to_receive_audio; } if (strcmp(namePtr, "OfferToReceiveVideo") == 0) { - return mConstraints.offer_to_receive_video; + return mOptions.offer_to_receive_video; } MOZ_ASSERT(false); - return mConstraints.moz_dont_offer_datachannel; + return mOptions.moz_dont_offer_datachannel; } }; } @@ -733,30 +732,29 @@ class PCDispatchWrapper : public nsSupportsWeakReference return rv; } - NS_IMETHODIMP CreateOffer(const MediaConstraintsExternal& aConstraints) { + NS_IMETHODIMP CreateOffer(const SipccOfferOptions& aOptions) { nsresult rv; if (NS_IsMainThread()) { - rv = pc_->CreateOffer(aConstraints); + rv = pc_->CreateOffer(aOptions); } else { gMainThread->Dispatch( WrapRunnableRet(this, &PCDispatchWrapper::CreateOffer, - aConstraints, &rv), + aOptions, &rv), NS_DISPATCH_SYNC); } return rv; } - NS_IMETHODIMP CreateAnswer(const MediaConstraintsExternal& aConstraints) { + NS_IMETHODIMP CreateAnswer() { nsresult rv; if (NS_IsMainThread()) { - rv = pc_->CreateAnswer(aConstraints); + rv = pc_->CreateAnswer(); } else { gMainThread->Dispatch( - WrapRunnableRet(this, &PCDispatchWrapper::CreateAnswer, - aConstraints, &rv), + WrapRunnableRet(this, &PCDispatchWrapper::CreateAnswer, &rv), NS_DISPATCH_SYNC); } @@ -808,16 +806,14 @@ class PCDispatchWrapper : public nsSupportsWeakReference return rv; } - NS_IMETHODIMP AddStream(DOMMediaStream *aMediaStream, - const MediaConstraintsExternal& aConstraints) { + NS_IMETHODIMP AddStream(DOMMediaStream *aMediaStream) { nsresult rv; if (NS_IsMainThread()) { - rv = pc_->AddStream(*aMediaStream, aConstraints); + rv = pc_->AddStream(*aMediaStream); } else { gMainThread->Dispatch( - WrapRunnableRet(this, &PCDispatchWrapper::AddStream, - aMediaStream, aConstraints, &rv), + WrapRunnableRet(this, &PCDispatchWrapper::AddStream, aMediaStream, &rv), NS_DISPATCH_SYNC); } @@ -1084,14 +1080,7 @@ class SignalingAgent { void AddStream(uint32_t hint = DOMMediaStream::HINT_CONTENTS_AUDIO | DOMMediaStream::HINT_CONTENTS_VIDEO, - MediaStream *stream = nullptr, - sipcc::MediaConstraints *constraints = nullptr - ) { - - sipcc::MediaConstraints noConstraints; - if (!constraints) { - constraints = &noConstraints; - } + MediaStream *stream = nullptr) { nsRefPtr domMediaStream; if (stream) { @@ -1101,7 +1090,7 @@ class SignalingAgent { } domMediaStream->SetHintContents(hint); - ASSERT_EQ(pc->AddStream(domMediaStream, *constraints), NS_OK); + ASSERT_EQ(pc->AddStream(domMediaStream), NS_OK); domMediaStream_ = domMediaStream; } @@ -1113,7 +1102,7 @@ class SignalingAgent { ASSERT_EQ(pc->RemoveStream(domMediaStream_), NS_OK); } - void CreateOffer(sipcc::MediaConstraints& constraints, + void CreateOffer(sipcc::OfferOptions& options, uint32_t offerFlags, uint32_t sdpCheck, PCImplSignalingState endState = PCImplSignalingState::SignalingStable) { @@ -1140,7 +1129,7 @@ class SignalingAgent { // Now call CreateOffer as JS would pObserver->state = TestObserver::stateNoResponse; - ASSERT_EQ(pc->CreateOffer(constraints), NS_OK); + ASSERT_EQ(pc->CreateOffer(options), NS_OK); ASSERT_TRUE_WAIT(pObserver->state != TestObserver::stateNoResponse, kDefaultTimeout); ASSERT_EQ(pObserver->state, TestObserver::stateSuccess); @@ -1149,7 +1138,7 @@ class SignalingAgent { offer_ = pObserver->lastString; } -void CreateAnswer(sipcc::MediaConstraints& constraints, std::string offer, +void CreateAnswer(std::string offer, uint32_t offerAnswerFlags, uint32_t sdpCheck = DONT_CHECK_AUDIO| DONT_CHECK_VIDEO| @@ -1169,7 +1158,7 @@ void CreateAnswer(sipcc::MediaConstraints& constraints, std::string offer, // Decide if streams are disabled for offer or answer // then perform SDP checking based on which stream disabled pObserver->state = TestObserver::stateNoResponse; - ASSERT_EQ(pc->CreateAnswer(constraints), NS_OK); + ASSERT_EQ(pc->CreateAnswer(), NS_OK); ASSERT_TRUE_WAIT(pObserver->state != TestObserver::stateNoResponse, kDefaultTimeout); ASSERT_EQ(pObserver->state, TestObserver::stateSuccess); @@ -1184,7 +1173,7 @@ void CreateAnswer(sipcc::MediaConstraints& constraints, std::string offer, // unique among all streams in the PeerConnection. This is not // generally true, and will need significant revision once // multiple streams are supported. - void CreateOfferRemoveStream(sipcc::MediaConstraints& constraints, + void CreateOfferRemoveStream(sipcc::OfferOptions& options, uint32_t hints, uint32_t sdpCheck) { domMediaStream_->SetHintContents(hints); @@ -1197,7 +1186,7 @@ void CreateAnswer(sipcc::MediaConstraints& constraints, std::string offer, // Now call CreateOffer as JS would pObserver->state = TestObserver::stateNoResponse; - ASSERT_EQ(pc->CreateOffer(constraints), NS_OK); + ASSERT_EQ(pc->CreateOffer(options), NS_OK); ASSERT_TRUE_WAIT(pObserver->state != TestObserver::stateNoResponse, kDefaultTimeout); ASSERT_TRUE(pObserver->state == TestObserver::stateSuccess); @@ -1650,29 +1639,27 @@ public: static void TearDownTestCase() { } - void CreateOffer(sipcc::MediaConstraints& constraints, + void CreateOffer(sipcc::OfferOptions& options, uint32_t offerFlags, uint32_t sdpCheck) { EnsureInit(); - a1_->CreateOffer(constraints, offerFlags, sdpCheck); + a1_->CreateOffer(options, offerFlags, sdpCheck); } - void CreateSetOffer(sipcc::MediaConstraints& constraints, uint32_t sdpCheck) { + void CreateSetOffer(sipcc::OfferOptions& options, uint32_t sdpCheck) { EnsureInit(); - a1_->CreateOffer(constraints, OFFER_AV, sdpCheck); + a1_->CreateOffer(options, OFFER_AV, sdpCheck); a1_->SetLocal(TestObserver::OFFER, a1_->offer()); } - void OfferAnswer(sipcc::MediaConstraints& aconstraints, - sipcc::MediaConstraints& bconstraints, + void OfferAnswer(sipcc::OfferOptions& options, uint32_t offerAnswerFlags, bool finishAfterAnswer, uint32_t offerSdpCheck, uint32_t answerSdpCheck) { EnsureInit(); - a1_->CreateOffer(aconstraints, offerAnswerFlags, offerSdpCheck); + a1_->CreateOffer(options, offerAnswerFlags, offerSdpCheck); a1_->SetLocal(TestObserver::OFFER, a1_->offer()); a2_->SetRemote(TestObserver::OFFER, a1_->offer()); - a2_->CreateAnswer(bconstraints, a1_->offer(), - offerAnswerFlags, answerSdpCheck); + a2_->CreateAnswer(a1_->offer(), offerAnswerFlags, answerSdpCheck); if(true == finishAfterAnswer) { a2_->SetLocal(TestObserver::ANSWER, a2_->answer()); a1_->SetRemote(TestObserver::ANSWER, a2_->answer()); @@ -1682,15 +1669,13 @@ public: } } - void OfferModifiedAnswer(sipcc::MediaConstraints& aconstraints, - sipcc::MediaConstraints& bconstraints, + void OfferModifiedAnswer(sipcc::OfferOptions& options, uint32_t offerSdpCheck, uint32_t answerSdpCheck) { EnsureInit(); - a1_->CreateOffer(aconstraints, OFFER_AUDIO, offerSdpCheck); + a1_->CreateOffer(options, OFFER_AUDIO, offerSdpCheck); a1_->SetLocal(TestObserver::OFFER, a1_->offer()); a2_->SetRemote(TestObserver::OFFER, a1_->offer()); - a2_->CreateAnswer(bconstraints, a1_->offer(), OFFER_AUDIO | ANSWER_AUDIO, - answerSdpCheck); + a2_->CreateAnswer(a1_->offer(), OFFER_AUDIO | ANSWER_AUDIO, answerSdpCheck); a2_->SetLocal(TestObserver::ANSWER, a2_->answer()); ParsedSDP sdpWrapper(a2_->answer()); sdpWrapper.ReplaceLine("m=audio", "m=audio 65375 RTP/SAVPF 109 8 101\r\n"); @@ -1702,15 +1687,14 @@ public: ASSERT_TRUE_WAIT(a2_->IceCompleted() == true, kDefaultTimeout); } - void OfferAnswerTrickle(sipcc::MediaConstraints& aconstraints, - sipcc::MediaConstraints& bconstraints, + void OfferAnswerTrickle(sipcc::OfferOptions& options, uint32_t offerSdpCheck, uint32_t answerSdpCheck) { EnsureInit(); - a1_->CreateOffer(aconstraints, OFFER_AV, offerSdpCheck); + a1_->CreateOffer(options, OFFER_AV, offerSdpCheck); a1_->SetLocal(TestObserver::OFFER, a1_->offer()); ParsedSDP a1_offer(a1_->offer()); a2_->SetRemote(TestObserver::OFFER, a1_offer.sdp_without_ice_); - a2_->CreateAnswer(bconstraints, a1_offer.sdp_without_ice_, + a2_->CreateAnswer(a1_offer.sdp_without_ice_, OFFER_AV|ANSWER_AV, answerSdpCheck); a2_->SetLocal(TestObserver::ANSWER, a2_->answer()); ParsedSDP a2_answer(a2_->answer()); @@ -1723,15 +1707,14 @@ public: } - void OfferAnswerTrickleChrome(sipcc::MediaConstraints& aconstraints, - sipcc::MediaConstraints& bconstraints, + void OfferAnswerTrickleChrome(sipcc::OfferOptions& options, uint32_t offerSdpCheck, uint32_t answerSdpCheck) { EnsureInit(); - a1_->CreateOffer(aconstraints, OFFER_AV, offerSdpCheck); + a1_->CreateOffer(options, OFFER_AV, offerSdpCheck); a1_->SetLocal(TestObserver::OFFER, a1_->offer()); ParsedSDP a1_offer(a1_->offer()); a2_->SetRemote(TestObserver::OFFER, a1_offer.sdp_without_ice_); - a2_->CreateAnswer(bconstraints, a1_offer.sdp_without_ice_, + a2_->CreateAnswer(a1_offer.sdp_without_ice_, OFFER_AV|ANSWER_AV, answerSdpCheck); a2_->SetLocal(TestObserver::ANSWER, a2_->answer()); ParsedSDP a2_answer(a2_->answer()); @@ -1743,27 +1726,27 @@ public: ASSERT_TRUE_WAIT(a2_->IceCompleted() == true, kDefaultTimeout); } - void CreateOfferRemoveStream(sipcc::MediaConstraints& constraints, + void CreateOfferRemoveStream(sipcc::OfferOptions& options, uint32_t hints, uint32_t sdpCheck) { EnsureInit(); - sipcc::MediaConstraints aconstraints; - aconstraints.setBooleanConstraint("OfferToReceiveAudio", true, false); - aconstraints.setBooleanConstraint("OfferToReceiveVideo", true, false); - a1_->CreateOffer(aconstraints, OFFER_AV, SHOULD_SENDRECV_AV ); - a1_->CreateOfferRemoveStream(constraints, hints, sdpCheck); + sipcc::OfferOptions aoptions; + aoptions.setBooleanOption("OfferToReceiveAudio", true); + aoptions.setBooleanOption("OfferToReceiveVideo", true); + a1_->CreateOffer(aoptions, OFFER_AV, SHOULD_SENDRECV_AV ); + a1_->CreateOfferRemoveStream(options, hints, sdpCheck); } - void CreateOfferAudioOnly(sipcc::MediaConstraints& constraints, + void CreateOfferAudioOnly(sipcc::OfferOptions& options, uint32_t sdpCheck) { EnsureInit(); - a1_->CreateOffer(constraints, OFFER_AUDIO, sdpCheck); + a1_->CreateOffer(options, OFFER_AUDIO, sdpCheck); } - void CreateOfferAddCandidate(sipcc::MediaConstraints& constraints, + void CreateOfferAddCandidate(sipcc::OfferOptions& options, const char * candidate, const char * mid, unsigned short level, uint32_t sdpCheck) { EnsureInit(); - a1_->CreateOffer(constraints, OFFER_AV, sdpCheck); + a1_->CreateOffer(options, OFFER_AV, sdpCheck); a1_->AddIceCandidate(candidate, mid, level, true); } @@ -1802,9 +1785,9 @@ public: uint32_t rtcpFbFlags, VideoSessionConduit::FrameRequestType frameRequestMethod) { EnsureInit(); - sipcc::MediaConstraints constraints; + sipcc::OfferOptions options; - a1_->CreateOffer(constraints, OFFER_AV, SHOULD_SENDRECV_AV); + a1_->CreateOffer(options, OFFER_AV, SHOULD_SENDRECV_AV); a1_->SetLocal(TestObserver::OFFER, a1_->offer()); ParsedSDP sdpWrapper(a1_->offer()); @@ -1827,7 +1810,7 @@ public: CheckRtcpFbSdp(sdpWrapper.getSdp(), feedback); a2_->SetRemote(TestObserver::OFFER, sdpWrapper.getSdp()); - a2_->CreateAnswer(constraints, sdpWrapper.getSdp(), OFFER_AV | ANSWER_AV); + a2_->CreateAnswer(sdpWrapper.getSdp(), OFFER_AV | ANSWER_AV); CheckRtcpFbSdp(a2_->answer(), feedback); @@ -1969,310 +1952,265 @@ TEST_F(SignalingTest, JustInit) TEST_F(SignalingTest, CreateSetOffer) { - sipcc::MediaConstraints constraints; - CreateSetOffer(constraints, SHOULD_SENDRECV_AV); + sipcc::OfferOptions options; + CreateSetOffer(options, SHOULD_SENDRECV_AV); } -TEST_F(SignalingTest, CreateOfferAudioVideoConstraintUndefined) +TEST_F(SignalingTest, CreateOfferAudioVideoOptionUndefined) { - sipcc::MediaConstraints constraints; - CreateOffer(constraints, OFFER_AV, SHOULD_SENDRECV_AV); + sipcc::OfferOptions options; + CreateOffer(options, OFFER_AV, SHOULD_SENDRECV_AV); } TEST_F(SignalingTest, CreateOfferNoVideoStreamRecvVideo) { - sipcc::MediaConstraints constraints; - constraints.setBooleanConstraint("OfferToReceiveAudio", true, false); - constraints.setBooleanConstraint("OfferToReceiveVideo", true, false); - CreateOffer(constraints, OFFER_AUDIO, + sipcc::OfferOptions options; + options.setBooleanOption("OfferToReceiveAudio", true); + options.setBooleanOption("OfferToReceiveVideo", true); + CreateOffer(options, OFFER_AUDIO, SHOULD_SENDRECV_AUDIO | SHOULD_RECV_VIDEO); } TEST_F(SignalingTest, CreateOfferNoAudioStreamRecvAudio) { - sipcc::MediaConstraints constraints; - constraints.setBooleanConstraint("OfferToReceiveAudio", true, false); - constraints.setBooleanConstraint("OfferToReceiveVideo", true, false); - CreateOffer(constraints, OFFER_VIDEO, + sipcc::OfferOptions options; + options.setBooleanOption("OfferToReceiveAudio", true); + options.setBooleanOption("OfferToReceiveVideo", true); + CreateOffer(options, OFFER_VIDEO, SHOULD_RECV_AUDIO | SHOULD_SENDRECV_VIDEO); } TEST_F(SignalingTest, CreateOfferNoVideoStream) { - sipcc::MediaConstraints constraints; - constraints.setBooleanConstraint("OfferToReceiveAudio", true, false); - constraints.setBooleanConstraint("OfferToReceiveVideo", false, false); - CreateOffer(constraints, OFFER_AUDIO, + sipcc::OfferOptions options; + options.setBooleanOption("OfferToReceiveAudio", true); + options.setBooleanOption("OfferToReceiveVideo", false); + CreateOffer(options, OFFER_AUDIO, SHOULD_SENDRECV_AUDIO | SHOULD_OMIT_VIDEO); } TEST_F(SignalingTest, CreateOfferNoAudioStream) { - sipcc::MediaConstraints constraints; - constraints.setBooleanConstraint("OfferToReceiveAudio", false, false); - constraints.setBooleanConstraint("OfferToReceiveVideo", true, false); - CreateOffer(constraints, OFFER_VIDEO, + sipcc::OfferOptions options; + options.setBooleanOption("OfferToReceiveAudio", false); + options.setBooleanOption("OfferToReceiveVideo", true); + CreateOffer(options, OFFER_VIDEO, SHOULD_OMIT_AUDIO | SHOULD_SENDRECV_VIDEO); } TEST_F(SignalingTest, CreateOfferDontReceiveAudio) { - sipcc::MediaConstraints constraints; - constraints.setBooleanConstraint("OfferToReceiveAudio", false, false); - constraints.setBooleanConstraint("OfferToReceiveVideo", true, false); - CreateOffer(constraints, OFFER_AV, + sipcc::OfferOptions options; + options.setBooleanOption("OfferToReceiveAudio", false); + options.setBooleanOption("OfferToReceiveVideo", true); + CreateOffer(options, OFFER_AV, SHOULD_SEND_AUDIO | SHOULD_SENDRECV_VIDEO); } TEST_F(SignalingTest, CreateOfferDontReceiveVideo) { - sipcc::MediaConstraints constraints; - constraints.setBooleanConstraint("OfferToReceiveAudio", true, false); - constraints.setBooleanConstraint("OfferToReceiveVideo", false, false); - CreateOffer(constraints, OFFER_AV, + sipcc::OfferOptions options; + options.setBooleanOption("OfferToReceiveAudio", true); + options.setBooleanOption("OfferToReceiveVideo", false); + CreateOffer(options, OFFER_AV, SHOULD_SENDRECV_AUDIO | SHOULD_SEND_VIDEO); } // XXX Disabled pending resolution of Bug 840728 TEST_F(SignalingTest, DISABLED_CreateOfferRemoveAudioStream) { - sipcc::MediaConstraints constraints; - constraints.setBooleanConstraint("OfferToReceiveAudio", true, false); - constraints.setBooleanConstraint("OfferToReceiveVideo", true, false); - CreateOfferRemoveStream(constraints, DOMMediaStream::HINT_CONTENTS_AUDIO, + sipcc::OfferOptions options; + options.setBooleanOption("OfferToReceiveAudio", true); + options.setBooleanOption("OfferToReceiveVideo", true); + CreateOfferRemoveStream(options, DOMMediaStream::HINT_CONTENTS_AUDIO, SHOULD_RECV_AUDIO | SHOULD_SENDRECV_VIDEO); } // XXX Disabled pending resolution of Bug 840728 TEST_F(SignalingTest, DISABLED_CreateOfferDontReceiveAudioRemoveAudioStream) { - sipcc::MediaConstraints constraints; - constraints.setBooleanConstraint("OfferToReceiveAudio", false, false); - constraints.setBooleanConstraint("OfferToReceiveVideo", true, false); - CreateOfferRemoveStream(constraints, DOMMediaStream::HINT_CONTENTS_AUDIO, + sipcc::OfferOptions options; + options.setBooleanOption("OfferToReceiveAudio", false); + options.setBooleanOption("OfferToReceiveVideo", true); + CreateOfferRemoveStream(options, DOMMediaStream::HINT_CONTENTS_AUDIO, SHOULD_SENDRECV_VIDEO); } // XXX Disabled pending resolution of Bug 840728 TEST_F(SignalingTest, DISABLED_CreateOfferDontReceiveVideoRemoveVideoStream) { - sipcc::MediaConstraints constraints; - constraints.setBooleanConstraint("OfferToReceiveAudio", true, false); - constraints.setBooleanConstraint("OfferToReceiveVideo", false, false); - CreateOfferRemoveStream(constraints, DOMMediaStream::HINT_CONTENTS_VIDEO, + sipcc::OfferOptions options; + options.setBooleanOption("OfferToReceiveAudio", true); + options.setBooleanOption("OfferToReceiveVideo", false); + CreateOfferRemoveStream(options, DOMMediaStream::HINT_CONTENTS_VIDEO, SHOULD_SENDRECV_AUDIO); } TEST_F(SignalingTest, OfferAnswerNothingDisabled) { - sipcc::MediaConstraints constraints; - OfferAnswer(constraints, constraints, OFFER_AV | ANSWER_AV, false, + sipcc::OfferOptions options; + OfferAnswer(options, OFFER_AV | ANSWER_AV, false, SHOULD_SENDRECV_AV, SHOULD_SENDRECV_AV); } TEST_F(SignalingTest, OfferAnswerDontReceiveAudioOnOffer) { - sipcc::MediaConstraints offerconstraints; - offerconstraints.setBooleanConstraint("OfferToReceiveAudio", false, false); - offerconstraints.setBooleanConstraint("OfferToReceiveVideo", true, false); - sipcc::MediaConstraints answerconstraints; - answerconstraints.setBooleanConstraint("OfferToReceiveAudio", true, false); - answerconstraints.setBooleanConstraint("OfferToReceiveVideo", true, false); - OfferAnswer(offerconstraints, answerconstraints, OFFER_AV | ANSWER_AV, + sipcc::OfferOptions options; + options.setBooleanOption("OfferToReceiveAudio", false); + options.setBooleanOption("OfferToReceiveVideo", true); + OfferAnswer(options, OFFER_AV | ANSWER_AV, false, SHOULD_SEND_AUDIO | SHOULD_SENDRECV_VIDEO, SHOULD_RECV_AUDIO | SHOULD_SENDRECV_VIDEO); } TEST_F(SignalingTest, OfferAnswerDontReceiveVideoOnOffer) { - sipcc::MediaConstraints offerconstraints; - offerconstraints.setBooleanConstraint("OfferToReceiveAudio", true, false); - offerconstraints.setBooleanConstraint("OfferToReceiveVideo", false, false); - sipcc::MediaConstraints answerconstraints; - answerconstraints.setBooleanConstraint("OfferToReceiveAudio", true, false); - answerconstraints.setBooleanConstraint("OfferToReceiveVideo", true, false); - OfferAnswer(offerconstraints, answerconstraints, OFFER_AV | ANSWER_AV, + sipcc::OfferOptions options; + options.setBooleanOption("OfferToReceiveAudio", true); + options.setBooleanOption("OfferToReceiveVideo", false); + OfferAnswer(options, OFFER_AV | ANSWER_AV, false, SHOULD_SENDRECV_AUDIO | SHOULD_SEND_VIDEO, SHOULD_SENDRECV_AUDIO | SHOULD_RECV_VIDEO); } TEST_F(SignalingTest, OfferAnswerDontReceiveAudioOnAnswer) { - sipcc::MediaConstraints offerconstraints; - offerconstraints.setBooleanConstraint("OfferToReceiveAudio", true, false); - offerconstraints.setBooleanConstraint("OfferToReceiveVideo", true, false); - sipcc::MediaConstraints answerconstraints; - answerconstraints.setBooleanConstraint("OfferToReceiveAudio", false, false); - answerconstraints.setBooleanConstraint("OfferToReceiveVideo", true, false); - OfferAnswer(offerconstraints, answerconstraints, OFFER_AV | ANSWER_AV, + sipcc::OfferOptions options; + options.setBooleanOption("OfferToReceiveAudio", true); + options.setBooleanOption("OfferToReceiveVideo", true); + OfferAnswer(options, OFFER_AV | ANSWER_AV, false, SHOULD_SENDRECV_AV, SHOULD_SEND_AUDIO | SHOULD_SENDRECV_VIDEO); } TEST_F(SignalingTest, OfferAnswerDontReceiveVideoOnAnswer) { - sipcc::MediaConstraints offerconstraints; - offerconstraints.setBooleanConstraint("OfferToReceiveAudio", true, false); - offerconstraints.setBooleanConstraint("OfferToReceiveVideo", true, false); - sipcc::MediaConstraints answerconstraints; - answerconstraints.setBooleanConstraint("OfferToReceiveAudio", true, false); - answerconstraints.setBooleanConstraint("OfferToReceiveVideo", false, false); - OfferAnswer(offerconstraints, answerconstraints, OFFER_AV | ANSWER_AV, + sipcc::OfferOptions options; + options.setBooleanOption("OfferToReceiveAudio", true); + options.setBooleanOption("OfferToReceiveVideo", true); + OfferAnswer(options, OFFER_AV | ANSWER_AV, false, SHOULD_SENDRECV_AV, SHOULD_SENDRECV_AUDIO | SHOULD_SEND_VIDEO); } TEST_F(SignalingTest, OfferAnswerDontAddAudioStreamOnOfferRecvAudio) { - sipcc::MediaConstraints offerconstraints; - offerconstraints.setBooleanConstraint("OfferToReceiveAudio", true, false); - offerconstraints.setBooleanConstraint("OfferToReceiveVideo", true, false); - sipcc::MediaConstraints answerconstraints; - answerconstraints.setBooleanConstraint("OfferToReceiveAudio", true, false); - answerconstraints.setBooleanConstraint("OfferToReceiveVideo", true, false); - OfferAnswer(offerconstraints, answerconstraints, OFFER_VIDEO | ANSWER_AV, + sipcc::OfferOptions options; + options.setBooleanOption("OfferToReceiveAudio", true); + options.setBooleanOption("OfferToReceiveVideo", true); + OfferAnswer(options, OFFER_VIDEO | ANSWER_AV, false, SHOULD_RECV_AUDIO | SHOULD_SENDRECV_VIDEO, SHOULD_SEND_AUDIO | SHOULD_SENDRECV_VIDEO); } TEST_F(SignalingTest, OfferAnswerDontAddAudioStreamOnOffer) { - sipcc::MediaConstraints offerconstraints; - offerconstraints.setBooleanConstraint("OfferToReceiveAudio", false, false); - offerconstraints.setBooleanConstraint("OfferToReceiveVideo", true, false); - sipcc::MediaConstraints answerconstraints; - answerconstraints.setBooleanConstraint("OfferToReceiveAudio", true, false); - answerconstraints.setBooleanConstraint("OfferToReceiveVideo", true, false); - OfferAnswer(offerconstraints, answerconstraints, OFFER_VIDEO | ANSWER_AV, + sipcc::OfferOptions options; + options.setBooleanOption("OfferToReceiveAudio", false); + options.setBooleanOption("OfferToReceiveVideo", true); + OfferAnswer(options, OFFER_VIDEO | ANSWER_AV, false, SHOULD_OMIT_AUDIO | SHOULD_SENDRECV_VIDEO, SHOULD_OMIT_AUDIO | SHOULD_SENDRECV_VIDEO); } TEST_F(SignalingTest, OfferAnswerDontAddVideoStreamOnOfferRecvVideo) { - sipcc::MediaConstraints offerconstraints; - offerconstraints.setBooleanConstraint("OfferToReceiveAudio", true, false); - offerconstraints.setBooleanConstraint("OfferToReceiveVideo", true, false); - sipcc::MediaConstraints answerconstraints; - answerconstraints.setBooleanConstraint("OfferToReceiveAudio", true, false); - answerconstraints.setBooleanConstraint("OfferToReceiveVideo", true, false); - OfferAnswer(offerconstraints, answerconstraints, OFFER_AUDIO | ANSWER_AV, + sipcc::OfferOptions options; + options.setBooleanOption("OfferToReceiveAudio", true); + options.setBooleanOption("OfferToReceiveVideo", true); + OfferAnswer(options, OFFER_AUDIO | ANSWER_AV, false, SHOULD_SENDRECV_AUDIO | SHOULD_RECV_VIDEO, SHOULD_SENDRECV_AUDIO | SHOULD_SEND_VIDEO); } TEST_F(SignalingTest, OfferAnswerDontAddVideoStreamOnOffer) { - sipcc::MediaConstraints offerconstraints; - offerconstraints.setBooleanConstraint("OfferToReceiveAudio", true, false); - offerconstraints.setBooleanConstraint("OfferToReceiveVideo", false, false); - sipcc::MediaConstraints answerconstraints; - answerconstraints.setBooleanConstraint("OfferToReceiveAudio", true, false); - answerconstraints.setBooleanConstraint("OfferToReceiveVideo", true, false); - OfferAnswer(offerconstraints, answerconstraints, OFFER_AUDIO | ANSWER_AV, + sipcc::OfferOptions options; + options.setBooleanOption("OfferToReceiveAudio", true); + options.setBooleanOption("OfferToReceiveVideo", false); + OfferAnswer(options, OFFER_AUDIO | ANSWER_AV, false, SHOULD_SENDRECV_AUDIO | SHOULD_OMIT_VIDEO, SHOULD_SENDRECV_AUDIO | SHOULD_OMIT_VIDEO); } TEST_F(SignalingTest, OfferAnswerDontAddAudioStreamOnAnswer) { - sipcc::MediaConstraints offerconstraints; - offerconstraints.setBooleanConstraint("OfferToReceiveAudio", true, false); - offerconstraints.setBooleanConstraint("OfferToReceiveVideo", true, false); - sipcc::MediaConstraints answerconstraints; - answerconstraints.setBooleanConstraint("OfferToReceiveAudio", true, false); - answerconstraints.setBooleanConstraint("OfferToReceiveVideo", true, false); - OfferAnswer(offerconstraints, answerconstraints, OFFER_AV | ANSWER_VIDEO, + sipcc::OfferOptions options; + options.setBooleanOption("OfferToReceiveAudio", true); + options.setBooleanOption("OfferToReceiveVideo", true); + OfferAnswer(options, OFFER_AV | ANSWER_VIDEO, false, SHOULD_SENDRECV_AV, SHOULD_RECV_AUDIO | SHOULD_SENDRECV_VIDEO); } TEST_F(SignalingTest, OfferAnswerDontAddVideoStreamOnAnswer) { - sipcc::MediaConstraints offerconstraints; - offerconstraints.setBooleanConstraint("OfferToReceiveAudio", true, false); - offerconstraints.setBooleanConstraint("OfferToReceiveVideo", true, false); - sipcc::MediaConstraints answerconstraints; - answerconstraints.setBooleanConstraint("OfferToReceiveAudio", true, false); - answerconstraints.setBooleanConstraint("OfferToReceiveVideo", true, false); - OfferAnswer(offerconstraints, answerconstraints, OFFER_AV | ANSWER_AUDIO, + sipcc::OfferOptions options; + options.setBooleanOption("OfferToReceiveAudio", true); + options.setBooleanOption("OfferToReceiveVideo", true); + OfferAnswer(options, OFFER_AV | ANSWER_AUDIO, false, SHOULD_SENDRECV_AV, SHOULD_SENDRECV_AUDIO | SHOULD_RECV_VIDEO); } TEST_F(SignalingTest, OfferAnswerDontAddVideoStreamOnAnswerDontReceiveVideoOnAnswer) { - sipcc::MediaConstraints offerconstraints; - offerconstraints.setBooleanConstraint("OfferToReceiveAudio", true, false); - offerconstraints.setBooleanConstraint("OfferToReceiveVideo", true, false); - sipcc::MediaConstraints answerconstraints; - answerconstraints.setBooleanConstraint("OfferToReceiveAudio", true, false); - answerconstraints.setBooleanConstraint("OfferToReceiveVideo", false, false); - OfferAnswer(offerconstraints, answerconstraints, OFFER_AV | ANSWER_AUDIO, + sipcc::OfferOptions options; + options.setBooleanOption("OfferToReceiveAudio", true); + options.setBooleanOption("OfferToReceiveVideo", true); + OfferAnswer(options, OFFER_AV | ANSWER_AUDIO, false, SHOULD_SENDRECV_AV, SHOULD_SENDRECV_AUDIO ); } TEST_F(SignalingTest, OfferAnswerDontAddAudioStreamOnAnswerDontReceiveAudioOnAnswer) { - sipcc::MediaConstraints offerconstraints; - offerconstraints.setBooleanConstraint("OfferToReceiveAudio", true, false); - offerconstraints.setBooleanConstraint("OfferToReceiveVideo", true, false); - sipcc::MediaConstraints answerconstraints; - answerconstraints.setBooleanConstraint("OfferToReceiveAudio", false, false); - answerconstraints.setBooleanConstraint("OfferToReceiveVideo", true, false); - OfferAnswer(offerconstraints, answerconstraints, OFFER_AV | ANSWER_VIDEO, + sipcc::OfferOptions options; + options.setBooleanOption("OfferToReceiveAudio", true); + options.setBooleanOption("OfferToReceiveVideo", true); + OfferAnswer(options, OFFER_AV | ANSWER_VIDEO, false, SHOULD_SENDRECV_AV, SHOULD_REJECT_AUDIO | SHOULD_SENDRECV_VIDEO); } TEST_F(SignalingTest, OfferAnswerDontAddAudioStreamOnOfferDontReceiveAudioOnOffer) { - sipcc::MediaConstraints offerconstraints; - offerconstraints.setBooleanConstraint("OfferToReceiveAudio", false, false); - offerconstraints.setBooleanConstraint("OfferToReceiveVideo", true, false); - sipcc::MediaConstraints answerconstraints; - answerconstraints.setBooleanConstraint("OfferToReceiveAudio", true, false); - answerconstraints.setBooleanConstraint("OfferToReceiveVideo", true, false); - OfferAnswer(offerconstraints, answerconstraints, OFFER_VIDEO | ANSWER_AV, + sipcc::OfferOptions options; + options.setBooleanOption("OfferToReceiveAudio", false); + options.setBooleanOption("OfferToReceiveVideo", true); + OfferAnswer(options, OFFER_VIDEO | ANSWER_AV, false, SHOULD_SENDRECV_VIDEO, SHOULD_SENDRECV_VIDEO); } TEST_F(SignalingTest, OfferAnswerDontAddVideoStreamOnOfferDontReceiveVideoOnOffer) { - sipcc::MediaConstraints offerconstraints; - offerconstraints.setBooleanConstraint("OfferToReceiveAudio", true, false); - offerconstraints.setBooleanConstraint("OfferToReceiveVideo", false, false); - sipcc::MediaConstraints answerconstraints; - answerconstraints.setBooleanConstraint("OfferToReceiveAudio", true, false); - answerconstraints.setBooleanConstraint("OfferToReceiveVideo", true, false); - OfferAnswer(offerconstraints, answerconstraints, OFFER_AUDIO | ANSWER_AV, + sipcc::OfferOptions options; + options.setBooleanOption("OfferToReceiveAudio", true); + options.setBooleanOption("OfferToReceiveVideo", false); + OfferAnswer(options, OFFER_AUDIO | ANSWER_AV, false, SHOULD_SENDRECV_AUDIO | SHOULD_OMIT_VIDEO, SHOULD_SENDRECV_AUDIO | SHOULD_OMIT_VIDEO); } TEST_F(SignalingTest, OfferAnswerDontReceiveAudioNoAudioStreamOnOfferDontReceiveVideoOnAnswer) { - sipcc::MediaConstraints offerconstraints; - offerconstraints.setBooleanConstraint("OfferToReceiveAudio", false, false); - offerconstraints.setBooleanConstraint("OfferToReceiveVideo", true, false); - sipcc::MediaConstraints answerconstraints; - answerconstraints.setBooleanConstraint("OfferToReceiveAudio", true, false); - answerconstraints.setBooleanConstraint("OfferToReceiveVideo", false, false); - OfferAnswer(offerconstraints, answerconstraints, OFFER_VIDEO | ANSWER_AV, + sipcc::OfferOptions options; + options.setBooleanOption("OfferToReceiveAudio", false); + options.setBooleanOption("OfferToReceiveVideo", true); + OfferAnswer(options, OFFER_VIDEO | ANSWER_AV, false, SHOULD_SENDRECV_VIDEO, SHOULD_SEND_VIDEO); } TEST_F(SignalingTest, CreateOfferAddCandidate) { - sipcc::MediaConstraints constraints; - CreateOfferAddCandidate(constraints, strSampleCandidate.c_str(), + sipcc::OfferOptions options; + CreateOfferAddCandidate(options, strSampleCandidate.c_str(), strSampleMid.c_str(), nSamplelevel, SHOULD_SENDRECV_AV); } TEST_F(SignalingTest, AddIceCandidateEarly) { - sipcc::MediaConstraints constraints; + sipcc::OfferOptions options; AddIceCandidateEarly(strSampleCandidate.c_str(), strSampleMid.c_str(), nSamplelevel); } @@ -2281,58 +2219,55 @@ TEST_F(SignalingTest, AddIceCandidateEarly) // through what actually needs to be tested here. TEST_F(SignalingTest, DISABLED_OfferAnswerReNegotiateOfferAnswerDontReceiveVideoNoVideoStream) { - sipcc::MediaConstraints aconstraints; - aconstraints.setBooleanConstraint("OfferToReceiveAudio", true, false); - aconstraints.setBooleanConstraint("OfferToReceiveVideo", true, false); + sipcc::OfferOptions aoptions; + aoptions.setBooleanOption("OfferToReceiveAudio", true); + aoptions.setBooleanOption("OfferToReceiveVideo", true); - sipcc::MediaConstraints bconstraints; - bconstraints.setBooleanConstraint("OfferToReceiveAudio", true, false); - bconstraints.setBooleanConstraint("OfferToReceiveVideo", false, false); + sipcc::OfferOptions boptions; + boptions.setBooleanOption("OfferToReceiveAudio", true); + boptions.setBooleanOption("OfferToReceiveVideo", false); - OfferAnswer(aconstraints, aconstraints, OFFER_AV | ANSWER_AV, + OfferAnswer(aoptions, OFFER_AV | ANSWER_AV, false, SHOULD_SENDRECV_AV, SHOULD_SENDRECV_AV); - OfferAnswer(bconstraints, bconstraints, OFFER_AUDIO | ANSWER_AV, + OfferAnswer(boptions, OFFER_AUDIO | ANSWER_AV, false, SHOULD_SENDRECV_AUDIO | SHOULD_SEND_VIDEO, SHOULD_SENDRECV_AUDIO | SHOULD_INACTIVE_VIDEO); } -TEST_F(SignalingTest, OfferAnswerDontAddAudioStreamOnAnswerNoConstraints) +TEST_F(SignalingTest, OfferAnswerDontAddAudioStreamOnAnswerNoOptions) { - sipcc::MediaConstraints offerconstraints; - offerconstraints.setBooleanConstraint("OfferToReceiveAudio", true, false); - offerconstraints.setBooleanConstraint("OfferToReceiveVideo", true, false); - sipcc::MediaConstraints answerconstraints; - OfferAnswer(offerconstraints, answerconstraints, OFFER_AV | ANSWER_VIDEO, + sipcc::OfferOptions options; + options.setBooleanOption("OfferToReceiveAudio", true); + options.setBooleanOption("OfferToReceiveVideo", true); + OfferAnswer(options, OFFER_AV | ANSWER_VIDEO, false, SHOULD_SENDRECV_AV, SHOULD_RECV_AUDIO | SHOULD_SENDRECV_VIDEO); } -TEST_F(SignalingTest, OfferAnswerDontAddVideoStreamOnAnswerNoConstraints) +TEST_F(SignalingTest, OfferAnswerDontAddVideoStreamOnAnswerNoOptions) { - sipcc::MediaConstraints offerconstraints; - offerconstraints.setBooleanConstraint("OfferToReceiveAudio", true, false); - offerconstraints.setBooleanConstraint("OfferToReceiveVideo", true, false); - sipcc::MediaConstraints answerconstraints; - OfferAnswer(offerconstraints, answerconstraints, OFFER_AV | ANSWER_AUDIO, + sipcc::OfferOptions options; + options.setBooleanOption("OfferToReceiveAudio", true); + options.setBooleanOption("OfferToReceiveVideo", true); + OfferAnswer(options, OFFER_AV | ANSWER_AUDIO, false, SHOULD_SENDRECV_AV, SHOULD_SENDRECV_AUDIO | SHOULD_RECV_VIDEO); } -TEST_F(SignalingTest, OfferAnswerDontAddAudioVideoStreamsOnAnswerNoConstraints) +TEST_F(SignalingTest, OfferAnswerDontAddAudioVideoStreamsOnAnswerNoOptions) { - sipcc::MediaConstraints offerconstraints; - offerconstraints.setBooleanConstraint("OfferToReceiveAudio", true, false); - offerconstraints.setBooleanConstraint("OfferToReceiveVideo", true, false); - sipcc::MediaConstraints answerconstraints; - OfferAnswer(offerconstraints, answerconstraints, OFFER_AV | ANSWER_NONE, + sipcc::OfferOptions options; + options.setBooleanOption("OfferToReceiveAudio", true); + options.setBooleanOption("OfferToReceiveVideo", true); + OfferAnswer(options, OFFER_AV | ANSWER_NONE, false, SHOULD_SENDRECV_AV, SHOULD_RECV_AUDIO | SHOULD_RECV_VIDEO); } TEST_F(SignalingTest, FullCall) { - sipcc::MediaConstraints constraints; - OfferAnswer(constraints, constraints, OFFER_AV | ANSWER_AV, + sipcc::OfferOptions options; + OfferAnswer(options, OFFER_AV | ANSWER_AV, true, SHOULD_SENDRECV_AV, SHOULD_SENDRECV_AV); // Wait for some data to get written @@ -2360,8 +2295,8 @@ TEST_F(SignalingTest, FullCall) TEST_F(SignalingTest, FullCallAudioOnly) { - sipcc::MediaConstraints constraints; - OfferAnswer(constraints, constraints, OFFER_AUDIO | ANSWER_AUDIO, + sipcc::OfferOptions options; + OfferAnswer(options, OFFER_AUDIO | ANSWER_AUDIO, true, SHOULD_SENDRECV_AUDIO, SHOULD_SENDRECV_AUDIO); // Wait for some data to get written @@ -2377,13 +2312,15 @@ TEST_F(SignalingTest, FullCallAudioOnly) ASSERT_GE(a2_->GetPacketsReceived(0), 40); } -TEST_F(SignalingTest, FullCallAnswererRejectsVideo) +// FIXME -- reject offered stream by .stop()ing the MST that was offered instead, +// or by setting .active property to false on the created RTPReceiver object. +TEST_F(SignalingTest, DISABLED_FullCallAnswererRejectsVideo) { - sipcc::MediaConstraints offerconstraints; - sipcc::MediaConstraints answerconstraints; - answerconstraints.setBooleanConstraint("OfferToReceiveAudio", true, false); - answerconstraints.setBooleanConstraint("OfferToReceiveVideo", false, false); - OfferAnswer(offerconstraints, answerconstraints, OFFER_AV | ANSWER_AUDIO, + sipcc::OfferOptions offeroptions; + sipcc::OfferOptions answeroptions; + answeroptions.setBooleanOption("offerToReceiveAudio", true); + answeroptions.setBooleanOption("offerToReceiveVideo", false); + OfferAnswer(offeroptions, OFFER_AV | ANSWER_AUDIO, true, SHOULD_SENDRECV_AV, SHOULD_SENDRECV_AUDIO); // Wait for some data to get written @@ -2401,8 +2338,8 @@ TEST_F(SignalingTest, FullCallAnswererRejectsVideo) TEST_F(SignalingTest, FullCallVideoOnly) { - sipcc::MediaConstraints constraints; - OfferAnswer(constraints, constraints, OFFER_VIDEO | ANSWER_VIDEO, + sipcc::OfferOptions options; + OfferAnswer(options, OFFER_VIDEO | ANSWER_VIDEO, true, SHOULD_SENDRECV_VIDEO, SHOULD_SENDRECV_VIDEO); // If we could check for video packets, we would wait for some to be written @@ -2426,18 +2363,16 @@ TEST_F(SignalingTest, FullCallVideoOnly) TEST_F(SignalingTest, OfferModifiedAnswer) { - sipcc::MediaConstraints constraints; - OfferModifiedAnswer(constraints, constraints, SHOULD_SENDRECV_AUDIO, - SHOULD_SENDRECV_AUDIO); + sipcc::OfferOptions options; + OfferModifiedAnswer(options, SHOULD_SENDRECV_AUDIO, SHOULD_SENDRECV_AUDIO); a1_->CloseSendStreams(); a2_->CloseReceiveStreams(); } TEST_F(SignalingTest, FullCallTrickle) { - sipcc::MediaConstraints constraints; - OfferAnswerTrickle(constraints, constraints, - SHOULD_SENDRECV_AV, SHOULD_SENDRECV_AV); + sipcc::OfferOptions options; + OfferAnswerTrickle(options, SHOULD_SENDRECV_AV, SHOULD_SENDRECV_AV); std::cerr << "ICE handshake completed" << std::endl; @@ -2454,8 +2389,8 @@ TEST_F(SignalingTest, FullCallTrickle) // Offer answer with trickle but with chrome-style candidates TEST_F(SignalingTest, FullCallTrickleChrome) { - sipcc::MediaConstraints constraints; - OfferAnswerTrickleChrome(constraints, constraints, + sipcc::OfferOptions options; + OfferAnswerTrickleChrome(options, SHOULD_SENDRECV_AV, SHOULD_SENDRECV_AV); std::cerr << "ICE handshake completed" << std::endl; @@ -2475,15 +2410,15 @@ TEST_F(SignalingTest, AudioOnlyG711Call) { EnsureInit(); - sipcc::MediaConstraints constraints; + sipcc::OfferOptions options; const std::string& offer(strG711SdpOffer); std::cout << "Setting offer to:" << std::endl << indent(offer) << std::endl; a2_->SetRemote(TestObserver::OFFER, offer); std::cout << "Creating answer:" << std::endl; - a2_->CreateAnswer(constraints, offer, OFFER_AUDIO | ANSWER_AUDIO, - DONT_CHECK_AUDIO | DONT_CHECK_VIDEO | DONT_CHECK_DATA); + a2_->CreateAnswer(offer, OFFER_AUDIO | ANSWER_AUDIO, + DONT_CHECK_AUDIO | DONT_CHECK_VIDEO | DONT_CHECK_DATA); std::string answer = a2_->answer(); @@ -2507,7 +2442,6 @@ TEST_F(SignalingTest, IncomingOfferIceLite) { EnsureInit(); - sipcc::MediaConstraints constraints; std::string offer = "v=0\r\n" "o=- 1936463 1936463 IN IP4 148.147.200.251\r\n" @@ -2534,7 +2468,7 @@ TEST_F(SignalingTest, IncomingOfferIceLite) a2_->SetRemote(TestObserver::OFFER, offer); std::cout << "Creating answer:" << std::endl; - a2_->CreateAnswer(constraints, offer, OFFER_AUDIO | ANSWER_AUDIO); + a2_->CreateAnswer(offer, OFFER_AUDIO | ANSWER_AUDIO); a2_->SetLocal(TestObserver::ANSWER, a2_->answer()); ASSERT_EQ(a2_->pc->media()->ice_ctx()->GetControlling(), @@ -2546,8 +2480,6 @@ TEST_F(SignalingTest, ChromeOfferAnswer) { EnsureInit(); - sipcc::MediaConstraints constraints; - // This is captured SDP from an early interop attempt with Chrome. std::string offer = "v=0\r\n" @@ -2617,7 +2549,7 @@ TEST_F(SignalingTest, ChromeOfferAnswer) a2_->SetRemote(TestObserver::OFFER, offer); std::cout << "Creating answer:" << std::endl; - a2_->CreateAnswer(constraints, offer, OFFER_AUDIO | ANSWER_AUDIO); + a2_->CreateAnswer(offer, OFFER_AUDIO | ANSWER_AUDIO); std::string answer = a2_->answer(); } @@ -2627,10 +2559,6 @@ TEST_F(SignalingTest, FullChromeHandshake) { EnsureInit(); - sipcc::MediaConstraints constraints; - constraints.setBooleanConstraint("OfferToReceiveAudio", true, false); - constraints.setBooleanConstraint("OfferToReceiveVideo", true, false); - std::string offer = "v=0\r\n" "o=- 3835809413 2 IN IP4 127.0.0.1\r\n" "s=-\r\n" @@ -2689,7 +2617,7 @@ TEST_F(SignalingTest, FullChromeHandshake) a2_->SetRemote(TestObserver::OFFER, offer); std::cout << "Creating answer:" << std::endl; - a2_->CreateAnswer(constraints, offer, OFFER_AUDIO | ANSWER_AUDIO); + a2_->CreateAnswer(offer, OFFER_AUDIO | ANSWER_AUDIO); std::cout << "Setting answer" << std::endl; a2_->SetLocal(TestObserver::ANSWER, a2_->answer()); @@ -2703,7 +2631,6 @@ TEST_F(SignalingTest, DISABLED_OfferAllDynamicTypes) { EnsureInit(); - sipcc::MediaConstraints constraints; std::string offer; for (int i = 96; i < 128; i++) { @@ -2735,7 +2662,7 @@ TEST_F(SignalingTest, DISABLED_OfferAllDynamicTypes) a2_->SetRemote(TestObserver::OFFER, offer); //std::cout << "Creating answer:" << std::endl; - a2_->CreateAnswer(constraints, offer, OFFER_AUDIO | ANSWER_AUDIO); + a2_->CreateAnswer(offer, OFFER_AUDIO | ANSWER_AUDIO); std::string answer = a2_->answer(); @@ -2746,8 +2673,8 @@ TEST_F(SignalingTest, DISABLED_OfferAllDynamicTypes) TEST_F(SignalingTest, OfferAnswerCheckDescriptions) { - sipcc::MediaConstraints constraints; - OfferAnswer(constraints, constraints, OFFER_AV | ANSWER_AV, true, + sipcc::OfferOptions options; + OfferAnswer(options, OFFER_AV | ANSWER_AV, true, SHOULD_SENDRECV_AV, SHOULD_SENDRECV_AV); std::cout << "Caller's Local Description: " << std::endl @@ -2769,8 +2696,8 @@ TEST_F(SignalingTest, OfferAnswerCheckDescriptions) TEST_F(SignalingTest, CheckTrickleSdpChange) { - sipcc::MediaConstraints constraints; - OfferAnswerTrickle(constraints, constraints, + sipcc::OfferOptions options; + OfferAnswerTrickle(options, SHOULD_SENDRECV_AV, SHOULD_SENDRECV_AV); std::cerr << "ICE handshake completed" << std::endl; @@ -2813,7 +2740,6 @@ TEST_F(SignalingTest, ipAddrAnyOffer) { EnsureInit(); - sipcc::MediaConstraints constraints; std::string offer = "v=0\r\n" "o=- 1 1 IN IP4 127.0.0.1\r\n" @@ -2831,7 +2757,7 @@ TEST_F(SignalingTest, ipAddrAnyOffer) a2_->SetRemote(TestObserver::OFFER, offer); ASSERT_TRUE(a2_->pObserver->state == TestObserver::stateSuccess); - a2_->CreateAnswer(constraints, offer, OFFER_AUDIO | ANSWER_AUDIO); + a2_->CreateAnswer(offer, OFFER_AUDIO | ANSWER_AUDIO); ASSERT_TRUE(a2_->pObserver->state == TestObserver::stateSuccess); std::string answer = a2_->answer(); ASSERT_NE(answer.find("a=sendrecv"), std::string::npos); @@ -2904,8 +2830,8 @@ TEST_F(SignalingTest, SetLocalAnswerInStable) { EnsureInit(); - sipcc::MediaConstraints constraints; - CreateOffer(constraints, OFFER_AUDIO, SHOULD_SENDRECV_AUDIO); + sipcc::OfferOptions options; + CreateOffer(options, OFFER_AUDIO, SHOULD_SENDRECV_AUDIO); // The signaling state will remain "stable" because the // SetLocalDescription call fails. @@ -2927,8 +2853,8 @@ TEST_F(SignalingTest, SetRemoteAnswerInStable) { } TEST_F(SignalingTest, SetLocalAnswerInHaveLocalOffer) { - sipcc::MediaConstraints constraints; - CreateOffer(constraints, OFFER_AUDIO, SHOULD_SENDRECV_AUDIO); + sipcc::OfferOptions options; + CreateOffer(options, OFFER_AUDIO, SHOULD_SENDRECV_AUDIO); a1_->SetLocal(TestObserver::OFFER, a1_->offer()); ASSERT_EQ(a1_->pObserver->lastStatusCode, sipcc::PeerConnectionImpl::kNoError); @@ -2942,8 +2868,8 @@ TEST_F(SignalingTest, SetLocalAnswerInHaveLocalOffer) { } TEST_F(SignalingTest, SetRemoteOfferInHaveLocalOffer) { - sipcc::MediaConstraints constraints; - CreateOffer(constraints, OFFER_AUDIO, SHOULD_SENDRECV_AUDIO); + sipcc::OfferOptions options; + CreateOffer(options, OFFER_AUDIO, SHOULD_SENDRECV_AUDIO); a1_->SetLocal(TestObserver::OFFER, a1_->offer()); ASSERT_EQ(a1_->pObserver->lastStatusCode, sipcc::PeerConnectionImpl::kNoError); @@ -2957,8 +2883,8 @@ TEST_F(SignalingTest, SetRemoteOfferInHaveLocalOffer) { } TEST_F(SignalingTest, SetLocalOfferInHaveRemoteOffer) { - sipcc::MediaConstraints constraints; - CreateOffer(constraints, OFFER_AUDIO, SHOULD_SENDRECV_AUDIO); + sipcc::OfferOptions options; + CreateOffer(options, OFFER_AUDIO, SHOULD_SENDRECV_AUDIO); a2_->SetRemote(TestObserver::OFFER, a1_->offer()); ASSERT_EQ(a2_->pObserver->lastStatusCode, sipcc::PeerConnectionImpl::kNoError); @@ -2972,8 +2898,8 @@ TEST_F(SignalingTest, SetLocalOfferInHaveRemoteOffer) { } TEST_F(SignalingTest, SetRemoteAnswerInHaveRemoteOffer) { - sipcc::MediaConstraints constraints; - CreateOffer(constraints, OFFER_AUDIO, SHOULD_SENDRECV_AUDIO); + sipcc::OfferOptions options; + CreateOffer(options, OFFER_AUDIO, SHOULD_SENDRECV_AUDIO); a2_->SetRemote(TestObserver::OFFER, a1_->offer()); ASSERT_EQ(a2_->pObserver->lastStatusCode, sipcc::PeerConnectionImpl::kNoError); @@ -2988,8 +2914,8 @@ TEST_F(SignalingTest, SetRemoteAnswerInHaveRemoteOffer) { // Disabled until the spec adds a failure callback to addStream TEST_F(SignalingTest, DISABLED_AddStreamInHaveLocalOffer) { - sipcc::MediaConstraints constraints; - CreateOffer(constraints, OFFER_AUDIO, SHOULD_SENDRECV_AUDIO); + sipcc::OfferOptions options; + CreateOffer(options, OFFER_AUDIO, SHOULD_SENDRECV_AUDIO); a1_->SetLocal(TestObserver::OFFER, a1_->offer()); ASSERT_EQ(a1_->pObserver->lastStatusCode, sipcc::PeerConnectionImpl::kNoError); @@ -3000,8 +2926,8 @@ TEST_F(SignalingTest, DISABLED_AddStreamInHaveLocalOffer) { // Disabled until the spec adds a failure callback to removeStream TEST_F(SignalingTest, DISABLED_RemoveStreamInHaveLocalOffer) { - sipcc::MediaConstraints constraints; - CreateOffer(constraints, OFFER_AUDIO, SHOULD_SENDRECV_AUDIO); + sipcc::OfferOptions options; + CreateOffer(options, OFFER_AUDIO, SHOULD_SENDRECV_AUDIO); a1_->SetLocal(TestObserver::OFFER, a1_->offer()); ASSERT_EQ(a1_->pObserver->lastStatusCode, sipcc::PeerConnectionImpl::kNoError); @@ -3011,8 +2937,8 @@ TEST_F(SignalingTest, DISABLED_RemoveStreamInHaveLocalOffer) { } TEST_F(SignalingTest, AddCandidateInHaveLocalOffer) { - sipcc::MediaConstraints constraints; - CreateOffer(constraints, OFFER_AUDIO, SHOULD_SENDRECV_AUDIO); + sipcc::OfferOptions options; + CreateOffer(options, OFFER_AUDIO, SHOULD_SENDRECV_AUDIO); a1_->SetLocal(TestObserver::OFFER, a1_->offer()); ASSERT_EQ(a1_->pObserver->lastStatusCode, sipcc::PeerConnectionImpl::kNoError); @@ -3024,8 +2950,8 @@ TEST_F(SignalingTest, AddCandidateInHaveLocalOffer) { TEST_F(SignalingAgentTest, CreateOffer) { CreateAgent(); - sipcc::MediaConstraints constraints; - agent(0)->CreateOffer(constraints, OFFER_AUDIO, SHOULD_SENDRECV_AUDIO); + sipcc::OfferOptions options; + agent(0)->CreateOffer(options, OFFER_AUDIO, SHOULD_SENDRECV_AUDIO); PR_Sleep(20000); } @@ -3039,8 +2965,8 @@ TEST_F(SignalingAgentTest, CreateOfferTrickleTestServer) { TestStunServer::GetInstance()->port(), false); - sipcc::MediaConstraints constraints; - agent(0)->CreateOffer(constraints, OFFER_AUDIO, SHOULD_SENDRECV_AUDIO); + sipcc::OfferOptions options; + agent(0)->CreateOffer(options, OFFER_AUDIO, SHOULD_SENDRECV_AUDIO); // Verify that the bogus addr is not there. ASSERT_FALSE(agent(0)->OfferContains(kBogusSrflxAddress)); @@ -3068,8 +2994,8 @@ TEST_F(SignalingAgentTest, CreateOfferSetLocalTrickleTestServer) { TestStunServer::GetInstance()->port(), false); - sipcc::MediaConstraints constraints; - agent(0)->CreateOffer(constraints, OFFER_AUDIO, SHOULD_SENDRECV_AUDIO); + sipcc::OfferOptions options; + agent(0)->CreateOffer(options, OFFER_AUDIO, SHOULD_SENDRECV_AUDIO); // Verify that the bogus addr is not there. ASSERT_FALSE(agent(0)->OfferContains(kBogusSrflxAddress)); @@ -3110,8 +3036,7 @@ TEST_F(SignalingAgentTest, CreateAnswerSetLocalTrickleTestServer) { ASSERT_EQ(agent(0)->pObserver->lastStatusCode, sipcc::PeerConnectionImpl::kNoError); - sipcc::MediaConstraints constraints; - agent(0)->CreateAnswer(constraints, offer, ANSWER_AUDIO, DONT_CHECK_AUDIO); + agent(0)->CreateAnswer(offer, ANSWER_AUDIO, DONT_CHECK_AUDIO); // Verify that the bogus addr is not there. ASSERT_FALSE(agent(0)->AnswerContains(kBogusSrflxAddress)); @@ -3162,7 +3087,7 @@ TEST_F(SignalingTest, missingUfrag) { EnsureInit(); - sipcc::MediaConstraints constraints; + sipcc::OfferOptions options; std::string offer = "v=0\r\n" "o=Mozilla-SIPUA 2208 0 IN IP4 0.0.0.0\r\n" @@ -3204,7 +3129,7 @@ TEST_F(SignalingTest, missingUfrag) // Need to create an offer, since that's currently required by our // FSM. This may change in the future. - a1_->CreateOffer(constraints, OFFER_AV, SHOULD_SENDRECV_AV); + a1_->CreateOffer(options, OFFER_AV, SHOULD_SENDRECV_AV); a1_->SetLocal(TestObserver::OFFER, offer, true); // We now detect the missing ICE parameters at SetRemoteDescription a2_->SetRemote(TestObserver::OFFER, offer, true, @@ -3216,16 +3141,16 @@ TEST_F(SignalingTest, AudioOnlyCalleeNoRtcpMux) { EnsureInit(); - sipcc::MediaConstraints constraints; + sipcc::OfferOptions options; - a1_->CreateOffer(constraints, OFFER_AUDIO, SHOULD_SENDRECV_AUDIO); + a1_->CreateOffer(options, OFFER_AUDIO, SHOULD_SENDRECV_AUDIO); a1_->SetLocal(TestObserver::OFFER, a1_->offer(), false); ParsedSDP sdpWrapper(a1_->offer()); sdpWrapper.DeleteLine("a=rtcp-mux"); std::cout << "Modified SDP " << std::endl << indent(sdpWrapper.getSdp()) << std::endl; a2_->SetRemote(TestObserver::OFFER, sdpWrapper.getSdp(), false); - a2_->CreateAnswer(constraints, sdpWrapper.getSdp(), + a2_->CreateAnswer(sdpWrapper.getSdp(), OFFER_AUDIO | ANSWER_AUDIO); a2_->SetLocal(TestObserver::ANSWER, a2_->answer(), false); a1_->SetRemote(TestObserver::ANSWER, a2_->answer(), false); @@ -3260,16 +3185,16 @@ TEST_F(SignalingTest, FullCallAudioNoMuxVideoMux) { EnsureInit(); - sipcc::MediaConstraints constraints; + sipcc::OfferOptions options; - a1_->CreateOffer(constraints, OFFER_AV, SHOULD_SENDRECV_AV); + a1_->CreateOffer(options, OFFER_AV, SHOULD_SENDRECV_AV); a1_->SetLocal(TestObserver::OFFER, a1_->offer(), false); ParsedSDP sdpWrapper(a1_->offer()); sdpWrapper.DeleteLine("a=rtcp-mux"); std::cout << "Modified SDP " << std::endl << indent(sdpWrapper.getSdp()) << std::endl; a2_->SetRemote(TestObserver::OFFER, sdpWrapper.getSdp(), false); - a2_->CreateAnswer(constraints, sdpWrapper.getSdp(), OFFER_AV | ANSWER_AV); + a2_->CreateAnswer(sdpWrapper.getSdp(), OFFER_AV | ANSWER_AV); a2_->SetLocal(TestObserver::ANSWER, a2_->answer(), false); a1_->SetRemote(TestObserver::ANSWER, a2_->answer(), false); @@ -3315,8 +3240,8 @@ TEST_F(SignalingTest, FullCallAudioNoMuxVideoMux) TEST_F(SignalingTest, RtcpFbInOffer) { EnsureInit(); - sipcc::MediaConstraints constraints; - a1_->CreateOffer(constraints, OFFER_AV, SHOULD_SENDRECV_AV); + sipcc::OfferOptions options; + a1_->CreateOffer(options, OFFER_AV, SHOULD_SENDRECV_AV); const char *expected[] = { "nack", "nack pli", "ccm fir" }; CheckRtcpFbSdp(a1_->offer(), ARRAY_TO_SET(std::string, expected)); } @@ -3391,10 +3316,10 @@ TEST_F(SignalingTest, AudioCallForceDtlsRoles) { EnsureInit(); - sipcc::MediaConstraints constraints; + sipcc::OfferOptions options; size_t match; - a1_->CreateOffer(constraints, OFFER_AUDIO, SHOULD_SENDRECV_AUDIO); + a1_->CreateOffer(options, OFFER_AUDIO, SHOULD_SENDRECV_AUDIO); // By default the offer should give actpass std::string offer(a1_->offer()); @@ -3409,7 +3334,7 @@ TEST_F(SignalingTest, AudioCallForceDtlsRoles) a1_->SetLocal(TestObserver::OFFER, offer.c_str(), false); a2_->SetRemote(TestObserver::OFFER, offer.c_str(), false); - a2_->CreateAnswer(constraints, offer.c_str(), OFFER_AUDIO | ANSWER_AUDIO); + a2_->CreateAnswer(offer.c_str(), OFFER_AUDIO | ANSWER_AUDIO); // Now the answer should contain a=setup:active std::string answer(a2_->answer()); @@ -3441,10 +3366,10 @@ TEST_F(SignalingTest, AudioCallReverseDtlsRoles) { EnsureInit(); - sipcc::MediaConstraints constraints; + sipcc::OfferOptions options; size_t match; - a1_->CreateOffer(constraints, OFFER_AUDIO, SHOULD_SENDRECV_AUDIO); + a1_->CreateOffer(options, OFFER_AUDIO, SHOULD_SENDRECV_AUDIO); // By default the offer should give actpass std::string offer(a1_->offer()); @@ -3459,7 +3384,7 @@ TEST_F(SignalingTest, AudioCallReverseDtlsRoles) a1_->SetLocal(TestObserver::OFFER, offer.c_str(), false); a2_->SetRemote(TestObserver::OFFER, offer.c_str(), false); - a2_->CreateAnswer(constraints, offer.c_str(), OFFER_AUDIO | ANSWER_AUDIO); + a2_->CreateAnswer(offer.c_str(), OFFER_AUDIO | ANSWER_AUDIO); // Now the answer should contain a=setup:passive std::string answer(a2_->answer()); @@ -3492,10 +3417,10 @@ TEST_F(SignalingTest, AudioCallMismatchDtlsRoles) { EnsureInit(); - sipcc::MediaConstraints constraints; + sipcc::OfferOptions options; size_t match; - a1_->CreateOffer(constraints, OFFER_AUDIO, SHOULD_SENDRECV_AUDIO); + a1_->CreateOffer(options, OFFER_AUDIO, SHOULD_SENDRECV_AUDIO); // By default the offer should give actpass std::string offer(a1_->offer()); @@ -3503,7 +3428,7 @@ TEST_F(SignalingTest, AudioCallMismatchDtlsRoles) ASSERT_NE(match, std::string::npos); a1_->SetLocal(TestObserver::OFFER, offer.c_str(), false); a2_->SetRemote(TestObserver::OFFER, offer.c_str(), false); - a2_->CreateAnswer(constraints, offer.c_str(), OFFER_AUDIO | ANSWER_AUDIO); + a2_->CreateAnswer(offer.c_str(), OFFER_AUDIO | ANSWER_AUDIO); // Now the answer should contain a=setup:active std::string answer(a2_->answer()); @@ -3542,10 +3467,10 @@ TEST_F(SignalingTest, AudioCallGarbageSetup) { EnsureInit(); - sipcc::MediaConstraints constraints; + sipcc::OfferOptions options; size_t match; - a1_->CreateOffer(constraints, OFFER_AUDIO, SHOULD_SENDRECV_AUDIO); + a1_->CreateOffer(options, OFFER_AUDIO, SHOULD_SENDRECV_AUDIO); // By default the offer should give actpass std::string offer(a1_->offer()); @@ -3559,7 +3484,7 @@ TEST_F(SignalingTest, AudioCallGarbageSetup) a1_->SetLocal(TestObserver::OFFER, offer.c_str(), false); a2_->SetRemote(TestObserver::OFFER, offer.c_str(), false); - a2_->CreateAnswer(constraints, offer.c_str(), OFFER_AUDIO | ANSWER_AUDIO); + a2_->CreateAnswer(offer.c_str(), OFFER_AUDIO | ANSWER_AUDIO); // Now the answer should contain a=setup:active std::string answer(a2_->answer()); @@ -3591,10 +3516,10 @@ TEST_F(SignalingTest, AudioCallOfferNoSetupOrConnection) { EnsureInit(); - sipcc::MediaConstraints constraints; + sipcc::OfferOptions options; size_t match; - a1_->CreateOffer(constraints, OFFER_AUDIO, SHOULD_SENDRECV_AUDIO); + a1_->CreateOffer(options, OFFER_AUDIO, SHOULD_SENDRECV_AUDIO); // By default the offer should give setup:actpass std::string offer(a1_->offer()); @@ -3607,7 +3532,7 @@ TEST_F(SignalingTest, AudioCallOfferNoSetupOrConnection) a1_->SetLocal(TestObserver::OFFER, offer.c_str(), false); a2_->SetRemote(TestObserver::OFFER, offer.c_str(), false); - a2_->CreateAnswer(constraints, offer.c_str(), OFFER_AUDIO | ANSWER_AUDIO); + a2_->CreateAnswer(offer.c_str(), OFFER_AUDIO | ANSWER_AUDIO); // Now the answer should contain a=setup:active std::string answer(a2_->answer()); @@ -3640,10 +3565,10 @@ TEST_F(SignalingTest, AudioCallAnswerNoSetupOrConnection) { EnsureInit(); - sipcc::MediaConstraints constraints; + sipcc::OfferOptions options; size_t match; - a1_->CreateOffer(constraints, OFFER_AUDIO, SHOULD_SENDRECV_AUDIO); + a1_->CreateOffer(options, OFFER_AUDIO, SHOULD_SENDRECV_AUDIO); // By default the offer should give setup:actpass std::string offer(a1_->offer()); @@ -3652,7 +3577,7 @@ TEST_F(SignalingTest, AudioCallAnswerNoSetupOrConnection) a1_->SetLocal(TestObserver::OFFER, offer.c_str(), false); a2_->SetRemote(TestObserver::OFFER, offer.c_str(), false); - a2_->CreateAnswer(constraints, offer.c_str(), OFFER_AUDIO | ANSWER_AUDIO); + a2_->CreateAnswer(offer.c_str(), OFFER_AUDIO | ANSWER_AUDIO); // Now the answer should contain a=setup:active std::string answer(a2_->answer()); @@ -3687,8 +3612,8 @@ TEST_F(SignalingTest, FullCallRealTrickle) { wait_for_gather_ = false; - sipcc::MediaConstraints constraints; - OfferAnswer(constraints, constraints, OFFER_AV | ANSWER_AV, + sipcc::OfferOptions options; + OfferAnswer(options, OFFER_AV | ANSWER_AV, true, SHOULD_SENDRECV_AV, SHOULD_SENDRECV_AV); // Wait for some data to get written @@ -3706,8 +3631,8 @@ TEST_F(SignalingTest, FullCallRealTrickleTestServer) wait_for_gather_ = false; SetTestStunServer(); - sipcc::MediaConstraints constraints; - OfferAnswer(constraints, constraints, OFFER_AV | ANSWER_AV, + sipcc::OfferOptions options; + OfferAnswer(options, OFFER_AV | ANSWER_AV, true, SHOULD_SENDRECV_AV, SHOULD_SENDRECV_AV); TestStunServer::GetInstance()->SetActive(true); @@ -3726,7 +3651,7 @@ TEST_F(SignalingTest, hugeSdp) { EnsureInit(); - sipcc::MediaConstraints constraints; + sipcc::OfferOptions options; std::string offer = "v=0\r\n" "o=- 1109973417102828257 2 IN IP4 127.0.0.1\r\n" @@ -3818,12 +3743,12 @@ TEST_F(SignalingTest, hugeSdp) "a=ssrc:54724160 mslabel:1PBxet5BYh0oYodwsvNM4k6KiO2eWCX40VIP\r\n" "a=ssrc:54724160 label:1PBxet5BYh0oYodwsvNM4k6KiO2eWCX40VIPv0\r\n"; - a1_->CreateOffer(constraints, OFFER_AV, SHOULD_SENDRECV_AV); + a1_->CreateOffer(options, OFFER_AV, SHOULD_SENDRECV_AV); a1_->SetLocal(TestObserver::OFFER, offer, true); a2_->SetRemote(TestObserver::OFFER, offer, true); ASSERT_GE(a2_->getRemoteDescription().length(), 4096U); - a2_->CreateAnswer(constraints, offer, OFFER_AV); + a2_->CreateAnswer(offer, OFFER_AV); } // Test max_fs and max_fr prefs have proper impact on SDP offer @@ -3831,7 +3756,7 @@ TEST_F(SignalingTest, MaxFsFrInOffer) { EnsureInit(); - sipcc::MediaConstraints constraints; + sipcc::OfferOptions options; nsCOMPtr prefs = do_GetService(NS_PREFSERVICE_CONTRACTID); ASSERT_TRUE(prefs); @@ -3839,7 +3764,7 @@ TEST_F(SignalingTest, MaxFsFrInOffer) SetMaxFsFr(prefs, 300, 30); - a1_->CreateOffer(constraints, OFFER_AV, SHOULD_CHECK_AV); + a1_->CreateOffer(options, OFFER_AV, SHOULD_CHECK_AV); // Verify that SDP contains correct max-fs and max-fr CheckMaxFsFrSdp(a1_->offer(), 120, 300, 30); @@ -3850,7 +3775,7 @@ TEST_F(SignalingTest, MaxFsFrInAnswer) { EnsureInit(); - sipcc::MediaConstraints constraints; + sipcc::OfferOptions options; nsCOMPtr prefs = do_GetService(NS_PREFSERVICE_CONTRACTID); ASSERT_TRUE(prefs); @@ -3859,7 +3784,7 @@ TEST_F(SignalingTest, MaxFsFrInAnswer) // We don't want max_fs and max_fr prefs impact SDP at this moment SetMaxFsFr(prefs, 0, 0); - a1_->CreateOffer(constraints, OFFER_AV, SHOULD_CHECK_AV); + a1_->CreateOffer(options, OFFER_AV, SHOULD_CHECK_AV); // SDP should not contain max-fs and max-fr here CheckMaxFsFrSdp(a1_->offer(), 120, 0, 0); @@ -3868,7 +3793,7 @@ TEST_F(SignalingTest, MaxFsFrInAnswer) SetMaxFsFr(prefs, 600, 60); - a2_->CreateAnswer(constraints, a1_->offer(), OFFER_AV | ANSWER_AV); + a2_->CreateAnswer(a1_->offer(), OFFER_AV | ANSWER_AV); // Verify that SDP contains correct max-fs and max-fr CheckMaxFsFrSdp(a2_->answer(), 120, 600, 60); @@ -3879,7 +3804,7 @@ TEST_F(SignalingTest, MaxFsFrCalleeCodec) { EnsureInit(); - sipcc::MediaConstraints constraints; + sipcc::OfferOptions options; nsCOMPtr prefs = do_GetService(NS_PREFSERVICE_CONTRACTID); ASSERT_TRUE(prefs); @@ -3888,7 +3813,7 @@ TEST_F(SignalingTest, MaxFsFrCalleeCodec) // We don't want max_fs and max_fr prefs impact SDP at this moment SetMaxFsFr(prefs, 0, 0); - a1_->CreateOffer(constraints, OFFER_AV, SHOULD_CHECK_AV); + a1_->CreateOffer(options, OFFER_AV, SHOULD_CHECK_AV); ParsedSDP sdpWrapper(a1_->offer()); @@ -3904,7 +3829,7 @@ TEST_F(SignalingTest, MaxFsFrCalleeCodec) a1_->SetLocal(TestObserver::OFFER, sdpWrapper.getSdp()); a2_->SetRemote(TestObserver::OFFER, sdpWrapper.getSdp()); - a2_->CreateAnswer(constraints, sdpWrapper.getSdp(), OFFER_AV | ANSWER_AV); + a2_->CreateAnswer(sdpWrapper.getSdp(), OFFER_AV | ANSWER_AV); // SDP should not contain max-fs and max-fr here CheckMaxFsFrSdp(a2_->answer(), 120, 0, 0); @@ -3935,7 +3860,7 @@ TEST_F(SignalingTest, MaxFsFrCallerCodec) { EnsureInit(); - sipcc::MediaConstraints constraints; + sipcc::OfferOptions options; nsCOMPtr prefs = do_GetService(NS_PREFSERVICE_CONTRACTID); ASSERT_TRUE(prefs); @@ -3944,11 +3869,11 @@ TEST_F(SignalingTest, MaxFsFrCallerCodec) // We don't want max_fs and max_fr prefs impact SDP at this moment SetMaxFsFr(prefs, 0, 0); - a1_->CreateOffer(constraints, OFFER_AV, SHOULD_CHECK_AV); + a1_->CreateOffer(options, OFFER_AV, SHOULD_CHECK_AV); a1_->SetLocal(TestObserver::OFFER, a1_->offer()); a2_->SetRemote(TestObserver::OFFER, a1_->offer()); - a2_->CreateAnswer(constraints, a1_->offer(), OFFER_AV | ANSWER_AV); + a2_->CreateAnswer(a1_->offer(), OFFER_AV | ANSWER_AV); ParsedSDP sdpWrapper(a2_->answer()); @@ -3986,9 +3911,9 @@ TEST_F(SignalingTest, MaxFsFrCallerCodec) TEST_F(SignalingTest, ValidateMultipleVideoCodecsInOffer) { EnsureInit(); - sipcc::MediaConstraints constraints; + sipcc::OfferOptions options; - a1_->CreateOffer(constraints, OFFER_AV, SHOULD_SENDRECV_AV); + a1_->CreateOffer(options, OFFER_AV, SHOULD_SENDRECV_AV); std::string offer = a1_->offer(); ASSERT_NE(offer.find("RTP/SAVPF 120 126 97"), std::string::npos); @@ -4013,10 +3938,10 @@ TEST_F(SignalingTest, RemoveVP8FromOfferWithP1First) { EnsureInit(); - sipcc::MediaConstraints constraints; + sipcc::OfferOptions options; size_t match; - a1_->CreateOffer(constraints, OFFER_AV, SHOULD_SENDRECV_AV); + a1_->CreateOffer(options, OFFER_AV, SHOULD_SENDRECV_AV); // Remove VP8 from offer std::string offer = a1_->offer(); @@ -4034,8 +3959,8 @@ TEST_F(SignalingTest, RemoveVP8FromOfferWithP1First) a1_->SetLocal(TestObserver::OFFER, sdpWrapper.getSdp()); a2_->SetRemote(TestObserver::OFFER, sdpWrapper.getSdp(), false); - a2_->CreateAnswer(constraints, sdpWrapper.getSdp(), - OFFER_AV|ANSWER_AV, SHOULD_SENDRECV_AV); + a2_->CreateAnswer(sdpWrapper.getSdp(), + OFFER_AV|ANSWER_AV, SHOULD_SENDRECV_AV); std::string answer(a2_->answer()); @@ -4057,10 +3982,10 @@ TEST_F(SignalingTest, OfferWithH264BeforeVP8) { EnsureInit(); - sipcc::MediaConstraints constraints; + sipcc::OfferOptions options; size_t match; - a1_->CreateOffer(constraints, OFFER_AV, SHOULD_SENDRECV_AV); + a1_->CreateOffer(options, OFFER_AV, SHOULD_SENDRECV_AV); // Swap VP8 and P1 in offer std::string offer = a1_->offer(); @@ -4094,8 +4019,7 @@ TEST_F(SignalingTest, OfferWithH264BeforeVP8) a1_->SetLocal(TestObserver::OFFER, offer); a2_->SetRemote(TestObserver::OFFER, offer, false); - a2_->CreateAnswer(constraints, offer, - OFFER_AV|ANSWER_AV, SHOULD_SENDRECV_AV); + a2_->CreateAnswer(offer, OFFER_AV|ANSWER_AV, SHOULD_SENDRECV_AV); std::string answer(a2_->answer()); @@ -4117,10 +4041,10 @@ TEST_F(SignalingTest, OfferWithOnlyH264P0) { EnsureInit(); - sipcc::MediaConstraints constraints; + sipcc::OfferOptions options; size_t match; - a1_->CreateOffer(constraints, OFFER_AV, SHOULD_SENDRECV_AV); + a1_->CreateOffer(options, OFFER_AV, SHOULD_SENDRECV_AV); // Remove VP8 from offer std::string offer = a1_->offer(); @@ -4146,8 +4070,7 @@ TEST_F(SignalingTest, OfferWithOnlyH264P0) a1_->SetLocal(TestObserver::OFFER, offer); a2_->SetRemote(TestObserver::OFFER, offer, false); - a2_->CreateAnswer(constraints, offer, - OFFER_AV|ANSWER_AV, SHOULD_SENDRECV_AV); + a2_->CreateAnswer(offer, OFFER_AV|ANSWER_AV, SHOULD_SENDRECV_AV); std::string answer(a2_->answer()); @@ -4170,13 +4093,12 @@ TEST_F(SignalingTest, AnswerWithoutVP8) { EnsureInit(); - sipcc::MediaConstraints constraints; + sipcc::OfferOptions options; - a1_->CreateOffer(constraints, OFFER_AV, SHOULD_SENDRECV_AV); + a1_->CreateOffer(options, OFFER_AV, SHOULD_SENDRECV_AV); a1_->SetLocal(TestObserver::OFFER, a1_->offer()); a2_->SetRemote(TestObserver::OFFER, a1_->offer(), false); - a2_->CreateAnswer(constraints, a1_->offer(), - OFFER_AV|ANSWER_AV, SHOULD_SENDRECV_AV); + a2_->CreateAnswer(a1_->offer(), OFFER_AV|ANSWER_AV, SHOULD_SENDRECV_AV); std::string answer(a2_->answer()); @@ -4220,12 +4142,11 @@ TEST_F(SignalingTest, UseNonPrefferedPayloadTypeOnAnswer) { EnsureInit(); - sipcc::MediaConstraints constraints; - a1_->CreateOffer(constraints, OFFER_AV, SHOULD_SENDRECV_AV); + sipcc::OfferOptions options; + a1_->CreateOffer(options, OFFER_AV, SHOULD_SENDRECV_AV); a1_->SetLocal(TestObserver::OFFER, a1_->offer()); a2_->SetRemote(TestObserver::OFFER, a1_->offer(), false); - a2_->CreateAnswer(constraints, a1_->offer(), - OFFER_AV|ANSWER_AV, SHOULD_SENDRECV_AV); + a2_->CreateAnswer(a1_->offer(), OFFER_AV|ANSWER_AV, SHOULD_SENDRECV_AV); std::string answer(a2_->answer()); From 110454f87380a63ab88978fd758cd8399dc9fa15 Mon Sep 17 00:00:00 2001 From: Jan-Ivar Bruaroey Date: Fri, 18 Jul 2014 17:58:55 -0400 Subject: [PATCH 10/84] Bug 1033833 - Remove signaling unittests for createAnswer options. r=abr --- .../signaling/test/signaling_unittests.cpp | 50 +++++++++++++------ 1 file changed, 35 insertions(+), 15 deletions(-) diff --git a/media/webrtc/signaling/test/signaling_unittests.cpp b/media/webrtc/signaling/test/signaling_unittests.cpp index fc14ad32109..da5df914055 100644 --- a/media/webrtc/signaling/test/signaling_unittests.cpp +++ b/media/webrtc/signaling/test/signaling_unittests.cpp @@ -2053,7 +2053,8 @@ TEST_F(SignalingTest, OfferAnswerNothingDisabled) SHOULD_SENDRECV_AV, SHOULD_SENDRECV_AV); } -TEST_F(SignalingTest, OfferAnswerDontReceiveAudioOnOffer) +// XXX reject streams has changed. Re-enable when we can stop() received stream +TEST_F(SignalingTest, DISABLED_OfferAnswerDontReceiveAudioOnOffer) { sipcc::OfferOptions options; options.setBooleanOption("OfferToReceiveAudio", false); @@ -2063,7 +2064,8 @@ TEST_F(SignalingTest, OfferAnswerDontReceiveAudioOnOffer) SHOULD_RECV_AUDIO | SHOULD_SENDRECV_VIDEO); } -TEST_F(SignalingTest, OfferAnswerDontReceiveVideoOnOffer) +// XXX reject streams has changed. Re-enable when we can stop() received stream +TEST_F(SignalingTest, DISABLED_OfferAnswerDontReceiveVideoOnOffer) { sipcc::OfferOptions options; options.setBooleanOption("OfferToReceiveAudio", true); @@ -2073,7 +2075,8 @@ TEST_F(SignalingTest, OfferAnswerDontReceiveVideoOnOffer) SHOULD_SENDRECV_AUDIO | SHOULD_RECV_VIDEO); } -TEST_F(SignalingTest, OfferAnswerDontReceiveAudioOnAnswer) +// XXX reject streams has changed. Re-enable when we can stop() received stream +TEST_F(SignalingTest, DISABLED_OfferAnswerDontReceiveAudioOnAnswer) { sipcc::OfferOptions options; options.setBooleanOption("OfferToReceiveAudio", true); @@ -2083,7 +2086,8 @@ TEST_F(SignalingTest, OfferAnswerDontReceiveAudioOnAnswer) SHOULD_SEND_AUDIO | SHOULD_SENDRECV_VIDEO); } -TEST_F(SignalingTest, OfferAnswerDontReceiveVideoOnAnswer) +// XXX reject streams has changed. Re-enable when we can stop() received stream +TEST_F(SignalingTest, DISABLED_OfferAnswerDontReceiveVideoOnAnswer) { sipcc::OfferOptions options; options.setBooleanOption("OfferToReceiveAudio", true); @@ -2093,7 +2097,8 @@ TEST_F(SignalingTest, OfferAnswerDontReceiveVideoOnAnswer) SHOULD_SENDRECV_AUDIO | SHOULD_SEND_VIDEO); } -TEST_F(SignalingTest, OfferAnswerDontAddAudioStreamOnOfferRecvAudio) +// XXX reject streams has changed. Re-enable when we can stop() received stream +TEST_F(SignalingTest, DISABLED_OfferAnswerDontAddAudioStreamOnOfferRecvAudio) { sipcc::OfferOptions options; options.setBooleanOption("OfferToReceiveAudio", true); @@ -2103,7 +2108,8 @@ TEST_F(SignalingTest, OfferAnswerDontAddAudioStreamOnOfferRecvAudio) SHOULD_SEND_AUDIO | SHOULD_SENDRECV_VIDEO); } -TEST_F(SignalingTest, OfferAnswerDontAddAudioStreamOnOffer) +// XXX reject streams has changed. Re-enable when we can stop() received stream +TEST_F(SignalingTest, DISABLED_OfferAnswerDontAddAudioStreamOnOffer) { sipcc::OfferOptions options; options.setBooleanOption("OfferToReceiveAudio", false); @@ -2113,7 +2119,8 @@ TEST_F(SignalingTest, OfferAnswerDontAddAudioStreamOnOffer) SHOULD_OMIT_AUDIO | SHOULD_SENDRECV_VIDEO); } -TEST_F(SignalingTest, OfferAnswerDontAddVideoStreamOnOfferRecvVideo) +// XXX reject streams has changed. Re-enable when we can stop() received stream +TEST_F(SignalingTest, DISABLED_OfferAnswerDontAddVideoStreamOnOfferRecvVideo) { sipcc::OfferOptions options; options.setBooleanOption("OfferToReceiveAudio", true); @@ -2123,7 +2130,8 @@ TEST_F(SignalingTest, OfferAnswerDontAddVideoStreamOnOfferRecvVideo) SHOULD_SENDRECV_AUDIO | SHOULD_SEND_VIDEO); } -TEST_F(SignalingTest, OfferAnswerDontAddVideoStreamOnOffer) +// XXX reject streams has changed. Re-enable when we can stop() received stream +TEST_F(SignalingTest, DISABLED_OfferAnswerDontAddVideoStreamOnOffer) { sipcc::OfferOptions options; options.setBooleanOption("OfferToReceiveAudio", true); @@ -2133,7 +2141,8 @@ TEST_F(SignalingTest, OfferAnswerDontAddVideoStreamOnOffer) SHOULD_SENDRECV_AUDIO | SHOULD_OMIT_VIDEO); } -TEST_F(SignalingTest, OfferAnswerDontAddAudioStreamOnAnswer) +// XXX reject streams has changed. Re-enable when we can stop() received stream +TEST_F(SignalingTest, DISABLED_OfferAnswerDontAddAudioStreamOnAnswer) { sipcc::OfferOptions options; options.setBooleanOption("OfferToReceiveAudio", true); @@ -2143,7 +2152,8 @@ TEST_F(SignalingTest, OfferAnswerDontAddAudioStreamOnAnswer) SHOULD_RECV_AUDIO | SHOULD_SENDRECV_VIDEO); } -TEST_F(SignalingTest, OfferAnswerDontAddVideoStreamOnAnswer) +// XXX reject streams has changed. Re-enable when we can stop() received stream +TEST_F(SignalingTest, DISABLED_OfferAnswerDontAddVideoStreamOnAnswer) { sipcc::OfferOptions options; options.setBooleanOption("OfferToReceiveAudio", true); @@ -2153,7 +2163,9 @@ TEST_F(SignalingTest, OfferAnswerDontAddVideoStreamOnAnswer) SHOULD_SENDRECV_AUDIO | SHOULD_RECV_VIDEO); } -TEST_F(SignalingTest, OfferAnswerDontAddVideoStreamOnAnswerDontReceiveVideoOnAnswer) +// XXX reject streams has changed. Re-enable when we can stop() received stream +TEST_F(SignalingTest, + DISABLED_OfferAnswerDontAddVideoStreamOnAnswerDontReceiveVideoOnAnswer) { sipcc::OfferOptions options; options.setBooleanOption("OfferToReceiveAudio", true); @@ -2162,7 +2174,9 @@ TEST_F(SignalingTest, OfferAnswerDontAddVideoStreamOnAnswerDontReceiveVideoOnAns false, SHOULD_SENDRECV_AV, SHOULD_SENDRECV_AUDIO ); } -TEST_F(SignalingTest, OfferAnswerDontAddAudioStreamOnAnswerDontReceiveAudioOnAnswer) +// XXX reject streams has changed. Re-enable when we can stop() received stream +TEST_F(SignalingTest, + DISABLED_OfferAnswerDontAddAudioStreamOnAnswerDontReceiveAudioOnAnswer) { sipcc::OfferOptions options; options.setBooleanOption("OfferToReceiveAudio", true); @@ -2172,7 +2186,9 @@ TEST_F(SignalingTest, OfferAnswerDontAddAudioStreamOnAnswerDontReceiveAudioOnAns SHOULD_REJECT_AUDIO | SHOULD_SENDRECV_VIDEO); } -TEST_F(SignalingTest, OfferAnswerDontAddAudioStreamOnOfferDontReceiveAudioOnOffer) +// XXX reject streams has changed. Re-enable when we can stop() received stream +TEST_F(SignalingTest, + DISABLED_OfferAnswerDontAddAudioStreamOnOfferDontReceiveAudioOnOffer) { sipcc::OfferOptions options; options.setBooleanOption("OfferToReceiveAudio", false); @@ -2181,7 +2197,9 @@ TEST_F(SignalingTest, OfferAnswerDontAddAudioStreamOnOfferDontReceiveAudioOnOffe false, SHOULD_SENDRECV_VIDEO, SHOULD_SENDRECV_VIDEO); } -TEST_F(SignalingTest, OfferAnswerDontAddVideoStreamOnOfferDontReceiveVideoOnOffer) +// XXX reject streams has changed. Re-enable when we can stop() received stream +TEST_F(SignalingTest, + DISABLED_OfferAnswerDontAddVideoStreamOnOfferDontReceiveVideoOnOffer) { sipcc::OfferOptions options; options.setBooleanOption("OfferToReceiveAudio", true); @@ -2191,7 +2209,9 @@ TEST_F(SignalingTest, OfferAnswerDontAddVideoStreamOnOfferDontReceiveVideoOnOffe SHOULD_SENDRECV_AUDIO | SHOULD_OMIT_VIDEO); } -TEST_F(SignalingTest, OfferAnswerDontReceiveAudioNoAudioStreamOnOfferDontReceiveVideoOnAnswer) +// XXX reject streams has changed. Re-enable when we can stop() received stream +TEST_F(SignalingTest, + DISABLED_OfferAnswerDontReceiveAudioNoAudioStreamOnOfferDontReceiveVideoOnAnswer) { sipcc::OfferOptions options; options.setBooleanOption("OfferToReceiveAudio", false); From 1863b0dba45691761007dfbda2e5f54b3bf8190d Mon Sep 17 00:00:00 2001 From: Jan-Ivar Bruaroey Date: Fri, 18 Jul 2014 18:08:30 -0400 Subject: [PATCH 11/84] Bug 1033833 - finish plumbing offerToReceiveAudio|Video to long. r=abr --- .../src/peerconnection/PeerConnectionCtx.cpp | 4 +- .../src/sipcc/include/cc_constants.h | 9 +- .../signaling/test/signaling_unittests.cpp | 132 +++++++++--------- 3 files changed, 75 insertions(+), 70 deletions(-) diff --git a/media/webrtc/signaling/src/peerconnection/PeerConnectionCtx.cpp b/media/webrtc/signaling/src/peerconnection/PeerConnectionCtx.cpp index 3b817fd8800..84f283367cf 100644 --- a/media/webrtc/signaling/src/peerconnection/PeerConnectionCtx.cpp +++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionCtx.cpp @@ -64,10 +64,10 @@ Apply(const Optional &aSrc, cc_boolean_option_t *aDst) { } static void -Apply(const Optional &aSrc, cc_boolean_option_t *aDst) { +Apply(const Optional &aSrc, cc_int32_option_t *aDst) { if (aSrc.WasPassed()) { aDst->was_passed = true; - aDst->value = !!aSrc.Value(); + aDst->value = aSrc.Value(); } } #endif diff --git a/media/webrtc/signaling/src/sipcc/include/cc_constants.h b/media/webrtc/signaling/src/sipcc/include/cc_constants.h index 57a66229b0b..b5f51ef8563 100644 --- a/media/webrtc/signaling/src/sipcc/include/cc_constants.h +++ b/media/webrtc/signaling/src/sipcc/include/cc_constants.h @@ -581,8 +581,13 @@ typedef struct { } cc_boolean_option_t; typedef struct { - cc_boolean_option_t offer_to_receive_audio; - cc_boolean_option_t offer_to_receive_video; + cc_boolean was_passed; + cc_int32_t value; +} cc_int32_option_t; + +typedef struct { + cc_int32_option_t offer_to_receive_audio; + cc_int32_option_t offer_to_receive_video; cc_boolean_option_t moz_dont_offer_datachannel; cc_boolean_option_t moz_bundle_only; } cc_media_options_t; diff --git a/media/webrtc/signaling/test/signaling_unittests.cpp b/media/webrtc/signaling/test/signaling_unittests.cpp index da5df914055..912b0538f34 100644 --- a/media/webrtc/signaling/test/signaling_unittests.cpp +++ b/media/webrtc/signaling/test/signaling_unittests.cpp @@ -85,13 +85,13 @@ namespace sipcc { class OfferOptions : public mozilla::SipccOfferOptions { public: - void setBooleanOption(const char *namePtr, bool value) { - cc_boolean_option_t &member (getMember(namePtr)); + void setInt32Option(const char *namePtr, int32_t value) { + auto &member = getMember(namePtr); member.was_passed = true; member.value = value; } private: - cc_boolean_option_t &getMember(const char *namePtr) { + cc_int32_option_t &getMember(const char *namePtr) { if (strcmp(namePtr, "OfferToReceiveAudio") == 0) { return mOptions.offer_to_receive_audio; } @@ -99,7 +99,7 @@ private: return mOptions.offer_to_receive_video; } MOZ_ASSERT(false); - return mOptions.moz_dont_offer_datachannel; + return mOptions.offer_to_receive_video; } }; } @@ -1730,8 +1730,8 @@ public: uint32_t hints, uint32_t sdpCheck) { EnsureInit(); sipcc::OfferOptions aoptions; - aoptions.setBooleanOption("OfferToReceiveAudio", true); - aoptions.setBooleanOption("OfferToReceiveVideo", true); + aoptions.setInt32Option("OfferToReceiveAudio", true); + aoptions.setInt32Option("OfferToReceiveVideo", true); a1_->CreateOffer(aoptions, OFFER_AV, SHOULD_SENDRECV_AV ); a1_->CreateOfferRemoveStream(options, hints, sdpCheck); } @@ -1965,8 +1965,8 @@ TEST_F(SignalingTest, CreateOfferAudioVideoOptionUndefined) TEST_F(SignalingTest, CreateOfferNoVideoStreamRecvVideo) { sipcc::OfferOptions options; - options.setBooleanOption("OfferToReceiveAudio", true); - options.setBooleanOption("OfferToReceiveVideo", true); + options.setInt32Option("OfferToReceiveAudio", true); + options.setInt32Option("OfferToReceiveVideo", true); CreateOffer(options, OFFER_AUDIO, SHOULD_SENDRECV_AUDIO | SHOULD_RECV_VIDEO); } @@ -1974,8 +1974,8 @@ TEST_F(SignalingTest, CreateOfferNoVideoStreamRecvVideo) TEST_F(SignalingTest, CreateOfferNoAudioStreamRecvAudio) { sipcc::OfferOptions options; - options.setBooleanOption("OfferToReceiveAudio", true); - options.setBooleanOption("OfferToReceiveVideo", true); + options.setInt32Option("OfferToReceiveAudio", true); + options.setInt32Option("OfferToReceiveVideo", true); CreateOffer(options, OFFER_VIDEO, SHOULD_RECV_AUDIO | SHOULD_SENDRECV_VIDEO); } @@ -1983,8 +1983,8 @@ TEST_F(SignalingTest, CreateOfferNoAudioStreamRecvAudio) TEST_F(SignalingTest, CreateOfferNoVideoStream) { sipcc::OfferOptions options; - options.setBooleanOption("OfferToReceiveAudio", true); - options.setBooleanOption("OfferToReceiveVideo", false); + options.setInt32Option("OfferToReceiveAudio", true); + options.setInt32Option("OfferToReceiveVideo", false); CreateOffer(options, OFFER_AUDIO, SHOULD_SENDRECV_AUDIO | SHOULD_OMIT_VIDEO); } @@ -1992,8 +1992,8 @@ TEST_F(SignalingTest, CreateOfferNoVideoStream) TEST_F(SignalingTest, CreateOfferNoAudioStream) { sipcc::OfferOptions options; - options.setBooleanOption("OfferToReceiveAudio", false); - options.setBooleanOption("OfferToReceiveVideo", true); + options.setInt32Option("OfferToReceiveAudio", false); + options.setInt32Option("OfferToReceiveVideo", true); CreateOffer(options, OFFER_VIDEO, SHOULD_OMIT_AUDIO | SHOULD_SENDRECV_VIDEO); } @@ -2001,8 +2001,8 @@ TEST_F(SignalingTest, CreateOfferNoAudioStream) TEST_F(SignalingTest, CreateOfferDontReceiveAudio) { sipcc::OfferOptions options; - options.setBooleanOption("OfferToReceiveAudio", false); - options.setBooleanOption("OfferToReceiveVideo", true); + options.setInt32Option("OfferToReceiveAudio", false); + options.setInt32Option("OfferToReceiveVideo", true); CreateOffer(options, OFFER_AV, SHOULD_SEND_AUDIO | SHOULD_SENDRECV_VIDEO); } @@ -2010,8 +2010,8 @@ TEST_F(SignalingTest, CreateOfferDontReceiveAudio) TEST_F(SignalingTest, CreateOfferDontReceiveVideo) { sipcc::OfferOptions options; - options.setBooleanOption("OfferToReceiveAudio", true); - options.setBooleanOption("OfferToReceiveVideo", false); + options.setInt32Option("OfferToReceiveAudio", true); + options.setInt32Option("OfferToReceiveVideo", false); CreateOffer(options, OFFER_AV, SHOULD_SENDRECV_AUDIO | SHOULD_SEND_VIDEO); } @@ -2020,8 +2020,8 @@ TEST_F(SignalingTest, CreateOfferDontReceiveVideo) TEST_F(SignalingTest, DISABLED_CreateOfferRemoveAudioStream) { sipcc::OfferOptions options; - options.setBooleanOption("OfferToReceiveAudio", true); - options.setBooleanOption("OfferToReceiveVideo", true); + options.setInt32Option("OfferToReceiveAudio", true); + options.setInt32Option("OfferToReceiveVideo", true); CreateOfferRemoveStream(options, DOMMediaStream::HINT_CONTENTS_AUDIO, SHOULD_RECV_AUDIO | SHOULD_SENDRECV_VIDEO); } @@ -2030,8 +2030,8 @@ TEST_F(SignalingTest, DISABLED_CreateOfferRemoveAudioStream) TEST_F(SignalingTest, DISABLED_CreateOfferDontReceiveAudioRemoveAudioStream) { sipcc::OfferOptions options; - options.setBooleanOption("OfferToReceiveAudio", false); - options.setBooleanOption("OfferToReceiveVideo", true); + options.setInt32Option("OfferToReceiveAudio", false); + options.setInt32Option("OfferToReceiveVideo", true); CreateOfferRemoveStream(options, DOMMediaStream::HINT_CONTENTS_AUDIO, SHOULD_SENDRECV_VIDEO); } @@ -2040,8 +2040,8 @@ TEST_F(SignalingTest, DISABLED_CreateOfferDontReceiveAudioRemoveAudioStream) TEST_F(SignalingTest, DISABLED_CreateOfferDontReceiveVideoRemoveVideoStream) { sipcc::OfferOptions options; - options.setBooleanOption("OfferToReceiveAudio", true); - options.setBooleanOption("OfferToReceiveVideo", false); + options.setInt32Option("OfferToReceiveAudio", true); + options.setInt32Option("OfferToReceiveVideo", false); CreateOfferRemoveStream(options, DOMMediaStream::HINT_CONTENTS_VIDEO, SHOULD_SENDRECV_AUDIO); } @@ -2057,8 +2057,8 @@ TEST_F(SignalingTest, OfferAnswerNothingDisabled) TEST_F(SignalingTest, DISABLED_OfferAnswerDontReceiveAudioOnOffer) { sipcc::OfferOptions options; - options.setBooleanOption("OfferToReceiveAudio", false); - options.setBooleanOption("OfferToReceiveVideo", true); + options.setInt32Option("OfferToReceiveAudio", false); + options.setInt32Option("OfferToReceiveVideo", true); OfferAnswer(options, OFFER_AV | ANSWER_AV, false, SHOULD_SEND_AUDIO | SHOULD_SENDRECV_VIDEO, SHOULD_RECV_AUDIO | SHOULD_SENDRECV_VIDEO); @@ -2068,8 +2068,8 @@ TEST_F(SignalingTest, DISABLED_OfferAnswerDontReceiveAudioOnOffer) TEST_F(SignalingTest, DISABLED_OfferAnswerDontReceiveVideoOnOffer) { sipcc::OfferOptions options; - options.setBooleanOption("OfferToReceiveAudio", true); - options.setBooleanOption("OfferToReceiveVideo", false); + options.setInt32Option("OfferToReceiveAudio", true); + options.setInt32Option("OfferToReceiveVideo", false); OfferAnswer(options, OFFER_AV | ANSWER_AV, false, SHOULD_SENDRECV_AUDIO | SHOULD_SEND_VIDEO, SHOULD_SENDRECV_AUDIO | SHOULD_RECV_VIDEO); @@ -2079,8 +2079,8 @@ TEST_F(SignalingTest, DISABLED_OfferAnswerDontReceiveVideoOnOffer) TEST_F(SignalingTest, DISABLED_OfferAnswerDontReceiveAudioOnAnswer) { sipcc::OfferOptions options; - options.setBooleanOption("OfferToReceiveAudio", true); - options.setBooleanOption("OfferToReceiveVideo", true); + options.setInt32Option("OfferToReceiveAudio", true); + options.setInt32Option("OfferToReceiveVideo", true); OfferAnswer(options, OFFER_AV | ANSWER_AV, false, SHOULD_SENDRECV_AV, SHOULD_SEND_AUDIO | SHOULD_SENDRECV_VIDEO); @@ -2090,8 +2090,8 @@ TEST_F(SignalingTest, DISABLED_OfferAnswerDontReceiveAudioOnAnswer) TEST_F(SignalingTest, DISABLED_OfferAnswerDontReceiveVideoOnAnswer) { sipcc::OfferOptions options; - options.setBooleanOption("OfferToReceiveAudio", true); - options.setBooleanOption("OfferToReceiveVideo", true); + options.setInt32Option("OfferToReceiveAudio", true); + options.setInt32Option("OfferToReceiveVideo", true); OfferAnswer(options, OFFER_AV | ANSWER_AV, false, SHOULD_SENDRECV_AV, SHOULD_SENDRECV_AUDIO | SHOULD_SEND_VIDEO); @@ -2101,8 +2101,8 @@ TEST_F(SignalingTest, DISABLED_OfferAnswerDontReceiveVideoOnAnswer) TEST_F(SignalingTest, DISABLED_OfferAnswerDontAddAudioStreamOnOfferRecvAudio) { sipcc::OfferOptions options; - options.setBooleanOption("OfferToReceiveAudio", true); - options.setBooleanOption("OfferToReceiveVideo", true); + options.setInt32Option("OfferToReceiveAudio", true); + options.setInt32Option("OfferToReceiveVideo", true); OfferAnswer(options, OFFER_VIDEO | ANSWER_AV, false, SHOULD_RECV_AUDIO | SHOULD_SENDRECV_VIDEO, SHOULD_SEND_AUDIO | SHOULD_SENDRECV_VIDEO); @@ -2112,8 +2112,8 @@ TEST_F(SignalingTest, DISABLED_OfferAnswerDontAddAudioStreamOnOfferRecvAudio) TEST_F(SignalingTest, DISABLED_OfferAnswerDontAddAudioStreamOnOffer) { sipcc::OfferOptions options; - options.setBooleanOption("OfferToReceiveAudio", false); - options.setBooleanOption("OfferToReceiveVideo", true); + options.setInt32Option("OfferToReceiveAudio", false); + options.setInt32Option("OfferToReceiveVideo", true); OfferAnswer(options, OFFER_VIDEO | ANSWER_AV, false, SHOULD_OMIT_AUDIO | SHOULD_SENDRECV_VIDEO, SHOULD_OMIT_AUDIO | SHOULD_SENDRECV_VIDEO); @@ -2123,8 +2123,8 @@ TEST_F(SignalingTest, DISABLED_OfferAnswerDontAddAudioStreamOnOffer) TEST_F(SignalingTest, DISABLED_OfferAnswerDontAddVideoStreamOnOfferRecvVideo) { sipcc::OfferOptions options; - options.setBooleanOption("OfferToReceiveAudio", true); - options.setBooleanOption("OfferToReceiveVideo", true); + options.setInt32Option("OfferToReceiveAudio", true); + options.setInt32Option("OfferToReceiveVideo", true); OfferAnswer(options, OFFER_AUDIO | ANSWER_AV, false, SHOULD_SENDRECV_AUDIO | SHOULD_RECV_VIDEO, SHOULD_SENDRECV_AUDIO | SHOULD_SEND_VIDEO); @@ -2134,8 +2134,8 @@ TEST_F(SignalingTest, DISABLED_OfferAnswerDontAddVideoStreamOnOfferRecvVideo) TEST_F(SignalingTest, DISABLED_OfferAnswerDontAddVideoStreamOnOffer) { sipcc::OfferOptions options; - options.setBooleanOption("OfferToReceiveAudio", true); - options.setBooleanOption("OfferToReceiveVideo", false); + options.setInt32Option("OfferToReceiveAudio", true); + options.setInt32Option("OfferToReceiveVideo", false); OfferAnswer(options, OFFER_AUDIO | ANSWER_AV, false, SHOULD_SENDRECV_AUDIO | SHOULD_OMIT_VIDEO, SHOULD_SENDRECV_AUDIO | SHOULD_OMIT_VIDEO); @@ -2145,8 +2145,8 @@ TEST_F(SignalingTest, DISABLED_OfferAnswerDontAddVideoStreamOnOffer) TEST_F(SignalingTest, DISABLED_OfferAnswerDontAddAudioStreamOnAnswer) { sipcc::OfferOptions options; - options.setBooleanOption("OfferToReceiveAudio", true); - options.setBooleanOption("OfferToReceiveVideo", true); + options.setInt32Option("OfferToReceiveAudio", true); + options.setInt32Option("OfferToReceiveVideo", true); OfferAnswer(options, OFFER_AV | ANSWER_VIDEO, false, SHOULD_SENDRECV_AV, SHOULD_RECV_AUDIO | SHOULD_SENDRECV_VIDEO); @@ -2156,8 +2156,8 @@ TEST_F(SignalingTest, DISABLED_OfferAnswerDontAddAudioStreamOnAnswer) TEST_F(SignalingTest, DISABLED_OfferAnswerDontAddVideoStreamOnAnswer) { sipcc::OfferOptions options; - options.setBooleanOption("OfferToReceiveAudio", true); - options.setBooleanOption("OfferToReceiveVideo", true); + options.setInt32Option("OfferToReceiveAudio", true); + options.setInt32Option("OfferToReceiveVideo", true); OfferAnswer(options, OFFER_AV | ANSWER_AUDIO, false, SHOULD_SENDRECV_AV, SHOULD_SENDRECV_AUDIO | SHOULD_RECV_VIDEO); @@ -2168,8 +2168,8 @@ TEST_F(SignalingTest, DISABLED_OfferAnswerDontAddVideoStreamOnAnswerDontReceiveVideoOnAnswer) { sipcc::OfferOptions options; - options.setBooleanOption("OfferToReceiveAudio", true); - options.setBooleanOption("OfferToReceiveVideo", true); + options.setInt32Option("OfferToReceiveAudio", true); + options.setInt32Option("OfferToReceiveVideo", true); OfferAnswer(options, OFFER_AV | ANSWER_AUDIO, false, SHOULD_SENDRECV_AV, SHOULD_SENDRECV_AUDIO ); } @@ -2179,8 +2179,8 @@ TEST_F(SignalingTest, DISABLED_OfferAnswerDontAddAudioStreamOnAnswerDontReceiveAudioOnAnswer) { sipcc::OfferOptions options; - options.setBooleanOption("OfferToReceiveAudio", true); - options.setBooleanOption("OfferToReceiveVideo", true); + options.setInt32Option("OfferToReceiveAudio", true); + options.setInt32Option("OfferToReceiveVideo", true); OfferAnswer(options, OFFER_AV | ANSWER_VIDEO, false, SHOULD_SENDRECV_AV, SHOULD_REJECT_AUDIO | SHOULD_SENDRECV_VIDEO); @@ -2191,8 +2191,8 @@ TEST_F(SignalingTest, DISABLED_OfferAnswerDontAddAudioStreamOnOfferDontReceiveAudioOnOffer) { sipcc::OfferOptions options; - options.setBooleanOption("OfferToReceiveAudio", false); - options.setBooleanOption("OfferToReceiveVideo", true); + options.setInt32Option("OfferToReceiveAudio", false); + options.setInt32Option("OfferToReceiveVideo", true); OfferAnswer(options, OFFER_VIDEO | ANSWER_AV, false, SHOULD_SENDRECV_VIDEO, SHOULD_SENDRECV_VIDEO); } @@ -2202,8 +2202,8 @@ TEST_F(SignalingTest, DISABLED_OfferAnswerDontAddVideoStreamOnOfferDontReceiveVideoOnOffer) { sipcc::OfferOptions options; - options.setBooleanOption("OfferToReceiveAudio", true); - options.setBooleanOption("OfferToReceiveVideo", false); + options.setInt32Option("OfferToReceiveAudio", true); + options.setInt32Option("OfferToReceiveVideo", false); OfferAnswer(options, OFFER_AUDIO | ANSWER_AV, false, SHOULD_SENDRECV_AUDIO | SHOULD_OMIT_VIDEO, SHOULD_SENDRECV_AUDIO | SHOULD_OMIT_VIDEO); @@ -2214,8 +2214,8 @@ TEST_F(SignalingTest, DISABLED_OfferAnswerDontReceiveAudioNoAudioStreamOnOfferDontReceiveVideoOnAnswer) { sipcc::OfferOptions options; - options.setBooleanOption("OfferToReceiveAudio", false); - options.setBooleanOption("OfferToReceiveVideo", true); + options.setInt32Option("OfferToReceiveAudio", false); + options.setInt32Option("OfferToReceiveVideo", true); OfferAnswer(options, OFFER_VIDEO | ANSWER_AV, false, SHOULD_SENDRECV_VIDEO, SHOULD_SEND_VIDEO); } @@ -2240,12 +2240,12 @@ TEST_F(SignalingTest, AddIceCandidateEarly) TEST_F(SignalingTest, DISABLED_OfferAnswerReNegotiateOfferAnswerDontReceiveVideoNoVideoStream) { sipcc::OfferOptions aoptions; - aoptions.setBooleanOption("OfferToReceiveAudio", true); - aoptions.setBooleanOption("OfferToReceiveVideo", true); + aoptions.setInt32Option("OfferToReceiveAudio", true); + aoptions.setInt32Option("OfferToReceiveVideo", true); sipcc::OfferOptions boptions; - boptions.setBooleanOption("OfferToReceiveAudio", true); - boptions.setBooleanOption("OfferToReceiveVideo", false); + boptions.setInt32Option("OfferToReceiveAudio", true); + boptions.setInt32Option("OfferToReceiveVideo", false); OfferAnswer(aoptions, OFFER_AV | ANSWER_AV, false, SHOULD_SENDRECV_AV, SHOULD_SENDRECV_AV); @@ -2257,8 +2257,8 @@ TEST_F(SignalingTest, DISABLED_OfferAnswerReNegotiateOfferAnswerDontReceiveVideo TEST_F(SignalingTest, OfferAnswerDontAddAudioStreamOnAnswerNoOptions) { sipcc::OfferOptions options; - options.setBooleanOption("OfferToReceiveAudio", true); - options.setBooleanOption("OfferToReceiveVideo", true); + options.setInt32Option("OfferToReceiveAudio", true); + options.setInt32Option("OfferToReceiveVideo", true); OfferAnswer(options, OFFER_AV | ANSWER_VIDEO, false, SHOULD_SENDRECV_AV, SHOULD_RECV_AUDIO | SHOULD_SENDRECV_VIDEO); @@ -2267,8 +2267,8 @@ TEST_F(SignalingTest, OfferAnswerDontAddAudioStreamOnAnswerNoOptions) TEST_F(SignalingTest, OfferAnswerDontAddVideoStreamOnAnswerNoOptions) { sipcc::OfferOptions options; - options.setBooleanOption("OfferToReceiveAudio", true); - options.setBooleanOption("OfferToReceiveVideo", true); + options.setInt32Option("OfferToReceiveAudio", true); + options.setInt32Option("OfferToReceiveVideo", true); OfferAnswer(options, OFFER_AV | ANSWER_AUDIO, false, SHOULD_SENDRECV_AV, SHOULD_SENDRECV_AUDIO | SHOULD_RECV_VIDEO); @@ -2277,8 +2277,8 @@ TEST_F(SignalingTest, OfferAnswerDontAddVideoStreamOnAnswerNoOptions) TEST_F(SignalingTest, OfferAnswerDontAddAudioVideoStreamsOnAnswerNoOptions) { sipcc::OfferOptions options; - options.setBooleanOption("OfferToReceiveAudio", true); - options.setBooleanOption("OfferToReceiveVideo", true); + options.setInt32Option("OfferToReceiveAudio", true); + options.setInt32Option("OfferToReceiveVideo", true); OfferAnswer(options, OFFER_AV | ANSWER_NONE, false, SHOULD_SENDRECV_AV, SHOULD_RECV_AUDIO | SHOULD_RECV_VIDEO); @@ -2338,8 +2338,8 @@ TEST_F(SignalingTest, DISABLED_FullCallAnswererRejectsVideo) { sipcc::OfferOptions offeroptions; sipcc::OfferOptions answeroptions; - answeroptions.setBooleanOption("offerToReceiveAudio", true); - answeroptions.setBooleanOption("offerToReceiveVideo", false); + answeroptions.setInt32Option("offerToReceiveAudio", true); + answeroptions.setInt32Option("offerToReceiveVideo", false); OfferAnswer(offeroptions, OFFER_AV | ANSWER_AUDIO, true, SHOULD_SENDRECV_AV, SHOULD_SENDRECV_AUDIO); From 1b701c43d1c0453abe9e1855402c0eb667b226f6 Mon Sep 17 00:00:00 2001 From: Jan-Ivar Bruaroey Date: Mon, 21 Jul 2014 06:53:15 +0200 Subject: [PATCH 12/84] Bug 1033833 - unbreak test_exceptions_from_jsimplemented.html. r=bz --- .../test/test_exceptions_from_jsimplemented.html | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/dom/bindings/test/test_exceptions_from_jsimplemented.html b/dom/bindings/test/test_exceptions_from_jsimplemented.html index 339e7c4efe5..82c8a5f4bc3 100644 --- a/dom/bindings/test/test_exceptions_from_jsimplemented.html +++ b/dom/bindings/test/test_exceptions_from_jsimplemented.html @@ -12,17 +12,18 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=923010 /** Test for Bug 923010 **/ try { var conn = new mozRTCPeerConnection(); + var candidate = new mozRTCIceCandidate({candidate: null }); try { - conn.createAnswer(function() { - ok(false, "The call to createAnswer succeeded when it should have thrown"); + conn.addIceCandidate(candidate, function() { + ok(false, "The call to addIceCandidate succeeded when it should have thrown"); }, function() { - ok(false, "The call to createAnswer failed when it should have thrown"); - }, { "mandatory": { "BOGUS": 5 } } ) - ok(false, "That call to createAnswer should have thrown"); + ok(false, "The call to addIceCandidate failed when it should have thrown"); + }) + ok(false, "That call to addIceCandidate should have thrown"); } catch (e) { - is(e.lineNumber, 16, "Exception should have been on line 16"); + is(e.lineNumber, 17, "Exception should have been on line 17"); is(e.message, - "createAnswer passed invalid constraints - unknown mandatory constraint: BOGUS", + "Invalid candidate passed to addIceCandidate!", "Should have the exception we expect"); } } catch (e) { From 29420d4a6a446489fb7395be4b075f4f41b6cd69 Mon Sep 17 00:00:00 2001 From: Bob Owen Date: Wed, 16 Jul 2014 13:49:02 +0100 Subject: [PATCH 13/84] Bug 1037904 Part 1: Replace nsCxPusher in nsJSObjWrapper::NP_HasMethod. r=bholley --- dom/plugins/base/nsJSNPRuntime.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/dom/plugins/base/nsJSNPRuntime.cpp b/dom/plugins/base/nsJSNPRuntime.cpp index 0b62c3b828a..37f7693d79f 100644 --- a/dom/plugins/base/nsJSNPRuntime.cpp +++ b/dom/plugins/base/nsJSNPRuntime.cpp @@ -27,6 +27,7 @@ #include "nsWrapperCacheInlines.h" #include "js/HashTable.h" #include "mozilla/HashFunctions.h" +#include "mozilla/dom/ScriptSettings.h" #define NPRUNTIME_JSCLASS_NAME "NPObject JS wrapper class" @@ -291,8 +292,8 @@ namespace mozilla { namespace plugins { namespace parent { -JSContext * -GetJSContext(NPP npp) +static nsIGlobalObject* +GetGlobalObject(NPP npp) { NS_ENSURE_TRUE(npp, nullptr); @@ -306,8 +307,13 @@ GetJSContext(NPP npp) owner->GetDocument(getter_AddRefs(doc)); NS_ENSURE_TRUE(doc, nullptr); - nsCOMPtr documentContainer = doc->GetContainer(); - nsCOMPtr sgo(do_GetInterface(documentContainer)); + return doc->GetScopeObject(); +} + +JSContext * +GetJSContext(NPP npp) +{ + nsCOMPtr sgo = do_QueryInterface(GetGlobalObject(npp)); NS_ENSURE_TRUE(sgo, nullptr); nsIScriptContext *scx = sgo->GetContext(); @@ -571,11 +577,11 @@ bool nsJSObjWrapper::NP_HasMethod(NPObject *npobj, NPIdentifier id) { NPP npp = NPPStack::Peek(); - JSContext *cx = GetJSContext(npp); - - if (!cx) { + dom::AutoJSAPI jsapi; + if (NS_WARN_IF(!jsapi.InitWithLegacyErrorReporting(GetGlobalObject(npp)))) { return false; } + JSContext *cx = jsapi.cx(); if (!npobj) { ThrowJSException(cx, @@ -586,8 +592,6 @@ nsJSObjWrapper::NP_HasMethod(NPObject *npobj, NPIdentifier id) nsJSObjWrapper *npjsobj = (nsJSObjWrapper *)npobj; - nsCxPusher pusher; - pusher.Push(cx); JSAutoCompartment ac(cx, npjsobj->mJSObj); AutoJSExceptionReporter reporter(cx); From afcac85c7c33cdc672a673e8fc6b63888b600306 Mon Sep 17 00:00:00 2001 From: Bob Owen Date: Wed, 16 Jul 2014 12:24:36 +0100 Subject: [PATCH 14/84] Bug 1037904 Part 2: Replace nsCxPusher in nsJSObjWrapper::NP_HasProperties. r=bholley --- dom/plugins/base/nsJSNPRuntime.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/dom/plugins/base/nsJSNPRuntime.cpp b/dom/plugins/base/nsJSNPRuntime.cpp index 37f7693d79f..c743f3484a6 100644 --- a/dom/plugins/base/nsJSNPRuntime.cpp +++ b/dom/plugins/base/nsJSNPRuntime.cpp @@ -700,11 +700,11 @@ bool nsJSObjWrapper::NP_HasProperty(NPObject *npobj, NPIdentifier npid) { NPP npp = NPPStack::Peek(); - JSContext *cx = GetJSContext(npp); - - if (!cx) { + dom::AutoJSAPI jsapi; + if (NS_WARN_IF(!jsapi.InitWithLegacyErrorReporting(GetGlobalObject(npp)))) { return false; } + JSContext *cx = jsapi.cx(); if (!npobj) { ThrowJSException(cx, @@ -716,8 +716,6 @@ nsJSObjWrapper::NP_HasProperty(NPObject *npobj, NPIdentifier npid) nsJSObjWrapper *npjsobj = (nsJSObjWrapper *)npobj; bool found, ok = false; - nsCxPusher pusher; - pusher.Push(cx); AutoJSExceptionReporter reporter(cx); JS::Rooted jsobj(cx, npjsobj->mJSObj); JSAutoCompartment ac(cx, jsobj); From 44241a355897c791ac47f8f07f3969928498d5c5 Mon Sep 17 00:00:00 2001 From: Bob Owen Date: Wed, 16 Jul 2014 12:24:49 +0100 Subject: [PATCH 15/84] Bug 1037904 Part 5: Replace nsCxPusher in nsJSObjWrapper::NP_RemoveProperty. r=bholley --- dom/plugins/base/nsJSNPRuntime.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/dom/plugins/base/nsJSNPRuntime.cpp b/dom/plugins/base/nsJSNPRuntime.cpp index c743f3484a6..1712a52e315 100644 --- a/dom/plugins/base/nsJSNPRuntime.cpp +++ b/dom/plugins/base/nsJSNPRuntime.cpp @@ -801,11 +801,11 @@ bool nsJSObjWrapper::NP_RemoveProperty(NPObject *npobj, NPIdentifier npid) { NPP npp = NPPStack::Peek(); - JSContext *cx = GetJSContext(npp); - - if (!cx) { + dom::AutoJSAPI jsapi; + if (NS_WARN_IF(!jsapi.InitWithLegacyErrorReporting(GetGlobalObject(npp)))) { return false; } + JSContext *cx = jsapi.cx(); if (!npobj) { ThrowJSException(cx, @@ -817,8 +817,6 @@ nsJSObjWrapper::NP_RemoveProperty(NPObject *npobj, NPIdentifier npid) nsJSObjWrapper *npjsobj = (nsJSObjWrapper *)npobj; bool ok = false; - nsCxPusher pusher; - pusher.Push(cx); AutoJSExceptionReporter reporter(cx); bool deleted = false; JS::Rooted obj(cx, npjsobj->mJSObj); From 249c87c806fbfc02f6d7aa62a68d8c3352e41987 Mon Sep 17 00:00:00 2001 From: Bob Owen Date: Wed, 16 Jul 2014 12:25:02 +0100 Subject: [PATCH 16/84] Bug 1037904 Part 6: Replace nsCxPusher in nsJSObjWrapper::NP_Enumerate. r=bholley --- dom/plugins/base/nsJSNPRuntime.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/dom/plugins/base/nsJSNPRuntime.cpp b/dom/plugins/base/nsJSNPRuntime.cpp index 1712a52e315..e0a658af196 100644 --- a/dom/plugins/base/nsJSNPRuntime.cpp +++ b/dom/plugins/base/nsJSNPRuntime.cpp @@ -850,15 +850,15 @@ nsJSObjWrapper::NP_Enumerate(NPObject *npobj, NPIdentifier **idarray, uint32_t *count) { NPP npp = NPPStack::Peek(); - JSContext *cx = GetJSContext(npp); + dom::AutoJSAPI jsapi; + if (NS_WARN_IF(!jsapi.InitWithLegacyErrorReporting(GetGlobalObject(npp)))) { + return false; + } + JSContext *cx = jsapi.cx(); *idarray = 0; *count = 0; - if (!cx) { - return false; - } - if (!npobj) { ThrowJSException(cx, "Null npobj in nsJSObjWrapper::NP_Enumerate!"); @@ -868,8 +868,6 @@ nsJSObjWrapper::NP_Enumerate(NPObject *npobj, NPIdentifier **idarray, nsJSObjWrapper *npjsobj = (nsJSObjWrapper *)npobj; - nsCxPusher pusher; - pusher.Push(cx); AutoJSExceptionReporter reporter(cx); JS::Rooted jsobj(cx, npjsobj->mJSObj); JSAutoCompartment ac(cx, jsobj); From c7050c0475961831697fe662e58be854506af42d Mon Sep 17 00:00:00 2001 From: Jeremy Poulin Date: Tue, 15 Jul 2014 09:23:09 -0700 Subject: [PATCH 17/84] Bug 1038357 - Added automatic pruning for mForcedValidEntries in CacheStorage Service. r=honzab --- netwerk/cache2/CacheStorageService.cpp | 33 ++++++++++++++++++++++++-- netwerk/cache2/CacheStorageService.h | 2 ++ 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/netwerk/cache2/CacheStorageService.cpp b/netwerk/cache2/CacheStorageService.cpp index 0ed4dd70654..2220735f018 100644 --- a/netwerk/cache2/CacheStorageService.cpp +++ b/netwerk/cache2/CacheStorageService.cpp @@ -1067,13 +1067,42 @@ void CacheStorageService::ForceEntryValidFor(nsACString &aCacheEntryKey, { mozilla::MutexAutoLock lock(mLock); + TimeStamp now = TimeStamp::NowLoRes(); + ForcedValidEntriesPrune(now); + // This will be the timeout - TimeStamp validUntil = TimeStamp::NowLoRes() + - TimeDuration::FromSeconds(aSecondsToTheFuture); + TimeStamp validUntil = now + TimeDuration::FromSeconds(aSecondsToTheFuture); mForcedValidEntries.Put(aCacheEntryKey, validUntil); } +namespace { // anon + +PLDHashOperator PruneForcedValidEntries( + const nsACString& aKey, TimeStamp& aTimeStamp, void* aClosure) +{ + TimeStamp* now = static_cast(aClosure); + if (aTimeStamp < *now) { + return PL_DHASH_REMOVE; + } + + return PL_DHASH_NEXT; +} + +} // anon + +// Cleans out the old entries in mForcedValidEntries +void CacheStorageService::ForcedValidEntriesPrune(TimeStamp &now) +{ + static TimeDuration const oneMinute = TimeDuration::FromSeconds(60); + static TimeStamp dontPruneUntil = now + oneMinute; + if (now < dontPruneUntil) + return; + + mForcedValidEntries.Enumerate(PruneForcedValidEntries, &now); + dontPruneUntil = now + oneMinute; +} + void CacheStorageService::OnMemoryConsumptionChange(CacheMemoryConsumer* aConsumer, uint32_t aCurrentMemoryConsumption) diff --git a/netwerk/cache2/CacheStorageService.h b/netwerk/cache2/CacheStorageService.h index 6c494b2c039..3e3e34f2e94 100644 --- a/netwerk/cache2/CacheStorageService.h +++ b/netwerk/cache2/CacheStorageService.h @@ -280,6 +280,8 @@ private: bool aReplace, CacheEntryHandle** aResult); + void ForcedValidEntriesPrune(TimeStamp &now); + static CacheStorageService* sSelf; mozilla::Mutex mLock; From 5a72aa1711f51a1cc041555fbda0ceba8bcd425b Mon Sep 17 00:00:00 2001 From: Bob Owen Date: Mon, 14 Jul 2014 18:49:18 +0100 Subject: [PATCH 18/84] Bug 1037564 Part 1: Replace AutoPushJSContext in nsBindingManager::GetBindingImplementation. r=bholley --- dom/xbl/nsBindingManager.cpp | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/dom/xbl/nsBindingManager.cpp b/dom/xbl/nsBindingManager.cpp index 21c0d43d36f..517c4847de9 100644 --- a/dom/xbl/nsBindingManager.cpp +++ b/dom/xbl/nsBindingManager.cpp @@ -46,10 +46,10 @@ #include "nsIScriptContext.h" #include "xpcpublic.h" #include "jswrapper.h" -#include "nsCxPusher.h" #include "nsThreadUtils.h" #include "mozilla/dom/NodeListBinding.h" +#include "mozilla/dom/ScriptSettings.h" using namespace mozilla; using namespace mozilla::dom; @@ -638,21 +638,9 @@ nsBindingManager::GetBindingImplementation(nsIContent* aContent, REFNSIID aIID, // We have never made a wrapper for this implementation. // Create an XPC wrapper for the script object and hand it back. - - nsIDocument* doc = aContent->OwnerDoc(); - - nsCOMPtr global = - do_QueryInterface(doc->GetWindow()); - if (!global) - return NS_NOINTERFACE; - - nsIScriptContext *context = global->GetContext(); - if (!context) - return NS_NOINTERFACE; - - AutoPushJSContext cx(context->GetNativeContext()); - if (!cx) - return NS_NOINTERFACE; + AutoJSAPI jsapi; + jsapi.Init(); + JSContext* cx = jsapi.cx(); nsIXPConnect *xpConnect = nsContentUtils::XPConnect(); @@ -666,8 +654,7 @@ nsBindingManager::GetBindingImplementation(nsIContent* aContent, REFNSIID aIID, // because they're chrome-only and no Xrays are involved. // // If there's no separate XBL scope, or if the reflector itself lives in - // the XBL scope, we'll end up with the global of the reflector, and this - // will all be a no-op. + // the XBL scope, we'll end up with the global of the reflector. JS::Rooted xblScope(cx, xpc::GetXBLScopeOrGlobal(cx, jsobj)); JSAutoCompartment ac(cx, xblScope); bool ok = JS_WrapObject(cx, &jsobj); From 68db9742fbc056dfc2945e7f242b1e15ae3999e9 Mon Sep 17 00:00:00 2001 From: Bob Owen Date: Fri, 18 Jul 2014 12:52:32 +0100 Subject: [PATCH 19/84] Bug 1037564 Part 2: Replace AutoPushJSContexts et al. in nsXBLPrototypeHandler. r=bholley --- dom/base/ScriptSettings.h | 3 ++- dom/xbl/nsXBLPrototypeHandler.cpp | 35 ++++++++++++++----------------- dom/xbl/nsXBLPrototypeHandler.h | 5 ++--- js/xpconnect/src/nsCxPusher.cpp | 2 +- js/xpconnect/src/nsCxPusher.h | 2 +- 5 files changed, 22 insertions(+), 25 deletions(-) diff --git a/dom/base/ScriptSettings.h b/dom/base/ScriptSettings.h index 40f7b0afea2..02758333ec7 100644 --- a/dom/base/ScriptSettings.h +++ b/dom/base/ScriptSettings.h @@ -168,10 +168,11 @@ public: JSContext* cx() const { MOZ_ASSERT(mCx, "Must call Init before using an AutoJSAPI"); + MOZ_ASSERT_IF(NS_IsMainThread(), CxPusherIsStackTop()); return mCx; } - bool CxPusherIsStackTop() { return mCxPusher.ref().IsStackTop(); } + bool CxPusherIsStackTop() const { return mCxPusher.ref().IsStackTop(); } protected: // Protected constructor, allowing subclasses to specify a particular cx to diff --git a/dom/xbl/nsXBLPrototypeHandler.cpp b/dom/xbl/nsXBLPrototypeHandler.cpp index 012104e0277..1663738cfff 100644 --- a/dom/xbl/nsXBLPrototypeHandler.cpp +++ b/dom/xbl/nsXBLPrototypeHandler.cpp @@ -10,12 +10,12 @@ #include "nsXBLPrototypeBinding.h" #include "nsContentUtils.h" #include "nsCxPusher.h" +#include "nsGlobalWindow.h" #include "nsIContent.h" #include "nsIAtom.h" #include "nsIDOMKeyEvent.h" #include "nsIDOMMouseEvent.h" #include "nsNameSpaceManager.h" -#include "nsIScriptContext.h" #include "nsIDocument.h" #include "nsIController.h" #include "nsIControllers.h" @@ -46,6 +46,8 @@ #include "mozilla/JSEventHandler.h" #include "mozilla/Preferences.h" #include "mozilla/dom/EventHandlerBinding.h" +#include "mozilla/dom/ScriptSettings.h" +#include "xpcpublic.h" using namespace mozilla; using namespace mozilla::dom; @@ -259,10 +261,6 @@ nsXBLPrototypeHandler::ExecuteHandler(EventTarget* aTarget, if (!boundGlobal) return NS_OK; - nsIScriptContext *boundContext = boundGlobal->GetScriptContext(); - if (!boundContext) - return NS_OK; - nsISupports *scriptTarget; if (winRoot) { @@ -271,16 +269,17 @@ nsXBLPrototypeHandler::ExecuteHandler(EventTarget* aTarget, scriptTarget = aTarget; } - // We're about to create a new JSEventHandler, which means that we're - // responsible for pushing the context of the event target. See the similar - // comment in nsEventManagerListener.cpp. - nsCxPusher pusher; - NS_ENSURE_STATE(pusher.Push(aTarget)); - - AutoPushJSContext cx(boundContext->GetNativeContext()); + // We're about to create a new JSEventHandler, which means that we need to + // Initiatize an AutoJSAPI with aTarget's bound global to make sure any errors + // are reported to the correct place. + AutoJSAPI jsapi; + if (NS_WARN_IF(!jsapi.InitWithLegacyErrorReporting(boundGlobal))) { + return NS_OK; + } + JSContext* cx = jsapi.cx(); JS::Rooted handler(cx); - rv = EnsureEventHandler(boundGlobal, boundContext, onEventAtom, &handler); + rv = EnsureEventHandler(jsapi, onEventAtom, &handler); NS_ENSURE_SUCCESS(rv, rv); JSAddonId* addonId = MapURIToAddonID(mPrototypeBinding->DocURI()); @@ -338,15 +337,14 @@ nsXBLPrototypeHandler::ExecuteHandler(EventTarget* aTarget, } nsresult -nsXBLPrototypeHandler::EnsureEventHandler(nsIScriptGlobalObject* aGlobal, - nsIScriptContext *aBoundContext, - nsIAtom *aName, +nsXBLPrototypeHandler::EnsureEventHandler(AutoJSAPI& jsapi, nsIAtom* aName, JS::MutableHandle aHandler) { - AutoPushJSContext cx(aBoundContext->GetNativeContext()); + JSContext* cx = jsapi.cx(); // Check to see if we've already compiled this - nsCOMPtr pWindow = do_QueryInterface(aGlobal); + JS::Rooted globalObject(cx, JS::CurrentGlobalOrNull(cx)); + nsCOMPtr pWindow = xpc::WindowOrNull(globalObject); if (pWindow) { JS::Rooted cachedHandler(cx, pWindow->GetCachedXBLPrototypeHandler(this)); if (cachedHandler) { @@ -363,7 +361,6 @@ nsXBLPrototypeHandler::EnsureEventHandler(nsIScriptGlobalObject* aGlobal, JSAddonId* addonId = MapURIToAddonID(mPrototypeBinding->DocURI()); - JS::Rooted globalObject(cx, aGlobal->GetGlobalJSObject()); JS::Rooted scopeObject(cx, xpc::GetScopeForXBLExecution(cx, globalObject, addonId)); NS_ENSURE_TRUE(scopeObject, NS_ERROR_OUT_OF_MEMORY); diff --git a/dom/xbl/nsXBLPrototypeHandler.h b/dom/xbl/nsXBLPrototypeHandler.h index ca549b46333..94608188cc6 100644 --- a/dom/xbl/nsXBLPrototypeHandler.h +++ b/dom/xbl/nsXBLPrototypeHandler.h @@ -13,7 +13,6 @@ #include "nsAutoPtr.h" #include "nsXBLEventHandler.h" #include "nsIWeakReference.h" -#include "nsIScriptGlobalObject.h" #include "nsCycleCollectionParticipant.h" #include "js/TypeDecls.h" @@ -28,6 +27,7 @@ class nsXBLPrototypeBinding; namespace mozilla { namespace dom { +class AutoJSAPI; class EventTarget; } } @@ -166,8 +166,7 @@ protected: bool aIgnoreShiftKey = false); nsresult DispatchXBLCommand(mozilla::dom::EventTarget* aTarget, nsIDOMEvent* aEvent); nsresult DispatchXULKeyCommand(nsIDOMEvent* aEvent); - nsresult EnsureEventHandler(nsIScriptGlobalObject* aGlobal, - nsIScriptContext *aBoundContext, nsIAtom *aName, + nsresult EnsureEventHandler(mozilla::dom::AutoJSAPI& jsapi, nsIAtom* aName, JS::MutableHandle aHandler); static int32_t KeyToMask(int32_t key); static int32_t AccelKeyMask(); diff --git a/js/xpconnect/src/nsCxPusher.cpp b/js/xpconnect/src/nsCxPusher.cpp index 2747ac0ec60..34d2e4d1b03 100644 --- a/js/xpconnect/src/nsCxPusher.cpp +++ b/js/xpconnect/src/nsCxPusher.cpp @@ -161,7 +161,7 @@ AutoCxPusher::~AutoCxPusher() } bool -AutoCxPusher::IsStackTop() +AutoCxPusher::IsStackTop() const { uint32_t currentDepth = XPCJSRuntime::Get()->GetJSContextStack()->Count(); MOZ_ASSERT(currentDepth >= mStackDepthAfterPush); diff --git a/js/xpconnect/src/nsCxPusher.h b/js/xpconnect/src/nsCxPusher.h index 069bb5a3bc9..672f350fa62 100644 --- a/js/xpconnect/src/nsCxPusher.h +++ b/js/xpconnect/src/nsCxPusher.h @@ -36,7 +36,7 @@ public: // Returns true if this AutoCxPusher performed the push that is currently at // the top of the cx stack. - bool IsStackTop(); + bool IsStackTop() const; private: mozilla::Maybe mAutoRequest; From 37adeee8149bb5ae262b8c215d17edcb355739d7 Mon Sep 17 00:00:00 2001 From: Bob Owen Date: Tue, 15 Jul 2014 12:34:42 +0100 Subject: [PATCH 20/84] Bug 1037564 Part 3: Replace |nsCxPusher|s in nsObjectLoadingContent::NotifyContentObjectWrapper. r=bholley --- content/base/src/nsObjectLoadingContent.cpp | 40 +++++---------------- content/base/src/nsObjectLoadingContent.h | 4 +-- 2 files changed, 10 insertions(+), 34 deletions(-) diff --git a/content/base/src/nsObjectLoadingContent.cpp b/content/base/src/nsObjectLoadingContent.cpp index fd62ad308a1..0bb83bb6dfe 100644 --- a/content/base/src/nsObjectLoadingContent.cpp +++ b/content/base/src/nsObjectLoadingContent.cpp @@ -26,7 +26,6 @@ #include "nsJSNPRuntime.h" #include "nsINestedURI.h" #include "nsIPresShell.h" -#include "nsIScriptGlobalObject.h" #include "nsScriptSecurityManager.h" #include "nsIScriptSecurityManager.h" #include "nsIStreamConverterService.h" @@ -80,6 +79,7 @@ #include "mozilla/dom/BindingUtils.h" #include "mozilla/dom/Element.h" #include "mozilla/dom/Event.h" +#include "mozilla/dom/ScriptSettings.h" #include "mozilla/EventDispatcher.h" #include "mozilla/EventStates.h" #include "mozilla/Telemetry.h" @@ -2914,21 +2914,9 @@ nsObjectLoadingContent::NotifyContentObjectWrapper() nsCOMPtr thisContent = do_QueryInterface(static_cast(this)); - nsCOMPtr doc = thisContent->GetDocument(); - if (!doc) - return; - - nsCOMPtr sgo = do_QueryInterface(doc->GetScopeObject()); - if (!sgo) - return; - - nsIScriptContext *scx = sgo->GetContext(); - if (!scx) - return; - - JSContext *cx = scx->GetNativeContext(); - nsCxPusher pusher; - pusher.Push(cx); + AutoJSAPI jsapi; + jsapi.Init(); + JSContext* cx = jsapi.cx(); JS::Rooted obj(cx, thisContent->GetWrapper()); if (!obj) { @@ -3297,12 +3285,7 @@ nsObjectLoadingContent::SetupProtoChain(JSContext* aCx, } if (!nsContentUtils::IsSafeToRunScript()) { - // This may be null if the JS context is not a DOM context. That's ok, we'll - // use the safe context from XPConnect in the runnable. - nsCOMPtr scriptContext = GetScriptContextFromJSContext(aCx); - - nsRefPtr runner = - new SetupProtoChainRunner(scriptContext, this); + nsRefPtr runner = new SetupProtoChainRunner(this); nsContentUtils::AddScriptRunner(runner); return; } @@ -3510,10 +3493,8 @@ nsObjectLoadingContent::GetOwnPropertyNames(JSContext* aCx, // SetupProtoChainRunner implementation nsObjectLoadingContent::SetupProtoChainRunner::SetupProtoChainRunner( - nsIScriptContext* scriptContext, nsObjectLoadingContent* aContent) - : mContext(scriptContext) - , mContent(aContent) + : mContent(aContent) { } @@ -3524,12 +3505,9 @@ nsObjectLoadingContent::SetupProtoChainRunner::~SetupProtoChainRunner() NS_IMETHODIMP nsObjectLoadingContent::SetupProtoChainRunner::Run() { - // XXXbz Does it really matter what JSContext we use here? Seems - // like we could just always use the safe context.... - nsCxPusher pusher; - JSContext* cx = mContext ? mContext->GetNativeContext() - : nsContentUtils::GetSafeJSContext(); - pusher.Push(cx); + AutoJSAPI jsapi; + jsapi.Init(); + JSContext* cx = jsapi.cx(); nsCOMPtr content; CallQueryInterface(mContent.get(), getter_AddRefs(content)); diff --git a/content/base/src/nsObjectLoadingContent.h b/content/base/src/nsObjectLoadingContent.h index 255ef090386..375f645ddc5 100644 --- a/content/base/src/nsObjectLoadingContent.h +++ b/content/base/src/nsObjectLoadingContent.h @@ -477,13 +477,11 @@ class nsObjectLoadingContent : public nsImageLoadingContent public: NS_DECL_ISUPPORTS - SetupProtoChainRunner(nsIScriptContext* scriptContext, - nsObjectLoadingContent* aContent); + SetupProtoChainRunner(nsObjectLoadingContent* aContent); NS_IMETHOD Run() MOZ_OVERRIDE; private: - nsCOMPtr mContext; // We store an nsIObjectLoadingContent because we can // unambiguously refcount that. nsRefPtr mContent; From 430bcd7a93434582ac50a01c82aeeac657713e9e Mon Sep 17 00:00:00 2001 From: Bob Owen Date: Fri, 18 Jul 2014 12:58:10 +0100 Subject: [PATCH 21/84] Bug 1037564 Part 4: Replace nsCxPusher in nsJSContext::SetProperty. r=bholley --- dom/base/nsJSEnvironment.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dom/base/nsJSEnvironment.cpp b/dom/base/nsJSEnvironment.cpp index eb0e94e78c2..505cd4e7344 100644 --- a/dom/base/nsJSEnvironment.cpp +++ b/dom/base/nsJSEnvironment.cpp @@ -936,8 +936,12 @@ nsJSContext::InitContext() nsresult nsJSContext::SetProperty(JS::Handle aTarget, const char* aPropName, nsISupports* aArgs) { - nsCxPusher pusher; - pusher.Push(mContext); + AutoJSAPI jsapi; + if (NS_WARN_IF(!jsapi.InitWithLegacyErrorReporting(GetGlobalObject()))) { + return NS_ERROR_FAILURE; + } + MOZ_ASSERT(jsapi.cx() == mContext, + "AutoJSAPI should have found our own JSContext*"); JS::AutoValueVector args(mContext); From 719458b28d34b5f0bffe24c9e57e215505c3d846 Mon Sep 17 00:00:00 2001 From: Luke Wagner Date: Mon, 21 Jul 2014 09:36:07 +0200 Subject: [PATCH 22/84] Bug 986673: Test pointer's value in AsmJSInterruptCheck; r=bbouvier --- js/src/jit/CodeGenerator.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/src/jit/CodeGenerator.cpp b/js/src/jit/CodeGenerator.cpp index f8b696081eb..f45b0aec2a3 100644 --- a/js/src/jit/CodeGenerator.cpp +++ b/js/src/jit/CodeGenerator.cpp @@ -8808,10 +8808,11 @@ CodeGenerator::visitInterruptCheck(LInterruptCheck *lir) bool CodeGenerator::visitAsmJSInterruptCheck(LAsmJSInterruptCheck *lir) { - Label rejoin; Register scratch = ToRegister(lir->scratch()); masm.movePtr(AsmJSImmPtr(AsmJSImm_RuntimeInterrupt), scratch); - masm.branchIfFalseBool(scratch, &rejoin); + masm.load8ZeroExtend(Address(scratch, 0), scratch); + Label rejoin; + masm.branch32(Assembler::Equal, scratch, Imm32(0), &rejoin); { uint32_t stackFixup = ComputeByteAlignment(masm.framePushed() + AsmJSFrameSize, StackAlignment); From 3e0ba0a4cd51947ad4929b6e8bb0247a2840e07b Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Fri, 18 Jul 2014 12:14:51 +0200 Subject: [PATCH 23/84] Bug 986673: Tests; r=luke --- .../jit-test/tests/asm.js/testHeapAccess.js | 27 +++++++++++++++++++ ...stTimeout-deactivate-reactivate-signals.js | 27 +++++++++++++++++++ .../tests/asm.js/testTimeout1-nosignals.js | 9 +++++++ .../tests/asm.js/testTimeout2-nosignals.js | 9 +++++++ .../tests/asm.js/testTimeout3-nosignals.js | 9 +++++++ .../tests/asm.js/testTimeout4-nosignals.js | 9 +++++++ .../jit-test/tests/ion/iloop-nosignaling.js | 5 ++++ js/src/jsapi.cpp | 11 ++++++++ js/src/jsapi.h | 3 ++- js/src/vm/Runtime.h | 3 +++ 10 files changed, 111 insertions(+), 1 deletion(-) create mode 100644 js/src/jit-test/tests/asm.js/testTimeout-deactivate-reactivate-signals.js create mode 100644 js/src/jit-test/tests/asm.js/testTimeout1-nosignals.js create mode 100644 js/src/jit-test/tests/asm.js/testTimeout2-nosignals.js create mode 100644 js/src/jit-test/tests/asm.js/testTimeout3-nosignals.js create mode 100644 js/src/jit-test/tests/asm.js/testTimeout4-nosignals.js create mode 100644 js/src/jit-test/tests/ion/iloop-nosignaling.js diff --git a/js/src/jit-test/tests/asm.js/testHeapAccess.js b/js/src/jit-test/tests/asm.js/testHeapAccess.js index 8501c215792..094ef8b0444 100644 --- a/js/src/jit-test/tests/asm.js/testHeapAccess.js +++ b/js/src/jit-test/tests/asm.js/testHeapAccess.js @@ -22,6 +22,33 @@ assertEq(f(0x7f),0x7f); assertEq(f(0xff),-1); assertEq(f(0x100),0); +// Test signal handlers deactivation +(function() { + var jco = getJitCompilerOptions(); + var signalHandlersBefore = jco["signals.enable"]; + if (signalHandlersBefore == 1) { + setJitCompilerOption("signals.enable", 0); + + if (isCachingEnabled()) { + // Cloned modules should fail on linking if the initial module has + // been compiled with signals but signals are deactivated. + var code = asmCompile('glob', 'imp', 'b', USE_ASM + HEAP_IMPORTS + 'function f(i) {i=i|0; i32[0] = i; return i8[0]|0}; return f'); + assertAsmLinkFail(code, this, null, new ArrayBuffer(4096)); + } + + var code = asmCompile('glob', 'imp', 'b', USE_ASM + HEAP_IMPORTS + '/* not a clone */ function f(i) {i=i|0; i32[0] = i; return i8[0]|0}; return f'); + var f = asmLink(code, this, null, new ArrayBuffer(4096)); + assertEq(f(0),0); + assertEq(f(0x7f),0x7f); + assertEq(f(0xff),-1); + assertEq(f(0x100),0); + setJitCompilerOption("signals.enable", 1); + } + jco = getJitCompilerOptions(); + var signalHandlersAfter = jco["signals.enable"]; + assertEq(signalHandlersBefore, signalHandlersAfter); +})(); + var code = asmCompile('glob', 'imp', 'b', USE_ASM + HEAP_IMPORTS + 'function f(i) {i=i|0; i32[0] = i; return u8[0]|0}; return f'); var f = asmLink(code, this, null, new ArrayBuffer(4096)); assertEq(f(0),0); diff --git a/js/src/jit-test/tests/asm.js/testTimeout-deactivate-reactivate-signals.js b/js/src/jit-test/tests/asm.js/testTimeout-deactivate-reactivate-signals.js new file mode 100644 index 00000000000..4049d5733d4 --- /dev/null +++ b/js/src/jit-test/tests/asm.js/testTimeout-deactivate-reactivate-signals.js @@ -0,0 +1,27 @@ +// |jit-test| exitstatus: 6; + +load(libdir + "asm.js"); + +var jco = getJitCompilerOptions(); +if (jco["signals.enable"] === 0 || !isCachingEnabled() || !isAsmJSCompilationAvailable()) + quit(6); + +// Modules compiled without signal handlers should still work even if signal +// handlers have been reactivated. +setJitCompilerOption("signals.enable", 0); + +var code = USE_ASM + "/* deactivate-reactivate-signals */ function f() {} function g() { while(1) { f() } } return g"; + +var m = asmCompile(code); +assertEq(isAsmJSModule(m), true); + +setJitCompilerOption("signals.enable", 1); + +var m = asmCompile(code); +assertEq(isAsmJSModule(m), true); +assertEq(isAsmJSModuleLoadedFromCache(m), true); + +var g = asmLink(m); +timeout(1); +g(); +assertEq(true, false); diff --git a/js/src/jit-test/tests/asm.js/testTimeout1-nosignals.js b/js/src/jit-test/tests/asm.js/testTimeout1-nosignals.js new file mode 100644 index 00000000000..a3f74eee221 --- /dev/null +++ b/js/src/jit-test/tests/asm.js/testTimeout1-nosignals.js @@ -0,0 +1,9 @@ +// |jit-test| exitstatus: 6; + +load(libdir + "asm.js"); + +setJitCompilerOption("signals.enable", 0); +var g = asmLink(asmCompile(USE_ASM + "/* no-signals */ function f() {} function g() { while(1) { f() } } return g")); +timeout(1); +g(); +assertEq(true, false); diff --git a/js/src/jit-test/tests/asm.js/testTimeout2-nosignals.js b/js/src/jit-test/tests/asm.js/testTimeout2-nosignals.js new file mode 100644 index 00000000000..bb1fbc9083e --- /dev/null +++ b/js/src/jit-test/tests/asm.js/testTimeout2-nosignals.js @@ -0,0 +1,9 @@ +// |jit-test| exitstatus: 6; + +load(libdir + "asm.js"); + +setJitCompilerOption("signals.enable", 0); +var g = asmLink(asmCompile(USE_ASM + "/* no-signals */ function g() { while(1) {} } return g")); +timeout(1); +g(); +assertEq(true, false); diff --git a/js/src/jit-test/tests/asm.js/testTimeout3-nosignals.js b/js/src/jit-test/tests/asm.js/testTimeout3-nosignals.js new file mode 100644 index 00000000000..fc70bea7be4 --- /dev/null +++ b/js/src/jit-test/tests/asm.js/testTimeout3-nosignals.js @@ -0,0 +1,9 @@ +// |jit-test| exitstatus: 6; + +load(libdir + "asm.js"); + +setJitCompilerOption("signals.enable", 0); +var f = asmLink(asmCompile(USE_ASM + "/* no-signals */ function f(i) { i=i|0; if (!i) return; f((i-1)|0); f((i-1)|0); f((i-1)|0); f((i-1)|0); f((i-1)|0); } return f")); +timeout(1); +f(100); +assertEq(true, false); diff --git a/js/src/jit-test/tests/asm.js/testTimeout4-nosignals.js b/js/src/jit-test/tests/asm.js/testTimeout4-nosignals.js new file mode 100644 index 00000000000..14ecf0ca9a6 --- /dev/null +++ b/js/src/jit-test/tests/asm.js/testTimeout4-nosignals.js @@ -0,0 +1,9 @@ +// |jit-test| exitstatus: 6; + +load(libdir + "asm.js"); + +setJitCompilerOption("signals.enable", 0); +var g = asmLink(asmCompile(USE_ASM + "/* no-signals */ function f(d) { d=+d; d=d*.1; d=d/.4; return +d } function g() { while(1) { +f(1.1) } } return g")); +timeout(1); +g(); +assertEq(true, false); diff --git a/js/src/jit-test/tests/ion/iloop-nosignaling.js b/js/src/jit-test/tests/ion/iloop-nosignaling.js new file mode 100644 index 00000000000..d62dc6b19fe --- /dev/null +++ b/js/src/jit-test/tests/ion/iloop-nosignaling.js @@ -0,0 +1,5 @@ +// |jit-test| exitstatus: 6; + +setJitCompilerOption('signals.enable', 0); +timeout(1); +for(;;); diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp index 2a55eae1632..4a953b31f21 100644 --- a/js/src/jsapi.cpp +++ b/js/src/jsapi.cpp @@ -6309,6 +6309,15 @@ JS_SetGlobalJitCompilerOption(JSRuntime *rt, JSJitCompilerOption opt, uint32_t v IonSpew(js::jit::IonSpew_Scripts, "Disable offthread compilation"); } break; + case JSJITCOMPILER_SIGNALS_ENABLE: + if (value == 1) { + rt->setCanUseSignalHandlers(true); + IonSpew(js::jit::IonSpew_Scripts, "Enable signals"); + } else if (value == 0) { + rt->setCanUseSignalHandlers(false); + IonSpew(js::jit::IonSpew_Scripts, "Disable signals"); + } + break; default: break; } @@ -6330,6 +6339,8 @@ JS_GetGlobalJitCompilerOption(JSRuntime *rt, JSJitCompilerOption opt) return JS::RuntimeOptionsRef(rt).baseline(); case JSJITCOMPILER_OFFTHREAD_COMPILATION_ENABLE: return rt->canUseOffthreadIonCompilation(); + case JSJITCOMPILER_SIGNALS_ENABLE: + return rt->canUseSignalHandlers(); default: break; } diff --git a/js/src/jsapi.h b/js/src/jsapi.h index 9227d9c0c5c..4b5a4ce1ff5 100644 --- a/js/src/jsapi.h +++ b/js/src/jsapi.h @@ -4926,7 +4926,8 @@ JS_SetOffthreadIonCompilationEnabled(JSRuntime *rt, bool enabled); Register(ION_USECOUNT_TRIGGER, "ion.usecount.trigger") \ Register(ION_ENABLE, "ion.enable") \ Register(BASELINE_ENABLE, "baseline.enable") \ - Register(OFFTHREAD_COMPILATION_ENABLE, "offthread-compilation.enable") + Register(OFFTHREAD_COMPILATION_ENABLE, "offthread-compilation.enable") \ + Register(SIGNALS_ENABLE, "signals.enable") typedef enum JSJitCompilerOption { #define JIT_COMPILER_DECLARE(key, str) \ diff --git a/js/src/vm/Runtime.h b/js/src/vm/Runtime.h index e8dd7baa946..58e20efef88 100644 --- a/js/src/vm/Runtime.h +++ b/js/src/vm/Runtime.h @@ -1086,6 +1086,9 @@ struct JSRuntime : public JS::shadow::Runtime, bool canUseSignalHandlers() const { return canUseSignalHandlers_; } + void setCanUseSignalHandlers(bool enable) { + canUseSignalHandlers_ = signalHandlersInstalled_ && enable; + } private: js::FreeOp defaultFreeOp_; From c4fc9cc6aca9864ba655e3b2195257ae325d6bc6 Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Mon, 21 Jul 2014 09:45:04 +0200 Subject: [PATCH 24/84] Bug 1040785: Factor out InvokeFromAsmJS functions; r=luke --- js/src/jit/AsmJS.cpp | 47 +++++++++++++++++++------------------------- 1 file changed, 20 insertions(+), 27 deletions(-) diff --git a/js/src/jit/AsmJS.cpp b/js/src/jit/AsmJS.cpp index ccd54313af3..803ce124aed 100644 --- a/js/src/jit/AsmJS.cpp +++ b/js/src/jit/AsmJS.cpp @@ -6065,7 +6065,11 @@ GenerateEntry(ModuleCompiler &m, const AsmJSModule::ExportedFunction &exportedFu return true; } -static inline bool +// This function and InvokeFromAsmJS* functions all return int32_t rather than +// bool to prevent the compiler from optimizing bits higher than what's +// actually needed for a bool (as the result is tested in asm.js generated code +// which the compiler isn't aware of). +static inline int32_t TryEnablingIon(JSContext *cx, AsmJSModule &module, HandleFunction fun, uint32_t exitIndex, int32_t argc, Value *argv) { @@ -6105,64 +6109,53 @@ TryEnablingIon(JSContext *cx, AsmJSModule &module, HandleFunction fun, uint32_t namespace js { +// See comment above TryEnablingIon. int32_t -InvokeFromAsmJS_Ignore(JSContext *cx, int32_t exitIndex, int32_t argc, Value *argv) +InvokeFromAsmJS(JSContext *cx, int32_t exitIndex, int32_t argc, Value *argv, + MutableHandleValue rval) { AsmJSModule &module = cx->mainThread().asmJSActivationStackFromOwnerThread()->module(); RootedFunction fun(cx, module.exitIndexToGlobalDatum(exitIndex).fun); RootedValue fval(cx, ObjectValue(*fun)); + if (!Invoke(cx, UndefinedValue(), fval, argc, argv, rval)) + return false; + + return TryEnablingIon(cx, module, fun, exitIndex, argc, argv); +} + +int32_t +InvokeFromAsmJS_Ignore(JSContext *cx, int32_t exitIndex, int32_t argc, Value *argv) +{ RootedValue rval(cx); - if (!Invoke(cx, UndefinedValue(), fval, argc, argv, &rval)) - return false; - - if (!TryEnablingIon(cx, module, fun, exitIndex, argc, argv)) - return false; - - return true; + return InvokeFromAsmJS(cx, exitIndex, argc, argv, &rval); } int32_t InvokeFromAsmJS_ToInt32(JSContext *cx, int32_t exitIndex, int32_t argc, Value *argv) { - AsmJSModule &module = cx->mainThread().asmJSActivationStackFromOwnerThread()->module(); - - RootedFunction fun(cx, module.exitIndexToGlobalDatum(exitIndex).fun); - RootedValue fval(cx, ObjectValue(*fun)); RootedValue rval(cx); - if (!Invoke(cx, UndefinedValue(), fval, argc, argv, &rval)) - return false; - - if (!TryEnablingIon(cx, module, fun, exitIndex, argc, argv)) + if (!InvokeFromAsmJS(cx, exitIndex, argc, argv, &rval)) return false; int32_t i32; if (!ToInt32(cx, rval, &i32)) return false; argv[0] = Int32Value(i32); - return true; } int32_t InvokeFromAsmJS_ToNumber(JSContext *cx, int32_t exitIndex, int32_t argc, Value *argv) { - AsmJSModule &module = cx->mainThread().asmJSActivationStackFromOwnerThread()->module(); - - RootedFunction fun(cx, module.exitIndexToGlobalDatum(exitIndex).fun); - RootedValue fval(cx, ObjectValue(*fun)); RootedValue rval(cx); - if (!Invoke(cx, UndefinedValue(), fval, argc, argv, &rval)) - return false; - - if (!TryEnablingIon(cx, module, fun, exitIndex, argc, argv)) + if (!InvokeFromAsmJS(cx, exitIndex, argc, argv, &rval)) return false; double dbl; if (!ToNumber(cx, rval, &dbl)) return false; argv[0] = DoubleValue(dbl); - return true; } From 7c847b01fc5e44f3c8475146a5790eab737c30d5 Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Mon, 21 Jul 2014 09:45:13 +0200 Subject: [PATCH 25/84] Bug 1040785: Move LInterruptCheck from the platform-specific LIR headers to the platform-independent one; r=jandem --- js/src/jit/LIR-Common.h | 6 ++++++ js/src/jit/arm/LIR-arm.h | 6 ------ js/src/jit/mips/LIR-mips.h | 6 ------ js/src/jit/shared/LIR-x86-shared.h | 6 ------ 4 files changed, 6 insertions(+), 18 deletions(-) diff --git a/js/src/jit/LIR-Common.h b/js/src/jit/LIR-Common.h index f805f2c6126..987632e6718 100644 --- a/js/src/jit/LIR-Common.h +++ b/js/src/jit/LIR-Common.h @@ -739,6 +739,12 @@ class LAsmJSInterruptCheck : public LInstructionHelper<0, 0, 1> } }; +class LInterruptCheck : public LInstructionHelper<0, 0, 0> +{ + public: + LIR_HEADER(InterruptCheck) +}; + // Alternative to LInterruptCheck which does not emit an explicit check of the // interrupt flag but relies on the loop backedge being patched via a signal // handler. diff --git a/js/src/jit/arm/LIR-arm.h b/js/src/jit/arm/LIR-arm.h index 9a95bc24033..a69147eae19 100644 --- a/js/src/jit/arm/LIR-arm.h +++ b/js/src/jit/arm/LIR-arm.h @@ -397,12 +397,6 @@ class LGuardObjectType : public LInstructionHelper<0, 1, 1> } }; -class LInterruptCheck : public LInstructionHelper<0, 0, 0> -{ - public: - LIR_HEADER(InterruptCheck); -}; - class LMulI : public LBinaryMath<0> { public: diff --git a/js/src/jit/mips/LIR-mips.h b/js/src/jit/mips/LIR-mips.h index 996d7f36659..e9aebb6b72b 100644 --- a/js/src/jit/mips/LIR-mips.h +++ b/js/src/jit/mips/LIR-mips.h @@ -345,12 +345,6 @@ class LGuardObjectType : public LInstructionHelper<0, 1, 1> } }; -class LInterruptCheck : public LInstructionHelper<0, 0, 0> -{ - public: - LIR_HEADER(InterruptCheck); -}; - class LMulI : public LBinaryMath<0> { public: diff --git a/js/src/jit/shared/LIR-x86-shared.h b/js/src/jit/shared/LIR-x86-shared.h index c11e70fdde8..e6593f9584f 100644 --- a/js/src/jit/shared/LIR-x86-shared.h +++ b/js/src/jit/shared/LIR-x86-shared.h @@ -295,12 +295,6 @@ class LGuardObjectType : public LInstructionHelper<0, 1, 0> } }; -class LInterruptCheck : public LInstructionHelper<0, 0, 0> -{ - public: - LIR_HEADER(InterruptCheck) -}; - class LMulI : public LBinaryMath<0, 1> { public: From b0645f3f4162f5aa97c732d4aff7fa3144e95452 Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Mon, 21 Jul 2014 09:45:23 +0200 Subject: [PATCH 26/84] Bug 1040785: Remove unused inc32 and dec32; r=jandem --- js/src/jit/shared/MacroAssembler-x86-shared.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/js/src/jit/shared/MacroAssembler-x86-shared.h b/js/src/jit/shared/MacroAssembler-x86-shared.h index a7c8236245b..f96a4693274 100644 --- a/js/src/jit/shared/MacroAssembler-x86-shared.h +++ b/js/src/jit/shared/MacroAssembler-x86-shared.h @@ -187,15 +187,9 @@ class MacroAssemblerX86Shared : public Assembler void not32(Register reg) { notl(reg); } - void inc32(const Operand &addr) { - incl(addr); - } void atomic_inc32(const Operand &addr) { lock_incl(addr); } - void dec32(const Operand &addr) { - decl(addr); - } void atomic_dec32(const Operand &addr) { lock_decl(addr); } From 4ac7943b4f0d54327db7b3ad0d1f0abe10fe7d0d Mon Sep 17 00:00:00 2001 From: Randell Jesup Date: Mon, 21 Jul 2014 03:50:09 -0400 Subject: [PATCH 27/84] Bug 1038961: Patch 1 - Send GMP plugin crashes to observer, and implement PluginID system r=cpearce,jib --- content/media/gmp/GMPParent.cpp | 29 +++++++++++++++++-- content/media/gmp/GMPVideoDecoderParent.h | 1 + content/media/gmp/GMPVideoDecoderProxy.h | 1 + content/media/gmp/GMPVideoEncoderParent.h | 1 + content/media/gmp/GMPVideoEncoderProxy.h | 1 + .../src/media-conduit/WebrtcGmpVideoCodec.h | 19 +++++++++--- 6 files changed, 45 insertions(+), 7 deletions(-) diff --git a/content/media/gmp/GMPParent.cpp b/content/media/gmp/GMPParent.cpp index 63b4c725aec..ddc051158ac 100644 --- a/content/media/gmp/GMPParent.cpp +++ b/content/media/gmp/GMPParent.cpp @@ -14,6 +14,8 @@ #include "nsIRunnable.h" #include "mozIGeckoMediaPluginService.h" #include "mozilla/unused.h" +#include "nsIObserverService.h" +#include "mtransport/runnable_utils.h" #include "mozilla/dom/CrashReporterParent.h" using mozilla::dom::CrashReporterParent; @@ -321,16 +323,37 @@ GMPParent::GetCrashID(nsString& aResult) } #endif +static void +GMPNotifyObservers(nsAString& aData) +{ + nsCOMPtr obs = mozilla::services::GetObserverService(); + if (obs) { + nsString temp(aData); + obs->NotifyObservers(nullptr, "gmp-plugin-crash", temp.get()); + } +} + void GMPParent::ActorDestroy(ActorDestroyReason aWhy) { +#ifdef MOZ_CRASHREPORTER if (AbnormalShutdown == aWhy) { nsString dumpID; -#ifdef MOZ_CRASHREPORTER GetCrashID(dumpID); -#endif - // now do something with the crash ID, bug 1038961 + nsString id; + // use the parent address to identify it + // We could use any unique-to-the-parent value + id.AppendInt(reinterpret_cast(this)); + id.Append(NS_LITERAL_STRING(" ")); + AppendUTF8toUTF16(mDisplayName, id); + id.Append(NS_LITERAL_STRING(" ")); + id.Append(dumpID); + + // NotifyObservers is mainthread-only + NS_DispatchToMainThread(WrapRunnableNM(&GMPNotifyObservers, id), + NS_DISPATCH_NORMAL); } +#endif // warn us off trying to close again mState = GMPStateClosing; CloseActive(); diff --git a/content/media/gmp/GMPVideoDecoderParent.h b/content/media/gmp/GMPVideoDecoderParent.h index 0b1cea39a1e..423568e85a5 100644 --- a/content/media/gmp/GMPVideoDecoderParent.h +++ b/content/media/gmp/GMPVideoDecoderParent.h @@ -42,6 +42,7 @@ public: virtual nsresult Reset() MOZ_OVERRIDE; virtual nsresult Drain() MOZ_OVERRIDE; virtual nsresult DecodingComplete() MOZ_OVERRIDE; + virtual const uint64_t ParentID() MOZ_OVERRIDE { return reinterpret_cast(mPlugin.get()); } // GMPSharedMemManager virtual void CheckThread(); diff --git a/content/media/gmp/GMPVideoDecoderProxy.h b/content/media/gmp/GMPVideoDecoderProxy.h index b919a8dd5b8..5e8f4d587eb 100644 --- a/content/media/gmp/GMPVideoDecoderProxy.h +++ b/content/media/gmp/GMPVideoDecoderProxy.h @@ -28,6 +28,7 @@ public: virtual nsresult Reset() = 0; virtual nsresult Drain() = 0; virtual nsresult DecodingComplete() = 0; + virtual const uint64_t ParentID() = 0; }; #endif diff --git a/content/media/gmp/GMPVideoEncoderParent.h b/content/media/gmp/GMPVideoEncoderParent.h index 4414a60d973..40ae6e592d3 100644 --- a/content/media/gmp/GMPVideoEncoderParent.h +++ b/content/media/gmp/GMPVideoEncoderParent.h @@ -43,6 +43,7 @@ public: virtual GMPErr SetRates(uint32_t aNewBitRate, uint32_t aFrameRate) MOZ_OVERRIDE; virtual GMPErr SetPeriodicKeyFrames(bool aEnable) MOZ_OVERRIDE; virtual void EncodingComplete() MOZ_OVERRIDE; + virtual const uint64_t ParentID() MOZ_OVERRIDE { return reinterpret_cast(mPlugin.get()); } // GMPSharedMemManager virtual void CheckThread(); diff --git a/content/media/gmp/GMPVideoEncoderProxy.h b/content/media/gmp/GMPVideoEncoderProxy.h index 9a1f68a5479..6066c19c2aa 100644 --- a/content/media/gmp/GMPVideoEncoderProxy.h +++ b/content/media/gmp/GMPVideoEncoderProxy.h @@ -35,6 +35,7 @@ public: virtual GMPErr SetRates(uint32_t aNewBitRate, uint32_t aFrameRate) = 0; virtual GMPErr SetPeriodicKeyFrames(bool aEnable) = 0; virtual void EncodingComplete() = 0; + virtual const uint64_t ParentID() = 0; }; #endif // GMPVideoEncoderProxy_h_ diff --git a/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.h b/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.h index 02610ff7406..541a357b1d0 100644 --- a/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.h +++ b/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.h @@ -33,17 +33,24 @@ #include "GMPVideoDecoderProxy.h" #include "GMPVideoEncoderProxy.h" -#include "WebrtcGmpVideoCodec.h" - namespace mozilla { +class WebrtcGmpCrashReporter { +public: + virtual const uint64_t CrashID() = 0; +}; + class WebrtcGmpVideoEncoder : public WebrtcVideoEncoder, - public GMPVideoEncoderCallbackProxy + public GMPVideoEncoderCallbackProxy, + public WebrtcGmpCrashReporter { public: WebrtcGmpVideoEncoder(); virtual ~WebrtcGmpVideoEncoder() {} + // Implement CrashReporter + virtual const uint64_t CrashID() { return mGMP ? mGMP->ParentID() : 0; } + // Implement VideoEncoder interface. virtual int32_t InitEncode(const webrtc::VideoCodec* aCodecSettings, int32_t aNumberOfCores, @@ -90,12 +97,16 @@ private: class WebrtcGmpVideoDecoder : public WebrtcVideoDecoder, - public GMPVideoDecoderCallback + public GMPVideoDecoderCallback, + public WebrtcGmpCrashReporter { public: WebrtcGmpVideoDecoder(); virtual ~WebrtcGmpVideoDecoder() {} + // Implement CrashReporter + virtual const uint64_t CrashID() { return mGMP ? mGMP->ParentID() : 0; } + // Implement VideoDecoder interface. virtual int32_t InitDecode(const webrtc::VideoCodec* aCodecSettings, int32_t aNumberOfCores); From 62b0164ace064bc834086a1a2ae35504327b34f4 Mon Sep 17 00:00:00 2001 From: Randell Jesup Date: Mon, 21 Jul 2014 03:50:11 -0400 Subject: [PATCH 28/84] Bug 1038961: Patch 2 - Associate GMP plugin crash with a window and notify it r=bz,jib --- dom/media/PeerConnection.js | 35 ++++++++++++++++ dom/webidl/PeerConnectionImpl.webidl | 3 ++ .../src/media-conduit/AudioConduit.h | 1 + .../src/media-conduit/MediaConduitInterface.h | 18 +++++++-- .../src/media-conduit/VideoConduit.cpp | 11 +++++ .../src/media-conduit/VideoConduit.h | 2 + .../src/media-conduit/WebrtcGmpVideoCodec.h | 27 ++++++------- .../media-conduit/WebrtcOMXH264VideoCodec.h | 4 ++ .../src/peerconnection/PeerConnectionImpl.cpp | 10 +++++ .../src/peerconnection/PeerConnectionImpl.h | 2 + .../peerconnection/PeerConnectionMedia.cpp | 40 +++++++++++++++++++ .../src/peerconnection/PeerConnectionMedia.h | 6 +++ 12 files changed, 140 insertions(+), 19 deletions(-) diff --git a/dom/media/PeerConnection.js b/dom/media/PeerConnection.js index 328a4c6c39c..acda9cbb7e2 100644 --- a/dom/media/PeerConnection.js +++ b/dom/media/PeerConnection.js @@ -42,6 +42,7 @@ function GlobalPCList() { Services.obs.addObserver(this, "profile-change-net-teardown", true); Services.obs.addObserver(this, "network:offline-about-to-go-offline", true); Services.obs.addObserver(this, "network:offline-status-changed", true); + Services.obs.addObserver(this, "gmp-plugin-crash", true); } GlobalPCList.prototype = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver, @@ -107,6 +108,27 @@ GlobalPCList.prototype = { } }; + let hasPluginId = function(list, winID, pluginID, name, crashReport) { + if (list.hasOwnProperty(winID)) { + list[winID].forEach(function(pcref) { + let pc = pcref.get(); + if (pc) { + if (pc._pc.pluginCrash(pluginID)) { + // Notify DOM window of the crash + let event = new CustomEvent("PluginCrashed", + { bubbles: false, cancelable: false, + detail: { + pluginName: name, + pluginDumpId: crashReport, + submittedCrashReport: false } + }); + pc._win.dispatchEvent(event); + } + } + }); + } + }; + if (topic == "inner-window-destroyed") { let winID = subject.QueryInterface(Ci.nsISupportsPRUint64).data; cleanupWinId(this._list, winID); @@ -134,6 +156,19 @@ GlobalPCList.prototype = { } else if (data == "online") { this._networkdown = false; } + } else if (topic == "gmp-plugin-crash") { + // a plugin crashed; if it's associated with any of our PCs, fire an + // event to the DOM window + let sep = data.indexOf(' '); + let pluginId = data.slice(0, sep); + let rest = data.slice(sep+1); + // This presumes no spaces in the name! + sep = rest.indexOf(' '); + let name = rest.slice(0, sep); + let crashId = rest.slice(sep+1); + for (let winId in this._list) { + hasPluginId(this._list, winId, pluginId, name, crashId); + } } }, diff --git a/dom/webidl/PeerConnectionImpl.webidl b/dom/webidl/PeerConnectionImpl.webidl index ab2a6777cae..08e75da4f61 100644 --- a/dom/webidl/PeerConnectionImpl.webidl +++ b/dom/webidl/PeerConnectionImpl.webidl @@ -60,6 +60,9 @@ interface PeerConnectionImpl { /* Puts the SIPCC engine back to 'kIdle', shuts down threads, deletes state */ void close(); + /* Notify DOM window if this plugin crash is ours */ + boolean pluginCrash(unsigned long pluginId); + /* Attributes */ readonly attribute DOMString fingerprint; readonly attribute DOMString localDescription; diff --git a/media/webrtc/signaling/src/media-conduit/AudioConduit.h b/media/webrtc/signaling/src/media-conduit/AudioConduit.h index 8bf9fe27ecc..668b30dc3ad 100755 --- a/media/webrtc/signaling/src/media-conduit/AudioConduit.h +++ b/media/webrtc/signaling/src/media-conduit/AudioConduit.h @@ -151,6 +151,7 @@ public: virtual int SendRTCPPacket(int channel, const void *data, int len) ; + virtual uint64_t CodecPluginID() { return 0; } WebrtcAudioConduit(): mOtherDirection(nullptr), diff --git a/media/webrtc/signaling/src/media-conduit/MediaConduitInterface.h b/media/webrtc/signaling/src/media-conduit/MediaConduitInterface.h index 295fa7e89b5..27b572b0e23 100755 --- a/media/webrtc/signaling/src/media-conduit/MediaConduitInterface.h +++ b/media/webrtc/signaling/src/media-conduit/MediaConduitInterface.h @@ -192,21 +192,31 @@ public: unsigned int* packetsSent, uint64_t* bytesSent) = 0; + virtual uint64_t CodecPluginID() = 0; + NS_INLINE_DECL_THREADSAFE_REFCOUNTING(MediaSessionConduit) }; // Abstract base classes for external encoder/decoder. -class VideoEncoder +class CodecPluginID { public: - virtual ~VideoEncoder() {}; + virtual ~CodecPluginID() {} + + virtual const uint64_t PluginID() = 0; }; -class VideoDecoder +class VideoEncoder : public CodecPluginID { public: - virtual ~VideoDecoder() {}; + virtual ~VideoEncoder() {} +}; + +class VideoDecoder : public CodecPluginID +{ +public: + virtual ~VideoDecoder() {} }; /** diff --git a/media/webrtc/signaling/src/media-conduit/VideoConduit.cpp b/media/webrtc/signaling/src/media-conduit/VideoConduit.cpp index caf09718d76..72bc5577634 100644 --- a/media/webrtc/signaling/src/media-conduit/VideoConduit.cpp +++ b/media/webrtc/signaling/src/media-conduit/VideoConduit.cpp @@ -1438,4 +1438,15 @@ WebrtcVideoConduit::MozVideoLatencyAvg() return mVideoLatencyAvg / sRoundingPadding; } +uint64_t +WebrtcVideoConduit::CodecPluginID() +{ + if (mExternalSendCodecHandle) { + return mExternalSendCodecHandle->PluginID(); + } else if (mExternalRecvCodecHandle) { + return mExternalRecvCodecHandle->PluginID(); + } + return 0; +} + }// end namespace diff --git a/media/webrtc/signaling/src/media-conduit/VideoConduit.h b/media/webrtc/signaling/src/media-conduit/VideoConduit.h index f7cd1417013..638e03019f0 100755 --- a/media/webrtc/signaling/src/media-conduit/VideoConduit.h +++ b/media/webrtc/signaling/src/media-conduit/VideoConduit.h @@ -199,6 +199,8 @@ public: #endif } + virtual uint64_t CodecPluginID(); + unsigned short SendingWidth() { return mSendingWidth; } diff --git a/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.h b/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.h index 541a357b1d0..ff868abb867 100644 --- a/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.h +++ b/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.h @@ -35,23 +35,19 @@ namespace mozilla { -class WebrtcGmpCrashReporter { -public: - virtual const uint64_t CrashID() = 0; -}; - class WebrtcGmpVideoEncoder : public WebrtcVideoEncoder, - public GMPVideoEncoderCallbackProxy, - public WebrtcGmpCrashReporter + public GMPVideoEncoderCallbackProxy { public: WebrtcGmpVideoEncoder(); virtual ~WebrtcGmpVideoEncoder() {} - // Implement CrashReporter - virtual const uint64_t CrashID() { return mGMP ? mGMP->ParentID() : 0; } - // Implement VideoEncoder interface. + virtual const uint64_t PluginID() MOZ_OVERRIDE + { + return mGMP ? mGMP->ParentID() : 0; + } + virtual int32_t InitEncode(const webrtc::VideoCodec* aCodecSettings, int32_t aNumberOfCores, uint32_t aMaxPayloadSize); @@ -97,17 +93,18 @@ private: class WebrtcGmpVideoDecoder : public WebrtcVideoDecoder, - public GMPVideoDecoderCallback, - public WebrtcGmpCrashReporter + public GMPVideoDecoderCallback { public: WebrtcGmpVideoDecoder(); virtual ~WebrtcGmpVideoDecoder() {} - // Implement CrashReporter - virtual const uint64_t CrashID() { return mGMP ? mGMP->ParentID() : 0; } - // Implement VideoDecoder interface. + virtual const uint64_t PluginID() MOZ_OVERRIDE + { + return mGMP ? mGMP->ParentID() : 0; + } + virtual int32_t InitDecode(const webrtc::VideoCodec* aCodecSettings, int32_t aNumberOfCores); virtual int32_t Decode(const webrtc::EncodedImage& aInputImage, diff --git a/media/webrtc/signaling/src/media-conduit/WebrtcOMXH264VideoCodec.h b/media/webrtc/signaling/src/media-conduit/WebrtcOMXH264VideoCodec.h index f6e110c0224..6c5d08eb744 100644 --- a/media/webrtc/signaling/src/media-conduit/WebrtcOMXH264VideoCodec.h +++ b/media/webrtc/signaling/src/media-conduit/WebrtcOMXH264VideoCodec.h @@ -35,6 +35,8 @@ public: virtual ~WebrtcOMXH264VideoEncoder(); // Implement VideoEncoder interface. + virtual const uint64_t PluginID() MOZ_OVERRIDE { return 0; } + virtual int32_t InitEncode(const webrtc::VideoCodec* aCodecSettings, int32_t aNumOfCores, uint32_t aMaxPayloadSize) MOZ_OVERRIDE; @@ -77,6 +79,8 @@ public: virtual ~WebrtcOMXH264VideoDecoder(); // Implement VideoDecoder interface. + virtual const uint64_t PluginID() MOZ_OVERRIDE { return 0; } + virtual int32_t InitDecode(const webrtc::VideoCodec* aCodecSettings, int32_t aNumOfCores) MOZ_OVERRIDE; virtual int32_t Decode(const webrtc::EncodedImage& aInputImage, diff --git a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp index 9f087b010b3..3c4a1326e2b 100644 --- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp +++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp @@ -1636,6 +1636,16 @@ PeerConnectionImpl::Close() return res; } +bool +PeerConnectionImpl::PluginCrash(uint64_t aPluginID) +{ + // fire an event to the DOM window if this is "ours" + bool result = mMedia ? mMedia->AnyCodecHasPluginID(aPluginID) : false; + if (result) { + CSFLogError(logTag, "%s: Our plugin %llu crashed", __FUNCTION__, static_cast(aPluginID)); + } + return result; +} nsresult PeerConnectionImpl::CloseInt() diff --git a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h index acf25e5a0d0..3967ee3a14c 100644 --- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h +++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h @@ -482,6 +482,8 @@ public: rv = Close(); } + bool PluginCrash(uint64_t aPluginID); + nsresult InitializeDataChannel(int track_id, uint16_t aLocalport, uint16_t aRemoteport, uint16_t aNumstreams); diff --git a/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.cpp b/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.cpp index 2282a084390..605821b4cc7 100644 --- a/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.cpp +++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.cpp @@ -636,6 +636,46 @@ void RemoteSourceStreamInfo::UpdatePrincipal_m(nsIPrincipal* aPrincipal) } #endif // MOZILLA_INTERNAL_API +bool +PeerConnectionMedia::AnyCodecHasPluginID(uint64_t aPluginID) +{ + for (uint32_t i=0; i < mLocalSourceStreams.Length(); ++i) { + if (mLocalSourceStreams[i]->AnyCodecHasPluginID(aPluginID)) { + return true; + } + } + for (uint32_t i=0; i < mRemoteSourceStreams.Length(); ++i) { + if (mRemoteSourceStreams[i]->AnyCodecHasPluginID(aPluginID)) { + return true; + } + } + return false; +} + +bool +LocalSourceStreamInfo::AnyCodecHasPluginID(uint64_t aPluginID) +{ + // Scan the videoConduits for this plugin ID + for (auto it = mPipelines.begin(); it != mPipelines.end(); ++it) { + if (it->second->Conduit()->CodecPluginID() == aPluginID) { + return true; + } + } + return false; +} + +bool +RemoteSourceStreamInfo::AnyCodecHasPluginID(uint64_t aPluginID) +{ + // Scan the videoConduits for this plugin ID + for (auto it = mPipelines.begin(); it != mPipelines.end(); ++it) { + if (it->second->Conduit()->CodecPluginID() == aPluginID) { + return true; + } + } + return false; +} + void LocalSourceStreamInfo::StorePipeline( int aTrack, mozilla::RefPtr aPipeline) diff --git a/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.h b/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.h index d613ffed6d3..ca47be4720f 100644 --- a/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.h +++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.h @@ -231,6 +231,8 @@ public: void DetachTransport_s(); void DetachMedia_m(); + bool AnyCodecHasPluginID(uint64_t aPluginID); + NS_INLINE_DECL_THREADSAFE_REFCOUNTING(LocalSourceStreamInfo) private: nsTArray mAudioTracks; @@ -262,6 +264,8 @@ class RemoteSourceStreamInfo : public SourceStreamInfo { void UpdatePrincipal_m(nsIPrincipal* aPrincipal); #endif + bool AnyCodecHasPluginID(uint64_t aPluginID); + NS_INLINE_DECL_THREADSAFE_REFCOUNTING(RemoteSourceStreamInfo) public: @@ -337,6 +341,8 @@ class PeerConnectionMedia : public sigslot::has_slots<> { void UpdateRemoteStreamPrincipals_m(nsIPrincipal* aPrincipal); #endif + bool AnyCodecHasPluginID(uint64_t aPluginID); + const nsCOMPtr& GetMainThread() const { return mMainThread; } const nsCOMPtr& GetSTSThread() const { return mSTSThread; } From 9d5c6c8fed2763020c9cf29c4164794151d3e2ca Mon Sep 17 00:00:00 2001 From: Emanuel Hoogeveen Date: Sun, 20 Jul 2014 08:23:00 +0200 Subject: [PATCH 29/84] Bug 1041307 - Don't try to finalize JITcode in non-ion builds. r=billm --- js/src/jsgc.cpp | 16 +++++++++++++--- js/src/jsgc.h | 2 ++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/js/src/jsgc.cpp b/js/src/jsgc.cpp index e1fbebfcc10..b842bfbaab5 100644 --- a/js/src/jsgc.cpp +++ b/js/src/jsgc.cpp @@ -344,27 +344,35 @@ static const AllocKind FinalizePhaseScripts[] = { FINALIZE_LAZY_SCRIPT }; +#ifdef JS_ION static const AllocKind FinalizePhaseJitCode[] = { FINALIZE_JITCODE }; +#endif static const AllocKind * const FinalizePhases[] = { FinalizePhaseStrings, FinalizePhaseScripts, - FinalizePhaseJitCode +#ifdef JS_ION + FinalizePhaseJitCode, +#endif }; static const int FinalizePhaseCount = sizeof(FinalizePhases) / sizeof(AllocKind*); static const int FinalizePhaseLength[] = { sizeof(FinalizePhaseStrings) / sizeof(AllocKind), sizeof(FinalizePhaseScripts) / sizeof(AllocKind), - sizeof(FinalizePhaseJitCode) / sizeof(AllocKind) +#ifdef JS_ION + sizeof(FinalizePhaseJitCode) / sizeof(AllocKind), +#endif }; static const gcstats::Phase FinalizePhaseStatsPhase[] = { gcstats::PHASE_SWEEP_STRING, gcstats::PHASE_SWEEP_SCRIPT, - gcstats::PHASE_SWEEP_JITCODE +#ifdef JS_ION + gcstats::PHASE_SWEEP_JITCODE, +#endif }; /* @@ -2142,12 +2150,14 @@ ArenaLists::queueScriptsForSweep(FreeOp *fop) queueForForegroundSweep(fop, FINALIZE_LAZY_SCRIPT); } +#ifdef JS_ION void ArenaLists::queueJitCodeForSweep(FreeOp *fop) { gcstats::AutoPhase ap(fop->runtime()->gc.stats, gcstats::PHASE_SWEEP_JITCODE); queueForForegroundSweep(fop, FINALIZE_JITCODE); } +#endif void ArenaLists::queueShapesForSweep(FreeOp *fop) diff --git a/js/src/jsgc.h b/js/src/jsgc.h index 6e70d3eeb1c..194df1fbc54 100644 --- a/js/src/jsgc.h +++ b/js/src/jsgc.h @@ -919,7 +919,9 @@ class ArenaLists void queueStringsAndSymbolsForSweep(FreeOp *fop); void queueShapesForSweep(FreeOp *fop); void queueScriptsForSweep(FreeOp *fop); +#ifdef JS_ION void queueJitCodeForSweep(FreeOp *fop); +#endif bool foregroundFinalize(FreeOp *fop, AllocKind thingKind, SliceBudget &sliceBudget, SortedArenaList &sweepList); From 9f0205643e99497da956101fe7056b7f2ecb7a9d Mon Sep 17 00:00:00 2001 From: Shelly Lin Date: Tue, 15 Jul 2014 18:04:22 +0800 Subject: [PATCH 30/84] Bug 1038494 - Rewrite test cases of track interfaces when consuming a media stream. r=roc --- content/media/test/mochitest.ini | 3 +- ...test_mediatrack_consuming_mediastream.html | 157 +++++++++++++++ .../media/test/test_mediatrack_events.html | 125 ++++++++++++ ...st_mediatrack_events_and_consuming_ms.html | 189 ------------------ 4 files changed, 284 insertions(+), 190 deletions(-) create mode 100644 content/media/test/test_mediatrack_consuming_mediastream.html create mode 100644 content/media/test/test_mediatrack_events.html delete mode 100644 content/media/test/test_mediatrack_events_and_consuming_ms.html diff --git a/content/media/test/mochitest.ini b/content/media/test/mochitest.ini index 5308add8c69..0b5ae364a87 100644 --- a/content/media/test/mochitest.ini +++ b/content/media/test/mochitest.ini @@ -381,7 +381,8 @@ skip-if = buildapp == 'b2g' || toolkit == 'android' # mimetype check, bug 969289 [test_mediarecorder_unsupported_src.html] [test_mediarecorder_record_getdata_afterstart.html] [test_mediatrack_consuming_mediaresource.html] -[test_mediatrack_events_and_consuming_ms.html] +[test_mediatrack_consuming_mediastream.html] +[test_mediatrack_events.html] [test_mediatrack_replay_from_end.html] [test_metadata.html] [test_mixed_principals.html] diff --git a/content/media/test/test_mediatrack_consuming_mediastream.html b/content/media/test/test_mediatrack_consuming_mediastream.html new file mode 100644 index 00000000000..38499b7c860 --- /dev/null +++ b/content/media/test/test_mediatrack_consuming_mediastream.html @@ -0,0 +1,157 @@ + + + + Test track interfaces when consuming a MediaStream from gUM + + + + + +
+
+
+ + diff --git a/content/media/test/test_mediatrack_events.html b/content/media/test/test_mediatrack_events.html new file mode 100644 index 00000000000..90eea9dbd2c --- /dev/null +++ b/content/media/test/test_mediatrack_events.html @@ -0,0 +1,125 @@ + + + + Test events of media track interfaces + + + + + +
+
+
+ + diff --git a/content/media/test/test_mediatrack_events_and_consuming_ms.html b/content/media/test/test_mediatrack_events_and_consuming_ms.html deleted file mode 100644 index 1c5990659e4..00000000000 --- a/content/media/test/test_mediatrack_events_and_consuming_ms.html +++ /dev/null @@ -1,189 +0,0 @@ - - - - Test track interfaces when consuming a MediaStream from gUM - - - - - -
-
-
- - From 500ddd438da40da9d3f718a819f00da45c3010cf Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Mon, 21 Jul 2014 10:06:09 +0200 Subject: [PATCH 31/84] Bug 1040823: Make --js-cache-per-process the default for testing; r=luke --- js/src/jit-test/jit_test.py | 6 ------ js/src/jit-test/lib/asm.js | 2 +- js/src/jit-test/tests/asm.js/testBullet.js | 2 +- js/src/shell/js.cpp | 15 ++++++++------- 4 files changed, 10 insertions(+), 15 deletions(-) diff --git a/js/src/jit-test/jit_test.py b/js/src/jit-test/jit_test.py index 15aa975e78a..823e4a71cc1 100755 --- a/js/src/jit-test/jit_test.py +++ b/js/src/jit-test/jit_test.py @@ -220,12 +220,6 @@ def main(argv): prefix += ['-f', prolog] - # Avoid racing on the cache by having the js shell create a new cache - # subdir for each process. The js shell takes care of deleting these - # subdirs when the process exits. - if options.max_jobs > 1 and jittests.HAVE_MULTIPROCESSING: - prefix += ['--js-cache-per-process'] - # Clean up any remnants from previous crashes etc shutil.rmtree(jittests.JS_CACHE_DIR, ignore_errors=True) os.mkdir(jittests.JS_CACHE_DIR) diff --git a/js/src/jit-test/lib/asm.js b/js/src/jit-test/lib/asm.js index 8d98b7d3cdc..b73f5f5cbd2 100644 --- a/js/src/jit-test/lib/asm.js +++ b/js/src/jit-test/lib/asm.js @@ -35,7 +35,7 @@ function asmCompileCached() for (var i = 0; i < arguments.length; i++) quotedArgs.push("'" + arguments[i] + "'"); var code = "var f = new Function(" + quotedArgs.join(',') + ");assertEq(isAsmJSModule(f), true);"; - nestedShell("--js-cache", "--execute=" + code); + nestedShell("--js-cache", "--no-js-cache-per-process", "--execute=" + code); var f = Function.apply(null, arguments); assertEq(isAsmJSModuleLoadedFromCache(f), true); diff --git a/js/src/jit-test/tests/asm.js/testBullet.js b/js/src/jit-test/tests/asm.js/testBullet.js index 094826ac224..af51081f282 100644 --- a/js/src/jit-test/tests/asm.js/testBullet.js +++ b/js/src/jit-test/tests/asm.js/testBullet.js @@ -10,7 +10,7 @@ if (!isAsmJSCompilationAvailable()) // nestedShell() (and the loadedFromCache assertion) to see if the error // reproduces. var code = "setIonCheckGraphCoherency(false); load('" + libdir + "bullet.js'); runBullet()"; -nestedShell("--js-cache", "--execute=" + code); +nestedShell("--js-cache", "--no-js-cache-per-process", "--execute=" + code); setIonCheckGraphCoherency(false); load(libdir + 'bullet.js'); var results = runBullet(); diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp index 1d5941168c1..a4df414ae61 100644 --- a/js/src/shell/js.cpp +++ b/js/src/shell/js.cpp @@ -6058,7 +6058,7 @@ SetRuntimeOptions(JSRuntime *rt, const OptionParser &op) jsCacheDir = op.getStringOption("js-cache"); if (jsCacheDir) { - if (op.getBoolOption("js-cache-per-process")) + if (!op.getBoolOption("no-js-cache-per-process")) jsCacheDir = JS_smprintf("%s/%u", jsCacheDir, (unsigned)getpid()); jsCacheAsmJSPath = JS_smprintf("%s/asmjs.cache", jsCacheDir); } @@ -6100,7 +6100,7 @@ Shell(JSContext *cx, OptionParser *op, char **envp) if (enableDisassemblyDumps) JS_DumpCompartmentPCCounts(cx); - if (op->getBoolOption("js-cache-per-process")) { + if (!op->getBoolOption("no-js-cache-per-process")) { if (jsCacheAsmJSPath) unlink(jsCacheAsmJSPath); if (jsCacheDir) @@ -6178,11 +6178,12 @@ main(int argc, char **argv, char **envp) || !op.addStringOption('\0', "js-cache", "[path]", "Enable the JS cache by specifying the path of the directory to use " "to hold cache files") - || !op.addBoolOption('\0', "js-cache-per-process", - "Generate a separate cache sub-directory for this process inside " - "the cache directory specified by --js-cache. This cache directory " - "will be removed when the js shell exits. This is useful for running " - "tests in parallel.") + || !op.addBoolOption('\0', "no-js-cache-per-process", + "Deactivates cache per process. Otherwise, generate a separate cache" + "sub-directory for this process inside the cache directory" + "specified by --js-cache. This cache directory will be removed" + "when the js shell exits. This is useful for running tests in" + "parallel.") #ifdef DEBUG || !op.addBoolOption('O', "print-alloc", "Print the number of allocations at exit") #endif From 5496e794865c4ab337e8d45614a1fffb2a9b33a1 Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Mon, 21 Jul 2014 10:06:38 +0200 Subject: [PATCH 32/84] Bug 1040823: Simplify tests from bug 986673; r=tests-only --- .../tests/asm.js/testTimeout-deactivate-reactivate-signals.js | 3 ++- js/src/jit-test/tests/asm.js/testTimeout1-nosignals.js | 2 +- js/src/jit-test/tests/asm.js/testTimeout2-nosignals.js | 2 +- js/src/jit-test/tests/asm.js/testTimeout3-nosignals.js | 2 +- js/src/jit-test/tests/asm.js/testTimeout4-nosignals.js | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/js/src/jit-test/tests/asm.js/testTimeout-deactivate-reactivate-signals.js b/js/src/jit-test/tests/asm.js/testTimeout-deactivate-reactivate-signals.js index 4049d5733d4..4240441609a 100644 --- a/js/src/jit-test/tests/asm.js/testTimeout-deactivate-reactivate-signals.js +++ b/js/src/jit-test/tests/asm.js/testTimeout-deactivate-reactivate-signals.js @@ -10,10 +10,11 @@ if (jco["signals.enable"] === 0 || !isCachingEnabled() || !isAsmJSCompilationAva // handlers have been reactivated. setJitCompilerOption("signals.enable", 0); -var code = USE_ASM + "/* deactivate-reactivate-signals */ function f() {} function g() { while(1) { f() } } return g"; +var code = USE_ASM + "function f() {} function g() { while(1) { f() } } return g"; var m = asmCompile(code); assertEq(isAsmJSModule(m), true); +assertEq(isAsmJSModuleLoadedFromCache(m), false); setJitCompilerOption("signals.enable", 1); diff --git a/js/src/jit-test/tests/asm.js/testTimeout1-nosignals.js b/js/src/jit-test/tests/asm.js/testTimeout1-nosignals.js index a3f74eee221..6651842a19b 100644 --- a/js/src/jit-test/tests/asm.js/testTimeout1-nosignals.js +++ b/js/src/jit-test/tests/asm.js/testTimeout1-nosignals.js @@ -3,7 +3,7 @@ load(libdir + "asm.js"); setJitCompilerOption("signals.enable", 0); -var g = asmLink(asmCompile(USE_ASM + "/* no-signals */ function f() {} function g() { while(1) { f() } } return g")); +var g = asmLink(asmCompile(USE_ASM + "function f() {} function g() { while(1) { f() } } return g")); timeout(1); g(); assertEq(true, false); diff --git a/js/src/jit-test/tests/asm.js/testTimeout2-nosignals.js b/js/src/jit-test/tests/asm.js/testTimeout2-nosignals.js index bb1fbc9083e..14c663cfeea 100644 --- a/js/src/jit-test/tests/asm.js/testTimeout2-nosignals.js +++ b/js/src/jit-test/tests/asm.js/testTimeout2-nosignals.js @@ -3,7 +3,7 @@ load(libdir + "asm.js"); setJitCompilerOption("signals.enable", 0); -var g = asmLink(asmCompile(USE_ASM + "/* no-signals */ function g() { while(1) {} } return g")); +var g = asmLink(asmCompile(USE_ASM + "function g() { while(1) {} } return g")); timeout(1); g(); assertEq(true, false); diff --git a/js/src/jit-test/tests/asm.js/testTimeout3-nosignals.js b/js/src/jit-test/tests/asm.js/testTimeout3-nosignals.js index fc70bea7be4..9bef132d6fb 100644 --- a/js/src/jit-test/tests/asm.js/testTimeout3-nosignals.js +++ b/js/src/jit-test/tests/asm.js/testTimeout3-nosignals.js @@ -3,7 +3,7 @@ load(libdir + "asm.js"); setJitCompilerOption("signals.enable", 0); -var f = asmLink(asmCompile(USE_ASM + "/* no-signals */ function f(i) { i=i|0; if (!i) return; f((i-1)|0); f((i-1)|0); f((i-1)|0); f((i-1)|0); f((i-1)|0); } return f")); +var f = asmLink(asmCompile(USE_ASM + "function f(i) { i=i|0; if (!i) return; f((i-1)|0); f((i-1)|0); f((i-1)|0); f((i-1)|0); f((i-1)|0); } return f")); timeout(1); f(100); assertEq(true, false); diff --git a/js/src/jit-test/tests/asm.js/testTimeout4-nosignals.js b/js/src/jit-test/tests/asm.js/testTimeout4-nosignals.js index 14ecf0ca9a6..052f16693a7 100644 --- a/js/src/jit-test/tests/asm.js/testTimeout4-nosignals.js +++ b/js/src/jit-test/tests/asm.js/testTimeout4-nosignals.js @@ -3,7 +3,7 @@ load(libdir + "asm.js"); setJitCompilerOption("signals.enable", 0); -var g = asmLink(asmCompile(USE_ASM + "/* no-signals */ function f(d) { d=+d; d=d*.1; d=d/.4; return +d } function g() { while(1) { +f(1.1) } } return g")); +var g = asmLink(asmCompile(USE_ASM + "function f(d) { d=+d; d=d*.1; d=d/.4; return +d } function g() { while(1) { +f(1.1) } } return g")); timeout(1); g(); assertEq(true, false); From 69ac3d284b8381e56a15984eb2e169c4da9ac362 Mon Sep 17 00:00:00 2001 From: Chris Pearce Date: Mon, 21 Jul 2014 20:57:03 +1200 Subject: [PATCH 33/84] Bug 1041401 - Build WMF PDM in its own translation unit in unified builds. r=padenot --- content/media/fmp4/moz.build | 15 +-------------- content/media/fmp4/wmf/MFTDecoder.cpp | 2 +- content/media/fmp4/wmf/moz.build | 24 ++++++++++++++++++++++++ content/media/wmf/WMF.h | 10 ++++++++++ 4 files changed, 36 insertions(+), 15 deletions(-) create mode 100644 content/media/fmp4/wmf/moz.build diff --git a/content/media/fmp4/moz.build b/content/media/fmp4/moz.build index e7a9f438237..650cbbb7f82 100644 --- a/content/media/fmp4/moz.build +++ b/content/media/fmp4/moz.build @@ -21,20 +21,7 @@ SOURCES += [ ] if CONFIG['MOZ_WMF']: - EXPORTS += [ - 'wmf/MFTDecoder.h', - 'wmf/WMFAudioMFTManager.h', - 'wmf/WMFDecoderModule.h', - 'wmf/WMFMediaDataDecoder.h', - 'wmf/WMFVideoMFTManager.h', - ] - UNIFIED_SOURCES += [ - 'wmf/MFTDecoder.cpp', - 'wmf/WMFAudioMFTManager.cpp', - 'wmf/WMFDecoderModule.cpp', - 'wmf/WMFMediaDataDecoder.cpp', - 'wmf/WMFVideoMFTManager.cpp', - ] + PARALLEL_DIRS += [ 'wmf' ]; if CONFIG['MOZ_FFMPEG']: EXPORTS += [ diff --git a/content/media/fmp4/wmf/MFTDecoder.cpp b/content/media/fmp4/wmf/MFTDecoder.cpp index acffa484b33..e10d47389dc 100644 --- a/content/media/fmp4/wmf/MFTDecoder.cpp +++ b/content/media/fmp4/wmf/MFTDecoder.cpp @@ -133,7 +133,7 @@ MFTDecoder::CreateInputSample(const uint8_t* aData, NS_ENSURE_TRUE(SUCCEEDED(hr), hr); RefPtr buffer; - int32_t bufferSize = std::max(uint32_t(mInputStreamInfo.cbSize), aDataSize); + int32_t bufferSize = std::max(uint32_t(mInputStreamInfo.cbSize), aDataSize); UINT32 alignment = (mInputStreamInfo.cbAlignment > 1) ? mInputStreamInfo.cbAlignment - 1 : 0; hr = wmf::MFCreateAlignedMemoryBuffer(bufferSize, alignment, byRef(buffer)); NS_ENSURE_TRUE(SUCCEEDED(hr), hr); diff --git a/content/media/fmp4/wmf/moz.build b/content/media/fmp4/wmf/moz.build new file mode 100644 index 00000000000..6e7a4137fb0 --- /dev/null +++ b/content/media/fmp4/wmf/moz.build @@ -0,0 +1,24 @@ +# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +EXPORTS += [ + 'MFTDecoder.h', + 'WMFAudioMFTManager.h', + 'WMFDecoderModule.h', + 'WMFMediaDataDecoder.h', + 'WMFVideoMFTManager.h', +] +UNIFIED_SOURCES += [ + 'MFTDecoder.cpp', + 'WMFAudioMFTManager.cpp', + 'WMFDecoderModule.cpp', + 'WMFMediaDataDecoder.cpp', + 'WMFVideoMFTManager.cpp', +] + +FINAL_LIBRARY = 'gklayout' + +FAIL_ON_WARNINGS = True diff --git a/content/media/wmf/WMF.h b/content/media/wmf/WMF.h index ec7956d02e4..2fdfb975c3b 100644 --- a/content/media/wmf/WMF.h +++ b/content/media/wmf/WMF.h @@ -34,6 +34,16 @@ which makes Windows Media Foundation unavailable. #include #include +// The Windows headers helpfully declare min and max macros, which don't +// compile in the prescence of std::min and std::max and unified builds. +// So undef them here. +#ifdef min +#undef min +#endif +#ifdef max +#undef max +#endif + // Some SDK versions don't define the AAC decoder CLSID. #ifndef CLSID_CMSAACDecMFT extern "C" const CLSID CLSID_CMSAACDecMFT; From 4800404440b750b2e3580aab40057f4447486e7b Mon Sep 17 00:00:00 2001 From: Jan de Mooij Date: Mon, 21 Jul 2014 12:45:48 +0200 Subject: [PATCH 34/84] Bug 1028866 part 6 - Move NewString* functions from jsstr.{h,cpp} to vm/String.{h,cpp}. rs=luke --- js/src/jsstr.cpp | 265 ------------------------------------------- js/src/jsstr.h | 45 -------- js/src/vm/String.cpp | 265 +++++++++++++++++++++++++++++++++++++++++++ js/src/vm/String.h | 45 ++++++++ 4 files changed, 310 insertions(+), 310 deletions(-) diff --git a/js/src/jsstr.cpp b/js/src/jsstr.cpp index 19f40a97d09..d6f28896878 100644 --- a/js/src/jsstr.cpp +++ b/js/src/jsstr.cpp @@ -4268,271 +4268,6 @@ js_InitStringClass(JSContext *cx, HandleObject obj) return proto; } -JSLinearString * -js::NewDependentString(JSContext *cx, JSString *baseArg, size_t start, size_t length) -{ - if (length == 0) - return cx->emptyString(); - - JSLinearString *base = baseArg->ensureLinear(cx); - if (!base) - return nullptr; - - if (start == 0 && length == base->length()) - return base; - - if (base->hasTwoByteChars()) { - AutoCheckCannotGC nogc; - const jschar *chars = base->twoByteChars(nogc) + start; - if (JSLinearString *staticStr = cx->staticStrings().lookup(chars, length)) - return staticStr; - } else { - AutoCheckCannotGC nogc; - const Latin1Char *chars = base->latin1Chars(nogc) + start; - if (JSLinearString *staticStr = cx->staticStrings().lookup(chars, length)) - return staticStr; - } - - return JSDependentString::new_(cx, base, start, length); -} - -template -static void -CopyCharsMaybeInflate(jschar *dest, const CharT *src, size_t len); - -template <> -void -CopyCharsMaybeInflate(jschar *dest, const jschar *src, size_t len) -{ - PodCopy(dest, src, len); -} - -template <> -void -CopyCharsMaybeInflate(jschar *dest, const Latin1Char *src, size_t len) -{ - CopyAndInflateChars(dest, src, len); -} - -static bool -CanStoreCharsAsLatin1(const jschar *s, size_t length) -{ - if (!EnableLatin1Strings) - return false; - - for (const jschar *end = s + length; s < end; ++s) { - if (*s > JSString::MAX_LATIN1_CHAR) - return false; - } - - return true; -} - -static bool -CanStoreCharsAsLatin1(const Latin1Char *s, size_t length) -{ - MOZ_CRASH("Shouldn't be called for Latin1 chars"); -} - -template -static MOZ_ALWAYS_INLINE JSInlineString * -NewFatInlineStringDeflated(ThreadSafeContext *cx, mozilla::Range chars) -{ - MOZ_ASSERT(EnableLatin1Strings); - - size_t len = chars.length(); - Latin1Char *storage; - JSInlineString *str = AllocateFatInlineString(cx, len, &storage); - if (!str) - return nullptr; - - for (size_t i = 0; i < len; i++) { - MOZ_ASSERT(chars[i] <= JSString::MAX_LATIN1_CHAR); - storage[i] = Latin1Char(chars[i]); - } - storage[len] = '\0'; - return str; -} - -template -static JSFlatString * -NewStringDeflated(ThreadSafeContext *cx, const jschar *s, size_t n) -{ - MOZ_ASSERT(EnableLatin1Strings); - - if (JSFatInlineString::latin1LengthFits(n)) - return NewFatInlineStringDeflated(cx, mozilla::Range(s, n)); - - ScopedJSFreePtr news(cx->pod_malloc(n + 1)); - if (!news) - return nullptr; - - for (size_t i = 0; i < n; i++) { - MOZ_ASSERT(s[i] <= JSString::MAX_LATIN1_CHAR); - news.get()[i] = Latin1Char(s[i]); - } - news[n] = '\0'; - - JSFlatString *str = JSFlatString::new_(cx, news.get(), n); - if (!str) - return nullptr; - - news.forget(); - return str; -} - -template -static JSFlatString * -NewStringDeflated(ThreadSafeContext *cx, const Latin1Char *s, size_t n) -{ - MOZ_CRASH("Shouldn't be called for Latin1 chars"); -} - -template -JSFlatString * -js::NewStringDontDeflate(ThreadSafeContext *cx, CharT *chars, size_t length) -{ - if (length == 1) { - jschar c = chars[0]; - if (StaticStrings::hasUnit(c)) { - // Free |chars| because we're taking possession of it, but it's no - // longer needed because we use the static string instead. - js_free(chars); - return cx->staticStrings().getUnit(c); - } - } - - return JSFlatString::new_(cx, chars, length); -} - -template JSFlatString * -js::NewStringDontDeflate(ThreadSafeContext *cx, jschar *chars, size_t length); - -template JSFlatString * -js::NewStringDontDeflate(ThreadSafeContext *cx, jschar *chars, size_t length); - -template JSFlatString * -js::NewStringDontDeflate(ThreadSafeContext *cx, Latin1Char *chars, size_t length); - -template JSFlatString * -js::NewStringDontDeflate(ThreadSafeContext *cx, Latin1Char *chars, size_t length); - -template -JSFlatString * -js::NewString(ThreadSafeContext *cx, CharT *chars, size_t length) -{ - if (IsSame::value && CanStoreCharsAsLatin1(chars, length)) { - if (length == 1) { - jschar c = chars[0]; - if (StaticStrings::hasUnit(c)) { - js_free(chars); - return cx->staticStrings().getUnit(c); - } - } - - JSFlatString *s = NewStringDeflated(cx, chars, length); - if (!s) - return nullptr; - - // Free |chars| because we're taking possession of it but not using it. - js_free(chars); - return s; - } - - return NewStringDontDeflate(cx, chars, length); -} - -template JSFlatString * -js::NewString(ThreadSafeContext *cx, jschar *chars, size_t length); - -template JSFlatString * -js::NewString(ThreadSafeContext *cx, jschar *chars, size_t length); - -template JSFlatString * -js::NewString(ThreadSafeContext *cx, Latin1Char *chars, size_t length); - -template JSFlatString * -js::NewString(ThreadSafeContext *cx, Latin1Char *chars, size_t length); - -namespace js { - -template -JSFlatString * -NewStringCopyNDontDeflate(ThreadSafeContext *cx, const CharT *s, size_t n) -{ - if (EnableLatin1Strings) { - if (JSFatInlineString::lengthFits(n)) - return NewFatInlineString(cx, mozilla::Range(s, n)); - - ScopedJSFreePtr news(cx->pod_malloc(n + 1)); - if (!news) - return nullptr; - - PodCopy(news.get(), s, n); - news[n] = 0; - - JSFlatString *str = JSFlatString::new_(cx, news.get(), n); - if (!str) - return nullptr; - - news.forget(); - return str; - } - - if (JSFatInlineString::twoByteLengthFits(n)) - return NewFatInlineString(cx, mozilla::Range(s, n)); - - ScopedJSFreePtr news(cx->pod_malloc(n + 1)); - if (!news) - return nullptr; - - CopyCharsMaybeInflate(news.get(), s, n); - news[n] = 0; - - JSFlatString *str = JSFlatString::new_(cx, news.get(), n); - if (!str) - return nullptr; - - news.forget(); - return str; -} - -template JSFlatString * -NewStringCopyNDontDeflate(ThreadSafeContext *cx, const jschar *s, size_t n); - -template JSFlatString * -NewStringCopyNDontDeflate(ThreadSafeContext *cx, const jschar *s, size_t n); - -template JSFlatString * -NewStringCopyNDontDeflate(ThreadSafeContext *cx, const Latin1Char *s, size_t n); - -template JSFlatString * -NewStringCopyNDontDeflate(ThreadSafeContext *cx, const Latin1Char *s, size_t n); - -template -JSFlatString * -NewStringCopyN(ThreadSafeContext *cx, const CharT *s, size_t n) -{ - if (IsSame::value && CanStoreCharsAsLatin1(s, n)) - return NewStringDeflated(cx, s, n); - - return NewStringCopyNDontDeflate(cx, s, n); -} - -template JSFlatString * -NewStringCopyN(ThreadSafeContext *cx, const jschar *s, size_t n); - -template JSFlatString * -NewStringCopyN(ThreadSafeContext *cx, const jschar *s, size_t n); - -template JSFlatString * -NewStringCopyN(ThreadSafeContext *cx, const Latin1Char *s, size_t n); - -template JSFlatString * -NewStringCopyN(ThreadSafeContext *cx, const Latin1Char *s, size_t n); - -} /* namespace js */ - const char * js_ValueToPrintable(JSContext *cx, const Value &vArg, JSAutoByteString *bytes, bool asSource) { diff --git a/js/src/jsstr.h b/js/src/jsstr.h index 6af86e3f140..8f2a73bc233 100644 --- a/js/src/jsstr.h +++ b/js/src/jsstr.h @@ -127,51 +127,6 @@ namespace js { extern mozilla::UniquePtr DuplicateString(ThreadSafeContext *cx, const jschar *s); -/* GC-allocate a string descriptor for the given malloc-allocated chars. */ -template -extern JSFlatString * -NewString(js::ThreadSafeContext *cx, CharT *chars, size_t length); - -/* Like NewString, but doesn't try to deflate to Latin1. */ -template -extern JSFlatString * -NewStringDontDeflate(js::ThreadSafeContext *cx, CharT *chars, size_t length); - -extern JSLinearString * -NewDependentString(JSContext *cx, JSString *base, size_t start, size_t length); - -/* Copy a counted string and GC-allocate a descriptor for it. */ -template -extern JSFlatString * -NewStringCopyN(js::ThreadSafeContext *cx, const CharT *s, size_t n); - -template -inline JSFlatString * -NewStringCopyN(ThreadSafeContext *cx, const char *s, size_t n) -{ - return NewStringCopyN(cx, reinterpret_cast(s), n); -} - -/* Like NewStringCopyN, but doesn't try to deflate to Latin1. */ -template -extern JSFlatString * -NewStringCopyNDontDeflate(js::ThreadSafeContext *cx, const CharT *s, size_t n); - -/* Copy a C string and GC-allocate a descriptor for it. */ -template -inline JSFlatString * -NewStringCopyZ(js::ExclusiveContext *cx, const jschar *s) -{ - return NewStringCopyN(cx, s, js_strlen(s)); -} - -template -inline JSFlatString * -NewStringCopyZ(js::ThreadSafeContext *cx, const char *s) -{ - return NewStringCopyN(cx, s, strlen(s)); -} - /* * Convert a non-string value to a string, returning null after reporting an * error, otherwise returning a new string reference. diff --git a/js/src/vm/String.cpp b/js/src/vm/String.cpp index cf7b7a2c341..d5d19e63084 100644 --- a/js/src/vm/String.cpp +++ b/js/src/vm/String.cpp @@ -895,3 +895,268 @@ JSAtom::dump() this->JSString::dump(); } #endif /* DEBUG */ + +JSLinearString * +js::NewDependentString(JSContext *cx, JSString *baseArg, size_t start, size_t length) +{ + if (length == 0) + return cx->emptyString(); + + JSLinearString *base = baseArg->ensureLinear(cx); + if (!base) + return nullptr; + + if (start == 0 && length == base->length()) + return base; + + if (base->hasTwoByteChars()) { + AutoCheckCannotGC nogc; + const jschar *chars = base->twoByteChars(nogc) + start; + if (JSLinearString *staticStr = cx->staticStrings().lookup(chars, length)) + return staticStr; + } else { + AutoCheckCannotGC nogc; + const Latin1Char *chars = base->latin1Chars(nogc) + start; + if (JSLinearString *staticStr = cx->staticStrings().lookup(chars, length)) + return staticStr; + } + + return JSDependentString::new_(cx, base, start, length); +} + +template +static void +CopyCharsMaybeInflate(jschar *dest, const CharT *src, size_t len); + +template <> +void +CopyCharsMaybeInflate(jschar *dest, const jschar *src, size_t len) +{ + PodCopy(dest, src, len); +} + +template <> +void +CopyCharsMaybeInflate(jschar *dest, const Latin1Char *src, size_t len) +{ + CopyAndInflateChars(dest, src, len); +} + +static bool +CanStoreCharsAsLatin1(const jschar *s, size_t length) +{ + if (!EnableLatin1Strings) + return false; + + for (const jschar *end = s + length; s < end; ++s) { + if (*s > JSString::MAX_LATIN1_CHAR) + return false; + } + + return true; +} + +static bool +CanStoreCharsAsLatin1(const Latin1Char *s, size_t length) +{ + MOZ_CRASH("Shouldn't be called for Latin1 chars"); +} + +template +static MOZ_ALWAYS_INLINE JSInlineString * +NewFatInlineStringDeflated(ThreadSafeContext *cx, mozilla::Range chars) +{ + MOZ_ASSERT(EnableLatin1Strings); + + size_t len = chars.length(); + Latin1Char *storage; + JSInlineString *str = AllocateFatInlineString(cx, len, &storage); + if (!str) + return nullptr; + + for (size_t i = 0; i < len; i++) { + MOZ_ASSERT(chars[i] <= JSString::MAX_LATIN1_CHAR); + storage[i] = Latin1Char(chars[i]); + } + storage[len] = '\0'; + return str; +} + +template +static JSFlatString * +NewStringDeflated(ThreadSafeContext *cx, const jschar *s, size_t n) +{ + MOZ_ASSERT(EnableLatin1Strings); + + if (JSFatInlineString::latin1LengthFits(n)) + return NewFatInlineStringDeflated(cx, mozilla::Range(s, n)); + + ScopedJSFreePtr news(cx->pod_malloc(n + 1)); + if (!news) + return nullptr; + + for (size_t i = 0; i < n; i++) { + MOZ_ASSERT(s[i] <= JSString::MAX_LATIN1_CHAR); + news.get()[i] = Latin1Char(s[i]); + } + news[n] = '\0'; + + JSFlatString *str = JSFlatString::new_(cx, news.get(), n); + if (!str) + return nullptr; + + news.forget(); + return str; +} + +template +static JSFlatString * +NewStringDeflated(ThreadSafeContext *cx, const Latin1Char *s, size_t n) +{ + MOZ_CRASH("Shouldn't be called for Latin1 chars"); +} + +template +JSFlatString * +js::NewStringDontDeflate(ThreadSafeContext *cx, CharT *chars, size_t length) +{ + if (length == 1) { + jschar c = chars[0]; + if (StaticStrings::hasUnit(c)) { + // Free |chars| because we're taking possession of it, but it's no + // longer needed because we use the static string instead. + js_free(chars); + return cx->staticStrings().getUnit(c); + } + } + + return JSFlatString::new_(cx, chars, length); +} + +template JSFlatString * +js::NewStringDontDeflate(ThreadSafeContext *cx, jschar *chars, size_t length); + +template JSFlatString * +js::NewStringDontDeflate(ThreadSafeContext *cx, jschar *chars, size_t length); + +template JSFlatString * +js::NewStringDontDeflate(ThreadSafeContext *cx, Latin1Char *chars, size_t length); + +template JSFlatString * +js::NewStringDontDeflate(ThreadSafeContext *cx, Latin1Char *chars, size_t length); + +template +JSFlatString * +js::NewString(ThreadSafeContext *cx, CharT *chars, size_t length) +{ + if (IsSame::value && CanStoreCharsAsLatin1(chars, length)) { + if (length == 1) { + jschar c = chars[0]; + if (StaticStrings::hasUnit(c)) { + js_free(chars); + return cx->staticStrings().getUnit(c); + } + } + + JSFlatString *s = NewStringDeflated(cx, chars, length); + if (!s) + return nullptr; + + // Free |chars| because we're taking possession of it but not using it. + js_free(chars); + return s; + } + + return NewStringDontDeflate(cx, chars, length); +} + +template JSFlatString * +js::NewString(ThreadSafeContext *cx, jschar *chars, size_t length); + +template JSFlatString * +js::NewString(ThreadSafeContext *cx, jschar *chars, size_t length); + +template JSFlatString * +js::NewString(ThreadSafeContext *cx, Latin1Char *chars, size_t length); + +template JSFlatString * +js::NewString(ThreadSafeContext *cx, Latin1Char *chars, size_t length); + +namespace js { + +template +JSFlatString * +NewStringCopyNDontDeflate(ThreadSafeContext *cx, const CharT *s, size_t n) +{ + if (EnableLatin1Strings) { + if (JSFatInlineString::lengthFits(n)) + return NewFatInlineString(cx, mozilla::Range(s, n)); + + ScopedJSFreePtr news(cx->pod_malloc(n + 1)); + if (!news) + return nullptr; + + PodCopy(news.get(), s, n); + news[n] = 0; + + JSFlatString *str = JSFlatString::new_(cx, news.get(), n); + if (!str) + return nullptr; + + news.forget(); + return str; + } + + if (JSFatInlineString::twoByteLengthFits(n)) + return NewFatInlineString(cx, mozilla::Range(s, n)); + + ScopedJSFreePtr news(cx->pod_malloc(n + 1)); + if (!news) + return nullptr; + + CopyCharsMaybeInflate(news.get(), s, n); + news[n] = 0; + + JSFlatString *str = JSFlatString::new_(cx, news.get(), n); + if (!str) + return nullptr; + + news.forget(); + return str; +} + +template JSFlatString * +NewStringCopyNDontDeflate(ThreadSafeContext *cx, const jschar *s, size_t n); + +template JSFlatString * +NewStringCopyNDontDeflate(ThreadSafeContext *cx, const jschar *s, size_t n); + +template JSFlatString * +NewStringCopyNDontDeflate(ThreadSafeContext *cx, const Latin1Char *s, size_t n); + +template JSFlatString * +NewStringCopyNDontDeflate(ThreadSafeContext *cx, const Latin1Char *s, size_t n); + +template +JSFlatString * +NewStringCopyN(ThreadSafeContext *cx, const CharT *s, size_t n) +{ + if (IsSame::value && CanStoreCharsAsLatin1(s, n)) + return NewStringDeflated(cx, s, n); + + return NewStringCopyNDontDeflate(cx, s, n); +} + +template JSFlatString * +NewStringCopyN(ThreadSafeContext *cx, const jschar *s, size_t n); + +template JSFlatString * +NewStringCopyN(ThreadSafeContext *cx, const jschar *s, size_t n); + +template JSFlatString * +NewStringCopyN(ThreadSafeContext *cx, const Latin1Char *s, size_t n); + +template JSFlatString * +NewStringCopyN(ThreadSafeContext *cx, const Latin1Char *s, size_t n); + +} /* namespace js */ diff --git a/js/src/vm/String.h b/js/src/vm/String.h index 8dd0c1c7848..500481a283a 100644 --- a/js/src/vm/String.h +++ b/js/src/vm/String.h @@ -1177,6 +1177,51 @@ template void CopyChars(CharT *dest, const JSLinearString &str); +/* GC-allocate a string descriptor for the given malloc-allocated chars. */ +template +extern JSFlatString * +NewString(js::ThreadSafeContext *cx, CharT *chars, size_t length); + +/* Like NewString, but doesn't try to deflate to Latin1. */ +template +extern JSFlatString * +NewStringDontDeflate(js::ThreadSafeContext *cx, CharT *chars, size_t length); + +extern JSLinearString * +NewDependentString(JSContext *cx, JSString *base, size_t start, size_t length); + +/* Copy a counted string and GC-allocate a descriptor for it. */ +template +extern JSFlatString * +NewStringCopyN(js::ThreadSafeContext *cx, const CharT *s, size_t n); + +template +inline JSFlatString * +NewStringCopyN(ThreadSafeContext *cx, const char *s, size_t n) +{ + return NewStringCopyN(cx, reinterpret_cast(s), n); +} + +/* Like NewStringCopyN, but doesn't try to deflate to Latin1. */ +template +extern JSFlatString * +NewStringCopyNDontDeflate(js::ThreadSafeContext *cx, const CharT *s, size_t n); + +/* Copy a C string and GC-allocate a descriptor for it. */ +template +inline JSFlatString * +NewStringCopyZ(js::ExclusiveContext *cx, const jschar *s) +{ + return NewStringCopyN(cx, s, js_strlen(s)); +} + +template +inline JSFlatString * +NewStringCopyZ(js::ThreadSafeContext *cx, const char *s) +{ + return NewStringCopyN(cx, s, strlen(s)); +} + } /* namespace js */ // Addon IDs are interned atoms which are never destroyed. This detail is From 32baa5a3edfd7c9e0ef9d6189bd381a2faa90950 Mon Sep 17 00:00:00 2001 From: Chris Lord Date: Mon, 21 Jul 2014 12:59:05 +0100 Subject: [PATCH 35/84] Bug 994541 - Enable OMTC on Linux via BasicCompositor. r=Bas --- modules/libpref/src/init/all.js | 19 +------------------ widget/xpwidgets/nsBaseWidget.cpp | 18 ------------------ 2 files changed, 1 insertion(+), 36 deletions(-) diff --git a/modules/libpref/src/init/all.js b/modules/libpref/src/init/all.js index cdc665afe1d..8f4e881e518 100644 --- a/modules/libpref/src/init/all.js +++ b/modules/libpref/src/init/all.js @@ -3832,7 +3832,7 @@ pref("layers.max-active", -1); pref("layers.scroll-graph", false); // Set the default values, and then override per-platform as needed -pref("layers.offmainthreadcomposition.enabled", false); +pref("layers.offmainthreadcomposition.enabled", true); // Compositor target frame rate. NOTE: If vsync is enabled the compositor // frame rate will still be capped. // -1 -> default (match layout.frame_rate or 60 FPS) @@ -3845,31 +3845,14 @@ pref("layers.async-video.enabled", true); pref("layers.async-video-oop.enabled",true); #ifdef XP_WIN -pref("layers.offmainthreadcomposition.enabled", true); // XXX - see bug 1009616 pref("layers.async-video-oop.enabled", false); #endif -#ifdef MOZ_WIDGET_QT -pref("layers.offmainthreadcomposition.enabled", true); -#endif - -#ifdef XP_MACOSX -pref("layers.offmainthreadcomposition.enabled", true); -#endif - -// ANDROID covers android and b2g -#ifdef ANDROID -pref("layers.offmainthreadcomposition.enabled", true); -#endif - // same effect as layers.offmainthreadcomposition.enabled, but specifically for // use with tests. pref("layers.offmainthreadcomposition.testing.enabled", false); -// whether to allow use of the basic compositor -pref("layers.offmainthreadcomposition.force-basic", false); - // Whether to animate simple opacity and transforms on the compositor pref("layers.offmainthreadcomposition.async-animations", false); diff --git a/widget/xpwidgets/nsBaseWidget.cpp b/widget/xpwidgets/nsBaseWidget.cpp index c06c1967fa0..07bc9817d93 100644 --- a/widget/xpwidgets/nsBaseWidget.cpp +++ b/widget/xpwidgets/nsBaseWidget.cpp @@ -872,20 +872,6 @@ nsBaseWidget::GetPreferredCompositorBackends(nsTArray& aHints) aHints.AppendElement(LayersBackend::LAYERS_BASIC); } -static void -CheckForBasicBackends(nsTArray& aHints) -{ -#ifndef XP_WIN - for (size_t i = 0; i < aHints.Length(); ++i) { - if (aHints[i] == LayersBackend::LAYERS_BASIC && - !Preferences::GetBool("layers.offmainthreadcomposition.force-basic", false)) { - // basic compositor is not stable enough for regular use - aHints[i] = LayersBackend::LAYERS_NONE; - } - } -#endif -} - void nsBaseWidget::CreateCompositor(int aWidth, int aHeight) { MOZ_ASSERT(gfxPlatform::UsesOffMainThreadCompositing(), @@ -915,10 +901,6 @@ void nsBaseWidget::CreateCompositor(int aWidth, int aHeight) nsTArray backendHints; GetPreferredCompositorBackends(backendHints); - if (!mRequireOffMainThreadCompositing) { - CheckForBasicBackends(backendHints); - } - bool success = false; if (!backendHints.IsEmpty()) { shadowManager = mCompositorChild->SendPLayerTransactionConstructor( From c7a033be8e40172c1850b5f5241cb74970ba4674 Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Sun, 20 Jul 2014 19:05:44 -0400 Subject: [PATCH 36/84] Bug 1041325 - Use intrin.h for _ReturnAddress in the chromium sandbox code; r=bbondy --HG-- extra : rebase_source : 06bb642636a9f3df2e75eb950816a7d48da85faf --- security/sandbox/chromium/base/location.cc | 5 +---- security/sandbox/chromium/base/win/scoped_handle.h | 11 ++++------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/security/sandbox/chromium/base/location.cc b/security/sandbox/chromium/base/location.cc index b5da027ee82..6d7a565604c 100644 --- a/security/sandbox/chromium/base/location.cc +++ b/security/sandbox/chromium/base/location.cc @@ -5,10 +5,7 @@ #include "build/build_config.h" #if defined(COMPILER_MSVC) -// MSDN says to #include , but that breaks the VS2005 build. -extern "C" { - void* _ReturnAddress(); -} +#include #endif #include "base/location.h" diff --git a/security/sandbox/chromium/base/win/scoped_handle.h b/security/sandbox/chromium/base/win/scoped_handle.h index d236a70beb4..d3f5c22facd 100644 --- a/security/sandbox/chromium/base/win/scoped_handle.h +++ b/security/sandbox/chromium/base/win/scoped_handle.h @@ -13,21 +13,18 @@ #include "base/logging.h" #include "base/move.h" -namespace base { -namespace win { - // TODO(rvargas): remove this with the rest of the verifier. #if defined(COMPILER_MSVC) -// MSDN says to #include , but that breaks the VS2005 build. -extern "C" { - void* _ReturnAddress(); -} +#include #define BASE_WIN_GET_CALLER _ReturnAddress() #elif defined(COMPILER_GCC) #define BASE_WIN_GET_CALLER __builtin_extract_return_addr(\\ __builtin_return_address(0)) #endif +namespace base { +namespace win { + // Generic wrapper for raw handles that takes care of closing handles // automatically. The class interface follows the style of // the ScopedStdioHandle class with a few additions: From 273e0478f9c9da8aa67c14b0bdf2a9cc838e5735 Mon Sep 17 00:00:00 2001 From: Eric Chou Date: Mon, 21 Jul 2014 09:56:58 +0800 Subject: [PATCH 37/84] Bug 1036861 - [MTP] Write file size into the response of getObjectInfo, r=dhylands In the response of operation GetObjectInfo, there is a field "ObjectCompressedSize". Currently it's assigned with 0. We need to put correct file size into it. I also corrected the type of property value in function getObjectPropertyDesc(). --- dom/system/gonk/MozMtpDatabase.cpp | 44 +++++++++++++++++++++++------- 1 file changed, 34 insertions(+), 10 deletions(-) diff --git a/dom/system/gonk/MozMtpDatabase.cpp b/dom/system/gonk/MozMtpDatabase.cpp index 44b787a41ab..893802ee207 100644 --- a/dom/system/gonk/MozMtpDatabase.cpp +++ b/dom/system/gonk/MozMtpDatabase.cpp @@ -635,7 +635,13 @@ MozMtpDatabase::getObjectInfo(MtpObjectHandle aHandle, aInfo.mStorageID = entry->mStorageID; aInfo.mFormat = entry->mObjectFormat; aInfo.mProtectionStatus = 0x0; - aInfo.mCompressedSize = 0; + + if (entry->mObjectSize > 0xFFFFFFFFuLL) { + aInfo.mCompressedSize = 0xFFFFFFFFuLL; + } else { + aInfo.mCompressedSize = entry->mObjectSize; + } + aInfo.mThumbFormat = entry->mObjectFormat; aInfo.mThumbCompressedSize = 20*20*4; aInfo.mThumbPixWidth = 20; @@ -748,18 +754,36 @@ MozMtpDatabase::getObjectPropertyDesc(MtpObjectProperty aProperty, { MTP_LOG("Property: %s 0x%08x", ObjectPropertyAsStr(aProperty), aProperty); - // TODO: Perhaps Filesize should be 64-bit? - MtpProperty* result = nullptr; switch (aProperty) { - case MTP_PROPERTY_STORAGE_ID: result = new MtpProperty(aProperty, MTP_TYPE_UINT32); break; - case MTP_PROPERTY_OBJECT_FORMAT: result = new MtpProperty(aProperty, MTP_TYPE_UINT32); break; - case MTP_PROPERTY_OBJECT_SIZE: result = new MtpProperty(aProperty, MTP_TYPE_UINT32); break; - case MTP_PROPERTY_WIDTH: result = new MtpProperty(aProperty, MTP_TYPE_UINT32); break; - case MTP_PROPERTY_HEIGHT: result = new MtpProperty(aProperty, MTP_TYPE_UINT32); break; - case MTP_PROPERTY_IMAGE_BIT_DEPTH: result = new MtpProperty(aProperty, MTP_TYPE_UINT32); break; - case MTP_PROPERTY_DISPLAY_NAME: result = new MtpProperty(aProperty, MTP_TYPE_STR); break; + case MTP_PROPERTY_PROTECTION_STATUS: + result = new MtpProperty(aProperty, MTP_TYPE_UINT16); + break; + case MTP_PROPERTY_OBJECT_FORMAT: + result = new MtpProperty(aProperty, MTP_TYPE_UINT16, false, aFormat); + break; + case MTP_PROPERTY_STORAGE_ID: + case MTP_PROPERTY_PARENT_OBJECT: + case MTP_PROPERTY_WIDTH: + case MTP_PROPERTY_HEIGHT: + case MTP_PROPERTY_IMAGE_BIT_DEPTH: + result = new MtpProperty(aProperty, MTP_TYPE_UINT32); + break; + case MTP_PROPERTY_OBJECT_SIZE: + result = new MtpProperty(aProperty, MTP_TYPE_UINT64); + break; + case MTP_PROPERTY_DISPLAY_NAME: + result = new MtpProperty(aProperty, MTP_TYPE_STR); + break; + case MTP_PROPERTY_OBJECT_FILE_NAME: + result = new MtpProperty(aProperty, MTP_TYPE_STR, true); + break; + case MTP_PROPERTY_DATE_MODIFIED: + case MTP_PROPERTY_DATE_ADDED: + result = new MtpProperty(aProperty, MTP_TYPE_STR); + result->setFormDateTime(); + break; default: break; } From 2ffd4c7896bfa6e8611af82ccf4ea4008af5d2f2 Mon Sep 17 00:00:00 2001 From: Eric Chou Date: Mon, 21 Jul 2014 09:57:04 +0800 Subject: [PATCH 38/84] Bug 1036863 - [MTP] Rename file/folder via MTP, r=dhylands This patch fixed 'unable to rename file/folder via MTP' by responding to MTP operation 'setObjectPropertyValue' correctly --- dom/system/gonk/MozMtpCommon.h | 2 + dom/system/gonk/MozMtpDatabase.cpp | 91 +++++++++++++++++++++++++++++- 2 files changed, 91 insertions(+), 2 deletions(-) diff --git a/dom/system/gonk/MozMtpCommon.h b/dom/system/gonk/MozMtpCommon.h index 72769f87f5c..6ef801081a2 100644 --- a/dom/system/gonk/MozMtpCommon.h +++ b/dom/system/gonk/MozMtpCommon.h @@ -28,6 +28,7 @@ namespace android { class MOZ_EXPORT MtpServer; class MOZ_EXPORT MtpStorage; + class MOZ_EXPORT MtpStringBuffer; class MOZ_EXPORT MtpDatabase; class MOZ_EXPORT MtpDataPacket; class MOZ_EXPORT MtpProperty; @@ -39,6 +40,7 @@ namespace android { #include #include #include +#include #include #endif // mozilla_system_mtpcommon_h__ diff --git a/dom/system/gonk/MozMtpDatabase.cpp b/dom/system/gonk/MozMtpDatabase.cpp index 893802ee207..29534d5089c 100644 --- a/dom/system/gonk/MozMtpDatabase.cpp +++ b/dom/system/gonk/MozMtpDatabase.cpp @@ -29,6 +29,7 @@ ObjectPropertyAsStr(MtpObjectProperty aProperty) { switch (aProperty) { case MTP_PROPERTY_STORAGE_ID: return "MTP_PROPERTY_STORAGE_ID"; + case MTP_PROPERTY_OBJECT_FILE_NAME: return "MTP_PROPERTY_OBJECT_FILE_NAME"; case MTP_PROPERTY_OBJECT_FORMAT: return "MTP_PROPERTY_OBJECT_FORMAT"; case MTP_PROPERTY_OBJECT_SIZE: return "MTP_PROPERTY_OBJECT_SIZE"; case MTP_PROPERTY_WIDTH: return "MTP_PROPERTY_WIDTH"; @@ -102,6 +103,22 @@ MozMtpDatabase::BaseName(const nsCString& path) return path; } +static nsCString +GetPathWithoutFileName(const nsCString& aFullPath) +{ + nsCString path; + + int32_t offset = aFullPath.RFindChar('/'); + if (offset != kNotFound) { + // The trailing slash will be as part of 'path' + path = StringHead(aFullPath, offset + 1); + } + + MTP_LOG("returning '%s'", path.get()); + + return path; +} + void MozMtpDatabase::ParseDirectory(const char *aDir, MtpObjectHandle aParent) { @@ -353,14 +370,84 @@ MozMtpDatabase::getObjectPropertyValue(MtpObjectHandle aHandle, return MTP_RESPONSE_OK; } +static int +GetTypeOfObjectProp(MtpObjectProperty aProperty) +{ + struct PropertyTableEntry { + MtpObjectProperty property; + int type; + }; + + static const PropertyTableEntry kObjectPropertyTable[] = { + {MTP_PROPERTY_STORAGE_ID, MTP_TYPE_UINT32 }, + {MTP_PROPERTY_OBJECT_FORMAT, MTP_TYPE_UINT16 }, + {MTP_PROPERTY_PROTECTION_STATUS, MTP_TYPE_UINT16 }, + {MTP_PROPERTY_OBJECT_SIZE, MTP_TYPE_UINT64 }, + {MTP_PROPERTY_OBJECT_FILE_NAME, MTP_TYPE_STR }, + {MTP_PROPERTY_DATE_MODIFIED, MTP_TYPE_STR }, + {MTP_PROPERTY_PARENT_OBJECT, MTP_TYPE_UINT32 }, + {MTP_PROPERTY_DISPLAY_NAME, MTP_TYPE_STR }, + {MTP_PROPERTY_DATE_ADDED, MTP_TYPE_STR }, + }; + + int count = sizeof(kObjectPropertyTable) / sizeof(kObjectPropertyTable[0]); + const PropertyTableEntry* entryProp = kObjectPropertyTable; + int type = 0; + + for (int i = 0; i < count; ++i, ++entryProp) { + if (entryProp->property == aProperty) { + type = entryProp->type; + break; + } + } + + return type; +} + //virtual MtpResponseCode MozMtpDatabase::setObjectPropertyValue(MtpObjectHandle aHandle, MtpObjectProperty aProperty, MtpDataPacket& aPacket) { - MTP_LOG("Handle: 0x%08x (NOT SUPPORTED)", aHandle); - return MTP_RESPONSE_OPERATION_NOT_SUPPORTED; + MTP_LOG("Handle: 0x%08x Property: 0x%08x", aHandle, aProperty); + + // Only support file name change + if (aProperty != MTP_PROPERTY_OBJECT_FILE_NAME) { + MTP_ERR("property 0x%x not supported", aProperty); + return MTP_RESPONSE_OBJECT_PROP_NOT_SUPPORTED; + } + + if (GetTypeOfObjectProp(aProperty) != MTP_TYPE_STR) { + MTP_ERR("property type 0x%x not supported", GetTypeOfObjectProp(aProperty)); + return MTP_RESPONSE_GENERAL_ERROR; + } + + RefPtr entry = GetEntry(aHandle); + if (!entry) { + MTP_ERR("Invalid Handle: 0x%08x", aHandle); + return MTP_RESPONSE_INVALID_OBJECT_HANDLE; + } + + MtpStringBuffer buf; + aPacket.getString(buf); + + nsDependentCString newFileName(buf); + nsCString newFileFullPath(GetPathWithoutFileName(entry->mPath) + newFileName); + + if (PR_Rename(entry->mPath.get(), newFileFullPath.get()) != PR_SUCCESS) { + MTP_ERR("Failed to rename '%s' to '%s'", + entry->mPath.get(), newFileFullPath.get()); + return MTP_RESPONSE_GENERAL_ERROR; + } + + MTP_LOG("renamed '%s' to '%s'", entry->mPath.get(), newFileFullPath.get()); + + entry->mPath = newFileFullPath; + entry->mObjectName = BaseName(entry->mPath); + entry->mDisplayName = entry->mObjectName; + + return MTP_RESPONSE_OK; } //virtual From b2b985efa62346a7052dd3d681b6292832affbd9 Mon Sep 17 00:00:00 2001 From: Ben Tian Date: Mon, 21 Jul 2014 10:44:09 +0800 Subject: [PATCH 39/84] Bug 1038026 - Fire onattributechanged event when adapter fails to turn on/off BT and restores state to Disabled/Enabled, r=echou --- dom/bluetooth2/BluetoothAdapter.cpp | 19 ++++++++++++++----- dom/bluetooth2/BluetoothAdapter.h | 1 + 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/dom/bluetooth2/BluetoothAdapter.cpp b/dom/bluetooth2/BluetoothAdapter.cpp index 7d0b0362aef..42e7bf99d67 100644 --- a/dom/bluetooth2/BluetoothAdapter.cpp +++ b/dom/bluetooth2/BluetoothAdapter.cpp @@ -819,11 +819,7 @@ BluetoothAdapter::EnableDisable(bool aEnable, ErrorResult& aRv) } // Notify applications of adapter state change to Enabling/Disabling - nsTArray types; - BT_APPEND_ENUM_STRING(types, - BluetoothAdapterAttribute, - BluetoothAdapterAttribute::State); - DispatchAttributeEvent(types); + HandleAdapterStateChanged(); // Wrap runnable to handle result nsRefPtr result = @@ -832,8 +828,11 @@ BluetoothAdapter::EnableDisable(bool aEnable, ErrorResult& aRv) methodName); if(NS_FAILED(bs->EnableDisable(aEnable, result))) { + // Restore mState and notify applications of adapter state change mState = aEnable ? BluetoothAdapterState::Disabled : BluetoothAdapterState::Enabled; + HandleAdapterStateChanged(); + promise->MaybeReject(NS_ERROR_DOM_OPERATION_ERR); } @@ -894,6 +893,16 @@ BluetoothAdapter::IsAdapterAttributeChanged(BluetoothAdapterAttribute aType, } } +void +BluetoothAdapter::HandleAdapterStateChanged() +{ + nsTArray types; + BT_APPEND_ENUM_STRING(types, + BluetoothAdapterAttribute, + BluetoothAdapterAttribute::State); + DispatchAttributeEvent(types); +} + void BluetoothAdapter::HandlePropertyChanged(const BluetoothValue& aValue) { diff --git a/dom/bluetooth2/BluetoothAdapter.h b/dom/bluetooth2/BluetoothAdapter.h index 718bf7c0dca..6be8f520a40 100644 --- a/dom/bluetooth2/BluetoothAdapter.h +++ b/dom/bluetooth2/BluetoothAdapter.h @@ -193,6 +193,7 @@ private: bool IsAdapterAttributeChanged(BluetoothAdapterAttribute aType, const BluetoothValue& aValue); + void HandleAdapterStateChanged(); void HandlePropertyChanged(const BluetoothValue& aValue); void DispatchAttributeEvent(const nsTArray& aTypes); BluetoothAdapterAttribute From 809b14a081fbb18b81edb7ab84dbfc98913ba845 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Sun, 20 Jul 2014 21:35:32 -0700 Subject: [PATCH 40/84] Bumping gaia.json for 10 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/d0bfe011a555 Author: Timothy Guan-tin Chien Desc: Merge pull request #21898 from timdream/keyboard-target-handler Bug 1035062 - Implement TargetHandlersManager, r=rudyl ======== https://hg.mozilla.org/integration/gaia-central/rev/aa191e5108e0 Author: Timothy Guan-tin Chien Desc: Bug 1035062 - (Part IX) Implement TargetHandlersManager ======== https://hg.mozilla.org/integration/gaia-central/rev/3128d765dc18 Author: Timothy Guan-tin Chien Desc: Bug 1035062 - (Part VIII) Implement CandidatePanelManager ======== https://hg.mozilla.org/integration/gaia-central/rev/9ada807315de Author: Timothy Guan-tin Chien Desc: Bug 1035062 - (Part VII) Remove resetScroll from IMERender.toggleCandidatePanel() ======== https://hg.mozilla.org/integration/gaia-central/rev/38a3acf3a372 Author: Timothy Guan-tin Chien Desc: Bug 1035062 - (Part VI) Remove the NO_OP special keyCode ======== https://hg.mozilla.org/integration/gaia-central/rev/c45e1bbb0115 Author: Timothy Guan-tin Chien Desc: Bug 1035062 - (Part V) Use state object in IMERender.setUpperCaseLock() ======== https://hg.mozilla.org/integration/gaia-central/rev/d823635bb36b Author: Timothy Guan-tin Chien Desc: Bug 1035062 - (Part IV) Make setUpperCase take a state object ======== https://hg.mozilla.org/integration/gaia-central/rev/41aa02c39da0 Author: Timothy Guan-tin Chien Desc: Bug 1035062 - (Part III) Remove resetUpperCase() ======== https://hg.mozilla.org/integration/gaia-central/rev/8608e6421d57 Author: Timothy Guan-tin Chien Desc: Bug 1035062 - (Part II) Move double tap monitoring to ActiveTargetsManager ======== https://hg.mozilla.org/integration/gaia-central/rev/9aae290b5992 Author: Timothy Guan-tin Chien Desc: Bug 1035062 - (Part I) Remove unused isContinousSpacePressed remove unused variable --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 7d8cf5ce971..800e6844089 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "cea1598e51f188fe8c48196cbb2c73aacbf3b1dc", + "revision": "d0bfe011a5551a9a6d090688035288e4d8a18b78", "repo_path": "/integration/gaia-central" } From 28cbe6336d2c6110b0f86dc43b284e6ec915c473 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Sun, 20 Jul 2014 21:41:17 -0700 Subject: [PATCH 41/84] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 7eaf2a4a108..7826bab22ee 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 176f37de1aa..6ac91ed20ce 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 7993f3c525a..370a89fce0e 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 7eaf2a4a108..7826bab22ee 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index d86a195d45e..c254495162c 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 34aaab40be5..1a05eb0446b 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 9b42b4e8a1e..7d7ad9f3040 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 88b4befa39f..82c8509facd 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 62b9ca391f8..c345bf035a6 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From d0b717086f98536d210de5aca820aac72e3c7ac3 Mon Sep 17 00:00:00 2001 From: Bill McCloskey Date: Sun, 20 Jul 2014 21:58:49 -0700 Subject: [PATCH 42/84] Bug 1041370 - Fix script entry hook #ifdefing (a=RyanVM) --- js/src/vm/Runtime.cpp | 2 ++ js/src/vm/Runtime.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/js/src/vm/Runtime.cpp b/js/src/vm/Runtime.cpp index 9e358710dc9..499d6d6a371 100644 --- a/js/src/vm/Runtime.cpp +++ b/js/src/vm/Runtime.cpp @@ -181,7 +181,9 @@ JSRuntime::JSRuntime(JSRuntime *parentRuntime) negativeInfinityValue(DoubleValue(NegativeInfinity())), positiveInfinityValue(DoubleValue(PositiveInfinity())), emptyString(nullptr), +#ifdef NIGHTLY_BUILD assertOnScriptEntryHook_(nullptr), +#endif debugMode(false), spsProfiler(thisFromCtor()), profilingScripts(false), diff --git a/js/src/vm/Runtime.h b/js/src/vm/Runtime.h index e8dd7baa946..0303523cf48 100644 --- a/js/src/vm/Runtime.h +++ b/js/src/vm/Runtime.h @@ -1036,7 +1036,9 @@ struct JSRuntime : public JS::shadow::Runtime, mozilla::UniquePtr sourceHook; +#ifdef NIGHTLY_BUILD js::AssertOnScriptEntryHook assertOnScriptEntryHook_; +#endif /* Per runtime debug hooks -- see js/OldDebugAPI.h. */ JSDebugHooks debugHooks; From dc12ac02b1ee4dfa865e0ad004e73ceefee8797f Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 21 Jul 2014 00:25:32 -0700 Subject: [PATCH 43/84] Bumping gaia.json for 4 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/e63ca851cb32 Author: Yuren Ju Desc: Merge pull request #21944 from wlach/1039739-2 Bug 1039739 - Make it more clear what command we're executing;r=yuren ======== https://hg.mozilla.org/integration/gaia-central/rev/d8802cfd38a5 Author: William Lachance Desc: Bug 1039739 - Make it more clear what command we're executing;r=yuren ======== https://hg.mozilla.org/integration/gaia-central/rev/0f061f41a849 Author: Yuren Ju Desc: Merge pull request #21841 from tenmilestereo/master Bug 1031998 - JSHint now throwing no errors r=@yurenju ======== https://hg.mozilla.org/integration/gaia-central/rev/a146f315d66b Author: Lewis Cowper Desc: Bug 1031998 - Fix jshint error for build/config/payment-dev-prefs.js --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 800e6844089..86d46297a38 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "d0bfe011a5551a9a6d090688035288e4d8a18b78", + "revision": "e63ca851cb32a199d23e1835957f9c31baf237e6", "repo_path": "/integration/gaia-central" } From 1d466382084d6eea5f92b647ce682da2a2098ced Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 21 Jul 2014 00:31:20 -0700 Subject: [PATCH 44/84] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 7826bab22ee..c1522c4ed4d 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 6ac91ed20ce..a5d080b3cff 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 370a89fce0e..8df6ed1fc73 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 7826bab22ee..c1522c4ed4d 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index c254495162c..d88c2382e46 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 1a05eb0446b..d2e295aab82 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 7d7ad9f3040..9ce2c8d9415 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 82c8509facd..300b22e7c55 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index c345bf035a6..37169d7d199 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 925bde42b9deb1285efcb4aeb733b7ebb04acb66 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 21 Jul 2014 01:25:32 -0700 Subject: [PATCH 45/84] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/3112418e17e7 Author: Francisco Jordano Desc: Merge pull request #21955 from arcturus/bug-1038414 Bug 1038414 - [B2G][Contacts][Camera][273MB Flame] Camera app OOMs when adding picture to contact r=jmcf ======== https://hg.mozilla.org/integration/gaia-central/rev/f0ebb320d202 Author: Francisco Jordano Desc: Bug 1038414 - [B2G][Contacts][Camera][273MB Flame] Camera app OOMs when adding picture to contact --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 86d46297a38..372ff702e70 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "e63ca851cb32a199d23e1835957f9c31baf237e6", + "revision": "3112418e17e7f0b56dddb38316f6a448ec9c1e2a", "repo_path": "/integration/gaia-central" } From 2018346281dcbeba124abd33265cd6f61448ba35 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 21 Jul 2014 01:31:16 -0700 Subject: [PATCH 46/84] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index c1522c4ed4d..87ebdb172ba 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index a5d080b3cff..9add01bb250 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 8df6ed1fc73..3a903c30b2a 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index c1522c4ed4d..87ebdb172ba 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index d88c2382e46..6a9ba80157b 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index d2e295aab82..68a0c3ff0d5 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 9ce2c8d9415..2c270f90507 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 300b22e7c55..33885afb9d9 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 37169d7d199..7e41f32cbf2 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 054e7d23ac2a103171f5c2e27950a8abadab910a Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 21 Jul 2014 01:55:32 -0700 Subject: [PATCH 47/84] Bumping gaia.json for 6 gaia revision(s) a=gaia-bump MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ======== https://hg.mozilla.org/integration/gaia-central/rev/5703878185d4 Author: Salvador de la Puente González Desc: Merge pull request #21862 from lodr/bug-1039984-smartcollections-and-homescreen Bug 1039984 - [System] Trying to open a smartcollection after killing th... ======== https://hg.mozilla.org/integration/gaia-central/rev/dc8c5d9df3c1 Author: Salvador de la Puente Desc: Bug 1039984 - [System] Trying to open a smartcollection after killing the Homescreen do nothing. Allow Homescreen application window to be killed as other windows. But avoiding to be marked as _killed as, from a system app perspective, the homescreen is never killed. ======== https://hg.mozilla.org/integration/gaia-central/rev/fb44b8b6023f Author: gasolin Desc: Merge pull request #21970 from gasolin/issue-1040676 Bug 1040676 - [System] Wrong 2.25x resource for Quick setting bluethooth...r=pavel ======== https://hg.mozilla.org/integration/gaia-central/rev/a51012ca9771 Author: gasolin Desc: Bug 1040676 - [System] Wrong 2.25x resource for Quick setting bluethooth on indicator ======== https://hg.mozilla.org/integration/gaia-central/rev/e51498449283 Author: Jose Antonio Olivera Ortega Desc: Merge pull request #21934 from acperez/bug-1040700 Bug 1040700 - Modify APN for ATT because last update doesn't work as expected. r=jaoo ======== https://hg.mozilla.org/integration/gaia-central/rev/a2ba0f99da63 Author: Albert Desc: Bug 1040700 - Modify APN for ATT because last update doesn't work as expected.r=jaoo --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 372ff702e70..9435861207a 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "3112418e17e7f0b56dddb38316f6a448ec9c1e2a", + "revision": "5703878185d422cfd3227a3d49cd51f7f70ebbcc", "repo_path": "/integration/gaia-central" } From ebf93a2e7bc5e2c5e4a8dfaef81d6d81de9d6a61 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 21 Jul 2014 02:01:23 -0700 Subject: [PATCH 48/84] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 87ebdb172ba..30ebb91f294 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 9add01bb250..88150e32935 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 3a903c30b2a..ea6fac5bb49 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 87ebdb172ba..30ebb91f294 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 6a9ba80157b..b55a63a9ae9 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 68a0c3ff0d5..6d4d4e6fa75 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 2c270f90507..753307af7a9 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 33885afb9d9..8a4c1c3bc61 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 7e41f32cbf2..db1be2ad853 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 73b211c62f6139ee670eb598750861557b2fa82a Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 21 Jul 2014 02:10:33 -0700 Subject: [PATCH 49/84] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/654f171deb50 Author: Wilson Page Desc: Merge pull request #21956 from wilsonpage/1040982 Bug 1040982 - [Camera][Hamachi] Doesn't show loading spinner on start-up ======== https://hg.mozilla.org/integration/gaia-central/rev/dd5d1aba7fb8 Author: Wilson Page Desc: Bug 1040982 - [Camera][Hamachi] Doesn't show loading spinner on start-up --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 9435861207a..416b715193a 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "5703878185d422cfd3227a3d49cd51f7f70ebbcc", + "revision": "654f171deb50f3c4e12ccafda6c4bec0bc01887e", "repo_path": "/integration/gaia-central" } From 524c789453ef8e23e55296e230b896645c80037c Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 21 Jul 2014 02:16:22 -0700 Subject: [PATCH 50/84] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 30ebb91f294..239e5c6382b 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 88150e32935..b96135a6ce0 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index ea6fac5bb49..29c08102a7b 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 30ebb91f294..239e5c6382b 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index b55a63a9ae9..1469b21e48b 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 6d4d4e6fa75..c3150915258 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 753307af7a9..117ea355380 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 8a4c1c3bc61..dbdedfc5390 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index db1be2ad853..7724065f087 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From ff301d52f8f0b0b79734a73bb1d0d98d61d24b7c Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 21 Jul 2014 02:40:33 -0700 Subject: [PATCH 51/84] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/bf1a57f891c0 Author: EragonJ Desc: Merge pull request #18471 from EragonJ/bug-973466 Bug 973466 - [settings] refactor wifi panel with AMD pattern ======== https://hg.mozilla.org/integration/gaia-central/rev/64a2ff79c756 Author: EragonJ Desc: Bug 973466 - [settings] refactor wifi panel with AMD pattern --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 416b715193a..42f25000388 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "654f171deb50f3c4e12ccafda6c4bec0bc01887e", + "revision": "bf1a57f891c0a04d05ec1121a581db92a6d1e691", "repo_path": "/integration/gaia-central" } From 9eeec734d5538b1469eb91e64e42e4c3217ec285 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 21 Jul 2014 02:46:25 -0700 Subject: [PATCH 52/84] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 239e5c6382b..3f0459f58ef 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index b96135a6ce0..19323549f4d 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 29c08102a7b..011a5fa050e 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 239e5c6382b..3f0459f58ef 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 1469b21e48b..521194483c4 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index c3150915258..d4e8bf9e414 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 117ea355380..b304a841e81 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index dbdedfc5390..545e0f76155 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 7724065f087..621d95d7753 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 83d2f2f0ac9b25ebdc30a5d5b6af3fc1915f3c5a Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 21 Jul 2014 02:55:33 -0700 Subject: [PATCH 53/84] Bumping gaia.json for 3 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/27d1e38b33eb Author: Yuren Ju Desc: Revert "Bug 1036821 - git commit hash isn't wrote to settings/resources/gaia_commit.txt on Windows" This reverts commit 6b6c77c2a1b93deab5466744bb857b37ec755567. ======== https://hg.mozilla.org/integration/gaia-central/rev/142a658bd3d3 Author: Yuren Ju Desc: Revert "Bug 1039739 - Add some logging when writing the git commit id into the settings app;r=yurenju" This reverts commit 8d0f21f728c837276b2ad3484213f623622c81bf. ======== https://hg.mozilla.org/integration/gaia-central/rev/f3e5599b7202 Author: Yuren Ju Desc: Revert "Bug 1039739 - Make it more clear what command we're executing;r=yuren" This reverts commit 74caef0139574c7fcf2c77255df9088f44a4dafe. --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 42f25000388..10052c533ff 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "bf1a57f891c0a04d05ec1121a581db92a6d1e691", + "revision": "27d1e38b33eb89a39627cb0848106aa6feb0992e", "repo_path": "/integration/gaia-central" } From bef50eef3d827ce6ac7cdc5fd85b772a3ed08ecb Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 21 Jul 2014 03:01:17 -0700 Subject: [PATCH 54/84] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 3f0459f58ef..1319914e0d5 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 19323549f4d..ebb2381057c 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 011a5fa050e..03ef31e2a71 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 3f0459f58ef..1319914e0d5 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 521194483c4..a741abfa1a2 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index d4e8bf9e414..deb9558ab57 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index b304a841e81..6458079f068 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 545e0f76155..204bede089f 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 621d95d7753..a4aef39f6fa 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From ec544bc3c7699b69436d4382b5d4784aa65319e8 Mon Sep 17 00:00:00 2001 From: Jessica Jong Date: Mon, 21 Jul 2014 18:21:42 +0800 Subject: [PATCH 55/84] Bug 1032858 - Part 1: interface changes to support cell info list. f=hannosch r=hsinyi --- dom/mobileconnection/interfaces/moz.build | 1 + .../interfaces/nsICellInfo.idl | 256 ++++++++++++++++++ dom/system/gonk/nsIRadioInterfaceLayer.idl | 11 +- 3 files changed, 266 insertions(+), 2 deletions(-) create mode 100644 dom/mobileconnection/interfaces/nsICellInfo.idl diff --git a/dom/mobileconnection/interfaces/moz.build b/dom/mobileconnection/interfaces/moz.build index 16d3ce5b834..dacc8fafe81 100644 --- a/dom/mobileconnection/interfaces/moz.build +++ b/dom/mobileconnection/interfaces/moz.build @@ -5,6 +5,7 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. XPIDL_SOURCES += [ + 'nsICellInfo.idl', 'nsIMobileCellInfo.idl', 'nsIMobileConnectionInfo.idl', 'nsIMobileConnectionProvider.idl', diff --git a/dom/mobileconnection/interfaces/nsICellInfo.idl b/dom/mobileconnection/interfaces/nsICellInfo.idl new file mode 100644 index 00000000000..c7d71d76d5e --- /dev/null +++ b/dom/mobileconnection/interfaces/nsICellInfo.idl @@ -0,0 +1,256 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" + +[scriptable, uuid(1aed4c36-979e-4d20-9fa0-55139da8301e)] +interface nsICellInfoListCallback : nsISupports +{ + /** + * result is an array of nsICellInfo. + */ + void notifyGetCellInfoList(in jsval result); + + /** + * Callback function with error message. + */ + void notifyGetCellInfoListFailed(in DOMString error); +}; + +[scriptable, uuid(86667898-c9ab-44ee-8a9a-026916b3183e)] +interface nsICellInfo : nsISupports +{ + const long CELL_INFO_TYPE_GSM = 1; + const long CELL_INFO_TYPE_CDMA = 2; + const long CELL_INFO_TYPE_LTE = 3; + const long CELL_INFO_TYPE_WCDMA = 4; + + const long TIMESTAMP_TYPE_UNKNOWN = 0; + const long TIMESTAMP_TYPE_ANTENNA = 1; + const long TIMESTAMP_TYPE_MODEM = 2; + const long TIMESTAMP_TYPE_OEM_RIL = 3; + const long TIMESTAMP_TYPE_JAVA_RIL = 4; + + /** + * Network type. One of the CELL_INFO_TYPE_* constants. + */ + readonly attribute long type; + + /* + * Registration state of this cell. + */ + readonly attribute boolean registered; + + /** + * Time stamp type. One of the TIMESTAMP_TYPE_* constants. + */ + readonly attribute long timestampType; + + /** + * Time in nanoseconds since boot. + */ + readonly attribute long long timestamp; +}; + +[scriptable, uuid(6345967c-61fc-45a1-8362-39e9261df052)] +interface nsIGsmCellInfo : nsICellInfo +{ + /** + * 3-digit Mobile Country Code, 0..999, INT_MAX if unknown. + */ + readonly attribute long mcc; + + /** + * 2 or 3-digit Mobile Network Code, 0..999, INT_MAX if unknown. + */ + readonly attribute long mnc; + + /** + * 16-bit Location Area Code, 0..65535, INT_MAX if unknown. + */ + readonly attribute long lac; + + /** + * 16-bit GSM Cell Identity described in TS 27.007, 0..65535, INT_MAX if unknown. + */ + readonly attribute long cid; + + /** + * Valid values are 0-31 as defined in TS 27.007 8.5, 99 if unknown. + */ + readonly attribute long signalStrength; + + /** + * Bit error rate 0-7 as defined in TS 27.007 8.5, 99 if unknown. + */ + readonly attribute long bitErrorRate; +}; + +[scriptable, uuid(19693f98-943d-45e7-a3e8-25373228ce6b)] +interface nsIWcdmaCellInfo : nsICellInfo +{ + /** + * 2 or 3-digit Mobile Network Code, 0..999, INT_MAX if unknown. + */ + readonly attribute long mcc; + + /** + * 2 or 3-digit Mobile Network Code, 0..999, INT_MAX if unknown. + */ + readonly attribute long mnc; + + /** + * 16-bit Location Area Code, 0..65535, INT_MAX if unknown. + */ + readonly attribute long lac; + + /** + * 28-bit UMTS Cell Identity described in TS 25.331, 0..268435455, + * INT_MAX if unknown. + */ + readonly attribute long cid; + + /** + * 9-bit UMTS Primary Scrambling Code described in TS 25.331, 0..511, + * INT_MAX if unknown. + */ + readonly attribute long psc; + + /** + * Valid values are 0-31 as defined in TS 27.007 8.5, 99 if unknown. + */ + readonly attribute long signalStrength; + + /** + * Bit error rate 0-7 as defined in TS 27.007 8.5, 99 if unknown. + */ + readonly attribute long bitErrorRate; +}; + +[scriptable, uuid(76b4a35d-7e45-42bc-a2e0-bc07a6434db3)] +interface nsICdmaCellInfo : nsICellInfo +{ + /** + * Network Id, 0..65535, INT_MAX if unknown. + */ + readonly attribute long networkId; + + /** + * CDMA System Id, 0..32767, INT_MAX if unknown. + */ + readonly attribute long systemId; + + /** + * Base Station Id, 0..65535, INT_MAX if unknown. + */ + readonly attribute long baseStationId; + + /** + * Longitude is a decimal number as specified in 3GPP2 C.S0005-A v6.0. + * It is represented in units of 0.25 seconds and ranges from -2592000 to + * 2592000, INT_MAX if unknown. + */ + readonly attribute long longitude; + + /** + * Latitude is a decimal number as specified in 3GPP2 C.S0005-A v6.0. + * It is represented in units of 0.25 seconds and ranges from -1296000 to + * 1296000, INT_MAX if unknown. + */ + readonly attribute long latitude; + + /** + * Valid values are positive integers, INT_MAX if unknown. This value is the + * actual RSSI value multiplied by -1. + */ + readonly attribute long cdmaDbm; + + /** + * Valid values are positive integers, INT_MAX if unknown. This value is the + * actual Ec/Io multiplied by -10. -1 if unknown. + */ + readonly attribute long cdmaEcio; + + /** + * Valid values are positive integers, INT_MAX if unknown. This value is the + * actual Evdo RSSI value multiplied by -1. + */ + readonly attribute long evdoDbm; + + /** + * Valid values are positive integers, INT_MAX if unknown. This value is the + * actual Evdo Ec/Io multiplied by -10. + */ + readonly attribute long evdoEcio; + + /** + * Valid values are 0-8, INT_MAX if unknown. 8 is the highest signal to noise + * ratio. + */ + readonly attribute long evdoSnr; +}; + +[scriptable, uuid(122937d9-1ee5-45e0-a360-5959d578bc31)] +interface nsILteCellInfo : nsICellInfo +{ + /** + * 3-digit Mobile Country Code, 0..999, INT_MAX if unknown. + */ + readonly attribute long mcc; + + /** + * 2 or 3-digit Mobile Network Code, 0..999, INT_MAX if unknown. + */ + readonly attribute long mnc; + + /** + * 28-bit Cell Identity, 0..268435455, INT_MAX if unknown. + */ + readonly attribute long cid; + + /** + * Physical cell id, 0..503, INT_MAX if unknown. + */ + readonly attribute long pcid; + + /** + * 16-bit tracking area code, 0..65535, INT_MAX if unknown. + */ + readonly attribute long tac; + + /** + * Valid values are 0-31 as defined in TS 27.007 8.5, 99 if unknown. + */ + readonly attribute long signalStrength; + + /** + * The current Reference Signal Receive Power in dBm multipled by -1. + * Range: 44 to 140 dBm, INT_MAX if unknown. + */ + readonly attribute long rsrp; + + /** + * The current Reference Signal Receive Quality in dB multiplied by -1. + * Range: 3 to 20 dB, INT_MAX if unknown. + */ + readonly attribute long rsrq; + + /** + * The current reference signal signal-to-noise ratio in 0.1 dB units. + * Range: -200 to +300 (-200 = -20.0 dB, +300 = 30dB), INT_MAX if unknown. + */ + readonly attribute long rssnr; + + /** + * The current Channel Quality Indicator. Range: 0 to 15, INT_MAX if unknown. + */ + readonly attribute long cqi; + + /** + * Timing advance in micro seconds for a one way trip from cell to device. + * Approximate distance can be calculated using 300m/us * timingAdvance. + * Range: 0 to 0x7FFFFFFE, INT_MAX if unknown. + */ + readonly attribute long timingAdvance; +}; \ No newline at end of file diff --git a/dom/system/gonk/nsIRadioInterfaceLayer.idl b/dom/system/gonk/nsIRadioInterfaceLayer.idl index cb1be0e4586..2e72a10344d 100644 --- a/dom/system/gonk/nsIRadioInterfaceLayer.idl +++ b/dom/system/gonk/nsIRadioInterfaceLayer.idl @@ -9,6 +9,7 @@ interface nsIDOMMozIccInfo; interface nsIMobileConnectionInfo; interface nsIMobileMessageCallback; interface nsINeighboringCellIdsCallback; +interface nsICellInfoListCallback; [scriptable, uuid(6e0f45b8-410e-11e3-8c8e-b715b2cd0128)] interface nsIRilNetworkInterface : nsINetworkInterface @@ -56,7 +57,7 @@ interface nsIRilSendWorkerMessageCallback : nsISupports boolean handleResponse(in jsval response); }; -[scriptable, uuid(31ba65b6-05c7-4bc8-abdc-f1a219811fb4)] +[scriptable, uuid(c13a8890-797b-4557-b92f-6b959f56c1d8)] interface nsIRadioInterface : nsISupports { readonly attribute nsIRilContext rilContext; @@ -88,9 +89,15 @@ interface nsIRadioInterface : nsISupports void getSmscAddress(in nsIMobileMessageCallback request); /** - * Cell Info functionality. + * Request neighboring cell ids in GSM/UMTS network. */ void getNeighboringCellIds(in nsINeighboringCellIdsCallback callback); + + /** + * Request all of the current cell information known to the radio, including + * neighboring cells. + */ + void getCellInfoList(in nsICellInfoListCallback callback); }; [scriptable, uuid(78b65e8c-68e7-4510-9a05-65bba12b283e)] From daabb0746938fd6bc50d0392e30df3e72e5308be Mon Sep 17 00:00:00 2001 From: Jessica Jong Date: Mon, 21 Jul 2014 18:21:44 +0800 Subject: [PATCH 56/84] Bug 1032858 - Part 2: implementation of cell info list. r=hsinyi --- dom/system/gonk/RadioInterfaceLayer.js | 154 ++++++++++++++++++++++++- dom/system/gonk/ril_consts.js | 6 + dom/system/gonk/ril_worker.js | 67 +++++++++++ dom/system/gonk/worker_buf.js | 13 +++ 4 files changed, 239 insertions(+), 1 deletion(-) diff --git a/dom/system/gonk/RadioInterfaceLayer.js b/dom/system/gonk/RadioInterfaceLayer.js index a9855cd5304..eaccf7ecc7c 100644 --- a/dom/system/gonk/RadioInterfaceLayer.js +++ b/dom/system/gonk/RadioInterfaceLayer.js @@ -59,6 +59,14 @@ const CDMAICCINFO_CID = Components.ID("{39ba3c08-aacc-46d0-8c04-9b619c387061}"); const NEIGHBORINGCELLINFO_CID = Components.ID("{f9dfe26a-851e-4a8b-a769-cbb1baae7ded}"); +const GSMCELLINFO_CID = + Components.ID("{41f6201e-7263-42e3-b31f-38a9dc8a280a}"); +const WCDMACELLINFO_CID = + Components.ID("{eeaaf307-df6e-4c98-b121-e3302b1fc468}"); +const CDMACELLINFO_CID = + Components.ID("{b497d6e4-4cb8-4d6e-b673-840c7d5ddf25}"); +const LTECELLINFO_CID = + Components.ID("{c7e0a78a-4e99-42f5-9251-e6172c5ed8d8}"); const NS_XPCOM_SHUTDOWN_OBSERVER_ID = "xpcom-shutdown"; const kNetworkInterfaceStateChangedTopic = "network-interface-state-changed"; @@ -97,6 +105,9 @@ const RADIO_POWER_OFF_TIMEOUT = 30000; const SMS_HANDLED_WAKELOCK_TIMEOUT = 5000; const HW_DEFAULT_CLIENT_ID = 0; +const INT32_MAX = 2147483647; +const UNKNOWN_RSSI = 99; + const RIL_IPC_MOBILECONNECTION_MSG_NAMES = [ "RIL:GetRilContext", "RIL:GetAvailableNetworks", @@ -1076,7 +1087,109 @@ NeighboringCellInfo.prototype = { gsmLocationAreaCode: -1, gsmCellId: -1, wcdmaPsc: -1, - signalStrength: 99 + signalStrength: UNKNOWN_RSSI +}; + +function CellInfo() {} +CellInfo.prototype = { + type: null, + registered: false, + timestampType: Ci.nsICellInfo.TIMESTAMP_TYPE_UNKNOWN, + timestamp: 0 +}; + +function GsmCellInfo() {} +GsmCellInfo.prototype = { + __proto__: CellInfo.prototype, + QueryInterface: XPCOMUtils.generateQI([Ci.nsIGsmCellInfo]), + classID: GSMCELLINFO_CID, + classInfo: XPCOMUtils.generateCI({ + classID: GSMCELLINFO_CID, + classDescription: "GsmCellInfo", + interfaces: [Ci.nsIGsmCellInfo] + }), + + // nsIGsmCellInfo + + mcc: INT32_MAX, + mnc: INT32_MAX, + lac: INT32_MAX, + cid: INT32_MAX, + signalStrength: UNKNOWN_RSSI, + bitErrorRate: UNKNOWN_RSSI +}; + +function WcdmaCellInfo() {} +WcdmaCellInfo.prototype = { + __proto__: CellInfo.prototype, + QueryInterface: XPCOMUtils.generateQI([Ci.nsIWcdmaCellInfo]), + classID: WCDMACELLINFO_CID, + classInfo: XPCOMUtils.generateCI({ + classID: WCDMACELLINFO_CID, + classDescription: "WcdmaCellInfo", + interfaces: [Ci.nsIWcdmaCellInfo] + }), + + // nsIWcdmaCellInfo + + mcc: INT32_MAX, + mnc: INT32_MAX, + lac: INT32_MAX, + cid: INT32_MAX, + psc: INT32_MAX, + signalStrength: UNKNOWN_RSSI, + bitErrorRate: UNKNOWN_RSSI +}; + +function LteCellInfo() {} +LteCellInfo.prototype = { + __proto__: CellInfo.prototype, + QueryInterface: XPCOMUtils.generateQI([Ci.nsILteCellInfo]), + classID: LTECELLINFO_CID, + classInfo: XPCOMUtils.generateCI({ + classID: LTECELLINFO_CID, + classDescription: "LteCellInfo", + interfaces: [Ci.nsILteCellInfo] + }), + + // nsILteCellInfo + + mcc: INT32_MAX, + mnc: INT32_MAX, + cid: INT32_MAX, + pcid: INT32_MAX, + tac: INT32_MAX, + signalStrength: UNKNOWN_RSSI, + rsrp: INT32_MAX, + rsrq: INT32_MAX, + rssnr: INT32_MAX, + cqi: INT32_MAX, + timingAdvance: INT32_MAX +}; + +function CdmaCellInfo() {} +CdmaCellInfo.prototype = { + __proto__: CellInfo.prototype, + QueryInterface: XPCOMUtils.generateQI([Ci.nsICdmaCellInfo]), + classID: CDMACELLINFO_CID, + classInfo: XPCOMUtils.generateCI({ + classID: CDMACELLINFO_CID, + classDescription: "CdmaCellInfo", + interfaces: [Ci.nsICdmaCellInfo] + }), + + // nsICdmaCellInfo + + networkId: INT32_MAX, + systemId: INT32_MAX, + baseStationId: INT32_MAX, + longitude: INT32_MAX, + latitude: INT32_MAX, + cdmaDbm: INT32_MAX, + cdmaEcio: INT32_MAX, + evdoDbm: INT32_MAX, + evdoEcio: INT32_MAX, + evdoSnr: INT32_MAX }; function DataConnectionHandler(clientId, radioInterface) { @@ -4420,6 +4533,45 @@ RadioInterface.prototype = { } }, + getCellInfoList: function(callback) { + this.workerMessenger.send("getCellInfoList", + null, + function(response) { + if (response.errorMsg) { + callback.notifyGetCellInfoListFailed(response.errorMsg); + return; + } + + let cellInfoList = []; + let count = response.result.length; + for (let i = 0; i < count; i++) { + let srcCellInfo = response.result[i]; + let cellInfo; + switch (srcCellInfo.type) { + case RIL.CELL_INFO_TYPE_GSM: + cellInfo = new GsmCellInfo(); + break; + case RIL.CELL_INFO_TYPE_WCDMA: + cellInfo = new WcdmaCellInfo(); + break; + case RIL.CELL_INFO_TYPE_LTE: + cellInfo = new LteCellInfo(); + break; + case RIL.CELL_INFO_TYPE_CDMA: + cellInfo = new CdmaCellInfo(); + break; + } + + if (!cellInfo) { + continue; + } + this.updateInfo(srcCellInfo, cellInfo); + cellInfoList.push(cellInfo); + } + callback.notifyGetCellInfoList(cellInfoList); + }.bind(this)); + }, + getNeighboringCellIds: function(callback) { this.workerMessenger.send("getNeighboringCellIds", null, diff --git a/dom/system/gonk/ril_consts.js b/dom/system/gonk/ril_consts.js index 4210cd94c12..28df8013930 100644 --- a/dom/system/gonk/ril_consts.js +++ b/dom/system/gonk/ril_consts.js @@ -129,6 +129,7 @@ this.REQUEST_ISIM_AUTHENTICATION = 105; this.REQUEST_ACKNOWLEDGE_INCOMING_GSM_SMS_WITH_PDU = 106; this.REQUEST_STK_SEND_ENVELOPE_WITH_STATUS = 107; this.REQUEST_VOICE_RADIO_TECH = 108; +this.REQUEST_GET_CELL_INFO_LIST = 109; // Flame specific parcel types. this.REQUEST_SET_UICC_SUBSCRIPTION = 114; @@ -465,6 +466,11 @@ this.NETWORK_CREG_TECH_LTE = 14; this.NETWORK_CREG_TECH_HSPAP = 15; this.NETWORK_CREG_TECH_GSM = 16; +this.CELL_INFO_TYPE_GSM = 1; +this.CELL_INFO_TYPE_CDMA = 2; +this.CELL_INFO_TYPE_LTE = 3; +this.CELL_INFO_TYPE_WCDMA = 4; + this.CALL_STATE_UNKNOWN = -1; this.CALL_STATE_ACTIVE = 0; this.CALL_STATE_HOLDING = 1; diff --git a/dom/system/gonk/ril_worker.js b/dom/system/gonk/ril_worker.js index 53e236a025d..dd4eecc1a40 100644 --- a/dom/system/gonk/ril_worker.js +++ b/dom/system/gonk/ril_worker.js @@ -1312,6 +1312,13 @@ RilObject.prototype = { this.context.Buf.simpleRequest(REQUEST_GET_NEIGHBORING_CELL_IDS, options); }, + /** + * Request all of the current cell information known to the radio. + */ + getCellInfoList: function(options) { + this.context.Buf.simpleRequest(REQUEST_GET_CELL_INFO_LIST, options); + }, + /** * Request various states about the network. */ @@ -6447,6 +6454,66 @@ RilObject.prototype[REQUEST_GET_NEIGHBORING_CELL_IDS] = function REQUEST_GET_NEI options.result = neighboringCellIds; this.sendChromeMessage(options); }; +RilObject.prototype[REQUEST_GET_CELL_INFO_LIST] = function REQUEST_GET_CELL_INFO_LIST(length, options) { + if (options.rilRequestError) { + options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError]; + this.sendChromeMessage(options); + return; + } + + let Buf = this.context.Buf; + let cellInfoList = []; + let num = Buf.readInt32(); + for (let i = 0; i < num; i++) { + let cellInfo = {}; + cellInfo.type = Buf.readInt32(); + cellInfo.registered = Buf.readInt32() ? true : false; + cellInfo.timestampType = Buf.readInt32(); + cellInfo.timestamp = Buf.readInt64(); + + switch(cellInfo.type) { + case CELL_INFO_TYPE_GSM: + case CELL_INFO_TYPE_WCDMA: + cellInfo.mcc = Buf.readInt32(); + cellInfo.mnc = Buf.readInt32(); + cellInfo.lac = Buf.readInt32(); + cellInfo.cid = Buf.readInt32(); + if (cellInfo.type == CELL_INFO_TYPE_WCDMA) { + cellInfo.psc = Buf.readInt32(); + } + cellInfo.signalStrength = Buf.readInt32(); + cellInfo.bitErrorRate = Buf.readInt32(); + break; + case CELL_INFO_TYPE_CDMA: + cellInfo.networkId = Buf.readInt32(); + cellInfo.systemId = Buf.readInt32(); + cellInfo.basestationId = Buf.readInt32(); + cellInfo.longitude = Buf.readInt32(); + cellInfo.latitude = Buf.readInt32(); + cellInfo.cdmaDbm = Buf.readInt32(); + cellInfo.cdmaEcio = Buf.readInt32(); + cellInfo.evdoDbm = Buf.readInt32(); + cellInfo.evdoEcio = Buf.readInt32(); + cellInfo.evdoSnr = Buf.readInt32(); + break; + case CELL_INFO_TYPE_LTE: + cellInfo.mcc = Buf.readInt32(); + cellInfo.mnc = Buf.readInt32(); + cellInfo.cid = Buf.readInt32(); + cellInfo.pcid = Buf.readInt32(); + cellInfo.tac = Buf.readInt32(); + cellInfo.signalStrength = Buf.readInt32(); + cellInfo.rsrp = Buf.readInt32(); + cellInfo.rsrq = Buf.readInt32(); + cellInfo.rssnr = Buf.readInt32(); + cellInfo.cqi = Buf.readInt32(); + break; + } + cellInfoList.push(cellInfo); + } + options.result = cellInfoList; + this.sendChromeMessage(options); +}; RilObject.prototype[REQUEST_SET_LOCATION_UPDATES] = null; RilObject.prototype[REQUEST_CDMA_SET_SUBSCRIPTION_SOURCE] = null; RilObject.prototype[REQUEST_CDMA_SET_ROAMING_PREFERENCE] = function REQUEST_CDMA_SET_ROAMING_PREFERENCE(length, options) { diff --git a/dom/system/gonk/worker_buf.js b/dom/system/gonk/worker_buf.js index 4da719bce65..bf193fc6566 100644 --- a/dom/system/gonk/worker_buf.js +++ b/dom/system/gonk/worker_buf.js @@ -267,6 +267,19 @@ let Buf = { this.readUint8() << 16 | this.readUint8() << 24; }, + readInt64: function() { + // Avoid using bitwise operators as the operands of all bitwise operators + // are converted to signed 32-bit integers. + return this.readUint8() + + this.readUint8() * Math.pow(2, 8) + + this.readUint8() * Math.pow(2, 16) + + this.readUint8() * Math.pow(2, 24) + + this.readUint8() * Math.pow(2, 32) + + this.readUint8() * Math.pow(2, 40) + + this.readUint8() * Math.pow(2, 48) + + this.readUint8() * Math.pow(2, 56); + }, + readInt32List: function() { let length = this.readInt32(); let ints = []; From 58f6c1906d4ef3c8c3302f1bcd57f86d38f300f2 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 21 Jul 2014 03:40:33 -0700 Subject: [PATCH 57/84] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/dd035f212994 Author: Sherman Chen Desc: Merge pull request #21983 from shamenchens/Bug942718-FTUAboutFirefoxOS Bug 942718 - FTU About Firefox page should not be moved, r=fcampo ======== https://hg.mozilla.org/integration/gaia-central/rev/0d055daec87f Author: Sherman Chen Desc: Bug 942718 - FTU About Firefox page should not be moved --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 10052c533ff..e0dcb81ec65 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "27d1e38b33eb89a39627cb0848106aa6feb0992e", + "revision": "dd035f2129944c8df269952ceb08f9585623d605", "repo_path": "/integration/gaia-central" } From 3ef435f451d3686ee2bc95bb56b592003978e54c Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 21 Jul 2014 03:41:55 -0700 Subject: [PATCH 58/84] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 1319914e0d5..9104b105701 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index ebb2381057c..a9ff57ab3f1 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 03ef31e2a71..af9e1877c07 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 1319914e0d5..9104b105701 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index a741abfa1a2..771fdab5b72 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index deb9558ab57..e66ba4200f5 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 6458079f068..8c32a3ad9c9 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 204bede089f..e9e537802cc 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index a4aef39f6fa..0481f0664ac 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From c3c2e2ac90a3c147c012df1296a8356f40985787 Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Mon, 21 Jul 2014 12:41:29 +0200 Subject: [PATCH 59/84] Bug 1041440: Create Promise using |Promise::Create|, r=btian This patch fixes a call to the private constructor of |Promise|. --- dom/bluetooth2/BluetoothAdapter.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dom/bluetooth2/BluetoothAdapter.cpp b/dom/bluetooth2/BluetoothAdapter.cpp index 42e7bf99d67..c5a1c88b250 100644 --- a/dom/bluetooth2/BluetoothAdapter.cpp +++ b/dom/bluetooth2/BluetoothAdapter.cpp @@ -457,7 +457,10 @@ BluetoothAdapter::StopDiscovery(ErrorResult& aRv) aRv.Throw(NS_ERROR_FAILURE); return nullptr; } - nsRefPtr promise = new Promise(global); + nsRefPtr promise = Promise::Create(global, aRv); + if (aRv.Failed()) { + return nullptr; + } /** * Ensure From 54a4c18bb538c6df905a2acac5ef6d0d0e2b4296 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 21 Jul 2014 04:05:31 -0700 Subject: [PATCH 60/84] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/090c8de8ca1c Author: steveck-chung Desc: Merge pull request #21849 from steveck-chung/bug-1015390 Bug 1015390 - [SMS] Implement new startup loading events r=julienw ======== https://hg.mozilla.org/integration/gaia-central/rev/01d72446b272 Author: Steve Chung Desc: Bug 1015390 - [SMS] Implement new startup loading events --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index e0dcb81ec65..60bb4880b4e 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "dd035f2129944c8df269952ceb08f9585623d605", + "revision": "090c8de8ca1cfa90d3640cbab36f4a2e5a1996cb", "repo_path": "/integration/gaia-central" } From 5bf867c145f9c935872030371eeaadf9fd8b9818 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 21 Jul 2014 04:07:19 -0700 Subject: [PATCH 61/84] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 9104b105701..7e52cac7655 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index a9ff57ab3f1..b9ed1a2f143 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index af9e1877c07..a6f98aee431 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 9104b105701..7e52cac7655 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 771fdab5b72..a103932a135 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index e66ba4200f5..cff0c7e526d 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 8c32a3ad9c9..f3d8c005fdc 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index e9e537802cc..fde98c861cf 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 0481f0664ac..db6e747bcbc 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 143a6dd7584c93eb7b9cd7da6719c5dd361b3a20 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 21 Jul 2014 04:47:00 -0700 Subject: [PATCH 62/84] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 7e52cac7655..862c6990535 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -25,7 +25,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index b9ed1a2f143..924343c3a78 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -20,7 +20,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index a6f98aee431..ff993ee4d70 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -23,7 +23,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 7e52cac7655..862c6990535 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -25,7 +25,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index a103932a135..0aa0b6de90a 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -20,7 +20,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index cff0c7e526d..2a7f256f59c 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -22,7 +22,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index fde98c861cf..bdf69d6601d 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -20,7 +20,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index db6e747bcbc..da9b9b735bd 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -22,7 +22,7 @@ - + From e8559099522be1184259b476a2718376de5ce7f5 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 21 Jul 2014 05:35:34 -0700 Subject: [PATCH 63/84] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/6f9056216772 Author: Jose M. Cantera Desc: Merge pull request #21977 from jmcanterafonseca/fix_loop_contacts2 Bug 1017756 - Update Loop buttons & state (color, name, visibility...) i... ======== https://hg.mozilla.org/integration/gaia-central/rev/e6f901e5ea92 Author: Jose M. Cantera Desc: Bug 1017756 - Update Loop buttons & state (color, name, visibility...) in contact details when a branding/UX decision is taken --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 60bb4880b4e..eca87fba82a 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "090c8de8ca1cfa90d3640cbab36f4a2e5a1996cb", + "revision": "6f9056216772f43c0c21a763f4db1f9123fba17d", "repo_path": "/integration/gaia-central" } From ff4b496b2eb0f5955421bcc591889b241eabd756 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 21 Jul 2014 05:41:19 -0700 Subject: [PATCH 64/84] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 862c6990535..fd697fae4d3 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 924343c3a78..8b0b3f2d510 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index ff993ee4d70..ae3dd9ea722 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 862c6990535..fd697fae4d3 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 0aa0b6de90a..919072d50bf 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 2a7f256f59c..84769289657 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index f3d8c005fdc..aa83fb2b091 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index bdf69d6601d..0d86dca6707 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index da9b9b735bd..ded95cfd101 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 2f2ce1befcca82fc531e15a83fb73e91fff1eaae Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 21 Jul 2014 05:50:32 -0700 Subject: [PATCH 65/84] Bumping gaia.json for 6 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/fbfc6e04d748 Author: Kevin Grandon Desc: Merge pull request #21952 from KevinGrandon/bug_1021276_sms_icon Bug 1021276 - [Messages] Update message app icons ======== https://hg.mozilla.org/integration/gaia-central/rev/b21b189c26c7 Author: Kevin Grandon Desc: Bug 1021276 - [Messages] Update message app icons r=julienw ======== https://hg.mozilla.org/integration/gaia-central/rev/d170f66c7129 Author: Kevin Grandon Desc: Merge pull request #21951 from KevinGrandon/bug_1021276_dialer_icon Bug 1021276 - [Dialer] Update dialer app icons ======== https://hg.mozilla.org/integration/gaia-central/rev/0aa93cebf7e0 Author: Kevin Grandon Desc: Bug 1021276 - [Dialer] Update dialer app icons r=rik ======== https://hg.mozilla.org/integration/gaia-central/rev/414c564a62ae Author: Kevin Grandon Desc: Merge pull request #21950 from KevinGrandon/bug_1021276_contacts_icon Bug 1021276 - [Contacts] Update contacts app icons ======== https://hg.mozilla.org/integration/gaia-central/rev/d6adc59c0d43 Author: Kevin Grandon Desc: Bug 1021276 - [Contacts] Update contacts app icons r=arcturus --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index eca87fba82a..4c6f53f9cbc 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "6f9056216772f43c0c21a763f4db1f9123fba17d", + "revision": "fbfc6e04d7487c49ddf90c867394b2c406f3eca6", "repo_path": "/integration/gaia-central" } From 071bcd5183500c08f4eb595b557484bc72c26e7a Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 21 Jul 2014 05:56:18 -0700 Subject: [PATCH 66/84] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index fd697fae4d3..b939024b527 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 8b0b3f2d510..815562329c4 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index ae3dd9ea722..ff33ce9f6d6 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index fd697fae4d3..b939024b527 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 919072d50bf..421b278c4ac 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 84769289657..e49d8b26c2b 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index aa83fb2b091..59d1f04a903 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 0d86dca6707..dc1605ffebd 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index ded95cfd101..d0b03aed986 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From d671713557889a4209605f55fe4a96a85fb4388a Mon Sep 17 00:00:00 2001 From: "Carsten \"Tomcat\" Book" Date: Mon, 21 Jul 2014 14:57:09 +0200 Subject: [PATCH 67/84] Backed out changeset a232fd36c827 (bug 1020416) for nightly startup crashed - bug 1041492 a=sheriffduty --- netwerk/cache2/CacheEntry.cpp | 32 -------- netwerk/cache2/CacheIndex.cpp | 78 +++---------------- netwerk/cache2/CacheIndex.h | 8 +- netwerk/cache2/CacheStorageService.cpp | 53 +------------ netwerk/cache2/CacheStorageService.h | 23 ------ netwerk/cache2/OldWrappers.cpp | 12 --- netwerk/cache2/OldWrappers.h | 2 - netwerk/cache2/nsICacheEntry.idl | 24 +----- .../unit/test_cache2-27-force-valid-for.js | 37 --------- netwerk/test/unit/xpcshell.ini | 5 +- 10 files changed, 17 insertions(+), 257 deletions(-) delete mode 100644 netwerk/test/unit/test_cache2-27-force-valid-for.js diff --git a/netwerk/cache2/CacheEntry.cpp b/netwerk/cache2/CacheEntry.cpp index f63a0298316..8dea4ce8b8e 100644 --- a/netwerk/cache2/CacheEntry.cpp +++ b/netwerk/cache2/CacheEntry.cpp @@ -960,38 +960,6 @@ NS_IMETHODIMP CacheEntry::GetExpirationTime(uint32_t *aExpirationTime) return mFile->GetExpirationTime(aExpirationTime); } -NS_IMETHODIMP CacheEntry::GetIsForcedValid(bool *aIsForcedValid) -{ - NS_ENSURE_ARG(aIsForcedValid); - - nsAutoCString key; - - nsresult rv = HashingKeyWithStorage(key); - if (NS_FAILED(rv)) { - return rv; - } - - *aIsForcedValid = CacheStorageService::Self()->IsForcedValidEntry(key); - LOG(("CacheEntry::GetIsForcedValid [this=%p, IsForcedValid=%d]", this, *aIsForcedValid)); - - return NS_OK; -} - -NS_IMETHODIMP CacheEntry::ForceValidFor(uint32_t aSecondsToTheFuture) -{ - LOG(("CacheEntry::ForceValidFor [this=%p, aSecondsToTheFuture=%d]", this, aSecondsToTheFuture)); - - nsAutoCString key; - nsresult rv = HashingKeyWithStorage(key); - if (NS_FAILED(rv)) { - return rv; - } - - CacheStorageService::Self()->ForceEntryValidFor(key, aSecondsToTheFuture); - - return NS_OK; -} - NS_IMETHODIMP CacheEntry::SetExpirationTime(uint32_t aExpirationTime) { NS_ENSURE_SUCCESS(mFileStatus, NS_ERROR_NOT_AVAILABLE); diff --git a/netwerk/cache2/CacheIndex.cpp b/netwerk/cache2/CacheIndex.cpp index 34976908efd..dd0021ac97b 100644 --- a/netwerk/cache2/CacheIndex.cpp +++ b/netwerk/cache2/CacheIndex.cpp @@ -1148,8 +1148,6 @@ CacheIndex::GetEntryForEviction(SHA1Sum::Hash *aHash, uint32_t *aCnt) if (!index) return NS_ERROR_NOT_INITIALIZED; - MOZ_ASSERT(CacheFileIOManager::IsOnIOThread()); - CacheIndexAutoLock lock(index); if (!index->IsIndexUsable()) { @@ -1162,83 +1160,29 @@ CacheIndex::GetEntryForEviction(SHA1Sum::Hash *aHash, uint32_t *aCnt) if (index->mExpirationArray.Length() == 0) return NS_ERROR_NOT_AVAILABLE; - SHA1Sum::Hash hash; - bool foundEntry = false; - uint32_t i = 0, j = 0; uint32_t now = PR_Now() / PR_USEC_PER_SEC; - - // find the first expired, non-forced valid entry - for (i = 0; i < index->mExpirationArray.Length(); i++) { - if (index->mExpirationArray[i]->mExpirationTime < now) { - memcpy(&hash, &index->mExpirationArray[i]->mHash, sizeof(SHA1Sum::Hash)); - - if (!IsForcedValidEntry(&hash)) { - foundEntry = true; - break; - } - - } else { - // all further entries have not expired yet - break; - } - } - - if (foundEntry) { - *aCnt = index->mExpirationArray.Length() - i; - + if (index->mExpirationArray[0]->mExpirationTime < now) { + memcpy(aHash, &index->mExpirationArray[0]->mHash, sizeof(SHA1Sum::Hash)); + *aCnt = index->mExpirationArray.Length(); LOG(("CacheIndex::GetEntryForEviction() - returning entry from expiration " "array [hash=%08x%08x%08x%08x%08x, cnt=%u, expTime=%u, now=%u, " - "frecency=%u]", LOGSHA1(&hash), *aCnt, - index->mExpirationArray[i]->mExpirationTime, now, - index->mExpirationArray[i]->mFrecency)); + "frecency=%u]", LOGSHA1(aHash), *aCnt, + index->mExpirationArray[0]->mExpirationTime, now, + index->mExpirationArray[0]->mFrecency)); } else { - // check if we've already tried all the entries - if (i == index->mExpirationArray.Length()) - return NS_ERROR_NOT_AVAILABLE; - - // find first non-forced valid entry with the lowest frecency - for (j = 0; j < index->mFrecencyArray.Length(); j++) { - memcpy(&hash, &index->mFrecencyArray[j]->mHash, sizeof(SHA1Sum::Hash)); - - if (!IsForcedValidEntry(&hash)) { - foundEntry = true; - break; - } - } - - if (!foundEntry) - return NS_ERROR_NOT_AVAILABLE; - - // forced valid entries skipped in both arrays could overlap, just use max - *aCnt = index->mFrecencyArray.Length() - std::max(i, j); - + memcpy(aHash, &index->mFrecencyArray[0]->mHash, sizeof(SHA1Sum::Hash)); + *aCnt = index->mFrecencyArray.Length(); LOG(("CacheIndex::GetEntryForEviction() - returning entry from frecency " "array [hash=%08x%08x%08x%08x%08x, cnt=%u, expTime=%u, now=%u, " - "frecency=%u]", LOGSHA1(&hash), *aCnt, - index->mFrecencyArray[j]->mExpirationTime, now, - index->mFrecencyArray[j]->mFrecency)); + "frecency=%u]", LOGSHA1(aHash), *aCnt, + index->mExpirationArray[0]->mExpirationTime, now, + index->mExpirationArray[0]->mFrecency)); } - memcpy(aHash, &hash, sizeof(SHA1Sum::Hash)); - return NS_OK; } - -// static -bool CacheIndex::IsForcedValidEntry(const SHA1Sum::Hash *aHash) -{ - nsRefPtr handle; - - CacheFileIOManager::gInstance->mHandles.GetHandle( - aHash, false, getter_AddRefs(handle)); - - nsCString hashKey = handle->Key(); - return CacheStorageService::Self()->IsForcedValidEntry(hashKey); -} - - // static nsresult CacheIndex::GetCacheSize(uint32_t *_retval) diff --git a/netwerk/cache2/CacheIndex.h b/netwerk/cache2/CacheIndex.h index 928cac3830b..cec623555e6 100644 --- a/netwerk/cache2/CacheIndex.h +++ b/netwerk/cache2/CacheIndex.h @@ -561,15 +561,9 @@ public: // Returns a hash of the least important entry that should be evicted if the // cache size is over limit and also returns a total number of all entries in - // the index minus the number of forced valid entries that we encounter - // when searching (see below) + // the index. static nsresult GetEntryForEviction(SHA1Sum::Hash *aHash, uint32_t *aCnt); - // Checks if a cache entry is currently forced valid. Used to prevent an entry - // (that has been forced valid) from being evicted when the cache size reaches - // its limit. - static bool IsForcedValidEntry(const SHA1Sum::Hash *aHash); - // Returns cache size in kB. static nsresult GetCacheSize(uint32_t *_retval); diff --git a/netwerk/cache2/CacheStorageService.cpp b/netwerk/cache2/CacheStorageService.cpp index 0ed4dd70654..3b7d89033f3 100644 --- a/netwerk/cache2/CacheStorageService.cpp +++ b/netwerk/cache2/CacheStorageService.cpp @@ -957,16 +957,9 @@ CacheStorageService::RemoveEntry(CacheEntry* aEntry, bool aOnlyUnreferenced) return false; } - if (aOnlyUnreferenced) { - if (aEntry->IsReferenced()) { - LOG((" still referenced, not removing")); - return false; - } - - if (!aEntry->IsUsingDisk() && IsForcedValidEntry(entryKey)) { - LOG((" forced valid, not removing")); - return false; - } + if (aOnlyUnreferenced && aEntry->IsReferenced()) { + LOG((" still referenced, not removing")); + return false; } CacheEntryTable* entries; @@ -1034,46 +1027,6 @@ CacheStorageService::RecordMemoryOnlyEntry(CacheEntry* aEntry, } } -// Checks if a cache entry is forced valid (will be loaded directly from cache -// without further validation) - see nsICacheEntry.idl for further details -bool CacheStorageService::IsForcedValidEntry(nsACString &aCacheEntryKey) -{ - TimeStamp validUntil; - - mozilla::MutexAutoLock lock(mLock); - - if (!mForcedValidEntries.Get(aCacheEntryKey, &validUntil)) { - return false; - } - - if (validUntil.IsNull()) { - return false; - } - - // Entry timeout not reached yet - if (TimeStamp::NowLoRes() <= validUntil) { - return true; - } - - // Entry timeout has been reached - mForcedValidEntries.Remove(aCacheEntryKey); - return false; -} - -// Allows a cache entry to be loaded directly from cache without further -// validation - see nsICacheEntry.idl for further details -void CacheStorageService::ForceEntryValidFor(nsACString &aCacheEntryKey, - uint32_t aSecondsToTheFuture) -{ - mozilla::MutexAutoLock lock(mLock); - - // This will be the timeout - TimeStamp validUntil = TimeStamp::NowLoRes() + - TimeDuration::FromSeconds(aSecondsToTheFuture); - - mForcedValidEntries.Put(aCacheEntryKey, validUntil); -} - void CacheStorageService::OnMemoryConsumptionChange(CacheMemoryConsumer* aConsumer, uint32_t aCurrentMemoryConsumption) diff --git a/netwerk/cache2/CacheStorageService.h b/netwerk/cache2/CacheStorageService.h index 6c494b2c039..0e833b163b2 100644 --- a/netwerk/cache2/CacheStorageService.h +++ b/netwerk/cache2/CacheStorageService.h @@ -146,26 +146,6 @@ private: bool aOnlyInMemory, bool aOverwrite); - /** - * Sets a cache entry valid (overrides the default loading behavior by loading - * directly from cache) for the given number of seconds - * See nsICacheEntry.idl for more details - */ - void ForceEntryValidFor(nsACString &aCacheEntryKey, - uint32_t aSecondsToTheFuture); - -private: - friend class CacheIndex; - - /** - * Retrieves the status of the cache entry to see if it has been forced valid - * (so it will loaded directly from cache without further validation) - * CacheIndex uses this to prevent a cache entry from being prememptively - * thrown away when forced valid - * See nsICacheEntry.idl for more details - */ - bool IsForcedValidEntry(nsACString &aCacheEntryKey); - private: // These are helpers for telemetry monitorying of the memory pools. void TelemetryPrune(TimeStamp &now); @@ -284,9 +264,6 @@ private: mozilla::Mutex mLock; - // Tracks entries that may be forced valid. - nsDataHashtable mForcedValidEntries; - bool mShutdown; // Accessible only on the service thread diff --git a/netwerk/cache2/OldWrappers.cpp b/netwerk/cache2/OldWrappers.cpp index 5b485072e27..5e4979ff3ab 100644 --- a/netwerk/cache2/OldWrappers.cpp +++ b/netwerk/cache2/OldWrappers.cpp @@ -366,18 +366,6 @@ _OldCacheEntryWrapper::~_OldCacheEntryWrapper() LOG(("Destroying _OldCacheEntryWrapper %p for descriptor %p", this, mOldInfo.get())); } -NS_IMETHODIMP _OldCacheEntryWrapper::GetIsForcedValid(bool *aIsForcedValid) -{ - // Unused stub - return NS_ERROR_NOT_IMPLEMENTED; -} - -NS_IMETHODIMP _OldCacheEntryWrapper::ForceValidFor(uint32_t aSecondsToTheFuture) -{ - // Unused stub - return NS_ERROR_NOT_IMPLEMENTED; -} - NS_IMPL_ISUPPORTS(_OldCacheEntryWrapper, nsICacheEntry) NS_IMETHODIMP _OldCacheEntryWrapper::AsyncDoom(nsICacheEntryDoomCallback* listener) diff --git a/netwerk/cache2/OldWrappers.h b/netwerk/cache2/OldWrappers.h index 79b05cb1913..b7d46788aa3 100644 --- a/netwerk/cache2/OldWrappers.h +++ b/netwerk/cache2/OldWrappers.h @@ -33,8 +33,6 @@ public: NS_IMETHOD AsyncDoom(nsICacheEntryDoomCallback* listener); NS_IMETHOD GetPersistent(bool *aPersistToDisk); - NS_IMETHOD GetIsForcedValid(bool *aIsForcedValid); - NS_IMETHOD ForceValidFor(uint32_t aSecondsToTheFuture); NS_IMETHOD SetValid() { return NS_OK; } NS_IMETHOD MetaDataReady() { return NS_OK; } NS_IMETHOD Recreate(bool, nsICacheEntry**); diff --git a/netwerk/cache2/nsICacheEntry.idl b/netwerk/cache2/nsICacheEntry.idl index ec6f48379a5..cf6f35f74ec 100644 --- a/netwerk/cache2/nsICacheEntry.idl +++ b/netwerk/cache2/nsICacheEntry.idl @@ -16,7 +16,7 @@ interface nsICacheListener; interface nsIFile; interface nsICacheEntryMetaDataVisitor; -[scriptable, uuid(607c2a2c-0a48-40b9-a956-8cf2bb9857cf)] +[scriptable, uuid(972dc51d-df01-4b1e-b7f3-76dbcc603b1e)] interface nsICacheEntry : nsISupports { /** @@ -62,28 +62,6 @@ interface nsICacheEntry : nsISupports */ void setExpirationTime(in uint32_t expirationTime); - /** - * This method is intended to override the per-spec cache validation - * decisions for a duration specified in seconds. The current state can - * be examined with isForcedValid (see below). This value is not persisted, - * so it will not survive session restart. Cache entries that are forced valid - * will not be evicted from the cache for the duration of forced validity. - * This means that there is a potential problem if the number of forced valid - * entries grows to take up more space than the cache size allows. - * - * @param aSecondsToTheFuture - * the number of seconds the default cache validation behavior will be - * overridden before it returns to normal - */ - void forceValidFor(in unsigned long aSecondsToTheFuture); - - /** - * The state variable for whether this entry is currently forced valid. - * Defaults to false for normal cache validation behavior, and will return - * true if the number of seconds set by forceValidFor() has yet to be reached. - */ - readonly attribute boolean isForcedValid; - /** * Open blocking input stream to cache data. Use the stream transport * service to asynchronously read this stream on a background thread. diff --git a/netwerk/test/unit/test_cache2-27-force-valid-for.js b/netwerk/test/unit/test_cache2-27-force-valid-for.js deleted file mode 100644 index c3663751dfe..00000000000 --- a/netwerk/test/unit/test_cache2-27-force-valid-for.js +++ /dev/null @@ -1,37 +0,0 @@ -Components.utils.import('resource://gre/modules/LoadContextInfo.jsm'); - -function run_test() -{ - do_get_profile(); - - if (!newCacheBackEndUsed()) { - do_check_true(true, "This test checks only cache2 specific behavior."); - return; - } - - var mc = new MultipleCallbacks(2, function() { - finish_cache2_test(); - }); - - asyncOpenCacheEntry("http://m1/", "memory", Ci.nsICacheStorage.OPEN_NORMALLY, LoadContextInfo.default, - new OpenCallback(NEW, "meta", "data", function(entry) { - // Check the default - equal(entry.isForcedValid, false); - - // Forced valid and confirm - entry.forceValidFor(2); - do_timeout(1000, function() { - equal(entry.isForcedValid, true); - mc.fired(); - }); - - // Confirm the timeout occurs - do_timeout(3000, function() { - equal(entry.isForcedValid, false); - mc.fired(); - }); - }) - ); - - do_test_pending(); -} diff --git a/netwerk/test/unit/xpcshell.ini b/netwerk/test/unit/xpcshell.ini index d1f0ee1cedb..b566c66d5c8 100644 --- a/netwerk/test/unit/xpcshell.ini +++ b/netwerk/test/unit/xpcshell.ini @@ -67,10 +67,7 @@ skip-if = os == "android" skip-if = os == "android" [test_cache2-25-chunk-memory-limit.js] [test_cache2-26-no-outputstream-open.js] -# GC, that this patch is dependent on, doesn't work well on Android. -skip-if = os == "android" -[test_cache2-27-force-valid-for.js] -# Bug 675039, comment 6: "The difference is that the memory cache is disabled in Armv6 builds." +# GC, that this patch is depenedent on, doesn't work well on Android." skip-if = os == "android" [test_304_responses.js] # Bug 675039: test hangs on Android-armv6 From e2716d6158dbae0c5fa36abe30d573e4f334924d Mon Sep 17 00:00:00 2001 From: Neil Deakin Date: Mon, 21 Jul 2014 09:09:41 -0400 Subject: [PATCH 68/84] Bug 1013064, backout e5dfe9801f76, 11f3a97d1d2c, e2374762f521, 91db8acb8d7e, d0050ba0b875 due to sync issues --- .../content/aboutaccounts/aboutaccounts.js | 9 - browser/base/content/sync/customize.js | 14 ++ browser/base/content/sync/customize.xul | 3 +- browser/base/content/sync/utils.js | 6 + .../components/preferences/in-content/sync.js | 11 + .../preferences/in-content/sync.xul | 17 +- browser/components/preferences/sync.js | 11 + browser/components/preferences/sync.xul | 17 +- .../themes/linux/preferences/preferences.css | 8 + .../themes/osx/preferences/preferences.css | 16 ++ .../windows/preferences/preferences.css | 8 + services/fxaccounts/FxAccounts.jsm | 193 ------------------ services/fxaccounts/FxAccountsCommon.js | 13 -- services/fxaccounts/moz.build | 5 +- .../tests/xpcshell/test_loginmgr_storage.js | 113 ---------- .../fxaccounts/tests/xpcshell/xpcshell.ini | 2 - services/sync/Weave.js | 10 + services/sync/modules/browserid_identity.js | 61 +----- services/sync/modules/engines/passwords.js | 22 ++ services/sync/modules/identity.js | 19 -- services/sync/modules/service.js | 20 +- services/sync/modules/util.js | 12 +- .../tests/unit/test_browserid_identity.js | 15 -- .../tests/unit/test_password_mpenabled.js | 137 +++++++++++++ services/sync/tests/unit/xpcshell.ini | 2 + 25 files changed, 290 insertions(+), 454 deletions(-) create mode 100644 services/sync/tests/unit/test_password_mpenabled.js diff --git a/browser/base/content/aboutaccounts/aboutaccounts.js b/browser/base/content/aboutaccounts/aboutaccounts.js index af31be92e5b..5cceae154ac 100644 --- a/browser/base/content/aboutaccounts/aboutaccounts.js +++ b/browser/base/content/aboutaccounts/aboutaccounts.js @@ -12,9 +12,6 @@ Cu.import("resource://gre/modules/FxAccounts.jsm"); let fxAccountsCommon = {}; Cu.import("resource://gre/modules/FxAccountsCommon.js", fxAccountsCommon); -// for master-password utilities -Cu.import("resource://services-sync/util.js"); - const PREF_LAST_FXA_USER = "identity.fxaccounts.lastSignedInUserHash"; const PREF_SYNC_SHOW_CUSTOMIZATION = "services.sync.ui.showCustomizationDialog"; @@ -107,12 +104,6 @@ let wrapper = { return; } - // If a master-password is enabled, we want to encourage the user to - // unlock it. Things still work if not, but the user will probably need - // to re-auth next startup (in which case we will get here again and - // re-prompt) - Utils.ensureMPUnlocked(); - let iframe = document.getElementById("remote"); this.iframe = iframe; iframe.addEventListener("load", this); diff --git a/browser/base/content/sync/customize.js b/browser/base/content/sync/customize.js index b3178036d3c..8da91db7c8a 100644 --- a/browser/base/content/sync/customize.js +++ b/browser/base/content/sync/customize.js @@ -4,6 +4,20 @@ "use strict"; +const {classes: Cc, interfaces: Ci, utils: Cu} = Components; + +Cu.import("resource://gre/modules/Services.jsm"); + +let service = Cc["@mozilla.org/weave/service;1"] + .getService(Ci.nsISupports) + .wrappedJSObject; + +if (!service.allowPasswordsEngine) { + let checkbox = document.getElementById("fxa-pweng-chk"); + checkbox.checked = false; + checkbox.disabled = true; +} + addEventListener("dialogaccept", function () { let pane = document.getElementById("sync-customize-pane"); pane.writePreferences(true); diff --git a/browser/base/content/sync/customize.xul b/browser/base/content/sync/customize.xul index d95536d9ac9..e1fd95107b1 100644 --- a/browser/base/content/sync/customize.xul +++ b/browser/base/content/sync/customize.xul @@ -45,7 +45,8 @@ - - + + + + + + + + + + + diff --git a/browser/components/preferences/sync.js b/browser/components/preferences/sync.js index ea861ed671b..8c627ccb0b8 100644 --- a/browser/components/preferences/sync.js +++ b/browser/components/preferences/sync.js @@ -154,6 +154,17 @@ let gSyncPane = { for (let checkbox of engines.querySelectorAll("checkbox")) { checkbox.disabled = enginesListDisabled; } + + let checkbox = document.getElementById("fxa-pweng-chk"); + let help = document.getElementById("fxa-pweng-help"); + let allowPasswordsEngine = service.allowPasswordsEngine; + + if (!allowPasswordsEngine) { + checkbox.checked = false; + } + + checkbox.disabled = !allowPasswordsEngine || enginesListDisabled; + help.hidden = allowPasswordsEngine || enginesListDisabled; }); // If fxAccountEnabled is false and we are in a "not configured" state, // then fxAccounts is probably fully disabled rather than just unconfigured, diff --git a/browser/components/preferences/sync.xul b/browser/components/preferences/sync.xul index aef18dedc86..a88618794d4 100644 --- a/browser/components/preferences/sync.xul +++ b/browser/components/preferences/sync.xul @@ -265,9 +265,20 @@ - + + + + + + + + + + + diff --git a/browser/themes/linux/preferences/preferences.css b/browser/themes/linux/preferences/preferences.css index 2d2dffb3303..20d8a312b01 100644 --- a/browser/themes/linux/preferences/preferences.css +++ b/browser/themes/linux/preferences/preferences.css @@ -171,4 +171,12 @@ label.small { margin-bottom: 0.6em; } +#fxa-pweng-help-link > label { + margin: 0; +} + +#fxa-pweng-help-link > image { + list-style-image: url("chrome://global/skin/icons/question-16.png"); +} + %endif diff --git a/browser/themes/osx/preferences/preferences.css b/browser/themes/osx/preferences/preferences.css index 52ae7110bfa..50371d853a8 100644 --- a/browser/themes/osx/preferences/preferences.css +++ b/browser/themes/osx/preferences/preferences.css @@ -233,4 +233,20 @@ html|a.inline-link:-moz-focusring { margin-bottom: 0.6em; } +#fxa-pweng-help-link > label { + margin: 0; +} + +#fxa-pweng-help-link > image { + width: 16px; + height: 16px; + list-style-image: url("chrome://global/skin/icons/question-16.png"); +} + +@media (min-resolution: 2dppx) { + #fxa-pweng-help-link > image { + list-style-image: url("chrome://global/skin/icons/question-32.png"); + } +} + %endif diff --git a/browser/themes/windows/preferences/preferences.css b/browser/themes/windows/preferences/preferences.css index 13d5281f90b..63537da6992 100644 --- a/browser/themes/windows/preferences/preferences.css +++ b/browser/themes/windows/preferences/preferences.css @@ -161,4 +161,12 @@ label.small { margin-bottom: 0.6em; } +#fxa-pweng-help-link > label { + margin: 0; +} + +#fxa-pweng-help-link > image { + list-style-image: url("chrome://global/skin/icons/question-16.png"); +} + %endif diff --git a/services/fxaccounts/FxAccounts.jsm b/services/fxaccounts/FxAccounts.jsm index a4f9a72124a..5fb78a72ff7 100644 --- a/services/fxaccounts/FxAccounts.jsm +++ b/services/fxaccounts/FxAccounts.jsm @@ -303,12 +303,7 @@ function FxAccountsInternal() { // We don't reference |profileDir| in the top-level module scope // as we may be imported before we know where it is. - // We only want the fancy new LoginManagerStorage on desktop. -#if defined(MOZ_B2G) this.signedInUserStorage = new JSONStorage({ -#else - this.signedInUserStorage = new LoginManagerStorage({ -#endif filename: DEFAULT_STORAGE_FILENAME, baseDir: OS.Constants.Path.profileDir, }); @@ -906,194 +901,6 @@ JSONStorage.prototype = { } }; -/** - * LoginManagerStorage constructor that creates instances that may set/get - * from a combination of a clear-text JSON file and stored securely in - * the nsILoginManager. - * - * @param options { - * filename: of the plain-text file to write to - * baseDir: directory where the file resides - * } - * @return instance - */ - -function LoginManagerStorage(options) { - // we reuse the JSONStorage for writing the plain-text stuff. - this.jsonStorage = new JSONStorage(options); -} - -LoginManagerStorage.prototype = { - // The fields in the credentials JSON object that are stored in plain-text - // in the profile directory. All other fields are stored in the login manager, - // and thus are only available when the master-password is unlocked. - - // a hook point for testing. - get _isLoggedIn() { - return Services.logins.isLoggedIn; - }, - - // Clear any data from the login manager. Returns true if the login manager - // was unlocked (even if no existing logins existed) or false if it was - // locked (meaning we don't even know if it existed or not.) - _clearLoginMgrData: Task.async(function* () { - try { // Services.logins might be third-party and broken... - yield Services.logins.initializationPromise; - if (!this._isLoggedIn) { - return false; - } - let logins = Services.logins.findLogins({}, FXA_PWDMGR_HOST, null, FXA_PWDMGR_REALM); - for (let login of logins) { - Services.logins.removeLogin(login); - } - return true; - } catch (ex) { - log.error("Failed to clear login data: ${}", ex); - return false; - } - }), - - set: Task.async(function* (contents) { - if (!contents) { - // User is signing out - write the null to the json file. - yield this.jsonStorage.set(contents); - - // And nuke it from the login manager. - let cleared = yield this._clearLoginMgrData(); - if (!cleared) { - // just log a message - we verify that the email address matches when - // we reload it, so having a stale entry doesn't really hurt. - log.info("not removing credentials from login manager - not logged in"); - } - return; - } - - // We are saving actual data. - // Split the data into 2 chunks - one to go to the plain-text, and the - // other to write to the login manager. - let toWriteJSON = {version: contents.version}; - let accountDataJSON = toWriteJSON.accountData = {}; - let toWriteLoginMgr = {version: contents.version}; - let accountDataLoginMgr = toWriteLoginMgr.accountData = {}; - for (let [name, value] of Iterator(contents.accountData)) { - if (FXA_PWDMGR_PLAINTEXT_FIELDS.indexOf(name) >= 0) { - accountDataJSON[name] = value; - } else { - accountDataLoginMgr[name] = value; - } - } - yield this.jsonStorage.set(toWriteJSON); - - try { // Services.logins might be third-party and broken... - // and the stuff into the login manager. - yield Services.logins.initializationPromise; - // If MP is locked we silently fail - the user may need to re-auth - // next startup. - if (!this._isLoggedIn) { - log.info("not saving credentials to login manager - not logged in"); - return; - } - // write the rest of the data to the login manager. - let loginInfo = new Components.Constructor( - "@mozilla.org/login-manager/loginInfo;1", Ci.nsILoginInfo, "init"); - let login = new loginInfo(FXA_PWDMGR_HOST, - null, // aFormSubmitURL, - FXA_PWDMGR_REALM, // aHttpRealm, - contents.accountData.email, // aUsername - JSON.stringify(toWriteLoginMgr), // aPassword - "", // aUsernameField - "");// aPasswordField - - let existingLogins = Services.logins.findLogins({}, FXA_PWDMGR_HOST, null, - FXA_PWDMGR_REALM); - if (existingLogins.length) { - Services.logins.modifyLogin(existingLogins[0], login); - } else { - Services.logins.addLogin(login); - } - } catch (ex) { - log.error("Failed to save data to the login manager: ${}", ex); - } - }), - - get: Task.async(function* () { - // we need to suck some data from the .json file in the profile dir and - // some other from the login manager. - let data = yield this.jsonStorage.get(); - if (!data) { - // no user logged in, nuke the storage data incase we couldn't remove - // it previously and then we are done. - yield this._clearLoginMgrData(); - return null; - } - - // if we have encryption keys it must have been saved before we - // used the login manager, so re-save it. - if (data.accountData.kA || data.accountData.kB || data.keyFetchToken) { - // We need to migrate, but the MP might be locked (eg, on the first run - // with this enabled, we will get here very soon after startup, so will - // certainly be locked.) This means we can't actually store the data in - // the login manager (and thus might lose it if we migrated now) - // So if the MP is locked, we *don't* migrate, but still just return - // the subset of data we now store in the JSON. - // This will cause sync to notice the lack of keys, force an unlock then - // re-fetch the account data to see if the keys are there. At *that* - // point we will end up back here, but because the MP is now unlocked - // we can actually perform the migration. - if (!this._isLoggedIn) { - // return the "safe" subset but leave the storage alone. - log.info("account data needs migration to the login manager but the MP is locked."); - let result = { - version: data.version, - accountData: {}, - }; - for (let fieldName of FXA_PWDMGR_PLAINTEXT_FIELDS) { - result.accountData[fieldName] = data.accountData[fieldName]; - } - return result; - } - // actually migrate - just calling .set() will split everything up. - log.info("account data is being migrated to the login manager."); - yield this.set(data); - } - - try { // Services.logins might be third-party and broken... - // read the data from the login manager and merge it for return. - yield Services.logins.initializationPromise; - - if (!this._isLoggedIn) { - log.info("returning partial account data as the login manager is locked."); - return data; - } - - let logins = Services.logins.findLogins({}, FXA_PWDMGR_HOST, null, FXA_PWDMGR_REALM); - if (logins.length == 0) { - // This could happen if the MP was locked when we wrote the data. - log.info("Can't find the rest of the credentials in the login manager"); - return data; - } - let login = logins[0]; - if (login.username == data.accountData.email) { - let lmData = JSON.parse(login.password); - if (lmData.version == data.version) { - // Merge the login manager data - copyObjectProperties(lmData.accountData, data.accountData); - } else { - log.info("version field in the login manager doesn't match - ignoring it"); - yield this._clearLoginMgrData(); - } - } else { - log.info("username in the login manager doesn't match - ignoring it"); - yield this._clearLoginMgrData(); - } - } catch (ex) { - log.error("Failed to get data from the login manager: ${}", ex); - } - return data; - }), - -} - // A getter for the instance to export XPCOMUtils.defineLazyGetter(this, "fxAccounts", function() { let a = new FxAccounts(); diff --git a/services/fxaccounts/FxAccountsCommon.js b/services/fxaccounts/FxAccountsCommon.js index 267e5ecdb7a..d3a2756f2f9 100644 --- a/services/fxaccounts/FxAccountsCommon.js +++ b/services/fxaccounts/FxAccountsCommon.js @@ -178,18 +178,5 @@ SERVER_ERRNO_TO_ERROR[ERRNO_INCORRECT_EMAIL_CASE] = ERROR_INCORRECT_EM SERVER_ERRNO_TO_ERROR[ERRNO_SERVICE_TEMP_UNAVAILABLE] = ERROR_SERVICE_TEMP_UNAVAILABLE; SERVER_ERRNO_TO_ERROR[ERRNO_UNKNOWN_ERROR] = ERROR_UNKNOWN; -// FxAccounts has the ability to "split" the credentials between a plain-text -// JSON file in the profile dir and in the login manager. -// These constants relate to that. - -// The fields we save in the plaintext JSON. -// See bug 1013064 comments 23-25 for why the sessionToken is "safe" -this.FXA_PWDMGR_PLAINTEXT_FIELDS = ["email", "verified", "authAt", - "sessionToken", "uid"]; -// The pseudo-host we use in the login manager -this.FXA_PWDMGR_HOST = "chrome://FirefoxAccounts"; -// The realm we use in the login manager. -this.FXA_PWDMGR_REALM = "Firefox Accounts credentials"; - // Allow this file to be imported via Components.utils.import(). this.EXPORTED_SYMBOLS = Object.keys(this); diff --git a/services/fxaccounts/moz.build b/services/fxaccounts/moz.build index 1bb8c0916b2..f95971425a6 100644 --- a/services/fxaccounts/moz.build +++ b/services/fxaccounts/moz.build @@ -10,14 +10,11 @@ TEST_DIRS += ['tests'] EXTRA_JS_MODULES += [ 'Credentials.jsm', + 'FxAccounts.jsm', 'FxAccountsClient.jsm', 'FxAccountsCommon.js' ] -EXTRA_PP_JS_MODULES += [ - 'FxAccounts.jsm', -] - # For now, we will only be using the FxA manager in B2G. if CONFIG['MOZ_B2G']: EXTRA_JS_MODULES += ['FxAccountsManager.jsm'] diff --git a/services/fxaccounts/tests/xpcshell/test_loginmgr_storage.js b/services/fxaccounts/tests/xpcshell/test_loginmgr_storage.js index a9cf5f4499b..297b2569170 100644 --- a/services/fxaccounts/tests/xpcshell/test_loginmgr_storage.js +++ b/services/fxaccounts/tests/xpcshell/test_loginmgr_storage.js @@ -103,119 +103,6 @@ add_task(function test_MPLocked() { yield fxa.signOut(/* localOnly = */ true) }); -add_task(function test_migrationMPUnlocked() { - // first manually save a signedInUser.json to simulate a first-run with - // pre-migrated data. - let fxa = new FxAccounts({}); - - let creds = { - email: "test@example.com", - sessionToken: "sessionToken", - kA: "the kA value", - kB: "the kB value", - verified: true - }; - let toWrite = { - version: fxa.version, - accountData: creds, - } - - let path = OS.Path.join(OS.Constants.Path.profileDir, "signedInUser.json"); - yield CommonUtils.writeJSON(toWrite, path); - - // now load it - it should migrate. - let data = yield fxa.getSignedInUser(); - Assert.deepEqual(data, creds, "we got all the data back"); - - // and verify it was actually migrated - re-read signedInUser back. - let data = yield CommonUtils.readJSON(path); - - Assert.strictEqual(data.accountData.email, creds.email, "correct email in the clear text"); - Assert.strictEqual(data.accountData.sessionToken, creds.sessionToken, "correct sessionToken in the clear text"); - Assert.strictEqual(data.accountData.verified, creds.verified, "correct verified flag"); - - Assert.ok(!("kA" in data.accountData), "kA not stored in clear text"); - Assert.ok(!("kB" in data.accountData), "kB not stored in clear text"); - - let login = getLoginMgrData(); - Assert.strictEqual(login.username, creds.email, "email matches"); - let loginData = JSON.parse(login.password); - Assert.strictEqual(loginData.version, data.version, "same version flag in both places"); - Assert.strictEqual(loginData.accountData.kA, creds.kA, "correct kA in the login mgr"); - Assert.strictEqual(loginData.accountData.kB, creds.kB, "correct kB in the login mgr"); - - Assert.ok(!("email" in loginData), "email not stored in the login mgr json"); - Assert.ok(!("sessionToken" in loginData), "sessionToken not stored in the login mgr json"); - Assert.ok(!("verified" in loginData), "verified not stored in the login mgr json"); - - yield fxa.signOut(/* localOnly = */ true); - Assert.strictEqual(getLoginMgrData(), null, "login mgr data deleted on logout"); -}); - -add_task(function test_migrationMPLocked() { - // first manually save a signedInUser.json to simulate a first-run with - // pre-migrated data. - let fxa = new FxAccounts({}); - - let creds = { - email: "test@example.com", - sessionToken: "sessionToken", - kA: "the kA value", - kB: "the kB value", - verified: true - }; - let toWrite = { - version: fxa.version, - accountData: creds, - } - - let path = OS.Path.join(OS.Constants.Path.profileDir, "signedInUser.json"); - yield CommonUtils.writeJSON(toWrite, path); - - // pretend the MP is locked. - fxa.internal.signedInUserStorage.__defineGetter__("_isLoggedIn", function() false); - - // now load it - it should *not* migrate, but should only give the JSON-safe - // data back. - let data = yield fxa.getSignedInUser(); - Assert.ok(!data.kA); - Assert.ok(!data.kB); - - // and verify the data on disk wan't migrated. - data = yield CommonUtils.readJSON(path); - Assert.deepEqual(data, toWrite); - - // Now "unlock" and re-ask for the signedInUser - it should migrate. - fxa.internal.signedInUserStorage.__defineGetter__("_isLoggedIn", function() true); - data = yield fxa.getSignedInUser(); - // this time we should have got all the data, not just the JSON-safe fields. - Assert.strictEqual(data.kA, creds.kA); - Assert.strictEqual(data.kB, creds.kB); - - // And verify the data in the JSON was migrated - data = yield CommonUtils.readJSON(path); - Assert.strictEqual(data.accountData.email, creds.email, "correct email in the clear text"); - Assert.strictEqual(data.accountData.sessionToken, creds.sessionToken, "correct sessionToken in the clear text"); - Assert.strictEqual(data.accountData.verified, creds.verified, "correct verified flag"); - - Assert.ok(!("kA" in data.accountData), "kA not stored in clear text"); - Assert.ok(!("kB" in data.accountData), "kB not stored in clear text"); - - let login = getLoginMgrData(); - Assert.strictEqual(login.username, creds.email, "email matches"); - let loginData = JSON.parse(login.password); - Assert.strictEqual(loginData.version, data.version, "same version flag in both places"); - Assert.strictEqual(loginData.accountData.kA, creds.kA, "correct kA in the login mgr"); - Assert.strictEqual(loginData.accountData.kB, creds.kB, "correct kB in the login mgr"); - - Assert.ok(!("email" in loginData), "email not stored in the login mgr json"); - Assert.ok(!("sessionToken" in loginData), "sessionToken not stored in the login mgr json"); - Assert.ok(!("verified" in loginData), "verified not stored in the login mgr json"); - - yield fxa.signOut(/* localOnly = */ true); - Assert.strictEqual(getLoginMgrData(), null, "login mgr data deleted on logout"); -}); - add_task(function test_consistentWithMPEdgeCases() { let fxa = new FxAccounts({}); diff --git a/services/fxaccounts/tests/xpcshell/xpcshell.ini b/services/fxaccounts/tests/xpcshell/xpcshell.ini index 4448d76a8f4..9d9bffe1254 100644 --- a/services/fxaccounts/tests/xpcshell/xpcshell.ini +++ b/services/fxaccounts/tests/xpcshell/xpcshell.ini @@ -5,8 +5,6 @@ tail = [test_accounts.js] [test_client.js] [test_credentials.js] -[test_loginmgr_storage.js] -skip-if = appname == 'b2g' # login manager storage only used on desktop. [test_manager.js] run-if = appname == 'b2g' reason = FxAccountsManager is only available for B2G for now diff --git a/services/sync/Weave.js b/services/sync/Weave.js index d7befe15b93..961bb7f0c45 100644 --- a/services/sync/Weave.js +++ b/services/sync/Weave.js @@ -108,6 +108,16 @@ WeaveService.prototype = { } }, + /** + * Returns whether the password engine is allowed. We explicitly disallow + * the password engine when a master password is used to ensure those can't + * be accessed without the master key. + */ + get allowPasswordsEngine() { + // This doesn't apply to old-style sync, it's only an issue for FxA. + return !this.fxAccountsEnabled || !Utils.mpEnabled(); + }, + /** * Whether Sync appears to be enabled. * diff --git a/services/sync/modules/browserid_identity.js b/services/sync/modules/browserid_identity.js index b489807cc8f..3b0e290ffcf 100644 --- a/services/sync/modules/browserid_identity.js +++ b/services/sync/modules/browserid_identity.js @@ -399,10 +399,7 @@ this.BrowserIDManager.prototype = { * The current state of the auth credentials. * * This essentially validates that enough credentials are available to use - * Sync, although it effectively ignores the state of the master-password - - * if that's locked and that's the only problem we can see, say everything - * is OK - unlockAndVerifyAuthState will be used to perform the unlock - * and re-verification if necessary. + * Sync. */ get currentAuthState() { if (this._authFailureReason) { @@ -419,53 +416,14 @@ this.BrowserIDManager.prototype = { // No need to check this.syncKey as our getter for that attribute // uses this.syncKeyBundle - // If bundle creation started, but failed due to any reason other than - // the MP being locked... - if (this._shouldHaveSyncKeyBundle && !this.syncKeyBundle && !Utils.mpLocked()) { - // Return a state that says a re-auth is necessary so we can get keys. - return LOGIN_FAILED_LOGIN_REJECTED; + // If bundle creation started, but failed. + if (this._shouldHaveSyncKeyBundle && !this.syncKeyBundle) { + return LOGIN_FAILED_NO_PASSPHRASE; } return STATUS_OK; }, - // Do we currently have keys, or do we have enough that we should be able - // to successfully fetch them? - _canFetchKeys: function() { - let userData = this._signedInUser; - // a keyFetchToken means we can almost certainly grab them. - // kA and kB means we already have them. - return userData && (userData.keyFetchToken || (userData.kA && userData.kB)); - }, - - /** - * Verify the current auth state, unlocking the master-password if necessary. - * - * Returns a promise that resolves with the current auth state after - * attempting to unlock. - */ - unlockAndVerifyAuthState: function() { - if (this._canFetchKeys()) { - return Promise.resolve(STATUS_OK); - } - // so no keys - ensure MP unlocked. - if (!Utils.ensureMPUnlocked()) { - // user declined to unlock, so we don't know if they are stored there. - return Promise.resolve(MASTER_PASSWORD_LOCKED); - } - // now we are unlocked we must re-fetch the user data as we may now have - // the details that were previously locked away. - return this._fxaService.getSignedInUser().then( - accountData => { - this._updateSignedInUser(accountData); - // If we still can't get keys it probably means the user authenticated - // without unlocking the MP or cleared the saved logins, so we've now - // lost them - the user will need to reauth before continuing. - return this._canFetchKeys() ? STATUS_OK : LOGIN_FAILED_LOGIN_REJECTED; - } - ); - }, - /** * Do we have a non-null, not yet expired token for the user currently * signed in? @@ -491,14 +449,6 @@ this.BrowserIDManager.prototype = { let fxa = this._fxaService; let userData = this._signedInUser; - // We need kA and kB for things to work. If we don't have them, just - // return null for the token - sync calling unlockAndVerifyAuthState() - // before actually syncing will setup the error states if necessary. - if (!this._canFetchKeys()) { - log.info("_fetchTokenForUser has no keys to use."); - return null; - } - log.info("Fetching assertion and token from: " + tokenServerURI); let maybeFetchKeys = () => { @@ -574,8 +524,7 @@ this.BrowserIDManager.prototype = { // set it to the "fatal" LOGIN_FAILED_LOGIN_REJECTED reason. this._authFailureReason = LOGIN_FAILED_LOGIN_REJECTED; } else { - this._log.error("Non-authentication error in _fetchTokenForUser: " - + (err.message || err)); + this._log.error("Non-authentication error in _fetchTokenForUser: " + err.message); // for now assume it is just a transient network related problem. this._authFailureReason = LOGIN_FAILED_NETWORK_ERROR; } diff --git a/services/sync/modules/engines/passwords.js b/services/sync/modules/engines/passwords.js index 7786fd9af08..ff5414578b2 100644 --- a/services/sync/modules/engines/passwords.js +++ b/services/sync/modules/engines/passwords.js @@ -36,6 +36,28 @@ PasswordEngine.prototype = { _recordObj: LoginRec, applyIncomingBatchSize: PASSWORDS_STORE_BATCH_SIZE, + get isAllowed() { + return Cc["@mozilla.org/weave/service;1"] + .getService(Ci.nsISupports) + .wrappedJSObject + .allowPasswordsEngine; + }, + + get enabled() { + // If we are disabled due to !isAllowed(), we must take care to ensure the + // engine has actually had the enabled setter called which reflects this state. + let prefVal = SyncEngine.prototype.__lookupGetter__("enabled").call(this); + let newVal = this.isAllowed && prefVal; + if (newVal != prefVal) { + this.enabled = newVal; + } + return newVal; + }, + + set enabled(val) { + SyncEngine.prototype.__lookupSetter__("enabled").call(this, this.isAllowed && val); + }, + _syncFinish: function _syncFinish() { SyncEngine.prototype._syncFinish.call(this); diff --git a/services/sync/modules/identity.js b/services/sync/modules/identity.js index 27129b827bf..cb7a1f58423 100644 --- a/services/sync/modules/identity.js +++ b/services/sync/modules/identity.js @@ -377,25 +377,6 @@ IdentityManager.prototype = { return STATUS_OK; }, - /** - * Verify the current auth state, unlocking the master-password if necessary. - * - * Returns a promise that resolves with the current auth state after - * attempting to unlock. - */ - unlockAndVerifyAuthState: function() { - // Try to fetch the passphrase - this will prompt for MP unlock as a - // side-effect... - try { - this.syncKey; - } catch (ex) { - this._log.debug("Fetching passphrase threw " + ex + - "; assuming master password locked."); - return Promise.resolve(MASTER_PASSWORD_LOCKED); - } - return Promise.resolve(STATUS_OK); - }, - /** * Persist credentials to password store. * diff --git a/services/sync/modules/service.js b/services/sync/modules/service.js index 4ab113e896f..7102dd7bae6 100644 --- a/services/sync/modules/service.js +++ b/services/sync/modules/service.js @@ -684,21 +684,17 @@ Sync11Service.prototype = { return false; } + // Unlock master password, or return. // Attaching auth credentials to a request requires access to // passwords, which means that Resource.get can throw MP-related // exceptions! - // So we ask the identity to verify the login state after unlocking the - // master password (ie, this call is expected to prompt for MP unlock - // if necessary) while we still have control. - let cb = Async.makeSpinningCallback(); - this.identity.unlockAndVerifyAuthState().then( - result => cb(null, result), - cb - ); - let unlockedState = cb.wait(); - this._log.debug("Fetching unlocked auth state returned " + unlockedState); - if (unlockedState != STATUS_OK) { - this.status.login = unlockedState; + // Try to fetch the passphrase first, while we still have control. + try { + this.identity.syncKey; + } catch (ex) { + this._log.debug("Fetching passphrase threw " + ex + + "; assuming master password locked."); + this.status.login = MASTER_PASSWORD_LOCKED; return false; } diff --git a/services/sync/modules/util.js b/services/sync/modules/util.js index 4691428613f..194e0b285ca 100644 --- a/services/sync/modules/util.js +++ b/services/sync/modules/util.js @@ -19,13 +19,6 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm", this); Cu.import("resource://gre/modules/osfile.jsm", this); Cu.import("resource://gre/modules/Task.jsm", this); -// FxAccountsCommon.js doesn't use a "namespace", so create one here. -XPCOMUtils.defineLazyGetter(this, "FxAccountsCommon", function() { - let FxAccountsCommon = {}; - Cu.import("resource://gre/modules/FxAccountsCommon.js", FxAccountsCommon); - return FxAccountsCommon; -}); - /* * Utility functions */ @@ -601,11 +594,8 @@ this.Utils = { return this._syncCredentialsHosts; } let result = new Set(); - // the legacy sync host + // the legacy sync host. result.add(PWDMGR_HOST); - // the FxA host - result.add(FxAccountsCommon.FXA_PWDMGR_HOST); - // // The FxA hosts - these almost certainly all have the same hostname, but // better safe than sorry... for (let prefName of ["identity.fxaccounts.remote.force_auth.uri", diff --git a/services/sync/tests/unit/test_browserid_identity.js b/services/sync/tests/unit/test_browserid_identity.js index f2ec7cc0a25..947b026fdbc 100644 --- a/services/sync/tests/unit/test_browserid_identity.js +++ b/services/sync/tests/unit/test_browserid_identity.js @@ -83,23 +83,9 @@ add_task(function test_initialializeWithCurrentIdentity() { } ); -add_task(function test_initialializeWithNoKeys() { - _("Verify start after initializeWithCurrentIdentity without kA, kB or keyFetchToken"); - let identityConfig = makeIdentityConfig(); - delete identityConfig.fxaccount.user.kA; - delete identityConfig.fxaccount.user.kB; - // there's no keyFetchToken by default, so the initialize should fail. - configureFxAccountIdentity(browseridManager, identityConfig); - - yield browseridManager.initializeWithCurrentIdentity(); - yield browseridManager.whenReadyToAuthenticate.promise; - do_check_eq(Status.login, LOGIN_SUCCEEDED, "login succeeded even without keys"); - do_check_false(browseridManager._canFetchKeys(), "_canFetchKeys reflects lack of keys"); -}); add_test(function test_getResourceAuthenticator() { _("BrowserIDManager supplies a Resource Authenticator callback which returns a Hawk header."); - configureFxAccountIdentity(browseridManager); let authenticator = browseridManager.getResourceAuthenticator(); do_check_true(!!authenticator); let req = {uri: CommonUtils.makeURI( @@ -254,7 +240,6 @@ add_test(function test_RESTResourceAuthenticatorSkew() { add_task(function test_ensureLoggedIn() { configureFxAccountIdentity(browseridManager); yield browseridManager.initializeWithCurrentIdentity(); - yield browseridManager.whenReadyToAuthenticate.promise; Assert.equal(Status.login, LOGIN_SUCCEEDED, "original initialize worked"); yield browseridManager.ensureLoggedIn(); Assert.equal(Status.login, LOGIN_SUCCEEDED, "original ensureLoggedIn worked"); diff --git a/services/sync/tests/unit/test_password_mpenabled.js b/services/sync/tests/unit/test_password_mpenabled.js new file mode 100644 index 00000000000..637969ee0a7 --- /dev/null +++ b/services/sync/tests/unit/test_password_mpenabled.js @@ -0,0 +1,137 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +Cu.import("resource://gre/modules/Log.jsm"); +Cu.import("resource://services-sync/stages/enginesync.js"); +Cu.import("resource://services-sync/util.js"); +Cu.import("resource://services-sync/engines/passwords.js"); +Cu.import("resource://services-sync/service.js"); +Cu.import("resource://testing-common/services/sync/utils.js"); + +function run_test() { + initTestLogging("Trace"); + run_next_test(); +} + +add_test(function test_simple() { + ensureLegacyIdentityManager(); + // Stub fxAccountsEnabled + let xpcs = Cc["@mozilla.org/weave/service;1"] + .getService(Components.interfaces.nsISupports) + .wrappedJSObject; + let fxaEnabledGetter = xpcs.__lookupGetter__("fxAccountsEnabled"); + xpcs.__defineGetter__("fxAccountsEnabled", () => true); + + // Stub mpEnabled. + let mpEnabledF = Utils.mpEnabled; + let mpEnabled = false; + Utils.mpEnabled = function() mpEnabled; + + let manager = Service.engineManager; + + Service.engineManager.register(PasswordEngine); + let engine = Service.engineManager.get("passwords"); + let wipeCount = 0; + let engineWipeServerF = engine.wipeServer; + engine.wipeServer = function() { + ++wipeCount; + } + + // A server for the metadata. + let server = new SyncServer(); + let johndoe = server.registerUser("johndoe", "password"); + johndoe.createContents({ + meta: {global: {engines: {passwords: {version: engine.version, + syncID: engine.syncID}}}}, + crypto: {}, + clients: {} + }); + server.start(); + setBasicCredentials("johndoe", "password", "abcdeabcdeabcdeabcdeabcdea"); + Service.serverURL = server.baseURI; + Service.clusterURL = server.baseURI; + + let engineSync = new EngineSynchronizer(Service); + engineSync._log.level = Log.Level.Trace; + + function assertEnabled(expected, message) { + Assert.strictEqual(engine.enabled, expected, message); + // The preference *must* reflect the actual state. + Assert.strictEqual(Svc.Prefs.get("engine." + engine.prefName), expected, + message + " (pref should match enabled state)"); + } + + try { + assertEnabled(true, "password engine should be enabled by default") + let engineMeta = Service.recordManager.get(engine.metaURL); + // This engine should be in the meta/global + Assert.notStrictEqual(engineMeta.payload.engines[engine.name], undefined, + "The engine should appear in the metadata"); + Assert.ok(!engineMeta.changed, "the metadata for the password engine hasn't changed"); + + // (pretend to) enable a master-password + mpEnabled = true; + // The password engine should be locally disabled... + assertEnabled(false, "if mp is locked the engine should be disabled"); + // ...but not declined. + Assert.ok(!manager.isDeclined("passwords"), "password engine is not declined"); + // Next time a sync would happen, we call _updateEnabledEngines(), which + // would remove the engine from the metadata - call that now. + engineSync._updateEnabledEngines(); + // The global meta should no longer list the engine. + engineMeta = Service.recordManager.get(engine.metaURL); + Assert.strictEqual(engineMeta.payload.engines[engine.name], undefined, + "The engine should have vanished"); + // And we should have wiped the server data. + Assert.strictEqual(wipeCount, 1, "wipeServer should have been called"); + + // Now simulate an incoming meta/global indicating the engine should be + // enabled. We should fail to actually enable it - the pref should remain + // false and we wipe the server for anything another device might have + // stored. + let meta = { + payload: { + engines: { + "passwords": {"version":1,"syncID":"yfBi2v7PpFO2"}, + }, + }, + }; + engineSync._updateEnabledFromMeta(meta, 3, manager); + Assert.strictEqual(wipeCount, 2, "wipeServer should have been called"); + Assert.ok(!manager.isDeclined("passwords"), "password engine is not declined"); + assertEnabled(false, "engine still not enabled locally"); + + // Let's turn the MP off - but *not* re-enable it locally. + mpEnabled = false; + // Just disabling the MP isn't enough to force it back to enabled. + assertEnabled(false, "engine still not enabled locally"); + // Another incoming metadata record with the engine enabled should cause + // it to be enabled locally. + meta = { + payload: { + engines: { + "passwords": 1, + }, + }, + }; + engineSync._updateEnabledFromMeta(meta, 3, manager); + Assert.strictEqual(wipeCount, 2, "wipeServer should *not* have been called again"); + Assert.ok(!manager.isDeclined("passwords"), "password engine is not declined"); + // It should be enabled locally. + assertEnabled(true, "engine now enabled locally"); + // Next time a sync starts it should magically re-appear in our meta/global + engine._syncStartup(); + //engineSync._updateEnabledEngines(); + engineMeta = Service.recordManager.get(engine.metaURL); + Assert.equal(engineMeta.payload.engines[engine.name].version, engine.version, + "The engine should re-appear in the metadata"); + } finally { + // restore the damage we did above... + engine.wipeServer = engineWipeServerF; + engine._store.wipe(); + // Un-stub mpEnabled and fxAccountsEnabled + Utils.mpEnabled = mpEnabledF; + xpcs.__defineGetter__("fxAccountsEnabled", fxaEnabledGetter); + server.stop(run_next_test); + } +}); diff --git a/services/sync/tests/unit/xpcshell.ini b/services/sync/tests/unit/xpcshell.ini index 72570125b34..fcba6e3ab3d 100644 --- a/services/sync/tests/unit/xpcshell.ini +++ b/services/sync/tests/unit/xpcshell.ini @@ -169,3 +169,5 @@ skip-if = debug [test_healthreport.js] skip-if = ! healthreport + +[test_password_mpenabled.js] From 3452cb011ab836597758bc9c2ad6ae803d9fc461 Mon Sep 17 00:00:00 2001 From: "Carsten \"Tomcat\" Book" Date: Mon, 21 Jul 2014 15:15:20 +0200 Subject: [PATCH 69/84] Backed out changeset 98fa8afd9169 (bug 1038357) for causing merge conflicts due startup crash backout --- netwerk/cache2/CacheStorageService.cpp | 33 ++------------------------ netwerk/cache2/CacheStorageService.h | 2 -- 2 files changed, 2 insertions(+), 33 deletions(-) diff --git a/netwerk/cache2/CacheStorageService.cpp b/netwerk/cache2/CacheStorageService.cpp index 2220735f018..0ed4dd70654 100644 --- a/netwerk/cache2/CacheStorageService.cpp +++ b/netwerk/cache2/CacheStorageService.cpp @@ -1067,42 +1067,13 @@ void CacheStorageService::ForceEntryValidFor(nsACString &aCacheEntryKey, { mozilla::MutexAutoLock lock(mLock); - TimeStamp now = TimeStamp::NowLoRes(); - ForcedValidEntriesPrune(now); - // This will be the timeout - TimeStamp validUntil = now + TimeDuration::FromSeconds(aSecondsToTheFuture); + TimeStamp validUntil = TimeStamp::NowLoRes() + + TimeDuration::FromSeconds(aSecondsToTheFuture); mForcedValidEntries.Put(aCacheEntryKey, validUntil); } -namespace { // anon - -PLDHashOperator PruneForcedValidEntries( - const nsACString& aKey, TimeStamp& aTimeStamp, void* aClosure) -{ - TimeStamp* now = static_cast(aClosure); - if (aTimeStamp < *now) { - return PL_DHASH_REMOVE; - } - - return PL_DHASH_NEXT; -} - -} // anon - -// Cleans out the old entries in mForcedValidEntries -void CacheStorageService::ForcedValidEntriesPrune(TimeStamp &now) -{ - static TimeDuration const oneMinute = TimeDuration::FromSeconds(60); - static TimeStamp dontPruneUntil = now + oneMinute; - if (now < dontPruneUntil) - return; - - mForcedValidEntries.Enumerate(PruneForcedValidEntries, &now); - dontPruneUntil = now + oneMinute; -} - void CacheStorageService::OnMemoryConsumptionChange(CacheMemoryConsumer* aConsumer, uint32_t aCurrentMemoryConsumption) diff --git a/netwerk/cache2/CacheStorageService.h b/netwerk/cache2/CacheStorageService.h index 3e3e34f2e94..6c494b2c039 100644 --- a/netwerk/cache2/CacheStorageService.h +++ b/netwerk/cache2/CacheStorageService.h @@ -280,8 +280,6 @@ private: bool aReplace, CacheEntryHandle** aResult); - void ForcedValidEntriesPrune(TimeStamp &now); - static CacheStorageService* sSelf; mozilla::Mutex mLock; From 209bb31b9905aaebe5774b604f8b843dc21ecf34 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 21 Jul 2014 06:20:34 -0700 Subject: [PATCH 70/84] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ======== https://hg.mozilla.org/integration/gaia-central/rev/037b908a57db Author: Staś Małolepszy Desc: Merge pull request #21345 from stasm/1015041-pseudol10n-runtime Bug 1015041 - Move pseudo l10n to runtime. r=gandalf f=yurenju ======== https://hg.mozilla.org/integration/gaia-central/rev/ae259cddfff2 Author: Staś Małolepszy Desc: Bug 1015041 - Move pseudo l10n to runtime. r=gandalf f=yurenju --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 4c6f53f9cbc..d3c68585745 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "fbfc6e04d7487c49ddf90c867394b2c406f3eca6", + "revision": "037b908a57dbbf70146dd11446a2187d4b22fb4c", "repo_path": "/integration/gaia-central" } From ac60b18f5ec760ee3617db8807152d2c14b0060c Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 21 Jul 2014 06:26:19 -0700 Subject: [PATCH 71/84] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index b939024b527..58fecd2a605 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 815562329c4..2a197c0c00e 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index ff33ce9f6d6..1989b381451 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index b939024b527..58fecd2a605 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 421b278c4ac..2afeba35b16 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index e49d8b26c2b..a5e5fe02a5c 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 59d1f04a903..ec1c726d65c 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index dc1605ffebd..99c8ee7aede 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index d0b03aed986..096e664db96 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 8dbb739236a1c9e19df157e2995b97b8579ce679 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 21 Jul 2014 07:45:35 -0700 Subject: [PATCH 72/84] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/19aae827ae94 Author: Florin Strugariu Desc: Merge pull request #21992 from viorelaioia/bug_1041543 Bug 1041543 - Disable tests that update a contact, due to Bug 1041510 ======== https://hg.mozilla.org/integration/gaia-central/rev/e954c6b2be3c Author: Viorela Ioia Desc: Bug 1041543 - DIsable tests that update a contact, due to Bug 1041510 --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index d3c68585745..1a7c835b78c 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "037b908a57dbbf70146dd11446a2187d4b22fb4c", + "revision": "19aae827ae94bdfd48c403f9c4deff3ce36ebcd0", "repo_path": "/integration/gaia-central" } From 625d21f7893768246eff61d6e21443e59075580f Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 21 Jul 2014 07:47:06 -0700 Subject: [PATCH 73/84] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 58fecd2a605..1cdaefd2805 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 2a197c0c00e..f556a95894d 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 1989b381451..eab3b33b9a5 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 58fecd2a605..1cdaefd2805 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 2afeba35b16..b4f296b7093 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index a5e5fe02a5c..e7413d7f0d0 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index ec1c726d65c..cd6cc103371 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 99c8ee7aede..e2bdf88a663 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 096e664db96..e6ee82fef2c 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From f7af6f89d95600cfb9db7e4afd3f60ec7e405297 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 21 Jul 2014 08:15:35 -0700 Subject: [PATCH 74/84] Bumping gaia.json for 3 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/7f81d74e2073 Author: Kevin Grandon Desc: Bug 1041539 - Rocketbar.js, TypeError: this.handleStackChanged is not a function r=daleharvey ======== https://hg.mozilla.org/integration/gaia-central/rev/250d9feaa16b Author: Florin Strugariu Desc: Merge pull request #21993 from viorelaioia/bug-1021732 Bug 1021732 - [Flame] Re-enable test_privileged_app_contacts_prompt ======== https://hg.mozilla.org/integration/gaia-central/rev/63fe9f499649 Author: Viorela Ioia Desc: Bug 1021732 - [Flame] Re-enable test_privileged_app_contacts_prompt --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 1a7c835b78c..d35dba89890 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "19aae827ae94bdfd48c403f9c4deff3ce36ebcd0", + "revision": "7f81d74e207308fb84ea6db68ee53f036426ffd5", "repo_path": "/integration/gaia-central" } From 1de98b275f5c9f1f6d381a1ffd2a8b732f9fdf11 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 21 Jul 2014 08:21:22 -0700 Subject: [PATCH 75/84] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 1cdaefd2805..34dc7e86039 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index f556a95894d..99ac7620610 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index eab3b33b9a5..c7bfeb18f77 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 1cdaefd2805..34dc7e86039 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index b4f296b7093..0ab757f177e 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index e7413d7f0d0..b237e116756 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index cd6cc103371..6d7a9e36ede 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index e2bdf88a663..68dc8e75c17 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index e6ee82fef2c..84cc7f9ef61 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From b3a25183aacc4b2cc6520c92c84c295c0484be79 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 21 Jul 2014 08:45:36 -0700 Subject: [PATCH 76/84] Bumping gaia.json for 4 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/a24d67d3941a Author: Anthony Ricaud Desc: Merge pull request #21939 from Rik/incoming-screen-961154 Bug 961154 - When a second incoming call occurs, it does not turn the sc... r=drs ======== https://hg.mozilla.org/integration/gaia-central/rev/c5aca7a532f9 Author: Anthony Ricaud Desc: Bug 961154 - When a second incoming call occurs, it does not turn the screen on ======== https://hg.mozilla.org/integration/gaia-central/rev/21f2f7f960d9 Author: Amir Nissim Desc: Merge pull request #21964 from EverythingMe/1040618-migrate Bug 1040618 - [B2G][OTA] Several issues opening smart collections migrat... ======== https://hg.mozilla.org/integration/gaia-central/rev/f7011df19e68 Author: Amir Nissim Desc: Bug 1040618 - [B2G][OTA] Several issues opening smart collections migrated from 1.x --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index d35dba89890..6540465e7b4 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "7f81d74e207308fb84ea6db68ee53f036426ffd5", + "revision": "a24d67d3941a8d1afeaea00fb69f921d1dc5acb5", "repo_path": "/integration/gaia-central" } From f89262a89add2e54df118e00cdee15854cda101d Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 21 Jul 2014 08:56:24 -0700 Subject: [PATCH 77/84] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 34dc7e86039..4f273cdc522 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 99ac7620610..0f24dac41be 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index c7bfeb18f77..ae91bc8aef4 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 34dc7e86039..4f273cdc522 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 0ab757f177e..7191a11ade4 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index b237e116756..2ee23163b35 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 6d7a9e36ede..5cef8dbf46c 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 68dc8e75c17..39a415cac90 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 84cc7f9ef61..396f441825c 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 957c3ab4a209d2836c3069eab855d3f1ccef5cf3 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 21 Jul 2014 10:00:27 -0700 Subject: [PATCH 78/84] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/4abeb620f7a1 Author: Jared Hirsch Desc: Merge pull request #20096 from johngruen/bug-1013522-firefox-account-ui-should-match bug 1013522 firefox account ui should match ======== https://hg.mozilla.org/integration/gaia-central/rev/60217bd9de0e Author: johngruen Desc: Bug 1013522 - Firefox Accounts system app visual polish. r=ferjm --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 6540465e7b4..413cc852ebe 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "a24d67d3941a8d1afeaea00fb69f921d1dc5acb5", + "revision": "4abeb620f7a18033a8c471b3860e11b910c327ce", "repo_path": "/integration/gaia-central" } From 54f5fb6116342084bc245278feb882be7b6d6166 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 21 Jul 2014 10:06:44 -0700 Subject: [PATCH 79/84] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 4f273cdc522..08fb8d2d3a4 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 0f24dac41be..331553bd590 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index ae91bc8aef4..98c5fdb93dc 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 4f273cdc522..08fb8d2d3a4 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 7191a11ade4..5ca1d9f1782 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 2ee23163b35..c8b0b1d4e9d 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 5cef8dbf46c..795c4dee2a9 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 39a415cac90..f61223a329a 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 396f441825c..b2fa4610185 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From bb962d639eac9a2689a0a553e2e48535ce5366d8 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 21 Jul 2014 10:40:25 -0700 Subject: [PATCH 80/84] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/591c866cb04a Author: Kevin Grandon Desc: Merge pull request #21995 from KevinGrandon/bug_1041607_async_xhr_in_tests Bug 1041607 - Remove synchronous XHR from tests ======== https://hg.mozilla.org/integration/gaia-central/rev/f0666d464d19 Author: Kevin Grandon Desc: Bug 1041607 - Remove synchronous XHR from tests r=amirn --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 413cc852ebe..fcb259387da 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "4abeb620f7a18033a8c471b3860e11b910c327ce", + "revision": "591c866cb04a88306e472c873429669229f28540", "repo_path": "/integration/gaia-central" } From a9a33802f04ae1c792bd94488b725aa052210b22 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 21 Jul 2014 10:46:42 -0700 Subject: [PATCH 81/84] Bumping manifests a=b2g-bump --- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 08fb8d2d3a4..2e78d6ba8c0 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 331553bd590..8fdf4f47ef5 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 98c5fdb93dc..a564d241045 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 08fb8d2d3a4..2e78d6ba8c0 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 5ca1d9f1782..0e437edfbf8 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index c8b0b1d4e9d..d6df2c75617 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 795c4dee2a9..011d1a7303c 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index f61223a329a..088244272ce 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index b2fa4610185..ae2cc54da78 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From fe1a6d3c394abf10ac62ca63fb6a6c72e2d67dca Mon Sep 17 00:00:00 2001 From: Ed Morley Date: Mon, 21 Jul 2014 17:26:40 +0100 Subject: [PATCH 82/84] Backed out changeset ea2341b06e6f (bug 994541) for reftest timeouts --- modules/libpref/src/init/all.js | 19 ++++++++++++++++++- widget/xpwidgets/nsBaseWidget.cpp | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/modules/libpref/src/init/all.js b/modules/libpref/src/init/all.js index 8f4e881e518..cdc665afe1d 100644 --- a/modules/libpref/src/init/all.js +++ b/modules/libpref/src/init/all.js @@ -3832,7 +3832,7 @@ pref("layers.max-active", -1); pref("layers.scroll-graph", false); // Set the default values, and then override per-platform as needed -pref("layers.offmainthreadcomposition.enabled", true); +pref("layers.offmainthreadcomposition.enabled", false); // Compositor target frame rate. NOTE: If vsync is enabled the compositor // frame rate will still be capped. // -1 -> default (match layout.frame_rate or 60 FPS) @@ -3845,14 +3845,31 @@ pref("layers.async-video.enabled", true); pref("layers.async-video-oop.enabled",true); #ifdef XP_WIN +pref("layers.offmainthreadcomposition.enabled", true); // XXX - see bug 1009616 pref("layers.async-video-oop.enabled", false); #endif +#ifdef MOZ_WIDGET_QT +pref("layers.offmainthreadcomposition.enabled", true); +#endif + +#ifdef XP_MACOSX +pref("layers.offmainthreadcomposition.enabled", true); +#endif + +// ANDROID covers android and b2g +#ifdef ANDROID +pref("layers.offmainthreadcomposition.enabled", true); +#endif + // same effect as layers.offmainthreadcomposition.enabled, but specifically for // use with tests. pref("layers.offmainthreadcomposition.testing.enabled", false); +// whether to allow use of the basic compositor +pref("layers.offmainthreadcomposition.force-basic", false); + // Whether to animate simple opacity and transforms on the compositor pref("layers.offmainthreadcomposition.async-animations", false); diff --git a/widget/xpwidgets/nsBaseWidget.cpp b/widget/xpwidgets/nsBaseWidget.cpp index 07bc9817d93..c06c1967fa0 100644 --- a/widget/xpwidgets/nsBaseWidget.cpp +++ b/widget/xpwidgets/nsBaseWidget.cpp @@ -872,6 +872,20 @@ nsBaseWidget::GetPreferredCompositorBackends(nsTArray& aHints) aHints.AppendElement(LayersBackend::LAYERS_BASIC); } +static void +CheckForBasicBackends(nsTArray& aHints) +{ +#ifndef XP_WIN + for (size_t i = 0; i < aHints.Length(); ++i) { + if (aHints[i] == LayersBackend::LAYERS_BASIC && + !Preferences::GetBool("layers.offmainthreadcomposition.force-basic", false)) { + // basic compositor is not stable enough for regular use + aHints[i] = LayersBackend::LAYERS_NONE; + } + } +#endif +} + void nsBaseWidget::CreateCompositor(int aWidth, int aHeight) { MOZ_ASSERT(gfxPlatform::UsesOffMainThreadCompositing(), @@ -901,6 +915,10 @@ void nsBaseWidget::CreateCompositor(int aWidth, int aHeight) nsTArray backendHints; GetPreferredCompositorBackends(backendHints); + if (!mRequireOffMainThreadCompositing) { + CheckForBasicBackends(backendHints); + } + bool success = false; if (!backendHints.IsEmpty()) { shadowManager = mCompositorChild->SendPLayerTransactionConstructor( From 667397095fc55db587b93c6930f16b89d44b6bd1 Mon Sep 17 00:00:00 2001 From: ffxbld Date: Mon, 21 Jul 2014 14:15:06 -0700 Subject: [PATCH 83/84] No bug - Tagging mozilla-central dc23164ba2a2 with FIREFOX_AURORA_33_BASE a=release DONTBUILD CLOSED TREE --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 3a937e47a5f..83e9e78ca88 100644 --- a/.hgtags +++ b/.hgtags @@ -102,3 +102,4 @@ ba2cc1eda988a1614d8986ae145d28e1268409b9 FIREFOX_AURORA_29_BASE 83c9853e136451474dfa6d1aaa60a7fca7d2d83a FIREFOX_AURORA_30_BASE cfde3603b0206e119abea76fdd6e134b634348f1 FIREFOX_AURORA_31_BASE 16f3cac5e8fe471e12f76d6a94a477b14e78df7c FIREFOX_AURORA_32_BASE +dc23164ba2a289a8b22902e30990c77d9677c214 FIREFOX_AURORA_33_BASE From ba070e96beb5efa4c0a705b288f6df08b930d4cb Mon Sep 17 00:00:00 2001 From: ffxbld Date: Mon, 21 Jul 2014 14:19:15 -0700 Subject: [PATCH 84/84] Update configs. IGNORE BROKEN CHANGESETS CLOSED TREE NO BUG a=release ba=release --- CLOBBER | 2 +- b2g/confvars.sh | 2 +- browser/config/version.txt | 2 +- config/milestone.txt | 2 +- mobile/android/confvars.sh | 2 +- services/sync/Makefile.in | 2 +- xpcom/components/Module.h | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CLOBBER b/CLOBBER index 4c1c664b68c..d4cdfaff33d 100644 --- a/CLOBBER +++ b/CLOBBER @@ -22,4 +22,4 @@ # changes to stick? As of bug 928195, this shouldn't be necessary! Please # don't change CLOBBER for WebIDL changes any more. -Clobber to work around bug 959928. +Merge day clobber \ No newline at end of file diff --git a/b2g/confvars.sh b/b2g/confvars.sh index 817ccd3838a..f77d791fb0d 100644 --- a/b2g/confvars.sh +++ b/b2g/confvars.sh @@ -5,7 +5,7 @@ MOZ_APP_BASENAME=B2G MOZ_APP_VENDOR=Mozilla -MOZ_APP_VERSION=33.0a1 +MOZ_APP_VERSION=34.0a1 MOZ_APP_UA_NAME=Firefox MOZ_UA_OS_AGNOSTIC=1 diff --git a/browser/config/version.txt b/browser/config/version.txt index 540ef4dda30..bb12bf2e22b 100644 --- a/browser/config/version.txt +++ b/browser/config/version.txt @@ -1 +1 @@ -33.0a1 +34.0a1 diff --git a/config/milestone.txt b/config/milestone.txt index a4cfd2e6b3f..1c88b7abded 100644 --- a/config/milestone.txt +++ b/config/milestone.txt @@ -10,4 +10,4 @@ # hardcoded milestones in the tree from these two files. #-------------------------------------------------------- -33.0a1 +34.0a1 diff --git a/mobile/android/confvars.sh b/mobile/android/confvars.sh index 7677c559a26..c7d3afe5698 100644 --- a/mobile/android/confvars.sh +++ b/mobile/android/confvars.sh @@ -5,7 +5,7 @@ MOZ_APP_BASENAME=Fennec MOZ_APP_VENDOR=Mozilla -MOZ_APP_VERSION=33.0a1 +MOZ_APP_VERSION=34.0a1 MOZ_APP_UA_NAME=Firefox MOZ_BRANDING_DIRECTORY=mobile/android/branding/unofficial diff --git a/services/sync/Makefile.in b/services/sync/Makefile.in index a040adbb7a2..4ccc503eb01 100644 --- a/services/sync/Makefile.in +++ b/services/sync/Makefile.in @@ -3,7 +3,7 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # Definitions used by constants.js. -weave_version := 1.35.0 +weave_version := 1.36.0 weave_id := {340c2bbc-ce74-4362-90b5-7c26312808ef} # Preprocess files. diff --git a/xpcom/components/Module.h b/xpcom/components/Module.h index e20fc39cfc7..d2f3127f2e0 100644 --- a/xpcom/components/Module.h +++ b/xpcom/components/Module.h @@ -21,7 +21,7 @@ namespace mozilla { */ struct Module { - static const unsigned int kVersion = 33; + static const unsigned int kVersion = 34; struct CIDEntry;