From 02e2edd2692343d72d5bc21c88c40cf4fade7a1d Mon Sep 17 00:00:00 2001 From: Henry Chang Date: Mon, 18 Jan 2016 00:07:00 +0100 Subject: [PATCH 001/119] Bug 1216443 - "moz-safe-about:blank" to signed content should switch process. r=kanru --- dom/ipc/TabParent.cpp | 12 +--- netwerk/test/mochitests/mochitest.ini | 2 + ...bout_blank_to_signed_web_packaged_app.html | 64 +++++++++++++++++++ 3 files changed, 69 insertions(+), 9 deletions(-) create mode 100644 netwerk/test/mochitests/test_about_blank_to_signed_web_packaged_app.html diff --git a/dom/ipc/TabParent.cpp b/dom/ipc/TabParent.cpp index 0a51a6877a3..54cee67fa2d 100644 --- a/dom/ipc/TabParent.cpp +++ b/dom/ipc/TabParent.cpp @@ -529,15 +529,9 @@ TabParent::ShouldSwitchProcess(nsIChannel* aChannel, const nsACString& aSignedPk return false; } - // If this is a brand new process created to load the signed package - // (triggered by previous OnStartSignedPackageRequest), the loading origin - // will be "moz-safe-about:blank". In that case, we don't need to switch process - // again. We compare with "moz-safe-about:blank" without appId/isBrowserElement/etc - // taken into account. That's why we use originNoSuffix. - nsCString loadingOriginNoSuffix; - loadingPrincipal->GetOriginNoSuffix(loadingOriginNoSuffix); - if (loadingOriginNoSuffix.EqualsLiteral("moz-safe-about:blank")) { - LOG("The content is already loaded by a brand new process.\n"); + DocShellOriginAttributes attrs = OriginAttributesRef(); + if (attrs.mSignedPkg == NS_ConvertUTF8toUTF16(aSignedPkg)) { + // This tab is made for the incoming signed content. return false; } diff --git a/netwerk/test/mochitests/mochitest.ini b/netwerk/test/mochitests/mochitest.ini index 7732498b595..da5a4f8acb7 100644 --- a/netwerk/test/mochitests/mochitest.ini +++ b/netwerk/test/mochitests/mochitest.ini @@ -38,3 +38,5 @@ skip-if = buildapp == 'b2g' #no ssl support [test_idn_redirect.html] [test_origin_attributes_conversion.html] skip-if = e10s || buildapp != 'browser' +[test_about_blank_to_signed_web_packaged_app.html] +skip-if = e10s || buildapp != 'browser' \ No newline at end of file diff --git a/netwerk/test/mochitests/test_about_blank_to_signed_web_packaged_app.html b/netwerk/test/mochitests/test_about_blank_to_signed_web_packaged_app.html new file mode 100644 index 00000000000..abd70b204cc --- /dev/null +++ b/netwerk/test/mochitests/test_about_blank_to_signed_web_packaged_app.html @@ -0,0 +1,64 @@ + + + + Web packaged app + + + + + +

+ +
+
+
+ + From 66f685086419116f36ee01bd6d7d93c8aabf5e58 Mon Sep 17 00:00:00 2001 From: Honza Bambas Date: Thu, 14 Jan 2016 11:24:00 +0100 Subject: [PATCH 002/119] Bug 1220272 - Fix signalling in HTTP cache test code suspender. r=michal --- netwerk/cache2/CacheStorageService.cpp | 5 ++++- netwerk/cache2/CacheStorageService.h | 3 ++- netwerk/test/unit/test_cache2-30d-pinning-WasEvicted-API.js | 6 ++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/netwerk/cache2/CacheStorageService.cpp b/netwerk/cache2/CacheStorageService.cpp index 74b8d4f6fe4..a3dd75d2e3d 100644 --- a/netwerk/cache2/CacheStorageService.cpp +++ b/netwerk/cache2/CacheStorageService.cpp @@ -2115,7 +2115,9 @@ NS_IMETHODIMP CacheStorageService::IOThreadSuspender::Run() { MonitorAutoLock mon(mMon); - mon.Wait(); + while (!mSignaled) { + mon.Wait(); + } return NS_OK; } @@ -2123,6 +2125,7 @@ void CacheStorageService::IOThreadSuspender::Notify() { MonitorAutoLock mon(mMon); + mSignaled = true; mon.Notify(); } diff --git a/netwerk/cache2/CacheStorageService.h b/netwerk/cache2/CacheStorageService.h index 789229809f8..054dab9b67c 100644 --- a/netwerk/cache2/CacheStorageService.h +++ b/netwerk/cache2/CacheStorageService.h @@ -367,13 +367,14 @@ private: class IOThreadSuspender : public nsRunnable { public: - IOThreadSuspender() : mMon("IOThreadSuspender") { } + IOThreadSuspender() : mMon("IOThreadSuspender"), mSignaled(false) { } void Notify(); private: virtual ~IOThreadSuspender() { } NS_IMETHOD Run() override; Monitor mMon; + bool mSignaled; }; RefPtr mActiveIOSuspender; diff --git a/netwerk/test/unit/test_cache2-30d-pinning-WasEvicted-API.js b/netwerk/test/unit/test_cache2-30d-pinning-WasEvicted-API.js index 1bf0a73ef59..07105d535fc 100644 --- a/netwerk/test/unit/test_cache2-30d-pinning-WasEvicted-API.js +++ b/netwerk/test/unit/test_cache2-30d-pinning-WasEvicted-API.js @@ -4,7 +4,7 @@ This test exercises the CacheFileContextEvictor::WasEvicted API and code using i - We store 10+10 (pinned and non-pinned) entries to the cache, wait for them being written. - Then we purge the memory pools. -- Now the IO thread is suspended on the EVICT (8) level to prevent actual deletion of the files. +- Now the IO thread is suspended on the EVICT (7) level to prevent actual deletion of the files. - Index is disabled. - We do clear() of the cache, this creates the "ce_*" file and posts to the EVICT level the eviction loop mechanics. @@ -51,9 +51,9 @@ function run_test() // (1), here we start + log_("first set of opens"); var i; for (i = 0; i < kENTRYCOUNT; ++i) { - log_("first set of opens"); // Callbacks 1-20 mc.add(); @@ -100,7 +100,9 @@ function run_test() // an early check on CacheIOThread::YieldAndRerun() in that method. // CacheFileIOManager::OpenFileInternal should now run and CacheFileContextEvictor::WasEvicted // should be checked on. + log_("resuming"); testingInterface.resumeCacheIOThread(); + log_("resumed"); mc.fired(); // Finishes this test } From 520e8f8f53974e88a6157bec88352a5094ca1efc Mon Sep 17 00:00:00 2001 From: Dragana Damjanovic Date: Fri, 15 Jan 2016 08:21:00 +0100 Subject: [PATCH 003/119] Bug 1239961 - Minimize amount of PR_Poll and PR_Read calls during shutdown. r=mcmanus --- netwerk/base/nsSocketTransportService2.cpp | 12 +++++++++++- netwerk/protocol/http/nsHttpConnection.cpp | 5 +++-- netwerk/protocol/http/nsHttpConnection.h | 2 +- netwerk/protocol/http/nsHttpConnectionMgr.cpp | 2 +- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/netwerk/base/nsSocketTransportService2.cpp b/netwerk/base/nsSocketTransportService2.cpp index 491c9a0c5db..95a6f8fa2ad 100644 --- a/netwerk/base/nsSocketTransportService2.cpp +++ b/netwerk/base/nsSocketTransportService2.cpp @@ -8,6 +8,7 @@ #include "nsSocketTransport2.h" #include "NetworkActivityMonitor.h" #include "mozilla/Preferences.h" +#include "nsIOService.h" #endif // !defined(MOZILLA_XPCOMRT_API) #include "nsASocketHandler.h" #include "nsError.h" @@ -1065,7 +1066,16 @@ nsSocketTransportService::DoPollIteration(bool wait, TimeDuration *pollDuration) // Measures seconds spent while blocked on PR_Poll uint32_t pollInterval; - int32_t n = Poll(wait, &pollInterval, pollDuration); + int32_t n = 0; +#if !defined(MOZILLA_XPCOMRT_API) + if (!gIOService->IsNetTearingDown()) { + // Let's not do polling during shutdown. + n = Poll(wait, &pollInterval, pollDuration); + } +#else + n = Poll(wait, &pollInterval, pollDuration); +#endif // defined(MOZILLA_XPCOMRT_API) + if (n < 0) { SOCKET_LOG((" PR_Poll error [%d] os error [%d]\n", PR_GetError(), PR_GetOSError())); diff --git a/netwerk/protocol/http/nsHttpConnection.cpp b/netwerk/protocol/http/nsHttpConnection.cpp index dcb877ee949..968938855c8 100644 --- a/netwerk/protocol/http/nsHttpConnection.cpp +++ b/netwerk/protocol/http/nsHttpConnection.cpp @@ -558,7 +558,7 @@ nsHttpConnection::AddTransaction(nsAHttpTransaction *httpTransaction, } void -nsHttpConnection::Close(nsresult reason) +nsHttpConnection::Close(nsresult reason, bool aIsShutdown) { LOG(("nsHttpConnection::Close [this=%p reason=%x]\n", this, reason)); @@ -596,7 +596,8 @@ nsHttpConnection::Close(nsresult reason) // socket with data pending. TLS is a classic case of this where // a Alert record might be superfulous to a clean HTTP/SPDY shutdown. // Never block to do this and limit it to a small amount of data. - if (mSocketIn) { + // During shutdown just be fast! + if (mSocketIn && !aIsShutdown) { char buffer[4000]; uint32_t count, total = 0; nsresult rv; diff --git a/netwerk/protocol/http/nsHttpConnection.h b/netwerk/protocol/http/nsHttpConnection.h index 1b9db711f3f..bdf9a7cc649 100644 --- a/netwerk/protocol/http/nsHttpConnection.h +++ b/netwerk/protocol/http/nsHttpConnection.h @@ -77,7 +77,7 @@ public: nsresult Activate(nsAHttpTransaction *, uint32_t caps, int32_t pri); // Close the underlying socket transport. - void Close(nsresult reason); + void Close(nsresult reason, bool aIsShutdown = false); //------------------------------------------------------------------------- // XXX document when these are ok to call diff --git a/netwerk/protocol/http/nsHttpConnectionMgr.cpp b/netwerk/protocol/http/nsHttpConnectionMgr.cpp index 76d04539bce..dc5d8fe8234 100644 --- a/netwerk/protocol/http/nsHttpConnectionMgr.cpp +++ b/netwerk/protocol/http/nsHttpConnectionMgr.cpp @@ -998,7 +998,7 @@ nsHttpConnectionMgr::ShutdownPassCB(const nsACString &key, ent->mActiveConns.RemoveElementAt(0); self->DecrementActiveConnCount(conn); - conn->Close(NS_ERROR_ABORT); + conn->Close(NS_ERROR_ABORT, true); NS_RELEASE(conn); } From 94619712b9b18967f148baf3659be3c1bb2f093c Mon Sep 17 00:00:00 2001 From: Dragana Damjanovic Date: Mon, 18 Jan 2016 08:20:00 +0100 Subject: [PATCH 004/119] Bug 1240481 - Limit PR_Close calls during shutdown. r=mcmanus --- modules/libpref/init/all.js | 4 ++++ netwerk/base/nsIOService.cpp | 6 +++++- netwerk/base/nsIOService.h | 10 +++++++--- netwerk/base/nsSocketTransport2.cpp | 7 ++++++- netwerk/base/nsSocketTransportService2.cpp | 10 ++++++++++ netwerk/base/nsSocketTransportService2.h | 2 ++ 6 files changed, 34 insertions(+), 5 deletions(-) diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index bf535c91cb2..c9d5b04bd9e 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -1481,6 +1481,10 @@ pref("network.ftp.control.qos", 0); // The max time to spend on xpcom events between two polls in ms. pref("network.sts.max_time_for_events_between_two_polls", 100); + +// During shutdown we limit PR_Close calls. If time exceeds this pref (in ms) +// let sockets just leak. +pref("network.sts.max_time_for_pr_close_during_shutdown", 5000); // // 2147483647 == PR_INT32_MAX == ~2 GB diff --git a/netwerk/base/nsIOService.cpp b/netwerk/base/nsIOService.cpp index a72e7157932..a7860a4fdaf 100644 --- a/netwerk/base/nsIOService.cpp +++ b/netwerk/base/nsIOService.cpp @@ -190,6 +190,7 @@ nsIOService::nsIOService() , mLastOfflineStateChange(PR_IntervalNow()) , mLastConnectivityChange(PR_IntervalNow()) , mLastNetworkLinkChange(PR_IntervalNow()) + , mNetTearingDownStarted(0) { } @@ -1419,6 +1420,7 @@ nsIOService::Observe(nsISupports *subject, } else if (!strcmp(topic, kProfileChangeNetTeardownTopic)) { if (!mOffline) { mOfflineForProfileChange = true; + mNetTearingDownStarted = PR_IntervalNow(); if (gHttpHandler) { gHttpHandler->ShutdownConnectionManager(); } @@ -1447,7 +1449,9 @@ nsIOService::Observe(nsISupports *subject, // changes of the offline status from now. We must not allow going // online after this point. mShutdown = true; - + if (!mOfflineForProfileChange) { + mNetTearingDownStarted = PR_IntervalNow(); + } if (gHttpHandler) { gHttpHandler->ShutdownConnectionManager(); } diff --git a/netwerk/base/nsIOService.h b/netwerk/base/nsIOService.h index 75cdcb35d4c..73e1d42acb4 100644 --- a/netwerk/base/nsIOService.h +++ b/netwerk/base/nsIOService.h @@ -85,6 +85,7 @@ public: PRIntervalTime LastConnectivityChange() { return mLastConnectivityChange; } PRIntervalTime LastNetworkLinkChange() { return mLastNetworkLinkChange; } bool IsNetTearingDown() { return mShutdown || mOfflineForProfileChange; } + PRIntervalTime NetTearingDownStarted() { return mNetTearingDownStarted; } bool IsLinkUp(); // Should only be called from NeckoChild. Use SetAppOffline instead. @@ -180,9 +181,12 @@ private: // PR_ConnectContinue and PR_Close blocking time. If we spend very long // time in any of these functions we want to know if and what network // change has happened shortly before. - mozilla::Atomic mLastOfflineStateChange; - mozilla::Atomic mLastConnectivityChange; - mozilla::Atomic mLastNetworkLinkChange; + mozilla::Atomic mLastOfflineStateChange; + mozilla::Atomic mLastConnectivityChange; + mozilla::Atomic mLastNetworkLinkChange; + + // Time a network tearing down started. + mozilla::Atomic mNetTearingDownStarted; public: // Used for all default buffer sizes that necko allocates. static uint32_t gDefaultSegmentSize; diff --git a/netwerk/base/nsSocketTransport2.cpp b/netwerk/base/nsSocketTransport2.cpp index 7199985b095..fdc22e09d22 100644 --- a/netwerk/base/nsSocketTransport2.cpp +++ b/netwerk/base/nsSocketTransport2.cpp @@ -1748,7 +1748,12 @@ nsSocketTransport::ReleaseFD_Locked(PRFileDesc *fd) SOCKET_LOG(("JIMB: ReleaseFD_Locked: mFDref = %d\n", mFDref)); if (--mFDref == 0) { - if (PR_GetCurrentThread() == gSocketThread) { + if (gIOService->IsNetTearingDown() && + ((PR_IntervalNow() - gIOService->NetTearingDownStarted()) > + gSocketTransportService->MaxTimeForPrClosePref())) { + // If shutdown last to long, let the socket leak and do not close it. + SOCKET_LOG(("Intentional leak")); + } else if (PR_GetCurrentThread() == gSocketThread) { SOCKET_LOG(("nsSocketTransport: calling PR_Close [this=%p]\n", this)); PR_Close(mFD); } else { diff --git a/netwerk/base/nsSocketTransportService2.cpp b/netwerk/base/nsSocketTransportService2.cpp index 95a6f8fa2ad..24076912adc 100644 --- a/netwerk/base/nsSocketTransportService2.cpp +++ b/netwerk/base/nsSocketTransportService2.cpp @@ -47,6 +47,7 @@ Atomic gSocketThread; #define BLIP_INTERVAL_PREF "network.activity.blipIntervalMilliseconds" #define MAX_TIME_BETWEEN_TWO_POLLS "network.sts.max_time_for_events_between_two_polls" #define TELEMETRY_PREF "toolkit.telemetry.enabled" +#define MAX_TIME_FOR_PR_CLOSE_DURING_SHUTDOWN "network.sts.max_time_for_pr_close_during_shutdown" uint32_t nsSocketTransportService::gMaxCount; PRCallOnceType nsSocketTransportService::gMaxCountInitOnce; @@ -111,6 +112,7 @@ nsSocketTransportService::nsSocketTransportService() , mServingPendingQueue(false) , mMaxTimePerPollIter(100) , mTelemetryEnabledPref(false) + , mMaxTimeForPrClosePref(PR_SecondsToInterval(5)) , mProbedMaxCount(false) { NS_ASSERTION(NS_IsMainThread(), "wrong thread"); @@ -550,6 +552,7 @@ nsSocketTransportService::Init() tmpPrefService->AddObserver(KEEPALIVE_PROBE_COUNT_PREF, this, false); tmpPrefService->AddObserver(MAX_TIME_BETWEEN_TWO_POLLS, this, false); tmpPrefService->AddObserver(TELEMETRY_PREF, this, false); + tmpPrefService->AddObserver(MAX_TIME_FOR_PR_CLOSE_DURING_SHUTDOWN, this, false); } UpdatePrefs(); @@ -1218,6 +1221,13 @@ nsSocketTransportService::UpdatePrefs() if (NS_SUCCEEDED(rv)) { mTelemetryEnabledPref = telemetryPref; } + + int32_t maxTimeForPrClosePref; + rv = tmpPrefService->GetIntPref(MAX_TIME_FOR_PR_CLOSE_DURING_SHUTDOWN, + &maxTimeForPrClosePref); + if (NS_SUCCEEDED(rv) && maxTimeForPrClosePref >=0) { + mMaxTimeForPrClosePref = PR_MillisecondsToInterval(maxTimeForPrClosePref); + } } return NS_OK; diff --git a/netwerk/base/nsSocketTransportService2.h b/netwerk/base/nsSocketTransportService2.h index 42c7db02381..44f514740d5 100644 --- a/netwerk/base/nsSocketTransportService2.h +++ b/netwerk/base/nsSocketTransportService2.h @@ -112,6 +112,7 @@ public: bool IsKeepaliveEnabled() { return mKeepaliveEnabledPref; } bool IsTelemetryEnabled() { return mTelemetryEnabledPref; } + PRIntervalTime MaxTimeForPrClosePref() {return mMaxTimeForPrClosePref; } protected: virtual ~nsSocketTransportService(); @@ -237,6 +238,7 @@ private: mozilla::Atomic mServingPendingQueue; mozilla::Atomic mMaxTimePerPollIter; mozilla::Atomic mTelemetryEnabledPref; + mozilla::Atomic mMaxTimeForPrClosePref; void OnKeepaliveEnabledPrefChange(); void NotifyKeepaliveEnabledPrefChange(SocketContext *sock); From 475efb4355d387b75c29bd03d03c2d54144dff94 Mon Sep 17 00:00:00 2001 From: Cameron McCormack Date: Tue, 19 Jan 2016 19:23:40 +1100 Subject: [PATCH 005/119] Bug 1240635 - Interpret glyph x-offsets on SVG vertical text paths in the correct direction. r=longsonr --- layout/reftests/svg/text/reftest.list | 3 +++ layout/reftests/svg/text/textpath-vertical-dx-ref.svg | 8 ++++++++ layout/reftests/svg/text/textpath-vertical-dx.svg | 8 ++++++++ layout/svg/SVGTextFrame.cpp | 2 +- 4 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 layout/reftests/svg/text/textpath-vertical-dx-ref.svg create mode 100644 layout/reftests/svg/text/textpath-vertical-dx.svg diff --git a/layout/reftests/svg/text/reftest.list b/layout/reftests/svg/text/reftest.list index 8aa520dc4fa..976d60c9a86 100644 --- a/layout/reftests/svg/text/reftest.list +++ b/layout/reftests/svg/text/reftest.list @@ -183,6 +183,9 @@ fuzzy-if(cocoaWidget,1,6) == pattern-content.svg pattern-content-ref.svg # text and filters HTTP(../..) == filter-applied.svg filter-applied-ref.svg +# vertical text +== textpath-vertical-dx.svg textpath-vertical-dx-ref.svg + # selection needs-focus == deselectAll.svg deselectAll-ref.svg needs-focus == selectSubString.svg selectSubString-ref.svg diff --git a/layout/reftests/svg/text/textpath-vertical-dx-ref.svg b/layout/reftests/svg/text/textpath-vertical-dx-ref.svg new file mode 100644 index 00000000000..e73812b61e0 --- /dev/null +++ b/layout/reftests/svg/text/textpath-vertical-dx-ref.svg @@ -0,0 +1,8 @@ + + + + 中国 China + diff --git a/layout/reftests/svg/text/textpath-vertical-dx.svg b/layout/reftests/svg/text/textpath-vertical-dx.svg new file mode 100644 index 00000000000..92657cd3c22 --- /dev/null +++ b/layout/reftests/svg/text/textpath-vertical-dx.svg @@ -0,0 +1,8 @@ + + + + 中国 China + diff --git a/layout/svg/SVGTextFrame.cpp b/layout/svg/SVGTextFrame.cpp index 276e5cac549..dc30c23ea3b 100644 --- a/layout/svg/SVGTextFrame.cpp +++ b/layout/svg/SVGTextFrame.cpp @@ -5040,7 +5040,7 @@ SVGTextFrame::DoTextPathLayout() Float rotation = vertical ? atan2f(-tangent.x, tangent.y) : atan2f(tangent.y, tangent.x); Point normal(-tangent.y, tangent.x); // Unit vector normal to the point. - Point offsetFromPath = normal * (vertical ? mPositions[i].mPosition.x + Point offsetFromPath = normal * (vertical ? -mPositions[i].mPosition.x : mPositions[i].mPosition.y); pt += offsetFromPath; Point direction = tangent * sign; From 68e758a03eb994c640929b74499f81733e654ab8 Mon Sep 17 00:00:00 2001 From: Jean-Yves Avenard Date: Mon, 18 Jan 2016 14:22:51 +1100 Subject: [PATCH 006/119] Bug 1240411: P1. Clean up webaudio headers. r=cpearce Remove redundant virtual keyword and add missing override if any. --- dom/media/webaudio/AudioBuffer.h | 2 +- dom/media/webaudio/AudioBufferSourceNode.cpp | 28 +++++++-------- dom/media/webaudio/AudioBufferSourceNode.h | 16 ++++----- dom/media/webaudio/AudioContext.h | 2 +- dom/media/webaudio/AudioDestinationNode.cpp | 34 +++++++++---------- dom/media/webaudio/AudioDestinationNode.h | 18 +++++----- dom/media/webaudio/AudioListener.h | 2 +- dom/media/webaudio/AudioNodeEngine.h | 4 +-- .../webaudio/AudioNodeExternalInputStream.h | 3 +- dom/media/webaudio/AudioNodeStream.cpp | 22 ++++++------ dom/media/webaudio/AudioNodeStream.h | 12 +++---- dom/media/webaudio/AudioParam.h | 6 ++-- dom/media/webaudio/AudioProcessingEvent.h | 2 +- dom/media/webaudio/BiquadFilterNode.cpp | 16 ++++----- dom/media/webaudio/BiquadFilterNode.h | 8 ++--- dom/media/webaudio/BufferDecoder.h | 12 +++---- dom/media/webaudio/ChannelMergerNode.cpp | 10 +++--- dom/media/webaudio/ChannelMergerNode.h | 8 ++--- dom/media/webaudio/ChannelSplitterNode.cpp | 10 +++--- dom/media/webaudio/ChannelSplitterNode.h | 8 ++--- dom/media/webaudio/ConvolverNode.cpp | 22 ++++++------ dom/media/webaudio/ConvolverNode.h | 12 +++---- dom/media/webaudio/DelayNode.cpp | 24 ++++++------- dom/media/webaudio/DelayNode.h | 8 ++--- dom/media/webaudio/DynamicsCompressorNode.cpp | 14 ++++---- dom/media/webaudio/DynamicsCompressorNode.h | 8 ++--- dom/media/webaudio/GainNode.cpp | 14 ++++---- dom/media/webaudio/GainNode.h | 8 ++--- .../webaudio/MediaElementAudioSourceNode.h | 6 ++-- .../MediaStreamAudioDestinationNode.h | 12 +++---- .../webaudio/MediaStreamAudioSourceNode.h | 16 ++++----- .../webaudio/OfflineAudioCompletionEvent.h | 2 +- dom/media/webaudio/OscillatorNode.cpp | 22 ++++++------ dom/media/webaudio/OscillatorNode.h | 14 ++++---- dom/media/webaudio/PannerNode.cpp | 22 ++++++------ dom/media/webaudio/PannerNode.h | 14 ++++---- dom/media/webaudio/PeriodicWave.h | 2 +- dom/media/webaudio/ScriptProcessorNode.cpp | 18 +++++----- dom/media/webaudio/ScriptProcessorNode.h | 30 ++++++++-------- dom/media/webaudio/WaveShaperNode.cpp | 18 +++++----- dom/media/webaudio/WaveShaperNode.h | 8 ++--- 41 files changed, 258 insertions(+), 259 deletions(-) diff --git a/dom/media/webaudio/AudioBuffer.h b/dom/media/webaudio/AudioBuffer.h index 3680abd550d..4f5ebe32719 100644 --- a/dom/media/webaudio/AudioBuffer.h +++ b/dom/media/webaudio/AudioBuffer.h @@ -61,7 +61,7 @@ public: return parentObject; } - virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; float SampleRate() const { diff --git a/dom/media/webaudio/AudioBufferSourceNode.cpp b/dom/media/webaudio/AudioBufferSourceNode.cpp index 4774160c37f..58d6fb0ecfd 100644 --- a/dom/media/webaudio/AudioBufferSourceNode.cpp +++ b/dom/media/webaudio/AudioBufferSourceNode.cpp @@ -67,8 +67,8 @@ public: mSource = aSource; } - virtual void RecvTimelineEvent(uint32_t aIndex, - dom::AudioTimelineEvent& aEvent) override + void RecvTimelineEvent(uint32_t aIndex, + dom::AudioTimelineEvent& aEvent) override { MOZ_ASSERT(mDestination); WebAudioUtils::ConvertAudioTimelineEventToTicks(aEvent, @@ -85,7 +85,7 @@ public: NS_ERROR("Bad AudioBufferSourceNodeEngine TimelineParameter"); } } - virtual void SetStreamTimeParameter(uint32_t aIndex, StreamTime aParam) override + void SetStreamTimeParameter(uint32_t aIndex, StreamTime aParam) override { switch (aIndex) { case AudioBufferSourceNode::STOP: mStop = aParam; break; @@ -93,7 +93,7 @@ public: NS_ERROR("Bad AudioBufferSourceNodeEngine StreamTimeParameter"); } } - virtual void SetDoubleParameter(uint32_t aIndex, double aParam) override + void SetDoubleParameter(uint32_t aIndex, double aParam) override { switch (aIndex) { case AudioBufferSourceNode::START: @@ -109,7 +109,7 @@ public: NS_ERROR("Bad AudioBufferSourceNodeEngine double parameter."); }; } - virtual void SetInt32Parameter(uint32_t aIndex, int32_t aParam) override + void SetInt32Parameter(uint32_t aIndex, int32_t aParam) override { switch (aIndex) { case AudioBufferSourceNode::SAMPLE_RATE: @@ -140,7 +140,7 @@ public: NS_ERROR("Bad AudioBufferSourceNodeEngine Int32Parameter"); } } - virtual void SetBuffer(already_AddRefed aBuffer) override + void SetBuffer(already_AddRefed aBuffer) override { mBuffer = aBuffer; } @@ -461,11 +461,11 @@ public: UpdateResampler(outRate, aChannels); } - virtual void ProcessBlock(AudioNodeStream* aStream, - GraphTime aFrom, - const AudioBlock& aInput, - AudioBlock* aOutput, - bool* aFinished) override + void ProcessBlock(AudioNodeStream* aStream, + GraphTime aFrom, + const AudioBlock& aInput, + AudioBlock* aOutput, + bool* aFinished) override { if (mBufferSampleRate == 0) { // start() has not yet been called or no buffer has yet been set @@ -515,13 +515,13 @@ public: } } - virtual bool IsActive() const override + bool IsActive() const override { // Whether buffer has been set and start() has been called. return mBufferSampleRate != 0; } - virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override + size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override { // Not owned: // - mBuffer - shared w/ AudioNode @@ -542,7 +542,7 @@ public: return amount; } - virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override + size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override { return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf); } diff --git a/dom/media/webaudio/AudioBufferSourceNode.h b/dom/media/webaudio/AudioBufferSourceNode.h index 0362a7072c8..d982ec5cce8 100644 --- a/dom/media/webaudio/AudioBufferSourceNode.h +++ b/dom/media/webaudio/AudioBufferSourceNode.h @@ -21,20 +21,20 @@ class AudioBufferSourceNode final : public AudioNode, public: explicit AudioBufferSourceNode(AudioContext* aContext); - virtual void DestroyMediaStream() override; + void DestroyMediaStream() override; - virtual uint16_t NumberOfInputs() const final override + uint16_t NumberOfInputs() const final override { return 0; } - virtual AudioBufferSourceNode* AsAudioBufferSourceNode() override + AudioBufferSourceNode* AsAudioBufferSourceNode() override { return this; } NS_DECL_ISUPPORTS_INHERITED NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(AudioBufferSourceNode, AudioNode) - virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; void Start(double aWhen, double aOffset, const Optional& aDuration, ErrorResult& aRv); @@ -89,15 +89,15 @@ public: IMPL_EVENT_HANDLER(ended) - virtual void NotifyMainThreadStreamFinished() override; + void NotifyMainThreadStreamFinished() override; - virtual const char* NodeType() const override + const char* NodeType() const override { return "AudioBufferSourceNode"; } - virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override; - virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override; + size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override; + size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override; protected: virtual ~AudioBufferSourceNode(); diff --git a/dom/media/webaudio/AudioContext.h b/dom/media/webaudio/AudioContext.h index 7ec1956d194..7f593100e70 100644 --- a/dom/media/webaudio/AudioContext.h +++ b/dom/media/webaudio/AudioContext.h @@ -141,7 +141,7 @@ public: void Shutdown(); // idempotent - virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; using DOMEventTargetHelper::DispatchTrustedEvent; diff --git a/dom/media/webaudio/AudioDestinationNode.cpp b/dom/media/webaudio/AudioDestinationNode.cpp index 0643d5db21c..5be0684e202 100644 --- a/dom/media/webaudio/AudioDestinationNode.cpp +++ b/dom/media/webaudio/AudioDestinationNode.cpp @@ -45,11 +45,11 @@ public: { } - virtual void ProcessBlock(AudioNodeStream* aStream, - GraphTime aFrom, - const AudioBlock& aInput, - AudioBlock* aOutput, - bool* aFinished) override + void ProcessBlock(AudioNodeStream* aStream, + GraphTime aFrom, + const AudioBlock& aInput, + AudioBlock* aOutput, + bool* aFinished) override { // Do this just for the sake of political correctness; this output // will not go anywhere. @@ -113,7 +113,7 @@ public: } } - virtual bool IsActive() const override + bool IsActive() const override { // Keep processing to track stream time, which is used for all timelines // associated with the same AudioContext. @@ -175,7 +175,7 @@ public: context->OnStateChanged(nullptr, AudioContextState::Closed); } - virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override + size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override { size_t amount = AudioNodeEngine::SizeOfExcludingThis(aMallocSizeOf); if (mBuffer) { @@ -184,7 +184,7 @@ public: return amount; } - virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override + size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override { return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf); } @@ -243,11 +243,11 @@ public: MOZ_ASSERT(aNode); } - virtual void ProcessBlock(AudioNodeStream* aStream, - GraphTime aFrom, - const AudioBlock& aInput, - AudioBlock* aOutput, - bool* aFinished) override + void ProcessBlock(AudioNodeStream* aStream, + GraphTime aFrom, + const AudioBlock& aInput, + AudioBlock* aOutput, + bool* aFinished) override { *aOutput = aInput; aOutput->mVolume *= mVolume; @@ -267,7 +267,7 @@ public: } } - virtual bool IsActive() const override + bool IsActive() const override { // Keep processing to track stream time, which is used for all timelines // associated with the same AudioContext. If there are no other engines @@ -277,14 +277,14 @@ public: return true; } - virtual void SetDoubleParameter(uint32_t aIndex, double aParam) override + void SetDoubleParameter(uint32_t aIndex, double aParam) override { if (aIndex == VOLUME) { mVolume = aParam; } } - virtual void SetInt32Parameter(uint32_t aIndex, int32_t aParam) override + void SetInt32Parameter(uint32_t aIndex, int32_t aParam) override { if (aIndex == SUSPENDED) { mSuspended = !!aParam; @@ -299,7 +299,7 @@ public: SUSPENDED, }; - virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override + size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override { return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf); } diff --git a/dom/media/webaudio/AudioDestinationNode.h b/dom/media/webaudio/AudioDestinationNode.h index ead5dfe0204..96a14e43556 100644 --- a/dom/media/webaudio/AudioDestinationNode.h +++ b/dom/media/webaudio/AudioDestinationNode.h @@ -30,22 +30,22 @@ public: uint32_t aLength = 0, float aSampleRate = 0.0f); - virtual void DestroyMediaStream() override; + void DestroyMediaStream() override; NS_DECL_ISUPPORTS_INHERITED NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(AudioDestinationNode, AudioNode) NS_DECL_NSIAUDIOCHANNELAGENTCALLBACK - virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; - virtual uint16_t NumberOfOutputs() const final override + uint16_t NumberOfOutputs() const final override { return 0; } uint32_t MaxChannelCount() const; - virtual void SetChannelCount(uint32_t aChannelCount, - ErrorResult& aRv) override; + void SetChannelCount(uint32_t aChannelCount, + ErrorResult& aRv) override; // Returns the stream or null after unlink. AudioNodeStream* Stream() { return mStream; } @@ -62,7 +62,7 @@ public: AudioChannel MozAudioChannelType() const; - virtual void NotifyMainThreadStreamFinished() override; + void NotifyMainThreadStreamFinished() override; void FireOfflineCompletionEvent(); // An amount that should be added to the MediaStream's current time to @@ -75,13 +75,13 @@ public: nsresult CreateAudioChannelAgent(); void DestroyAudioChannelAgent(); - virtual const char* NodeType() const override + const char* NodeType() const override { return "AudioDestinationNode"; } - virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override; - virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override; + size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override; + size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override; void InputMuted(bool aInputMuted); void ResolvePromise(AudioBuffer* aRenderedBuffer); diff --git a/dom/media/webaudio/AudioListener.h b/dom/media/webaudio/AudioListener.h index 052e20987f6..c6ad08b0679 100644 --- a/dom/media/webaudio/AudioListener.h +++ b/dom/media/webaudio/AudioListener.h @@ -37,7 +37,7 @@ public: return mContext; } - virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; double DopplerFactor() const { diff --git a/dom/media/webaudio/AudioNodeEngine.h b/dom/media/webaudio/AudioNodeEngine.h index 97619c5390c..51e64f7f593 100644 --- a/dom/media/webaudio/AudioNodeEngine.h +++ b/dom/media/webaudio/AudioNodeEngine.h @@ -111,7 +111,7 @@ public: */ void Clear() { mContents.Clear(); } - virtual size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const override + size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const override { size_t amount = ThreadSharedObject::SizeOfExcludingThis(aMallocSizeOf); amount += mContents.ShallowSizeOfExcludingThis(aMallocSizeOf); @@ -122,7 +122,7 @@ public: return amount; } - virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override + size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override { return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf); } diff --git a/dom/media/webaudio/AudioNodeExternalInputStream.h b/dom/media/webaudio/AudioNodeExternalInputStream.h index 89d39d432e3..83d2bba749d 100644 --- a/dom/media/webaudio/AudioNodeExternalInputStream.h +++ b/dom/media/webaudio/AudioNodeExternalInputStream.h @@ -29,8 +29,7 @@ protected: ~AudioNodeExternalInputStream(); public: - virtual void ProcessInput(GraphTime aFrom, GraphTime aTo, - uint32_t aFlags) override; + void ProcessInput(GraphTime aFrom, GraphTime aTo, uint32_t aFlags) override; private: /** diff --git a/dom/media/webaudio/AudioNodeStream.cpp b/dom/media/webaudio/AudioNodeStream.cpp index 87593d14feb..08c9f1a5a7e 100644 --- a/dom/media/webaudio/AudioNodeStream.cpp +++ b/dom/media/webaudio/AudioNodeStream.cpp @@ -137,7 +137,7 @@ AudioNodeStream::SetStreamTimeParameter(uint32_t aIndex, AudioContext* aContext, : ControlMessage(aStream), mStreamTime(aStreamTime), mRelativeToStream(aRelativeToStream), mIndex(aIndex) {} - virtual void Run() override + void Run() override { static_cast(mStream)-> SetStreamTimeParameterImpl(mIndex, mRelativeToStream, mStreamTime); @@ -169,7 +169,7 @@ AudioNodeStream::SetDoubleParameter(uint32_t aIndex, double aValue) Message(AudioNodeStream* aStream, uint32_t aIndex, double aValue) : ControlMessage(aStream), mValue(aValue), mIndex(aIndex) {} - virtual void Run() override + void Run() override { static_cast(mStream)->Engine()-> SetDoubleParameter(mIndex, mValue); @@ -190,7 +190,7 @@ AudioNodeStream::SetInt32Parameter(uint32_t aIndex, int32_t aValue) Message(AudioNodeStream* aStream, uint32_t aIndex, int32_t aValue) : ControlMessage(aStream), mValue(aValue), mIndex(aIndex) {} - virtual void Run() override + void Run() override { static_cast(mStream)->Engine()-> SetInt32Parameter(mIndex, mValue); @@ -216,7 +216,7 @@ AudioNodeStream::SendTimelineEvent(uint32_t aIndex, mSampleRate(aStream->SampleRate()), mIndex(aIndex) {} - virtual void Run() override + void Run() override { static_cast(mStream)->Engine()-> RecvTimelineEvent(mIndex, mEvent); @@ -237,7 +237,7 @@ AudioNodeStream::SetThreeDPointParameter(uint32_t aIndex, const ThreeDPoint& aVa Message(AudioNodeStream* aStream, uint32_t aIndex, const ThreeDPoint& aValue) : ControlMessage(aStream), mValue(aValue), mIndex(aIndex) {} - virtual void Run() override + void Run() override { static_cast(mStream)->Engine()-> SetThreeDPointParameter(mIndex, mValue); @@ -259,7 +259,7 @@ AudioNodeStream::SetBuffer(already_AddRefed&& already_AddRefed& aBuffer) : ControlMessage(aStream), mBuffer(aBuffer) {} - virtual void Run() override + void Run() override { static_cast(mStream)->Engine()-> SetBuffer(mBuffer.forget()); @@ -282,7 +282,7 @@ AudioNodeStream::SetRawArrayData(nsTArray& aData) { mData.SwapElements(aData); } - virtual void Run() override + void Run() override { static_cast(mStream)->Engine()->SetRawArrayData(mData); } @@ -309,7 +309,7 @@ AudioNodeStream::SetChannelMixingParameters(uint32_t aNumberOfChannels, mChannelCountMode(aChannelCountMode), mChannelInterpretation(aChannelInterpretation) {} - virtual void Run() override + void Run() override { static_cast(mStream)-> SetChannelMixingParametersImpl(mNumberOfChannels, mChannelCountMode, @@ -334,7 +334,7 @@ AudioNodeStream::SetPassThrough(bool aPassThrough) Message(AudioNodeStream* aStream, bool aPassThrough) : ControlMessage(aStream), mPassThrough(aPassThrough) {} - virtual void Run() override + void Run() override { static_cast(mStream)->mPassThrough = mPassThrough; } @@ -381,7 +381,7 @@ class AudioNodeStream::AdvanceAndResumeMessage final : public ControlMessage { public: AdvanceAndResumeMessage(AudioNodeStream* aStream, StreamTime aAdvance) : ControlMessage(aStream), mAdvance(aAdvance) {} - virtual void Run() override + void Run() override { auto ns = static_cast(mStream); ns->mBufferStartTime -= mAdvance; @@ -717,7 +717,7 @@ class AudioNodeStream::CheckForInactiveMessage final : public ControlMessage public: explicit CheckForInactiveMessage(AudioNodeStream* aStream) : ControlMessage(aStream) {} - virtual void Run() override + void Run() override { auto ns = static_cast(mStream); ns->CheckForInactive(); diff --git a/dom/media/webaudio/AudioNodeStream.h b/dom/media/webaudio/AudioNodeStream.h index c9a17e53c77..f0832e072ba 100644 --- a/dom/media/webaudio/AudioNodeStream.h +++ b/dom/media/webaudio/AudioNodeStream.h @@ -114,9 +114,9 @@ public: */ void AdvanceAndResume(StreamTime aAdvance); - virtual AudioNodeStream* AsAudioNodeStream() override { return this; } - virtual void AddInput(MediaInputPort* aPort) override; - virtual void RemoveInput(MediaInputPort* aPort) override; + AudioNodeStream* AsAudioNodeStream() override { return this; } + void AddInput(MediaInputPort* aPort) override; + void RemoveInput(MediaInputPort* aPort) override; // Graph thread only void SetStreamTimeParameterImpl(uint32_t aIndex, MediaStream* aRelativeToStream, @@ -124,7 +124,7 @@ public: void SetChannelMixingParametersImpl(uint32_t aNumberOfChannels, ChannelCountMode aChannelCountMoe, ChannelInterpretation aChannelInterpretation); - virtual void ProcessInput(GraphTime aFrom, GraphTime aTo, uint32_t aFlags) override; + void ProcessInput(GraphTime aFrom, GraphTime aTo, uint32_t aFlags) override; /** * Produce the next block of output, before input is provided. * ProcessInput() will be called later, and it then should not change @@ -140,7 +140,7 @@ public: { return mLastChunks; } - virtual bool MainThreadNeedsUpdates() const override + bool MainThreadNeedsUpdates() const override { return ((mFlags & NEED_MAIN_THREAD_FINISHED) && mFinished) || (mFlags & NEED_MAIN_THREAD_CURRENT_TIME); @@ -175,7 +175,7 @@ protected: class AdvanceAndResumeMessage; class CheckForInactiveMessage; - virtual void DestroyImpl() override; + void DestroyImpl() override; /* * CheckForInactive() is called when the engine transitions from active to diff --git a/dom/media/webaudio/AudioParam.h b/dom/media/webaudio/AudioParam.h index 5f7e0f43484..f3219514569 100644 --- a/dom/media/webaudio/AudioParam.h +++ b/dom/media/webaudio/AudioParam.h @@ -40,7 +40,7 @@ public: return mNode->Context(); } - virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; // We override SetValueCurveAtTime to convert the Float32Array to the wrapper // object. @@ -163,7 +163,7 @@ public: // May create the stream if it doesn't exist MediaStream* Stream(); - virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override + size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override { size_t amount = AudioParamTimeline::SizeOfExcludingThis(aMallocSizeOf); // Not owned: @@ -179,7 +179,7 @@ public: return amount; } - virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override + size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override { return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf); } diff --git a/dom/media/webaudio/AudioProcessingEvent.h b/dom/media/webaudio/AudioProcessingEvent.h index 5eb44160a1a..7b3b54d3edd 100644 --- a/dom/media/webaudio/AudioProcessingEvent.h +++ b/dom/media/webaudio/AudioProcessingEvent.h @@ -25,7 +25,7 @@ public: NS_FORWARD_TO_EVENT NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(AudioProcessingEvent, Event) - virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle aGivenProto) override; void InitEvent(AudioBuffer* aInputBuffer, uint32_t aNumberOfInputChannels, diff --git a/dom/media/webaudio/BiquadFilterNode.cpp b/dom/media/webaudio/BiquadFilterNode.cpp index c89ebd5cfa8..adde0e88b5a 100644 --- a/dom/media/webaudio/BiquadFilterNode.cpp +++ b/dom/media/webaudio/BiquadFilterNode.cpp @@ -131,11 +131,11 @@ public: } } - virtual void ProcessBlock(AudioNodeStream* aStream, - GraphTime aFrom, - const AudioBlock& aInput, - AudioBlock* aOutput, - bool* aFinished) override + void ProcessBlock(AudioNodeStream* aStream, + GraphTime aFrom, + const AudioBlock& aInput, + AudioBlock* aOutput, + bool* aFinished) override { float inputBuffer[WEBAUDIO_BLOCK_SIZE]; @@ -207,12 +207,12 @@ public: } } - virtual bool IsActive() const override + bool IsActive() const override { return !mBiquads.IsEmpty(); } - virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override + size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override { // Not owned: // - mDestination - probably not owned @@ -222,7 +222,7 @@ public: return amount; } - virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override + size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override { return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf); } diff --git a/dom/media/webaudio/BiquadFilterNode.h b/dom/media/webaudio/BiquadFilterNode.h index 5a614bf784b..f81c623f0b1 100644 --- a/dom/media/webaudio/BiquadFilterNode.h +++ b/dom/media/webaudio/BiquadFilterNode.h @@ -24,7 +24,7 @@ public: NS_DECL_ISUPPORTS_INHERITED NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(BiquadFilterNode, AudioNode) - virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; BiquadFilterType Type() const { @@ -56,13 +56,13 @@ public: const Float32Array& aMagResponse, const Float32Array& aPhaseResponse); - virtual const char* NodeType() const override + const char* NodeType() const override { return "BiquadFilterNode"; } - virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override; - virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override; + size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override; + size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override; protected: virtual ~BiquadFilterNode(); diff --git a/dom/media/webaudio/BufferDecoder.h b/dom/media/webaudio/BufferDecoder.h index f12a032e584..8cf8edf4c81 100644 --- a/dom/media/webaudio/BufferDecoder.h +++ b/dom/media/webaudio/BufferDecoder.h @@ -31,15 +31,15 @@ public: // This has to be called before decoding begins void BeginDecoding(TaskQueue* aTaskQueueIdentity); - virtual MediaResource* GetResource() const final override; + MediaResource* GetResource() const final override; - virtual void NotifyDecodedFrames(uint32_t aParsed, uint32_t aDecoded, - uint32_t aDropped) final override; + void NotifyDecodedFrames(uint32_t aParsed, uint32_t aDecoded, + uint32_t aDropped) final override; - virtual VideoFrameContainer* GetVideoFrameContainer() final override; - virtual layers::ImageContainer* GetImageContainer() final override; + VideoFrameContainer* GetVideoFrameContainer() final override; + layers::ImageContainer* GetImageContainer() final override; - virtual MediaDecoderOwner* GetOwner() final override; + MediaDecoderOwner* GetOwner() final override; private: virtual ~BufferDecoder(); diff --git a/dom/media/webaudio/ChannelMergerNode.cpp b/dom/media/webaudio/ChannelMergerNode.cpp index 4e18f823be3..6c025b1f377 100644 --- a/dom/media/webaudio/ChannelMergerNode.cpp +++ b/dom/media/webaudio/ChannelMergerNode.cpp @@ -23,10 +23,10 @@ public: MOZ_ASSERT(NS_IsMainThread()); } - virtual void ProcessBlocksOnPorts(AudioNodeStream* aStream, - const OutputChunks& aInput, - OutputChunks& aOutput, - bool* aFinished) override + void ProcessBlocksOnPorts(AudioNodeStream* aStream, + const OutputChunks& aInput, + OutputChunks& aOutput, + bool* aFinished) override { MOZ_ASSERT(aInput.Length() >= 1, "Should have one or more input ports"); @@ -55,7 +55,7 @@ public: } } - virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override + size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override { return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf); } diff --git a/dom/media/webaudio/ChannelMergerNode.h b/dom/media/webaudio/ChannelMergerNode.h index 772c3a879c4..d064c8e236b 100644 --- a/dom/media/webaudio/ChannelMergerNode.h +++ b/dom/media/webaudio/ChannelMergerNode.h @@ -22,16 +22,16 @@ public: NS_DECL_ISUPPORTS_INHERITED - virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; - virtual uint16_t NumberOfInputs() const override { return mInputCount; } + uint16_t NumberOfInputs() const override { return mInputCount; } - virtual const char* NodeType() const override + const char* NodeType() const override { return "ChannelMergerNode"; } - virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override + size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override { return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf); } diff --git a/dom/media/webaudio/ChannelSplitterNode.cpp b/dom/media/webaudio/ChannelSplitterNode.cpp index 8bf1d3bddc9..eb8e6356dee 100644 --- a/dom/media/webaudio/ChannelSplitterNode.cpp +++ b/dom/media/webaudio/ChannelSplitterNode.cpp @@ -23,10 +23,10 @@ public: MOZ_ASSERT(NS_IsMainThread()); } - virtual void ProcessBlocksOnPorts(AudioNodeStream* aStream, - const OutputChunks& aInput, - OutputChunks& aOutput, - bool* aFinished) override + void ProcessBlocksOnPorts(AudioNodeStream* aStream, + const OutputChunks& aInput, + OutputChunks& aOutput, + bool* aFinished) override { MOZ_ASSERT(aInput.Length() == 1, "Should only have one input port"); @@ -46,7 +46,7 @@ public: } } - virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override + size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override { return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf); } diff --git a/dom/media/webaudio/ChannelSplitterNode.h b/dom/media/webaudio/ChannelSplitterNode.h index f23603cfa9d..3b267eccc50 100644 --- a/dom/media/webaudio/ChannelSplitterNode.h +++ b/dom/media/webaudio/ChannelSplitterNode.h @@ -22,16 +22,16 @@ public: NS_DECL_ISUPPORTS_INHERITED - virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; - virtual uint16_t NumberOfOutputs() const override { return mOutputCount; } + uint16_t NumberOfOutputs() const override { return mOutputCount; } - virtual const char* NodeType() const override + const char* NodeType() const override { return "ChannelSplitterNode"; } - virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override + size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override { return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf); } diff --git a/dom/media/webaudio/ConvolverNode.cpp b/dom/media/webaudio/ConvolverNode.cpp index 7764617422d..30292b0f4cf 100644 --- a/dom/media/webaudio/ConvolverNode.cpp +++ b/dom/media/webaudio/ConvolverNode.cpp @@ -41,7 +41,7 @@ public: SAMPLE_RATE, NORMALIZE }; - virtual void SetInt32Parameter(uint32_t aIndex, int32_t aParam) override + void SetInt32Parameter(uint32_t aIndex, int32_t aParam) override { switch (aIndex) { case BUFFER_LENGTH: @@ -62,7 +62,7 @@ public: NS_ERROR("Bad ConvolverNodeEngine Int32Parameter"); } } - virtual void SetDoubleParameter(uint32_t aIndex, double aParam) override + void SetDoubleParameter(uint32_t aIndex, double aParam) override { switch (aIndex) { case SAMPLE_RATE: @@ -73,7 +73,7 @@ public: NS_ERROR("Bad ConvolverNodeEngine DoubleParameter"); } } - virtual void SetBuffer(already_AddRefed aBuffer) override + void SetBuffer(already_AddRefed aBuffer) override { mBuffer = aBuffer; AdjustReverb(); @@ -100,11 +100,11 @@ public: mNormalize, mSampleRate); } - virtual void ProcessBlock(AudioNodeStream* aStream, - GraphTime aFrom, - const AudioBlock& aInput, - AudioBlock* aOutput, - bool* aFinished) override + void ProcessBlock(AudioNodeStream* aStream, + GraphTime aFrom, + const AudioBlock& aInput, + AudioBlock* aOutput, + bool* aFinished) override { if (!mReverb) { aOutput->SetNull(WEBAUDIO_BLOCK_SIZE); @@ -155,12 +155,12 @@ public: mReverb->process(&input, aOutput); } - virtual bool IsActive() const override + bool IsActive() const override { return mLeftOverData != INT32_MIN; } - virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override + size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override { size_t amount = AudioNodeEngine::SizeOfExcludingThis(aMallocSizeOf); if (mBuffer && !mBuffer->IsShared()) { @@ -174,7 +174,7 @@ public: return amount; } - virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override + size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override { return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf); } diff --git a/dom/media/webaudio/ConvolverNode.h b/dom/media/webaudio/ConvolverNode.h index baa7f377bce..53cff9d273c 100644 --- a/dom/media/webaudio/ConvolverNode.h +++ b/dom/media/webaudio/ConvolverNode.h @@ -21,7 +21,7 @@ public: NS_DECL_ISUPPORTS_INHERITED NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(ConvolverNode, AudioNode); - virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; AudioBuffer* GetBuffer(JSContext* aCx) const { @@ -37,7 +37,7 @@ public: void SetNormalize(bool aNormal); - virtual void SetChannelCount(uint32_t aChannelCount, ErrorResult& aRv) override + void SetChannelCount(uint32_t aChannelCount, ErrorResult& aRv) override { if (aChannelCount > 2) { aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR); @@ -45,7 +45,7 @@ public: } AudioNode::SetChannelCount(aChannelCount, aRv); } - virtual void SetChannelCountModeValue(ChannelCountMode aMode, ErrorResult& aRv) override + void SetChannelCountModeValue(ChannelCountMode aMode, ErrorResult& aRv) override { if (aMode == ChannelCountMode::Max) { aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR); @@ -54,13 +54,13 @@ public: AudioNode::SetChannelCountModeValue(aMode, aRv); } - virtual const char* NodeType() const override + const char* NodeType() const override { return "ConvolverNode"; } - virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override; - virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override; + size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override; + size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override; protected: virtual ~ConvolverNode(); diff --git a/dom/media/webaudio/DelayNode.cpp b/dom/media/webaudio/DelayNode.cpp index 6fd1616c9cc..f772d8504fb 100644 --- a/dom/media/webaudio/DelayNode.cpp +++ b/dom/media/webaudio/DelayNode.cpp @@ -46,7 +46,7 @@ public: { } - virtual DelayNodeEngine* AsDelayNodeEngine() override + DelayNodeEngine* AsDelayNodeEngine() override { return this; } @@ -70,11 +70,11 @@ public: } } - virtual void ProcessBlock(AudioNodeStream* aStream, - GraphTime aFrom, - const AudioBlock& aInput, - AudioBlock* aOutput, - bool* aFinished) override + void ProcessBlock(AudioNodeStream* aStream, + GraphTime aFrom, + const AudioBlock& aInput, + AudioBlock* aOutput, + bool* aFinished) override { MOZ_ASSERT(aStream->SampleRate() == mDestination->SampleRate()); @@ -149,9 +149,9 @@ public: } } - virtual void ProduceBlockBeforeInput(AudioNodeStream* aStream, - GraphTime aFrom, - AudioBlock* aOutput) override + void ProduceBlockBeforeInput(AudioNodeStream* aStream, + GraphTime aFrom, + AudioBlock* aOutput) override { if (mLeftOverData <= 0) { aOutput->SetNull(WEBAUDIO_BLOCK_SIZE); @@ -161,12 +161,12 @@ public: mHaveProducedBeforeInput = true; } - virtual bool IsActive() const override + bool IsActive() const override { return mLeftOverData != INT32_MIN; } - virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override + size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override { size_t amount = AudioNodeEngine::SizeOfExcludingThis(aMallocSizeOf); // Not owned: @@ -176,7 +176,7 @@ public: return amount; } - virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override + size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override { return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf); } diff --git a/dom/media/webaudio/DelayNode.h b/dom/media/webaudio/DelayNode.h index 433ad272fe3..dfee970bc34 100644 --- a/dom/media/webaudio/DelayNode.h +++ b/dom/media/webaudio/DelayNode.h @@ -23,20 +23,20 @@ public: NS_DECL_ISUPPORTS_INHERITED NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(DelayNode, AudioNode) - virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; AudioParam* DelayTime() const { return mDelay; } - virtual const char* NodeType() const override + const char* NodeType() const override { return "DelayNode"; } - virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override; - virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override; + size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override; + size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override; protected: virtual ~DelayNode(); diff --git a/dom/media/webaudio/DynamicsCompressorNode.cpp b/dom/media/webaudio/DynamicsCompressorNode.cpp index d23694a2d74..f9e86a6f3b6 100644 --- a/dom/media/webaudio/DynamicsCompressorNode.cpp +++ b/dom/media/webaudio/DynamicsCompressorNode.cpp @@ -84,11 +84,11 @@ public: } } - virtual void ProcessBlock(AudioNodeStream* aStream, - GraphTime aFrom, - const AudioBlock& aInput, - AudioBlock* aOutput, - bool* aFinished) override + void ProcessBlock(AudioNodeStream* aStream, + GraphTime aFrom, + const AudioBlock& aInput, + AudioBlock* aOutput, + bool* aFinished) override { if (aInput.IsNull()) { // Just output silence @@ -122,7 +122,7 @@ public: mCompressor->parameterValue(DynamicsCompressor::ParamReduction)); } - virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override + size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override { // Not owned: // - mDestination (probably) @@ -133,7 +133,7 @@ public: return amount; } - virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override + size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override { return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf); } diff --git a/dom/media/webaudio/DynamicsCompressorNode.h b/dom/media/webaudio/DynamicsCompressorNode.h index 9e393105f63..5bdd5f2d04f 100644 --- a/dom/media/webaudio/DynamicsCompressorNode.h +++ b/dom/media/webaudio/DynamicsCompressorNode.h @@ -23,7 +23,7 @@ public: NS_DECL_ISUPPORTS_INHERITED NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(DynamicsCompressorNode, AudioNode) - virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; AudioParam* Threshold() const { @@ -56,13 +56,13 @@ public: return mReduction; } - virtual const char* NodeType() const override + const char* NodeType() const override { return "DynamicsCompressorNode"; } - virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override; - virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override; + size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override; + size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override; void SetReduction(float aReduction) { diff --git a/dom/media/webaudio/GainNode.cpp b/dom/media/webaudio/GainNode.cpp index c376be70032..4fb32e87973 100644 --- a/dom/media/webaudio/GainNode.cpp +++ b/dom/media/webaudio/GainNode.cpp @@ -53,11 +53,11 @@ public: } } - virtual void ProcessBlock(AudioNodeStream* aStream, - GraphTime aFrom, - const AudioBlock& aInput, - AudioBlock* aOutput, - bool* aFinished) override + void ProcessBlock(AudioNodeStream* aStream, + GraphTime aFrom, + const AudioBlock& aInput, + AudioBlock* aOutput, + bool* aFinished) override { if (aInput.IsNull()) { // If input is silent, so is the output @@ -95,7 +95,7 @@ public: } } - virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override + size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override { // Not owned: // - mDestination (probably) @@ -103,7 +103,7 @@ public: return AudioNodeEngine::SizeOfExcludingThis(aMallocSizeOf); } - virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override + size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override { return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf); } diff --git a/dom/media/webaudio/GainNode.h b/dom/media/webaudio/GainNode.h index 1baed74662f..aab22ad65eb 100644 --- a/dom/media/webaudio/GainNode.h +++ b/dom/media/webaudio/GainNode.h @@ -23,20 +23,20 @@ public: NS_DECL_ISUPPORTS_INHERITED NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(GainNode, AudioNode) - virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; AudioParam* Gain() const { return mGain; } - virtual const char* NodeType() const override + const char* NodeType() const override { return "GainNode"; } - virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override; - virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override; + size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override; + size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override; protected: virtual ~GainNode(); diff --git a/dom/media/webaudio/MediaElementAudioSourceNode.h b/dom/media/webaudio/MediaElementAudioSourceNode.h index 3365dff3f68..1a77dd964a6 100644 --- a/dom/media/webaudio/MediaElementAudioSourceNode.h +++ b/dom/media/webaudio/MediaElementAudioSourceNode.h @@ -18,14 +18,14 @@ public: static already_AddRefed Create(AudioContext* aContext, DOMMediaStream* aStream, ErrorResult& aRv); - virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; - virtual const char* NodeType() const override + const char* NodeType() const override { return "MediaElementAudioSourceNode"; } - virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override + size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override { return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf); } diff --git a/dom/media/webaudio/MediaStreamAudioDestinationNode.h b/dom/media/webaudio/MediaStreamAudioDestinationNode.h index 6621045511d..6c033b46608 100644 --- a/dom/media/webaudio/MediaStreamAudioDestinationNode.h +++ b/dom/media/webaudio/MediaStreamAudioDestinationNode.h @@ -20,27 +20,27 @@ public: NS_DECL_ISUPPORTS_INHERITED NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(MediaStreamAudioDestinationNode, AudioNode) - virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; - virtual uint16_t NumberOfOutputs() const final override + uint16_t NumberOfOutputs() const final override { return 0; } - virtual void DestroyMediaStream() override; + void DestroyMediaStream() override; DOMMediaStream* DOMStream() const { return mDOMStream; } - virtual const char* NodeType() const override + const char* NodeType() const override { return "MediaStreamAudioDestinationNode"; } - virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override; - virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override; + size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override; + size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override; protected: virtual ~MediaStreamAudioDestinationNode(); diff --git a/dom/media/webaudio/MediaStreamAudioSourceNode.h b/dom/media/webaudio/MediaStreamAudioSourceNode.h index 7356a81c655..c75fdb9e49f 100644 --- a/dom/media/webaudio/MediaStreamAudioSourceNode.h +++ b/dom/media/webaudio/MediaStreamAudioSourceNode.h @@ -25,7 +25,7 @@ public: enum Parameters { ENABLE }; - virtual void SetInt32Parameter(uint32_t aIndex, int32_t aValue) override + void SetInt32Parameter(uint32_t aIndex, int32_t aValue) override { switch (aIndex) { case ENABLE: @@ -50,21 +50,21 @@ public: NS_DECL_ISUPPORTS_INHERITED NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(MediaStreamAudioSourceNode, AudioNode) - virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; - virtual void DestroyMediaStream() override; + void DestroyMediaStream() override; - virtual uint16_t NumberOfInputs() const override { return 0; } + uint16_t NumberOfInputs() const override { return 0; } - virtual const char* NodeType() const override + const char* NodeType() const override { return "MediaStreamAudioSourceNode"; } - virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override; - virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override; + size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override; + size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override; - virtual void PrincipalChanged(DOMMediaStream* aMediaStream) override; + void PrincipalChanged(DOMMediaStream* aMediaStream) override; protected: explicit MediaStreamAudioSourceNode(AudioContext* aContext); diff --git a/dom/media/webaudio/OfflineAudioCompletionEvent.h b/dom/media/webaudio/OfflineAudioCompletionEvent.h index 8325f7d6bff..bc21fdec3c8 100644 --- a/dom/media/webaudio/OfflineAudioCompletionEvent.h +++ b/dom/media/webaudio/OfflineAudioCompletionEvent.h @@ -26,7 +26,7 @@ public: NS_FORWARD_TO_EVENT NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(OfflineAudioCompletionEvent, Event) - virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle aGivenProto) override; void InitEvent(AudioBuffer* aRenderedBuffer) { diff --git a/dom/media/webaudio/OscillatorNode.cpp b/dom/media/webaudio/OscillatorNode.cpp index e7e920c7e76..9b29a10e204 100644 --- a/dom/media/webaudio/OscillatorNode.cpp +++ b/dom/media/webaudio/OscillatorNode.cpp @@ -82,7 +82,7 @@ public: } } - virtual void SetStreamTimeParameter(uint32_t aIndex, StreamTime aParam) override + void SetStreamTimeParameter(uint32_t aIndex, StreamTime aParam) override { switch (aIndex) { case START: @@ -95,7 +95,7 @@ public: } } - virtual void SetInt32Parameter(uint32_t aIndex, int32_t aParam) override + void SetInt32Parameter(uint32_t aIndex, int32_t aParam) override { switch (aIndex) { case TYPE: @@ -134,7 +134,7 @@ public: // End index switch. } - virtual void SetBuffer(already_AddRefed aBuffer) override + void SetBuffer(already_AddRefed aBuffer) override { MOZ_ASSERT(mCustomLength, "Custom buffer sent before length"); mCustom = aBuffer; @@ -301,11 +301,11 @@ public: aOutput->SetNull(WEBAUDIO_BLOCK_SIZE); } - virtual void ProcessBlock(AudioNodeStream* aStream, - GraphTime aFrom, - const AudioBlock& aInput, - AudioBlock* aOutput, - bool* aFinished) override + void ProcessBlock(AudioNodeStream* aStream, + GraphTime aFrom, + const AudioBlock& aInput, + AudioBlock* aOutput, + bool* aFinished) override { MOZ_ASSERT(mSource == aStream, "Invalid source stream"); @@ -347,13 +347,13 @@ public: } } - virtual bool IsActive() const override + bool IsActive() const override { // start() has been called. return mStart != -1; } - virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override + size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override { size_t amount = AudioNodeEngine::SizeOfExcludingThis(aMallocSizeOf); @@ -374,7 +374,7 @@ public: return amount; } - virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override + size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override { return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf); } diff --git a/dom/media/webaudio/OscillatorNode.h b/dom/media/webaudio/OscillatorNode.h index d8aff9964fd..970afd58916 100644 --- a/dom/media/webaudio/OscillatorNode.h +++ b/dom/media/webaudio/OscillatorNode.h @@ -27,11 +27,11 @@ public: NS_DECL_ISUPPORTS_INHERITED NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(OscillatorNode, AudioNode) - virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; - virtual void DestroyMediaStream() override; + void DestroyMediaStream() override; - virtual uint16_t NumberOfInputs() const final override + uint16_t NumberOfInputs() const final override { return 0; } @@ -73,15 +73,15 @@ public: IMPL_EVENT_HANDLER(ended) - virtual void NotifyMainThreadStreamFinished() override; + void NotifyMainThreadStreamFinished() override; - virtual const char* NodeType() const override + const char* NodeType() const override { return "OscillatorNode"; } - virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override; - virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override; + size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override; + size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override; protected: virtual ~OscillatorNode(); diff --git a/dom/media/webaudio/PannerNode.cpp b/dom/media/webaudio/PannerNode.cpp index 431a74f6728..e1586ffe5bd 100644 --- a/dom/media/webaudio/PannerNode.cpp +++ b/dom/media/webaudio/PannerNode.cpp @@ -68,7 +68,7 @@ public: mHRTFPanner = new HRTFPanner(aNode->Context()->SampleRate(), Move(loader)); } - virtual void SetInt32Parameter(uint32_t aIndex, int32_t aParam) override + void SetInt32Parameter(uint32_t aIndex, int32_t aParam) override { switch (aIndex) { case PannerNode::PANNING_MODEL: @@ -104,7 +104,7 @@ public: NS_ERROR("Bad PannerNodeEngine Int32Parameter"); } } - virtual void SetThreeDPointParameter(uint32_t aIndex, const ThreeDPoint& aParam) override + void SetThreeDPointParameter(uint32_t aIndex, const ThreeDPoint& aParam) override { switch (aIndex) { case PannerNode::LISTENER_POSITION: mListenerPosition = aParam; break; @@ -118,7 +118,7 @@ public: NS_ERROR("Bad PannerNodeEngine ThreeDPointParameter"); } } - virtual void SetDoubleParameter(uint32_t aIndex, double aParam) override + void SetDoubleParameter(uint32_t aIndex, double aParam) override { switch (aIndex) { case PannerNode::LISTENER_DOPPLER_FACTOR: mListenerDopplerFactor = aParam; break; @@ -134,11 +134,11 @@ public: } } - virtual void ProcessBlock(AudioNodeStream* aStream, - GraphTime aFrom, - const AudioBlock& aInput, - AudioBlock* aOutput, - bool *aFinished) override + void ProcessBlock(AudioNodeStream* aStream, + GraphTime aFrom, + const AudioBlock& aInput, + AudioBlock* aOutput, + bool *aFinished) override { if (aInput.IsNull()) { // mLeftOverData != INT_MIN means that the panning model was HRTF and a @@ -174,7 +174,7 @@ public: (this->*mPanningModelFunction)(aInput, aOutput); } - virtual bool IsActive() const override + bool IsActive() const override { return mLeftOverData != INT_MIN; } @@ -191,7 +191,7 @@ public: float InverseGainFunction(float aDistance); float ExponentialGainFunction(float aDistance); - virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override + size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override { size_t amount = AudioNodeEngine::SizeOfExcludingThis(aMallocSizeOf); if (mHRTFPanner) { @@ -201,7 +201,7 @@ public: return amount; } - virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override + size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override { return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf); } diff --git a/dom/media/webaudio/PannerNode.h b/dom/media/webaudio/PannerNode.h index 2310a313bc1..8c0b77003cc 100644 --- a/dom/media/webaudio/PannerNode.h +++ b/dom/media/webaudio/PannerNode.h @@ -28,11 +28,11 @@ public: MOZ_DECLARE_WEAKREFERENCE_TYPENAME(PannerNode) explicit PannerNode(AudioContext* aContext); - virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; - virtual void DestroyMediaStream() override; + void DestroyMediaStream() override; - virtual void SetChannelCount(uint32_t aChannelCount, ErrorResult& aRv) override + void SetChannelCount(uint32_t aChannelCount, ErrorResult& aRv) override { if (aChannelCount > 2) { aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR); @@ -40,7 +40,7 @@ public: } AudioNode::SetChannelCount(aChannelCount, aRv); } - virtual void SetChannelCountModeValue(ChannelCountMode aMode, ErrorResult& aRv) override + void SetChannelCountModeValue(ChannelCountMode aMode, ErrorResult& aRv) override { if (aMode == ChannelCountMode::Max) { aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR); @@ -195,13 +195,13 @@ public: void FindConnectedSources(); void FindConnectedSources(AudioNode* aNode, nsTArray& aSources, std::set& aSeenNodes); - virtual const char* NodeType() const override + const char* NodeType() const override { return "PannerNode"; } - virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override; - virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override; + size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override; + size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override; protected: virtual ~PannerNode(); diff --git a/dom/media/webaudio/PeriodicWave.h b/dom/media/webaudio/PeriodicWave.h index 414dd0832ba..d4962f66480 100644 --- a/dom/media/webaudio/PeriodicWave.h +++ b/dom/media/webaudio/PeriodicWave.h @@ -34,7 +34,7 @@ public: return mContext; } - virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; uint32_t DataLength() const { diff --git a/dom/media/webaudio/ScriptProcessorNode.cpp b/dom/media/webaudio/ScriptProcessorNode.cpp index c00ccc8a86a..0e9330f91c4 100644 --- a/dom/media/webaudio/ScriptProcessorNode.cpp +++ b/dom/media/webaudio/ScriptProcessorNode.cpp @@ -262,7 +262,7 @@ public: IS_CONNECTED, }; - virtual void SetInt32Parameter(uint32_t aIndex, int32_t aParam) override + void SetInt32Parameter(uint32_t aIndex, int32_t aParam) override { switch (aIndex) { case IS_CONNECTED: @@ -273,11 +273,11 @@ public: } // End index switch. } - virtual void ProcessBlock(AudioNodeStream* aStream, - GraphTime aFrom, - const AudioBlock& aInput, - AudioBlock* aOutput, - bool* aFinished) override + void ProcessBlock(AudioNodeStream* aStream, + GraphTime aFrom, + const AudioBlock& aInput, + AudioBlock* aOutput, + bool* aFinished) override { // This node is not connected to anything. Per spec, we don't fire the // onaudioprocess event. We also want to clear out the input and output @@ -328,7 +328,7 @@ public: } } - virtual bool IsActive() const override + bool IsActive() const override { // Could return false when !mIsConnected after all output chunks produced // by main thread events calling @@ -336,7 +336,7 @@ public: return true; } - virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override + size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override { // Not owned: // - mDestination (probably) @@ -349,7 +349,7 @@ public: return amount; } - virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override + size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override { return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf); } diff --git a/dom/media/webaudio/ScriptProcessorNode.h b/dom/media/webaudio/ScriptProcessorNode.h index cc82a01fb1d..57dab4a246e 100644 --- a/dom/media/webaudio/ScriptProcessorNode.h +++ b/dom/media/webaudio/ScriptProcessorNode.h @@ -28,13 +28,13 @@ public: IMPL_EVENT_HANDLER(audioprocess) - virtual void EventListenerAdded(nsIAtom* aType) override; - virtual void EventListenerRemoved(nsIAtom* aType) override; + void EventListenerAdded(nsIAtom* aType) override; + void EventListenerRemoved(nsIAtom* aType) override; - virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; - virtual AudioNode* Connect(AudioNode& aDestination, uint32_t aOutput, - uint32_t aInput, ErrorResult& aRv) override + AudioNode* Connect(AudioNode& aDestination, uint32_t aOutput, + uint32_t aInput, ErrorResult& aRv) override { AudioNode* node = AudioNode::Connect(aDestination, aOutput, aInput, aRv); if (!aRv.Failed()) { @@ -43,8 +43,8 @@ public: return node; } - virtual void Connect(AudioParam& aDestination, uint32_t aOutput, - ErrorResult& aRv) override + void Connect(AudioParam& aDestination, uint32_t aOutput, + ErrorResult& aRv) override { AudioNode::Connect(aDestination, aOutput, aRv); if (!aRv.Failed()) { @@ -52,32 +52,32 @@ public: } } - virtual void Disconnect(uint32_t aOutput, ErrorResult& aRv) override + void Disconnect(uint32_t aOutput, ErrorResult& aRv) override { AudioNode::Disconnect(aOutput, aRv); if (!aRv.Failed()) { UpdateConnectedStatus(); } } - virtual void NotifyInputsChanged() override + void NotifyInputsChanged() override { UpdateConnectedStatus(); } - virtual void NotifyHasPhantomInput() override + void NotifyHasPhantomInput() override { mHasPhantomInput = true; // No need to UpdateConnectedStatus() because there was previously an // input in InputNodes(). } - virtual void SetChannelCount(uint32_t aChannelCount, ErrorResult& aRv) override + void SetChannelCount(uint32_t aChannelCount, ErrorResult& aRv) override { if (aChannelCount != ChannelCount()) { aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR); } return; } - virtual void SetChannelCountModeValue(ChannelCountMode aMode, ErrorResult& aRv) override + void SetChannelCountModeValue(ChannelCountMode aMode, ErrorResult& aRv) override { if (aMode != ChannelCountMode::Explicit) { aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR); @@ -97,13 +97,13 @@ public: using DOMEventTargetHelper::DispatchTrustedEvent; - virtual const char* NodeType() const override + const char* NodeType() const override { return "ScriptProcessorNode"; } - virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override; - virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override; + size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override; + size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override; private: virtual ~ScriptProcessorNode(); diff --git a/dom/media/webaudio/WaveShaperNode.cpp b/dom/media/webaudio/WaveShaperNode.cpp index ad48fa6893f..2d2bdba0975 100644 --- a/dom/media/webaudio/WaveShaperNode.cpp +++ b/dom/media/webaudio/WaveShaperNode.cpp @@ -174,12 +174,12 @@ public: TYPE }; - virtual void SetRawArrayData(nsTArray& aCurve) override + void SetRawArrayData(nsTArray& aCurve) override { mCurve.SwapElements(aCurve); } - virtual void SetInt32Parameter(uint32_t aIndex, int32_t aValue) override + void SetInt32Parameter(uint32_t aIndex, int32_t aValue) override { switch (aIndex) { case TYPE: @@ -214,11 +214,11 @@ public: } } - virtual void ProcessBlock(AudioNodeStream* aStream, - GraphTime aFrom, - const AudioBlock& aInput, - AudioBlock* aOutput, - bool* aFinished) override + void ProcessBlock(AudioNodeStream* aStream, + GraphTime aFrom, + const AudioBlock& aInput, + AudioBlock* aOutput, + bool* aFinished) override { uint32_t channelCount = aInput.ChannelCount(); if (!mCurve.Length() || !channelCount) { @@ -267,7 +267,7 @@ public: } } - virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override + size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override { size_t amount = AudioNodeEngine::SizeOfExcludingThis(aMallocSizeOf); amount += mCurve.ShallowSizeOfExcludingThis(aMallocSizeOf); @@ -275,7 +275,7 @@ public: return amount; } - virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override + size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override { return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf); } diff --git a/dom/media/webaudio/WaveShaperNode.h b/dom/media/webaudio/WaveShaperNode.h index 209d05d40f8..de0761eebe0 100644 --- a/dom/media/webaudio/WaveShaperNode.h +++ b/dom/media/webaudio/WaveShaperNode.h @@ -24,7 +24,7 @@ public: NS_DECL_ISUPPORTS_INHERITED NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(WaveShaperNode, AudioNode) - virtual JSObject* WrapObject(JSContext *aCx, JS::Handle aGivenProto) override; + JSObject* WrapObject(JSContext *aCx, JS::Handle aGivenProto) override; void GetCurve(JSContext* aCx, JS::MutableHandle aRetval) const { @@ -41,19 +41,19 @@ public: } void SetOversample(OverSampleType aType); - virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override + size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override { // Possibly track in the future: // - mCurve return AudioNode::SizeOfExcludingThis(aMallocSizeOf); } - virtual const char* NodeType() const override + const char* NodeType() const override { return "WaveShaperNode"; } - virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override + size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override { return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf); } From 6da9149b1351727304d1824a2b973bf20ea7617b Mon Sep 17 00:00:00 2001 From: Jean-Yves Avenard Date: Mon, 18 Jan 2016 14:25:30 +1100 Subject: [PATCH 007/119] Bug 1240411: P2. Clean up webrtc headers. r=jesup Remove redundant virtual keyword and add missing override if any. --- .../webrtc/MediaEngineCameraVideoSource.h | 26 ++--- dom/media/webrtc/MediaEngineDefault.h | 110 +++++++++--------- dom/media/webrtc/MediaEngineGonkVideoSource.h | 28 ++--- .../webrtc/MediaEngineRemoteVideoSource.h | 50 ++++---- dom/media/webrtc/MediaEngineTabVideoSource.h | 38 +++--- dom/media/webrtc/MediaEngineWebRTC.h | 58 ++++----- 6 files changed, 155 insertions(+), 155 deletions(-) diff --git a/dom/media/webrtc/MediaEngineCameraVideoSource.h b/dom/media/webrtc/MediaEngineCameraVideoSource.h index fa34f42b68b..7fbfbd45f86 100644 --- a/dom/media/webrtc/MediaEngineCameraVideoSource.h +++ b/dom/media/webrtc/MediaEngineCameraVideoSource.h @@ -34,23 +34,23 @@ public: {} - virtual void GetName(nsAString& aName) override; - virtual void GetUUID(nsACString& aUUID) override; - virtual void SetDirectListeners(bool aHasListeners) override; - virtual nsresult Config(bool aEchoOn, uint32_t aEcho, - bool aAgcOn, uint32_t aAGC, - bool aNoiseOn, uint32_t aNoise, - int32_t aPlayoutDelay) override + void GetName(nsAString& aName) override; + void GetUUID(nsACString& aUUID) override; + void SetDirectListeners(bool aHasListeners) override; + nsresult Config(bool aEchoOn, uint32_t aEcho, + bool aAgcOn, uint32_t aAGC, + bool aNoiseOn, uint32_t aNoise, + int32_t aPlayoutDelay) override { return NS_OK; }; - virtual bool IsFake() override + bool IsFake() override { return false; } - virtual nsresult TakePhoto(PhotoCallback* aCallback) override + nsresult TakePhoto(PhotoCallback* aCallback) override { return NS_ERROR_NOT_IMPLEMENTED; } @@ -59,7 +59,7 @@ public: const nsTArray& aConstraintSets, const nsString& aDeviceId) override; - virtual void Shutdown() override {}; + void Shutdown() override {}; protected: struct CapabilityCandidate { @@ -85,9 +85,9 @@ protected: static void TrimLessFitCandidates(CapabilitySet& set); static void LogConstraints(const dom::MediaTrackConstraintSet& aConstraints, bool aAdvanced); -static void LogCapability(const char* aHeader, - const webrtc::CaptureCapability &aCapability, - uint32_t aDistance); + static void LogCapability(const char* aHeader, + const webrtc::CaptureCapability &aCapability, + uint32_t aDistance); virtual size_t NumCapabilities(); virtual void GetCapability(size_t aIndex, webrtc::CaptureCapability& aOut); virtual bool ChooseCapability(const dom::MediaTrackConstraints &aConstraints, diff --git a/dom/media/webrtc/MediaEngineDefault.h b/dom/media/webrtc/MediaEngineDefault.h index b592e5733d7..8829796f046 100644 --- a/dom/media/webrtc/MediaEngineDefault.h +++ b/dom/media/webrtc/MediaEngineDefault.h @@ -38,42 +38,42 @@ class MediaEngineDefaultVideoSource : public nsITimerCallback, public: MediaEngineDefaultVideoSource(); - virtual void Shutdown() override {}; + void Shutdown() override {}; - virtual void GetName(nsAString&) override; - virtual void GetUUID(nsACString&) override; + void GetName(nsAString&) override; + void GetUUID(nsACString&) override; - virtual nsresult Allocate(const dom::MediaTrackConstraints &aConstraints, - const MediaEnginePrefs &aPrefs, - const nsString& aDeviceId) override; - virtual nsresult Deallocate() override; - virtual nsresult Start(SourceMediaStream*, TrackID) override; - virtual nsresult Stop(SourceMediaStream*, TrackID) override; - virtual nsresult Restart(const dom::MediaTrackConstraints& aConstraints, - const MediaEnginePrefs &aPrefs, - const nsString& aDeviceId) override; - virtual void SetDirectListeners(bool aHasDirectListeners) override {}; - virtual nsresult Config(bool aEchoOn, uint32_t aEcho, - bool aAgcOn, uint32_t aAGC, - bool aNoiseOn, uint32_t aNoise, - int32_t aPlayoutDelay) override { return NS_OK; }; - virtual void NotifyPull(MediaStreamGraph* aGraph, - SourceMediaStream *aSource, - TrackID aId, - StreamTime aDesiredTime) override; - virtual uint32_t GetBestFitnessDistance( + nsresult Allocate(const dom::MediaTrackConstraints &aConstraints, + const MediaEnginePrefs &aPrefs, + const nsString& aDeviceId) override; + nsresult Deallocate() override; + nsresult Start(SourceMediaStream*, TrackID) override; + nsresult Stop(SourceMediaStream*, TrackID) override; + nsresult Restart(const dom::MediaTrackConstraints& aConstraints, + const MediaEnginePrefs &aPrefs, + const nsString& aDeviceId) override; + void SetDirectListeners(bool aHasDirectListeners) override {}; + nsresult Config(bool aEchoOn, uint32_t aEcho, + bool aAgcOn, uint32_t aAGC, + bool aNoiseOn, uint32_t aNoise, + int32_t aPlayoutDelay) override { return NS_OK; }; + void NotifyPull(MediaStreamGraph* aGraph, + SourceMediaStream *aSource, + TrackID aId, + StreamTime aDesiredTime) override; + uint32_t GetBestFitnessDistance( const nsTArray& aConstraintSets, const nsString& aDeviceId) override; - virtual bool IsFake() override { + bool IsFake() override { return true; } - virtual dom::MediaSourceEnum GetMediaSource() const override { + dom::MediaSourceEnum GetMediaSource() const override { return dom::MediaSourceEnum::Camera; } - virtual nsresult TakePhoto(PhotoCallback* aCallback) override + nsresult TakePhoto(PhotoCallback* aCallback) override { return NS_ERROR_NOT_IMPLEMENTED; } @@ -111,30 +111,30 @@ class MediaEngineDefaultAudioSource : public nsITimerCallback, public: MediaEngineDefaultAudioSource(); - virtual void Shutdown() override {}; + void Shutdown() override {}; - virtual void GetName(nsAString&) override; - virtual void GetUUID(nsACString&) override; + void GetName(nsAString&) override; + void GetUUID(nsACString&) override; - virtual nsresult Allocate(const dom::MediaTrackConstraints &aConstraints, - const MediaEnginePrefs &aPrefs, - const nsString& aDeviceId) override; - virtual nsresult Deallocate() override; - virtual nsresult Start(SourceMediaStream*, TrackID) override; - virtual nsresult Stop(SourceMediaStream*, TrackID) override; - virtual nsresult Restart(const dom::MediaTrackConstraints& aConstraints, - const MediaEnginePrefs &aPrefs, - const nsString& aDeviceId) override; - virtual void SetDirectListeners(bool aHasDirectListeners) override {}; - virtual nsresult Config(bool aEchoOn, uint32_t aEcho, - bool aAgcOn, uint32_t aAGC, - bool aNoiseOn, uint32_t aNoise, - int32_t aPlayoutDelay) override { return NS_OK; }; + nsresult Allocate(const dom::MediaTrackConstraints &aConstraints, + const MediaEnginePrefs &aPrefs, + const nsString& aDeviceId) override; + nsresult Deallocate() override; + nsresult Start(SourceMediaStream*, TrackID) override; + nsresult Stop(SourceMediaStream*, TrackID) override; + nsresult Restart(const dom::MediaTrackConstraints& aConstraints, + const MediaEnginePrefs &aPrefs, + const nsString& aDeviceId) override; + void SetDirectListeners(bool aHasDirectListeners) override {}; + nsresult Config(bool aEchoOn, uint32_t aEcho, + bool aAgcOn, uint32_t aAGC, + bool aNoiseOn, uint32_t aNoise, + int32_t aPlayoutDelay) override { return NS_OK; }; void AppendToSegment(AudioSegment& aSegment, TrackTicks aSamples); - virtual void NotifyPull(MediaStreamGraph* aGraph, - SourceMediaStream *aSource, - TrackID aId, - StreamTime aDesiredTime) override + void NotifyPull(MediaStreamGraph* aGraph, + SourceMediaStream *aSource, + TrackID aId, + StreamTime aDesiredTime) override { #ifdef DEBUG StreamBuffer::Track* data = aSource->FindTrack(aId); @@ -144,20 +144,20 @@ public: #endif } - virtual bool IsFake() override { + bool IsFake() override { return true; } - virtual dom::MediaSourceEnum GetMediaSource() const override { + dom::MediaSourceEnum GetMediaSource() const override { return dom::MediaSourceEnum::Microphone; } - virtual nsresult TakePhoto(PhotoCallback* aCallback) override + nsresult TakePhoto(PhotoCallback* aCallback) override { return NS_ERROR_NOT_IMPLEMENTED; } - virtual uint32_t GetBestFitnessDistance( + uint32_t GetBestFitnessDistance( const nsTArray& aConstraintSets, const nsString& aDeviceId) override; @@ -186,11 +186,11 @@ public: , mMutex("mozilla::MediaEngineDefault") {} - virtual void EnumerateVideoDevices(dom::MediaSourceEnum, - nsTArray >*) override; - virtual void EnumerateAudioDevices(dom::MediaSourceEnum, - nsTArray >*) override; - virtual void Shutdown() override { + void EnumerateVideoDevices(dom::MediaSourceEnum, + nsTArray >*) override; + void EnumerateAudioDevices(dom::MediaSourceEnum, + nsTArray >*) override; + void Shutdown() override { MutexAutoLock lock(mMutex); mVSources.Clear(); diff --git a/dom/media/webrtc/MediaEngineGonkVideoSource.h b/dom/media/webrtc/MediaEngineGonkVideoSource.h index 42df3f157d2..203e6d82e1e 100644 --- a/dom/media/webrtc/MediaEngineGonkVideoSource.h +++ b/dom/media/webrtc/MediaEngineGonkVideoSource.h @@ -60,20 +60,20 @@ public: Init(); } - virtual nsresult Allocate(const dom::MediaTrackConstraints &aConstraints, - const MediaEnginePrefs &aPrefs, - const nsString& aDeviceId) override; - virtual nsresult Deallocate() override; - virtual nsresult Start(SourceMediaStream* aStream, TrackID aID) override; - virtual nsresult Stop(SourceMediaStream* aSource, TrackID aID) override; - virtual nsresult Restart(const dom::MediaTrackConstraints& aConstraints, - const MediaEnginePrefs &aPrefs, - const nsString& aDeviceId) override; - virtual void NotifyPull(MediaStreamGraph* aGraph, - SourceMediaStream* aSource, - TrackID aId, - StreamTime aDesiredTime) override; - virtual dom::MediaSourceEnum GetMediaSource() const override { + nsresult Allocate(const dom::MediaTrackConstraints &aConstraints, + const MediaEnginePrefs &aPrefs, + const nsString& aDeviceId) override; + nsresult Deallocate() override; + nsresult Start(SourceMediaStream* aStream, TrackID aID) override; + nsresult Stop(SourceMediaStream* aSource, TrackID aID) override; + nsresult Restart(const dom::MediaTrackConstraints& aConstraints, + const MediaEnginePrefs &aPrefs, + const nsString& aDeviceId) override; + void NotifyPull(MediaStreamGraph* aGraph, + SourceMediaStream* aSource, + TrackID aId, + StreamTime aDesiredTime) override; + dom::MediaSourceEnum GetMediaSource() const override { return dom::MediaSourceEnum::Camera; } diff --git a/dom/media/webrtc/MediaEngineRemoteVideoSource.h b/dom/media/webrtc/MediaEngineRemoteVideoSource.h index 9981cedeea7..766fc8a63fb 100644 --- a/dom/media/webrtc/MediaEngineRemoteVideoSource.h +++ b/dom/media/webrtc/MediaEngineRemoteVideoSource.h @@ -54,37 +54,37 @@ public: NS_DECL_THREADSAFE_ISUPPORTS // ExternalRenderer - virtual int FrameSizeChange(unsigned int w, unsigned int h, - unsigned int streams) override; - virtual int DeliverFrame(unsigned char* buffer, - size_t size, - uint32_t time_stamp, - int64_t ntp_time, - int64_t render_time, - void *handle) override; + int FrameSizeChange(unsigned int w, unsigned int h, + unsigned int streams) override; + int DeliverFrame(unsigned char* buffer, + size_t size, + uint32_t time_stamp, + int64_t ntp_time, + int64_t render_time, + void *handle) override; // XXX!!!! FIX THIS - virtual int DeliverI420Frame(const webrtc::I420VideoFrame& webrtc_frame) override { return 0; }; - virtual bool IsTextureSupported() override { return false; }; + int DeliverI420Frame(const webrtc::I420VideoFrame& webrtc_frame) override { return 0; }; + bool IsTextureSupported() override { return false; }; // MediaEngineCameraVideoSource MediaEngineRemoteVideoSource(int aIndex, mozilla::camera::CaptureEngine aCapEngine, dom::MediaSourceEnum aMediaSource, const char* aMonitorName = "RemoteVideo.Monitor"); - virtual nsresult Allocate(const dom::MediaTrackConstraints& aConstraints, - const MediaEnginePrefs& aPrefs, - const nsString& aDeviceId) override; - virtual nsresult Deallocate() override;; - virtual nsresult Start(SourceMediaStream*, TrackID) override; - virtual nsresult Stop(SourceMediaStream*, TrackID) override; - virtual nsresult Restart(const dom::MediaTrackConstraints& aConstraints, - const MediaEnginePrefs &aPrefs, - const nsString& aDeviceId) override; - virtual void NotifyPull(MediaStreamGraph* aGraph, - SourceMediaStream* aSource, - TrackID aId, - StreamTime aDesiredTime) override; - virtual dom::MediaSourceEnum GetMediaSource() const override { + nsresult Allocate(const dom::MediaTrackConstraints& aConstraints, + const MediaEnginePrefs& aPrefs, + const nsString& aDeviceId) override; + nsresult Deallocate() override;; + nsresult Start(SourceMediaStream*, TrackID) override; + nsresult Stop(SourceMediaStream*, TrackID) override; + nsresult Restart(const dom::MediaTrackConstraints& aConstraints, + const MediaEnginePrefs &aPrefs, + const nsString& aDeviceId) override; + void NotifyPull(MediaStreamGraph* aGraph, + SourceMediaStream* aSource, + TrackID aId, + StreamTime aDesiredTime) override; + dom::MediaSourceEnum GetMediaSource() const override { return mMediaSource; } @@ -94,7 +94,7 @@ public: void Refresh(int aIndex); - virtual void Shutdown() override; + void Shutdown() override; protected: ~MediaEngineRemoteVideoSource() { Shutdown(); } diff --git a/dom/media/webrtc/MediaEngineTabVideoSource.h b/dom/media/webrtc/MediaEngineTabVideoSource.h index 331a31a0ee6..8c120d38582 100644 --- a/dom/media/webrtc/MediaEngineTabVideoSource.h +++ b/dom/media/webrtc/MediaEngineTabVideoSource.h @@ -18,33 +18,33 @@ class MediaEngineTabVideoSource : public MediaEngineVideoSource, nsIDOMEventList NS_DECL_NSITIMERCALLBACK MediaEngineTabVideoSource(); - virtual void Shutdown() override {}; - virtual void GetName(nsAString_internal&) override; - virtual void GetUUID(nsACString_internal&) override; - virtual nsresult Allocate(const dom::MediaTrackConstraints &, - const mozilla::MediaEnginePrefs&, - const nsString& aDeviceId) override; - virtual nsresult Deallocate() override; - virtual nsresult Start(mozilla::SourceMediaStream*, mozilla::TrackID) override; - virtual void SetDirectListeners(bool aHasDirectListeners) override {}; - virtual void NotifyPull(mozilla::MediaStreamGraph*, mozilla::SourceMediaStream*, mozilla::TrackID, mozilla::StreamTime) override; - virtual nsresult Stop(mozilla::SourceMediaStream*, mozilla::TrackID) override; - virtual nsresult Restart(const dom::MediaTrackConstraints& aConstraints, - const mozilla::MediaEnginePrefs& aPrefs, - const nsString& aDeviceId) override; - virtual nsresult Config(bool, uint32_t, bool, uint32_t, bool, uint32_t, int32_t) override; - virtual bool IsFake() override; - virtual dom::MediaSourceEnum GetMediaSource() const override { + void Shutdown() override {}; + void GetName(nsAString_internal&) override; + void GetUUID(nsACString_internal&) override; + nsresult Allocate(const dom::MediaTrackConstraints &, + const mozilla::MediaEnginePrefs&, + const nsString& aDeviceId) override; + nsresult Deallocate() override; + nsresult Start(mozilla::SourceMediaStream*, mozilla::TrackID) override; + void SetDirectListeners(bool aHasDirectListeners) override {}; + void NotifyPull(mozilla::MediaStreamGraph*, mozilla::SourceMediaStream*, mozilla::TrackID, mozilla::StreamTime) override; + nsresult Stop(mozilla::SourceMediaStream*, mozilla::TrackID) override; + nsresult Restart(const dom::MediaTrackConstraints& aConstraints, + const mozilla::MediaEnginePrefs& aPrefs, + const nsString& aDeviceId) override; + nsresult Config(bool, uint32_t, bool, uint32_t, bool, uint32_t, int32_t) override; + bool IsFake() override; + dom::MediaSourceEnum GetMediaSource() const override { return dom::MediaSourceEnum::Browser; } - virtual uint32_t GetBestFitnessDistance( + uint32_t GetBestFitnessDistance( const nsTArray& aConstraintSets, const nsString& aDeviceId) override { return 0; } - virtual nsresult TakePhoto(PhotoCallback* aCallback) override + nsresult TakePhoto(PhotoCallback* aCallback) override { return NS_ERROR_NOT_IMPLEMENTED; } diff --git a/dom/media/webrtc/MediaEngineWebRTC.h b/dom/media/webrtc/MediaEngineWebRTC.h index bb3e304b3f3..e30cdf39dac 100644 --- a/dom/media/webrtc/MediaEngineWebRTC.h +++ b/dom/media/webrtc/MediaEngineWebRTC.h @@ -151,43 +151,43 @@ public: Init(); } - virtual void GetName(nsAString& aName) override; - virtual void GetUUID(nsACString& aUUID) override; + void GetName(nsAString& aName) override; + void GetUUID(nsACString& aUUID) override; - virtual nsresult Allocate(const dom::MediaTrackConstraints& aConstraints, - const MediaEnginePrefs& aPrefs, - const nsString& aDeviceId) override; - virtual nsresult Deallocate() override; - virtual nsresult Start(SourceMediaStream* aStream, TrackID aID) override; - virtual nsresult Stop(SourceMediaStream* aSource, TrackID aID) override; - virtual nsresult Restart(const dom::MediaTrackConstraints& aConstraints, - const MediaEnginePrefs &aPrefs, - const nsString& aDeviceId) override; - virtual void SetDirectListeners(bool aHasDirectListeners) override {}; - virtual nsresult Config(bool aEchoOn, uint32_t aEcho, - bool aAgcOn, uint32_t aAGC, - bool aNoiseOn, uint32_t aNoise, - int32_t aPlayoutDelay) override; + nsresult Allocate(const dom::MediaTrackConstraints& aConstraints, + const MediaEnginePrefs& aPrefs, + const nsString& aDeviceId) override; + nsresult Deallocate() override; + nsresult Start(SourceMediaStream* aStream, TrackID aID) override; + nsresult Stop(SourceMediaStream* aSource, TrackID aID) override; + nsresult Restart(const dom::MediaTrackConstraints& aConstraints, + const MediaEnginePrefs &aPrefs, + const nsString& aDeviceId) override; + void SetDirectListeners(bool aHasDirectListeners) override {}; + nsresult Config(bool aEchoOn, uint32_t aEcho, + bool aAgcOn, uint32_t aAGC, + bool aNoiseOn, uint32_t aNoise, + int32_t aPlayoutDelay) override; - virtual void NotifyPull(MediaStreamGraph* aGraph, - SourceMediaStream* aSource, - TrackID aId, - StreamTime aDesiredTime) override; + void NotifyPull(MediaStreamGraph* aGraph, + SourceMediaStream* aSource, + TrackID aId, + StreamTime aDesiredTime) override; - virtual bool IsFake() override { + bool IsFake() override { return false; } - virtual dom::MediaSourceEnum GetMediaSource() const override { + dom::MediaSourceEnum GetMediaSource() const override { return dom::MediaSourceEnum::Microphone; } - virtual nsresult TakePhoto(PhotoCallback* aCallback) override + nsresult TakePhoto(PhotoCallback* aCallback) override { return NS_ERROR_NOT_IMPLEMENTED; } - virtual uint32_t GetBestFitnessDistance( + uint32_t GetBestFitnessDistance( const nsTArray& aConstraintSets, const nsString& aDeviceId) override; @@ -196,7 +196,7 @@ public: int16_t audio10ms[], int length, int samplingFreq, bool isStereo) override; - virtual void Shutdown() override; + void Shutdown() override; NS_DECL_THREADSAFE_ISUPPORTS @@ -247,10 +247,10 @@ public: // before invoking Shutdown on this class. void Shutdown() override; - virtual void EnumerateVideoDevices(dom::MediaSourceEnum, - nsTArray>*) override; - virtual void EnumerateAudioDevices(dom::MediaSourceEnum, - nsTArray>*) override; + void EnumerateVideoDevices(dom::MediaSourceEnum, + nsTArray>*) override; + void EnumerateAudioDevices(dom::MediaSourceEnum, + nsTArray>*) override; private: ~MediaEngineWebRTC() { Shutdown(); From da8d71f0b7c7b8bf12036a2c16ba9e99eff18b3e Mon Sep 17 00:00:00 2001 From: Jean-Yves Avenard Date: Mon, 18 Jan 2016 14:29:21 +1100 Subject: [PATCH 008/119] Bug 1240411: P3. Clean up EME header declarations. r=cpearce --- dom/media/eme/CDMCallbackProxy.h | 52 ++++++++++++++-------------- dom/media/eme/MediaEncryptedEvent.h | 2 +- dom/media/eme/MediaKeyError.h | 2 +- dom/media/eme/MediaKeyMessageEvent.h | 2 +- dom/media/eme/MediaKeySession.h | 2 +- dom/media/eme/MediaKeyStatusMap.h | 2 +- dom/media/eme/MediaKeySystemAccess.h | 2 +- dom/media/eme/MediaKeys.h | 2 +- 8 files changed, 33 insertions(+), 33 deletions(-) diff --git a/dom/media/eme/CDMCallbackProxy.h b/dom/media/eme/CDMCallbackProxy.h index 60e085e6c51..967cc9ba17f 100644 --- a/dom/media/eme/CDMCallbackProxy.h +++ b/dom/media/eme/CDMCallbackProxy.h @@ -17,43 +17,43 @@ namespace mozilla { // object on the main thread. class CDMCallbackProxy : public GMPDecryptorProxyCallback { public: - virtual void SetSessionId(uint32_t aCreateSessionToken, - const nsCString& aSessionId) override; + void SetSessionId(uint32_t aCreateSessionToken, + const nsCString& aSessionId) override; - virtual void ResolveLoadSessionPromise(uint32_t aPromiseId, - bool aSuccess) override; + void ResolveLoadSessionPromise(uint32_t aPromiseId, + bool aSuccess) override; - virtual void ResolvePromise(uint32_t aPromiseId) override; + void ResolvePromise(uint32_t aPromiseId) override; - virtual void RejectPromise(uint32_t aPromiseId, - nsresult aException, - const nsCString& aSessionId) override; + void RejectPromise(uint32_t aPromiseId, + nsresult aException, + const nsCString& aSessionId) override; - virtual void SessionMessage(const nsCString& aSessionId, - GMPSessionMessageType aMessageType, - const nsTArray& aMessage) override; + void SessionMessage(const nsCString& aSessionId, + GMPSessionMessageType aMessageType, + const nsTArray& aMessage) override; - virtual void ExpirationChange(const nsCString& aSessionId, - GMPTimestamp aExpiryTime) override; + void ExpirationChange(const nsCString& aSessionId, + GMPTimestamp aExpiryTime) override; - virtual void SessionClosed(const nsCString& aSessionId) override; + void SessionClosed(const nsCString& aSessionId) override; - virtual void SessionError(const nsCString& aSessionId, - nsresult aException, - uint32_t aSystemCode, - const nsCString& aMessage) override; + void SessionError(const nsCString& aSessionId, + nsresult aException, + uint32_t aSystemCode, + const nsCString& aMessage) override; - virtual void KeyStatusChanged(const nsCString& aSessionId, - const nsTArray& aKeyId, - GMPMediaKeyStatus aStatus) override; + void KeyStatusChanged(const nsCString& aSessionId, + const nsTArray& aKeyId, + GMPMediaKeyStatus aStatus) override; - virtual void SetCaps(uint64_t aCaps) override; + void SetCaps(uint64_t aCaps) override; - virtual void Decrypted(uint32_t aId, - GMPErr aResult, - const nsTArray& aDecryptedData) override; + void Decrypted(uint32_t aId, + GMPErr aResult, + const nsTArray& aDecryptedData) override; - virtual void Terminated() override; + void Terminated() override; ~CDMCallbackProxy() {} diff --git a/dom/media/eme/MediaEncryptedEvent.h b/dom/media/eme/MediaEncryptedEvent.h index 3484c0d90fb..806fccad698 100644 --- a/dom/media/eme/MediaEncryptedEvent.h +++ b/dom/media/eme/MediaEncryptedEvent.h @@ -36,7 +36,7 @@ protected: public: - virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle aGivenProto) override; static already_AddRefed Constructor(EventTarget* aOwner); diff --git a/dom/media/eme/MediaKeyError.h b/dom/media/eme/MediaKeyError.h index f92a8791000..df79b2c9599 100644 --- a/dom/media/eme/MediaKeyError.h +++ b/dom/media/eme/MediaKeyError.h @@ -24,7 +24,7 @@ public: MediaKeyError(EventTarget* aOwner, uint32_t aSystemCode); ~MediaKeyError(); - virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle aGivenProto) override; uint32_t SystemCode() const; diff --git a/dom/media/eme/MediaKeyMessageEvent.h b/dom/media/eme/MediaKeyMessageEvent.h index c89351164b5..b6cc86dfaaf 100644 --- a/dom/media/eme/MediaKeyMessageEvent.h +++ b/dom/media/eme/MediaKeyMessageEvent.h @@ -37,7 +37,7 @@ protected: public: virtual MediaKeyMessageEvent* AsMediaKeyMessageEvent(); - virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle aGivenProto) override; static already_AddRefed Constructor(EventTarget* aOwner, diff --git a/dom/media/eme/MediaKeySession.h b/dom/media/eme/MediaKeySession.h index b0b981799b6..07461f1aea0 100644 --- a/dom/media/eme/MediaKeySession.h +++ b/dom/media/eme/MediaKeySession.h @@ -47,7 +47,7 @@ public: void SetSessionId(const nsAString& aSessionId); - virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; // Mark this as resultNotAddRefed to return raw pointers MediaKeyError* GetError() const; diff --git a/dom/media/eme/MediaKeyStatusMap.h b/dom/media/eme/MediaKeyStatusMap.h index 7355563be0f..8b15fb13d7a 100644 --- a/dom/media/eme/MediaKeyStatusMap.h +++ b/dom/media/eme/MediaKeyStatusMap.h @@ -42,7 +42,7 @@ protected: public: nsPIDOMWindow* GetParentObject() const; - virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; MediaKeyStatus Get(const ArrayBufferViewOrArrayBuffer& aKey) const; bool Has(const ArrayBufferViewOrArrayBuffer& aKey) const; diff --git a/dom/media/eme/MediaKeySystemAccess.h b/dom/media/eme/MediaKeySystemAccess.h index e6198ad9f88..0e52f46a1d4 100644 --- a/dom/media/eme/MediaKeySystemAccess.h +++ b/dom/media/eme/MediaKeySystemAccess.h @@ -40,7 +40,7 @@ protected: public: nsPIDOMWindow* GetParentObject() const; - virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; void GetKeySystem(nsString& aRetVal) const; diff --git a/dom/media/eme/MediaKeys.h b/dom/media/eme/MediaKeys.h index c39283471de..09e7102a870 100644 --- a/dom/media/eme/MediaKeys.h +++ b/dom/media/eme/MediaKeys.h @@ -52,7 +52,7 @@ public: nsPIDOMWindow* GetParentObject() const; - virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; nsresult Bind(HTMLMediaElement* aElement); void Unbind(); From c6b5313233888147f3b83b4849029119d0bf1e7b Mon Sep 17 00:00:00 2001 From: Jean-Yves Avenard Date: Mon, 18 Jan 2016 14:33:44 +1100 Subject: [PATCH 009/119] Bug 1240411: P4. Clean up readers headers. r=cpearce Remove redundant virtual keyword and add missing override if any. --- dom/media/android/AndroidMediaDecoder.h | 9 ++------- dom/media/android/AndroidMediaReader.h | 15 ++++++--------- dom/media/fmp4/MP4Decoder.h | 4 ++-- dom/media/fmp4/MP4Demuxer.cpp | 14 +++++++------- dom/media/fmp4/MP4Demuxer.h | 18 +++++++++--------- dom/media/fmp4/MP4Stream.h | 10 +++++----- dom/media/ogg/OggDecoder.h | 4 ++-- dom/media/ogg/OggReader.h | 17 +++++++---------- dom/media/raw/RawDecoder.h | 4 ++-- dom/media/raw/RawReader.h | 17 ++++++++--------- dom/media/wave/WaveDecoder.h | 4 ++-- dom/media/wave/WaveReader.h | 14 ++++++-------- dom/media/webm/WebMDecoder.h | 4 ++-- dom/media/webm/WebMDemuxer.h | 6 +++--- 14 files changed, 63 insertions(+), 77 deletions(-) diff --git a/dom/media/android/AndroidMediaDecoder.h b/dom/media/android/AndroidMediaDecoder.h index b38524f93d6..88b5a243fda 100644 --- a/dom/media/android/AndroidMediaDecoder.h +++ b/dom/media/android/AndroidMediaDecoder.h @@ -17,15 +17,10 @@ class AndroidMediaDecoder : public MediaDecoder public: AndroidMediaDecoder(MediaDecoderOwner* aOwner, const nsACString& aType); - nsresult GetContentType(nsACString& aType) const { - aType = mType; - return NS_OK; - } - - virtual MediaDecoder* Clone(MediaDecoderOwner* aOwner) { + MediaDecoder* Clone(MediaDecoderOwner* aOwner) override { return new AndroidMediaDecoder(aOwner, mType); } - virtual MediaDecoderStateMachine* CreateStateMachine(); + MediaDecoderStateMachine* CreateStateMachine() override; }; } // namespace mozilla diff --git a/dom/media/android/AndroidMediaReader.h b/dom/media/android/AndroidMediaReader.h index 267aca3a317..80f43448caa 100644 --- a/dom/media/android/AndroidMediaReader.h +++ b/dom/media/android/AndroidMediaReader.h @@ -42,18 +42,15 @@ public: AndroidMediaReader(AbstractMediaDecoder* aDecoder, const nsACString& aContentType); - virtual nsresult ResetDecode(); + nsresult ResetDecode() override; - virtual bool DecodeAudioData(); - virtual bool DecodeVideoFrame(bool &aKeyframeSkip, - int64_t aTimeThreshold); + bool DecodeAudioData() override; + bool DecodeVideoFrame(bool &aKeyframeSkip, int64_t aTimeThreshold) override; - virtual nsresult ReadMetadata(MediaInfo* aInfo, - MetadataTags** aTags); - virtual RefPtr - Seek(int64_t aTime, int64_t aEndTime) override; + nsresult ReadMetadata(MediaInfo* aInfo, MetadataTags** aTags) override; + RefPtr Seek(int64_t aTime, int64_t aEndTime) override; - virtual RefPtr Shutdown() override; + RefPtr Shutdown() override; class ImageBufferCallback : public MPAPI::BufferCallback { typedef mozilla::layers::Image Image; diff --git a/dom/media/fmp4/MP4Decoder.h b/dom/media/fmp4/MP4Decoder.h index 7fb1726c983..b509cb69e54 100644 --- a/dom/media/fmp4/MP4Decoder.h +++ b/dom/media/fmp4/MP4Decoder.h @@ -16,14 +16,14 @@ class MP4Decoder : public MediaDecoder public: explicit MP4Decoder(MediaDecoderOwner* aOwner); - virtual MediaDecoder* Clone(MediaDecoderOwner* aOwner) override { + MediaDecoder* Clone(MediaDecoderOwner* aOwner) override { if (!IsEnabled()) { return nullptr; } return new MP4Decoder(aOwner); } - virtual MediaDecoderStateMachine* CreateStateMachine() override; + MediaDecoderStateMachine* CreateStateMachine() override; // Returns true if aMIMEType is a type that we think we can render with the // a MP4 platform decoder backend. If aCodecs is non emtpy, it is filled diff --git a/dom/media/fmp4/MP4Demuxer.cpp b/dom/media/fmp4/MP4Demuxer.cpp index dc9fb427909..14a7ff1e035 100644 --- a/dom/media/fmp4/MP4Demuxer.cpp +++ b/dom/media/fmp4/MP4Demuxer.cpp @@ -34,21 +34,21 @@ public: UniquePtr&& aInfo, const nsTArray& indices); - virtual UniquePtr GetInfo() const override; + UniquePtr GetInfo() const override; - virtual RefPtr Seek(media::TimeUnit aTime) override; + RefPtr Seek(media::TimeUnit aTime) override; - virtual RefPtr GetSamples(int32_t aNumSamples = 1) override; + RefPtr GetSamples(int32_t aNumSamples = 1) override; - virtual void Reset() override; + void Reset() override; - virtual nsresult GetNextRandomAccessPoint(media::TimeUnit* aTime) override; + nsresult GetNextRandomAccessPoint(media::TimeUnit* aTime) override; RefPtr SkipToNextRandomAccessPoint(media::TimeUnit aTimeThreshold) override; - virtual media::TimeIntervals GetBuffered() override; + media::TimeIntervals GetBuffered() override; - virtual void BreakCycles() override; + void BreakCycles() override; private: friend class MP4Demuxer; diff --git a/dom/media/fmp4/MP4Demuxer.h b/dom/media/fmp4/MP4Demuxer.h index 8df1a5b2b0b..ab3f87c4b24 100644 --- a/dom/media/fmp4/MP4Demuxer.h +++ b/dom/media/fmp4/MP4Demuxer.h @@ -27,22 +27,22 @@ class MP4Demuxer : public MediaDataDemuxer public: explicit MP4Demuxer(MediaResource* aResource); - virtual RefPtr Init() override; + RefPtr Init() override; - virtual bool HasTrackType(TrackInfo::TrackType aType) const override; + bool HasTrackType(TrackInfo::TrackType aType) const override; - virtual uint32_t GetNumberTracks(TrackInfo::TrackType aType) const override; + uint32_t GetNumberTracks(TrackInfo::TrackType aType) const override; - virtual already_AddRefed GetTrackDemuxer(TrackInfo::TrackType aType, - uint32_t aTrackNumber) override; + already_AddRefed GetTrackDemuxer(TrackInfo::TrackType aType, + uint32_t aTrackNumber) override; - virtual bool IsSeekable() const override; + bool IsSeekable() const override; - virtual UniquePtr GetCrypto() override; + UniquePtr GetCrypto() override; - virtual void NotifyDataArrived() override; + void NotifyDataArrived() override; - virtual void NotifyDataRemoved() override; + void NotifyDataRemoved() override; private: friend class MP4TrackDemuxer; diff --git a/dom/media/fmp4/MP4Stream.h b/dom/media/fmp4/MP4Stream.h index 22a7faf89ac..d7d8e6afc10 100644 --- a/dom/media/fmp4/MP4Stream.h +++ b/dom/media/fmp4/MP4Stream.h @@ -24,11 +24,11 @@ public: explicit MP4Stream(MediaResource* aResource); virtual ~MP4Stream(); bool BlockingReadIntoCache(int64_t aOffset, size_t aCount, Monitor* aToUnlock); - virtual bool ReadAt(int64_t aOffset, void* aBuffer, size_t aCount, - size_t* aBytesRead) override; - virtual bool CachedReadAt(int64_t aOffset, void* aBuffer, size_t aCount, - size_t* aBytesRead) override; - virtual bool Length(int64_t* aSize) override; + bool ReadAt(int64_t aOffset, void* aBuffer, size_t aCount, + size_t* aBytesRead) override; + bool CachedReadAt(int64_t aOffset, void* aBuffer, size_t aCount, + size_t* aBytesRead) override; + bool Length(int64_t* aSize) override; struct ReadRecord { ReadRecord(int64_t aOffset, size_t aCount) : mOffset(aOffset), mCount(aCount) {} diff --git a/dom/media/ogg/OggDecoder.h b/dom/media/ogg/OggDecoder.h index 4858f5bfd59..d9c56ea17d8 100644 --- a/dom/media/ogg/OggDecoder.h +++ b/dom/media/ogg/OggDecoder.h @@ -19,13 +19,13 @@ public: , mShutdownBit(false) {} - virtual MediaDecoder* Clone(MediaDecoderOwner* aOwner) override { + MediaDecoder* Clone(MediaDecoderOwner* aOwner) override { if (!IsOggEnabled()) { return nullptr; } return new OggDecoder(aOwner); } - virtual MediaDecoderStateMachine* CreateStateMachine() override; + MediaDecoderStateMachine* CreateStateMachine() override; // For yucky legacy reasons, the ogg decoder needs to do a cross-thread read // to check for shutdown while it hogs its own task queue. We don't want to diff --git a/dom/media/ogg/OggReader.h b/dom/media/ogg/OggReader.h index e718eadd440..a7eff650306 100644 --- a/dom/media/ogg/OggReader.h +++ b/dom/media/ogg/OggReader.h @@ -50,21 +50,18 @@ protected: ~OggReader(); public: - virtual nsresult Init() override; - virtual nsresult ResetDecode() override; - virtual bool DecodeAudioData() override; + nsresult Init() override; + nsresult ResetDecode() override; + bool DecodeAudioData() override; // If the Theora granulepos has not been captured, it may read several packets // until one with a granulepos has been captured, to ensure that all packets // read have valid time info. - virtual bool DecodeVideoFrame(bool &aKeyframeSkip, - int64_t aTimeThreshold) override; + bool DecodeVideoFrame(bool &aKeyframeSkip, int64_t aTimeThreshold) override; - virtual nsresult ReadMetadata(MediaInfo* aInfo, - MetadataTags** aTags) override; - virtual RefPtr - Seek(int64_t aTime, int64_t aEndTime) override; - virtual media::TimeIntervals GetBuffered() override; + nsresult ReadMetadata(MediaInfo* aInfo, MetadataTags** aTags) override; + RefPtr Seek(int64_t aTime, int64_t aEndTime) override; + media::TimeIntervals GetBuffered() override; private: bool HasAudio() { diff --git a/dom/media/raw/RawDecoder.h b/dom/media/raw/RawDecoder.h index bbb206187a2..cc1fc85da38 100644 --- a/dom/media/raw/RawDecoder.h +++ b/dom/media/raw/RawDecoder.h @@ -13,13 +13,13 @@ class RawDecoder : public MediaDecoder { public: explicit RawDecoder(MediaDecoderOwner* aOwner) : MediaDecoder(aOwner) {} - virtual MediaDecoder* Clone(MediaDecoderOwner* aOwner) { + MediaDecoder* Clone(MediaDecoderOwner* aOwner) override { if (!IsRawEnabled()) { return nullptr; } return new RawDecoder(aOwner); } - virtual MediaDecoderStateMachine* CreateStateMachine(); + MediaDecoderStateMachine* CreateStateMachine() override; }; } // namespace mozilla diff --git a/dom/media/raw/RawReader.h b/dom/media/raw/RawReader.h index de3d8e10433..9742d26010c 100644 --- a/dom/media/raw/RawReader.h +++ b/dom/media/raw/RawReader.h @@ -20,18 +20,17 @@ protected: ~RawReader(); public: - virtual nsresult ResetDecode() override; - virtual bool DecodeAudioData() override; + nsresult ResetDecode() override; + bool DecodeAudioData() override; - virtual bool DecodeVideoFrame(bool &aKeyframeSkip, - int64_t aTimeThreshold) override; + bool DecodeVideoFrame(bool &aKeyframeSkip, + int64_t aTimeThreshold) override; - virtual nsresult ReadMetadata(MediaInfo* aInfo, - MetadataTags** aTags) override; - virtual RefPtr - Seek(int64_t aTime, int64_t aEndTime) override; + nsresult ReadMetadata(MediaInfo* aInfo, + MetadataTags** aTags) override; + RefPtr Seek(int64_t aTime, int64_t aEndTime) override; - virtual media::TimeIntervals GetBuffered() override; + media::TimeIntervals GetBuffered() override; private: bool ReadFromResource(uint8_t *aBuf, uint32_t aLength); diff --git a/dom/media/wave/WaveDecoder.h b/dom/media/wave/WaveDecoder.h index 71a4a2e6985..194b35dd1ec 100644 --- a/dom/media/wave/WaveDecoder.h +++ b/dom/media/wave/WaveDecoder.h @@ -25,13 +25,13 @@ class WaveDecoder : public MediaDecoder { public: explicit WaveDecoder(MediaDecoderOwner* aOwner) : MediaDecoder(aOwner) {} - virtual MediaDecoder* Clone(MediaDecoderOwner* aOwner) { + MediaDecoder* Clone(MediaDecoderOwner* aOwner) override { if (!IsWaveEnabled()) { return nullptr; } return new WaveDecoder(aOwner); } - virtual MediaDecoderStateMachine* CreateStateMachine(); + MediaDecoderStateMachine* CreateStateMachine() override; }; } // namespace mozilla diff --git a/dom/media/wave/WaveReader.h b/dom/media/wave/WaveReader.h index d7cb2ad72f5..ff58939c99b 100644 --- a/dom/media/wave/WaveReader.h +++ b/dom/media/wave/WaveReader.h @@ -22,16 +22,14 @@ protected: ~WaveReader(); public: - virtual bool DecodeAudioData() override; - virtual bool DecodeVideoFrame(bool &aKeyframeSkip, - int64_t aTimeThreshold) override; + bool DecodeAudioData() override; + bool DecodeVideoFrame(bool &aKeyframeSkip, + int64_t aTimeThreshold) override; - virtual nsresult ReadMetadata(MediaInfo* aInfo, - MetadataTags** aTags) override; - virtual RefPtr - Seek(int64_t aTime, int64_t aEndTime) override; + nsresult ReadMetadata(MediaInfo* aInfo, MetadataTags** aTags) override; + RefPtr Seek(int64_t aTime, int64_t aEndTime) override; - virtual media::TimeIntervals GetBuffered() override; + media::TimeIntervals GetBuffered() override; private: bool ReadAll(char* aBuf, int64_t aSize, int64_t* aBytesRead = nullptr); diff --git a/dom/media/webm/WebMDecoder.h b/dom/media/webm/WebMDecoder.h index c451e2d5e6d..03c049c48f8 100644 --- a/dom/media/webm/WebMDecoder.h +++ b/dom/media/webm/WebMDecoder.h @@ -14,13 +14,13 @@ class WebMDecoder : public MediaDecoder { public: explicit WebMDecoder(MediaDecoderOwner* aOwner) : MediaDecoder(aOwner) {} - virtual MediaDecoder* Clone(MediaDecoderOwner* aOwner) { + MediaDecoder* Clone(MediaDecoderOwner* aOwner) override { if (!IsWebMEnabled()) { return nullptr; } return new WebMDecoder(aOwner); } - virtual MediaDecoderStateMachine* CreateStateMachine(); + MediaDecoderStateMachine* CreateStateMachine() override; // Returns true if the WebM backend is preffed on. static bool IsEnabled(); diff --git a/dom/media/webm/WebMDemuxer.h b/dom/media/webm/WebMDemuxer.h index 88b236b9d3e..d1d9a2c6185 100644 --- a/dom/media/webm/WebMDemuxer.h +++ b/dom/media/webm/WebMDemuxer.h @@ -108,10 +108,10 @@ public: nsresult Reset(); // Pushes a packet to the front of the audio packet queue. - virtual void PushAudioPacket(NesteggPacketHolder* aItem); + void PushAudioPacket(NesteggPacketHolder* aItem); // Pushes a packet to the front of the video packet queue. - virtual void PushVideoPacket(NesteggPacketHolder* aItem); + void PushVideoPacket(NesteggPacketHolder* aItem); // Public accessor for nestegg callbacks MediaResourceIndex* GetResource() @@ -140,7 +140,7 @@ private: void NotifyDataRemoved() override; void EnsureUpToDateIndex(); media::TimeIntervals GetBuffered(); - virtual nsresult SeekInternal(const media::TimeUnit& aTarget); + nsresult SeekInternal(const media::TimeUnit& aTarget); // Read a packet from the nestegg file. Returns nullptr if all packets for // the particular track have been read. Pass TrackInfo::kVideoTrack or From 9e6373a4af1f9a1ea39efae067da0c49cc47b490 Mon Sep 17 00:00:00 2001 From: Jean-Yves Avenard Date: Mon, 18 Jan 2016 14:40:49 +1100 Subject: [PATCH 010/119] Bug 1240411: P5. Clean up GMP headers. r=cpearce Remove redundant virtual keywords --- dom/media/gmp-plugin/gmp-test-decryptor.h | 58 +++++------ dom/media/gmp-plugin/gmp-test-storage.cpp | 30 +++--- dom/media/gmp/GMPAudioDecoderChild.h | 20 ++-- dom/media/gmp/GMPAudioDecoderParent.h | 36 +++---- dom/media/gmp/GMPAudioHost.h | 30 +++--- dom/media/gmp/GMPChild.h | 30 +++--- dom/media/gmp/GMPContentChild.h | 30 +++--- dom/media/gmp/GMPContentParent.h | 20 ++-- dom/media/gmp/GMPDecryptorChild.h | 116 ++++++++++----------- dom/media/gmp/GMPDecryptorParent.h | 100 +++++++++--------- dom/media/gmp/GMPEncryptedBufferDataImpl.h | 30 +++--- dom/media/gmp/GMPLoader.cpp | 20 ++-- dom/media/gmp/GMPParent.h | 28 ++--- dom/media/gmp/GMPPlatform.h | 10 +- dom/media/gmp/GMPProcessChild.h | 4 +- dom/media/gmp/GMPProcessParent.h | 2 +- dom/media/gmp/GMPService.cpp | 8 +- dom/media/gmp/GMPServiceChild.cpp | 4 +- dom/media/gmp/GMPServiceChild.h | 15 ++- dom/media/gmp/GMPServiceParent.cpp | 4 +- dom/media/gmp/GMPServiceParent.h | 38 +++---- dom/media/gmp/GMPStorageChild.cpp | 6 +- dom/media/gmp/GMPStorageChild.h | 30 +++--- dom/media/gmp/GMPStorageParent.h | 14 +-- dom/media/gmp/GMPTimerChild.h | 2 +- dom/media/gmp/GMPTimerParent.h | 6 +- dom/media/gmp/GMPVideoDecoderChild.h | 40 +++---- dom/media/gmp/GMPVideoDecoderParent.h | 56 +++++----- dom/media/gmp/GMPVideoEncodedFrameImpl.h | 50 ++++----- dom/media/gmp/GMPVideoEncoderChild.h | 40 +++---- dom/media/gmp/GMPVideoEncoderParent.h | 48 ++++----- dom/media/gmp/GMPVideoHost.h | 4 +- dom/media/gmp/GMPVideoPlaneImpl.h | 30 +++--- dom/media/gmp/GMPVideoi420FrameImpl.h | 62 +++++------ 34 files changed, 510 insertions(+), 511 deletions(-) diff --git a/dom/media/gmp-plugin/gmp-test-decryptor.h b/dom/media/gmp-plugin/gmp-test-decryptor.h index e530273a024..5479c75d47f 100644 --- a/dom/media/gmp-plugin/gmp-test-decryptor.h +++ b/dom/media/gmp-plugin/gmp-test-decryptor.h @@ -16,56 +16,56 @@ public: explicit FakeDecryptor(GMPDecryptorHost* aHost); - virtual void Init(GMPDecryptorCallback* aCallback) override { + void Init(GMPDecryptorCallback* aCallback) override { mCallback = aCallback; } - virtual void CreateSession(uint32_t aCreateSessionToken, - uint32_t aPromiseId, - const char* aInitDataType, - uint32_t aInitDataTypeSize, - const uint8_t* aInitData, - uint32_t aInitDataSize, - GMPSessionType aSessionType) override + void CreateSession(uint32_t aCreateSessionToken, + uint32_t aPromiseId, + const char* aInitDataType, + uint32_t aInitDataTypeSize, + const uint8_t* aInitData, + uint32_t aInitDataSize, + GMPSessionType aSessionType) override { } - virtual void LoadSession(uint32_t aPromiseId, - const char* aSessionId, - uint32_t aSessionIdLength) override + void LoadSession(uint32_t aPromiseId, + const char* aSessionId, + uint32_t aSessionIdLength) override { } - virtual void UpdateSession(uint32_t aPromiseId, - const char* aSessionId, - uint32_t aSessionIdLength, - const uint8_t* aResponse, - uint32_t aResponseSize) override; + void UpdateSession(uint32_t aPromiseId, + const char* aSessionId, + uint32_t aSessionIdLength, + const uint8_t* aResponse, + uint32_t aResponseSize) override; - virtual void CloseSession(uint32_t aPromiseId, - const char* aSessionId, - uint32_t aSessionIdLength) override + void CloseSession(uint32_t aPromiseId, + const char* aSessionId, + uint32_t aSessionIdLength) override { } - virtual void RemoveSession(uint32_t aPromiseId, - const char* aSessionId, - uint32_t aSessionIdLength) override + void RemoveSession(uint32_t aPromiseId, + const char* aSessionId, + uint32_t aSessionIdLength) override { } - virtual void SetServerCertificate(uint32_t aPromiseId, - const uint8_t* aServerCert, - uint32_t aServerCertSize) override + void SetServerCertificate(uint32_t aPromiseId, + const uint8_t* aServerCert, + uint32_t aServerCertSize) override { } - virtual void Decrypt(GMPBuffer* aBuffer, - GMPEncryptedBufferMetadata* aMetadata) override + void Decrypt(GMPBuffer* aBuffer, + GMPEncryptedBufferMetadata* aMetadata) override { } - virtual void DecryptingComplete() override; + void DecryptingComplete() override; static void Message(const std::string& aMessage); @@ -89,7 +89,7 @@ public: : mHost(aHost) { } - virtual void BeginShutdown() override; + void BeginShutdown() override; private: GMPAsyncShutdownHost* mHost; }; diff --git a/dom/media/gmp-plugin/gmp-test-storage.cpp b/dom/media/gmp-plugin/gmp-test-storage.cpp index f733aef154f..e75b49f4212 100644 --- a/dom/media/gmp-plugin/gmp-test-storage.cpp +++ b/dom/media/gmp-plugin/gmp-test-storage.cpp @@ -23,7 +23,7 @@ public: return mRecord->Open(); } - virtual void OpenComplete(GMPErr aStatus) override { + void OpenComplete(GMPErr aStatus) override { if (GMP_SUCCEEDED(aStatus)) { mRecord->Write(mData.size() ? &mData.front() : nullptr, mData.size()); } else { @@ -32,11 +32,11 @@ public: } } - virtual void ReadComplete(GMPErr aStatus, - const uint8_t* aData, - uint32_t aDataSize) override {} + void ReadComplete(GMPErr aStatus, + const uint8_t* aData, + uint32_t aDataSize) override {} - virtual void WriteComplete(GMPErr aStatus) override { + void WriteComplete(GMPErr aStatus) override { // Note: Call Close() before running continuation, in case the // continuation tries to open the same record; if we call Close() // after running the continuation, the Close() call will arrive @@ -103,7 +103,7 @@ public: return mRecord->Open(); } - virtual void OpenComplete(GMPErr aStatus) override { + void OpenComplete(GMPErr aStatus) override { auto err = mRecord->Read(); if (GMP_FAILED(err)) { mContinuation->ReadComplete(err, ""); @@ -111,9 +111,9 @@ public: } } - virtual void ReadComplete(GMPErr aStatus, - const uint8_t* aData, - uint32_t aDataSize) override { + void ReadComplete(GMPErr aStatus, + const uint8_t* aData, + uint32_t aDataSize) override { // Note: Call Close() before running continuation, in case the // continuation tries to open the same record; if we call Close() // after running the continuation, the Close() call will arrive @@ -125,7 +125,7 @@ public: delete this; } - virtual void WriteComplete(GMPErr aStatus) override { + void WriteComplete(GMPErr aStatus) override { } private: @@ -181,17 +181,17 @@ public: (new OpenRecordClient(aContinuation))->Do(aRecordName); } - virtual void OpenComplete(GMPErr aStatus) override { + void OpenComplete(GMPErr aStatus) override { Done(aStatus); } - virtual void ReadComplete(GMPErr aStatus, - const uint8_t* aData, - uint32_t aDataSize) override { + void ReadComplete(GMPErr aStatus, + const uint8_t* aData, + uint32_t aDataSize) override { MOZ_CRASH("Should not reach here."); } - virtual void WriteComplete(GMPErr aStatus) override { + void WriteComplete(GMPErr aStatus) override { MOZ_CRASH("Should not reach here."); } diff --git a/dom/media/gmp/GMPAudioDecoderChild.h b/dom/media/gmp/GMPAudioDecoderChild.h index 1fb843fcaf0..0393fa57336 100644 --- a/dom/media/gmp/GMPAudioDecoderChild.h +++ b/dom/media/gmp/GMPAudioDecoderChild.h @@ -26,19 +26,19 @@ public: GMPAudioHostImpl& Host(); // GMPAudioDecoderCallback - virtual void Decoded(GMPAudioSamples* aEncodedSamples) override; - virtual void InputDataExhausted() override; - virtual void DrainComplete() override; - virtual void ResetComplete() override; - virtual void Error(GMPErr aError) override; + void Decoded(GMPAudioSamples* aEncodedSamples) override; + void InputDataExhausted() override; + void DrainComplete() override; + void ResetComplete() override; + void Error(GMPErr aError) override; private: // PGMPAudioDecoderChild - virtual bool RecvInitDecode(const GMPAudioCodecData& codecSettings) override; - virtual bool RecvDecode(const GMPAudioEncodedSampleData& input) override; - virtual bool RecvReset() override; - virtual bool RecvDrain() override; - virtual bool RecvDecodingComplete() override; + bool RecvInitDecode(const GMPAudioCodecData& codecSettings) override; + bool RecvDecode(const GMPAudioEncodedSampleData& input) override; + bool RecvReset() override; + bool RecvDrain() override; + bool RecvDecodingComplete() override; GMPContentChild* mPlugin; GMPAudioDecoder* mAudioDecoder; diff --git a/dom/media/gmp/GMPAudioDecoderParent.h b/dom/media/gmp/GMPAudioDecoderParent.h index 9ba6e7030f6..3e15edb0e63 100644 --- a/dom/media/gmp/GMPAudioDecoderParent.h +++ b/dom/media/gmp/GMPAudioDecoderParent.h @@ -29,29 +29,29 @@ public: nsresult Shutdown(); // GMPAudioDecoderProxy - virtual nsresult InitDecode(GMPAudioCodecType aCodecType, - uint32_t aChannelCount, - uint32_t aBitsPerChannel, - uint32_t aSamplesPerSecond, - nsTArray& aExtraData, - GMPAudioDecoderCallbackProxy* aCallback) override; - virtual nsresult Decode(GMPAudioSamplesImpl& aInput) override; - virtual nsresult Reset() override; - virtual nsresult Drain() override; - virtual nsresult Close() override; + nsresult InitDecode(GMPAudioCodecType aCodecType, + uint32_t aChannelCount, + uint32_t aBitsPerChannel, + uint32_t aSamplesPerSecond, + nsTArray& aExtraData, + GMPAudioDecoderCallbackProxy* aCallback) override; + nsresult Decode(GMPAudioSamplesImpl& aInput) override; + nsresult Reset() override; + nsresult Drain() override; + nsresult Close() override; private: ~GMPAudioDecoderParent(); // PGMPAudioDecoderParent - virtual void ActorDestroy(ActorDestroyReason aWhy) override; - virtual bool RecvDecoded(const GMPAudioDecodedSampleData& aDecoded) override; - virtual bool RecvInputDataExhausted() override; - virtual bool RecvDrainComplete() override; - virtual bool RecvResetComplete() override; - virtual bool RecvError(const GMPErr& aError) override; - virtual bool RecvShutdown() override; - virtual bool Recv__delete__() override; + void ActorDestroy(ActorDestroyReason aWhy) override; + bool RecvDecoded(const GMPAudioDecodedSampleData& aDecoded) override; + bool RecvInputDataExhausted() override; + bool RecvDrainComplete() override; + bool RecvResetComplete() override; + bool RecvError(const GMPErr& aError) override; + bool RecvShutdown() override; + bool Recv__delete__() override; void UnblockResetAndDrain(); diff --git a/dom/media/gmp/GMPAudioHost.h b/dom/media/gmp/GMPAudioHost.h index 6988044e39b..ed829b9c531 100644 --- a/dom/media/gmp/GMPAudioHost.h +++ b/dom/media/gmp/GMPAudioHost.h @@ -29,24 +29,24 @@ public: uint32_t aRate); virtual ~GMPAudioSamplesImpl(); - virtual GMPAudioFormat GetFormat() override; - virtual void Destroy() override; - virtual GMPErr SetBufferSize(uint32_t aSize) override; - virtual uint32_t Size() override; - virtual void SetTimeStamp(uint64_t aTimeStamp) override; - virtual uint64_t TimeStamp() override; - virtual const uint8_t* Buffer() const override; - virtual uint8_t* Buffer() override; - virtual const GMPEncryptedBufferMetadata* GetDecryptionData() const override; + GMPAudioFormat GetFormat() override; + void Destroy() override; + GMPErr SetBufferSize(uint32_t aSize) override; + uint32_t Size() override; + void SetTimeStamp(uint64_t aTimeStamp) override; + uint64_t TimeStamp() override; + const uint8_t* Buffer() const override; + uint8_t* Buffer() override; + const GMPEncryptedBufferMetadata* GetDecryptionData() const override; void InitCrypto(const CryptoSample& aCrypto); void RelinquishData(GMPAudioEncodedSampleData& aData); - virtual uint32_t Channels() const override; - virtual void SetChannels(uint32_t aChannels) override; - virtual uint32_t Rate() const override; - virtual void SetRate(uint32_t aRate) override; + uint32_t Channels() const override; + void SetChannels(uint32_t aChannels) override; + uint32_t Rate() const override; + void SetRate(uint32_t aRate) override; private: GMPAudioFormat mFormat; @@ -60,8 +60,8 @@ private: class GMPAudioHostImpl : public GMPAudioHost { public: - virtual GMPErr CreateSamples(GMPAudioFormat aFormat, - GMPAudioSamples** aSamples) override; + GMPErr CreateSamples(GMPAudioFormat aFormat, + GMPAudioSamples** aSamples) override; private: }; diff --git a/dom/media/gmp/GMPChild.h b/dom/media/gmp/GMPChild.h index 83956b24b9d..e6845c67170 100644 --- a/dom/media/gmp/GMPChild.h +++ b/dom/media/gmp/GMPChild.h @@ -55,28 +55,28 @@ private: bool GetUTF8LibPath(nsACString& aOutLibPath); - virtual bool RecvSetNodeId(const nsCString& aNodeId) override; - virtual bool AnswerStartPlugin() override; + bool RecvSetNodeId(const nsCString& aNodeId) override; + bool AnswerStartPlugin() override; - virtual PCrashReporterChild* AllocPCrashReporterChild(const NativeThreadId& aThread) override; - virtual bool DeallocPCrashReporterChild(PCrashReporterChild*) override; + PCrashReporterChild* AllocPCrashReporterChild(const NativeThreadId& aThread) override; + bool DeallocPCrashReporterChild(PCrashReporterChild*) override; - virtual PGMPTimerChild* AllocPGMPTimerChild() override; - virtual bool DeallocPGMPTimerChild(PGMPTimerChild* aActor) override; + PGMPTimerChild* AllocPGMPTimerChild() override; + bool DeallocPGMPTimerChild(PGMPTimerChild* aActor) override; - virtual PGMPStorageChild* AllocPGMPStorageChild() override; - virtual bool DeallocPGMPStorageChild(PGMPStorageChild* aActor) override; + PGMPStorageChild* AllocPGMPStorageChild() override; + bool DeallocPGMPStorageChild(PGMPStorageChild* aActor) override; - virtual PGMPContentChild* AllocPGMPContentChild(Transport* aTransport, - ProcessId aOtherPid) override; + PGMPContentChild* AllocPGMPContentChild(Transport* aTransport, + ProcessId aOtherPid) override; void GMPContentChildActorDestroy(GMPContentChild* aGMPContentChild); - virtual bool RecvCrashPluginNow() override; - virtual bool RecvBeginAsyncShutdown() override; - virtual bool RecvCloseActive() override; + bool RecvCrashPluginNow() override; + bool RecvBeginAsyncShutdown() override; + bool RecvCloseActive() override; - virtual void ActorDestroy(ActorDestroyReason aWhy) override; - virtual void ProcessingError(Result aCode, const char* aReason) override; + void ActorDestroy(ActorDestroyReason aWhy) override; + void ProcessingError(Result aCode, const char* aReason) override; GMPErr GetAPI(const char* aAPIName, void* aHostAPI, void** aPluginAPI); diff --git a/dom/media/gmp/GMPContentChild.h b/dom/media/gmp/GMPContentChild.h index 1170a533b21..1892defe1ef 100644 --- a/dom/media/gmp/GMPContentChild.h +++ b/dom/media/gmp/GMPContentChild.h @@ -23,28 +23,28 @@ public: MessageLoop* GMPMessageLoop(); - virtual bool RecvPGMPAudioDecoderConstructor(PGMPAudioDecoderChild* aActor) override; - virtual bool RecvPGMPDecryptorConstructor(PGMPDecryptorChild* aActor) override; - virtual bool RecvPGMPVideoDecoderConstructor(PGMPVideoDecoderChild* aActor) override; - virtual bool RecvPGMPVideoEncoderConstructor(PGMPVideoEncoderChild* aActor) override; + bool RecvPGMPAudioDecoderConstructor(PGMPAudioDecoderChild* aActor) override; + bool RecvPGMPDecryptorConstructor(PGMPDecryptorChild* aActor) override; + bool RecvPGMPVideoDecoderConstructor(PGMPVideoDecoderChild* aActor) override; + bool RecvPGMPVideoEncoderConstructor(PGMPVideoEncoderChild* aActor) override; - virtual PGMPAudioDecoderChild* AllocPGMPAudioDecoderChild() override; - virtual bool DeallocPGMPAudioDecoderChild(PGMPAudioDecoderChild* aActor) override; + PGMPAudioDecoderChild* AllocPGMPAudioDecoderChild() override; + bool DeallocPGMPAudioDecoderChild(PGMPAudioDecoderChild* aActor) override; - virtual PGMPDecryptorChild* AllocPGMPDecryptorChild() override; - virtual bool DeallocPGMPDecryptorChild(PGMPDecryptorChild* aActor) override; + PGMPDecryptorChild* AllocPGMPDecryptorChild() override; + bool DeallocPGMPDecryptorChild(PGMPDecryptorChild* aActor) override; - virtual PGMPVideoDecoderChild* AllocPGMPVideoDecoderChild() override; - virtual bool DeallocPGMPVideoDecoderChild(PGMPVideoDecoderChild* aActor) override; + PGMPVideoDecoderChild* AllocPGMPVideoDecoderChild() override; + bool DeallocPGMPVideoDecoderChild(PGMPVideoDecoderChild* aActor) override; - virtual PGMPVideoEncoderChild* AllocPGMPVideoEncoderChild() override; - virtual bool DeallocPGMPVideoEncoderChild(PGMPVideoEncoderChild* aActor) override; + PGMPVideoEncoderChild* AllocPGMPVideoEncoderChild() override; + bool DeallocPGMPVideoEncoderChild(PGMPVideoEncoderChild* aActor) override; - virtual void ActorDestroy(ActorDestroyReason aWhy) override; - virtual void ProcessingError(Result aCode, const char* aReason) override; + void ActorDestroy(ActorDestroyReason aWhy) override; + void ProcessingError(Result aCode, const char* aReason) override; // GMPSharedMem - virtual void CheckThread() override; + void CheckThread() override; void CloseActive(); bool IsUsed(); diff --git a/dom/media/gmp/GMPContentParent.h b/dom/media/gmp/GMPContentParent.h index 07aab7e8bd9..0003b5e1afb 100644 --- a/dom/media/gmp/GMPContentParent.h +++ b/dom/media/gmp/GMPContentParent.h @@ -42,7 +42,7 @@ public: nsIThread* GMPThread(); // GMPSharedMem - virtual void CheckThread() override; + void CheckThread() override; void SetDisplayName(const nsCString& aDisplayName) { @@ -64,19 +64,19 @@ public: private: ~GMPContentParent(); - virtual void ActorDestroy(ActorDestroyReason aWhy) override; + void ActorDestroy(ActorDestroyReason aWhy) override; - virtual PGMPVideoDecoderParent* AllocPGMPVideoDecoderParent() override; - virtual bool DeallocPGMPVideoDecoderParent(PGMPVideoDecoderParent* aActor) override; + PGMPVideoDecoderParent* AllocPGMPVideoDecoderParent() override; + bool DeallocPGMPVideoDecoderParent(PGMPVideoDecoderParent* aActor) override; - virtual PGMPVideoEncoderParent* AllocPGMPVideoEncoderParent() override; - virtual bool DeallocPGMPVideoEncoderParent(PGMPVideoEncoderParent* aActor) override; + PGMPVideoEncoderParent* AllocPGMPVideoEncoderParent() override; + bool DeallocPGMPVideoEncoderParent(PGMPVideoEncoderParent* aActor) override; - virtual PGMPDecryptorParent* AllocPGMPDecryptorParent() override; - virtual bool DeallocPGMPDecryptorParent(PGMPDecryptorParent* aActor) override; + PGMPDecryptorParent* AllocPGMPDecryptorParent() override; + bool DeallocPGMPDecryptorParent(PGMPDecryptorParent* aActor) override; - virtual PGMPAudioDecoderParent* AllocPGMPAudioDecoderParent() override; - virtual bool DeallocPGMPAudioDecoderParent(PGMPAudioDecoderParent* aActor) override; + PGMPAudioDecoderParent* AllocPGMPAudioDecoderParent() override; + bool DeallocPGMPAudioDecoderParent(PGMPAudioDecoderParent* aActor) override; void CloseIfUnused(); // Needed because NS_NewRunnableMethod tried to use the class that the method diff --git a/dom/media/gmp/GMPDecryptorChild.h b/dom/media/gmp/GMPDecryptorChild.h index cc8611d0bfb..175dc206c5d 100644 --- a/dom/media/gmp/GMPDecryptorChild.h +++ b/dom/media/gmp/GMPDecryptorChild.h @@ -31,88 +31,88 @@ public: void Init(GMPDecryptor* aSession); // GMPDecryptorCallback - virtual void SetSessionId(uint32_t aCreateSessionToken, - const char* aSessionId, - uint32_t aSessionIdLength) override; - virtual void ResolveLoadSessionPromise(uint32_t aPromiseId, - bool aSuccess) override; - virtual void ResolvePromise(uint32_t aPromiseId) override; + void SetSessionId(uint32_t aCreateSessionToken, + const char* aSessionId, + uint32_t aSessionIdLength) override; + void ResolveLoadSessionPromise(uint32_t aPromiseId, + bool aSuccess) override; + void ResolvePromise(uint32_t aPromiseId) override; - virtual void RejectPromise(uint32_t aPromiseId, - GMPDOMException aException, - const char* aMessage, - uint32_t aMessageLength) override; + void RejectPromise(uint32_t aPromiseId, + GMPDOMException aException, + const char* aMessage, + uint32_t aMessageLength) override; - virtual void SessionMessage(const char* aSessionId, - uint32_t aSessionIdLength, - GMPSessionMessageType aMessageType, - const uint8_t* aMessage, - uint32_t aMessageLength) override; + void SessionMessage(const char* aSessionId, + uint32_t aSessionIdLength, + GMPSessionMessageType aMessageType, + const uint8_t* aMessage, + uint32_t aMessageLength) override; - virtual void ExpirationChange(const char* aSessionId, - uint32_t aSessionIdLength, - GMPTimestamp aExpiryTime) override; + void ExpirationChange(const char* aSessionId, + uint32_t aSessionIdLength, + GMPTimestamp aExpiryTime) override; - virtual void SessionClosed(const char* aSessionId, - uint32_t aSessionIdLength) override; + void SessionClosed(const char* aSessionId, + uint32_t aSessionIdLength) override; - virtual void SessionError(const char* aSessionId, - uint32_t aSessionIdLength, - GMPDOMException aException, - uint32_t aSystemCode, - const char* aMessage, - uint32_t aMessageLength) override; + void SessionError(const char* aSessionId, + uint32_t aSessionIdLength, + GMPDOMException aException, + uint32_t aSystemCode, + const char* aMessage, + uint32_t aMessageLength) override; - virtual void KeyStatusChanged(const char* aSessionId, - uint32_t aSessionIdLength, - const uint8_t* aKeyId, - uint32_t aKeyIdLength, - GMPMediaKeyStatus aStatus) override; + void KeyStatusChanged(const char* aSessionId, + uint32_t aSessionIdLength, + const uint8_t* aKeyId, + uint32_t aKeyIdLength, + GMPMediaKeyStatus aStatus) override; - virtual void SetCapabilities(uint64_t aCaps) override; + void SetCapabilities(uint64_t aCaps) override; - virtual void Decrypted(GMPBuffer* aBuffer, GMPErr aResult) override; + void Decrypted(GMPBuffer* aBuffer, GMPErr aResult) override; // GMPDecryptorHost - virtual void GetSandboxVoucher(const uint8_t** aVoucher, - uint32_t* aVoucherLength) override; + void GetSandboxVoucher(const uint8_t** aVoucher, + uint32_t* aVoucherLength) override; - virtual void GetPluginVoucher(const uint8_t** aVoucher, - uint32_t* aVoucherLength) override; + void GetPluginVoucher(const uint8_t** aVoucher, + uint32_t* aVoucherLength) override; private: ~GMPDecryptorChild(); // GMPDecryptorChild - virtual bool RecvInit() override; + bool RecvInit() override; - virtual bool RecvCreateSession(const uint32_t& aCreateSessionToken, - const uint32_t& aPromiseId, - const nsCString& aInitDataType, - InfallibleTArray&& aInitData, - const GMPSessionType& aSessionType) override; + bool RecvCreateSession(const uint32_t& aCreateSessionToken, + const uint32_t& aPromiseId, + const nsCString& aInitDataType, + InfallibleTArray&& aInitData, + const GMPSessionType& aSessionType) override; - virtual bool RecvLoadSession(const uint32_t& aPromiseId, - const nsCString& aSessionId) override; + bool RecvLoadSession(const uint32_t& aPromiseId, + const nsCString& aSessionId) override; - virtual bool RecvUpdateSession(const uint32_t& aPromiseId, - const nsCString& aSessionId, - InfallibleTArray&& aResponse) override; + bool RecvUpdateSession(const uint32_t& aPromiseId, + const nsCString& aSessionId, + InfallibleTArray&& aResponse) override; - virtual bool RecvCloseSession(const uint32_t& aPromiseId, - const nsCString& aSessionId) override; + bool RecvCloseSession(const uint32_t& aPromiseId, + const nsCString& aSessionId) override; - virtual bool RecvRemoveSession(const uint32_t& aPromiseId, - const nsCString& aSessionId) override; + bool RecvRemoveSession(const uint32_t& aPromiseId, + const nsCString& aSessionId) override; - virtual bool RecvDecrypt(const uint32_t& aId, - InfallibleTArray&& aBuffer, - const GMPDecryptionData& aMetadata) override; + bool RecvDecrypt(const uint32_t& aId, + InfallibleTArray&& aBuffer, + const GMPDecryptionData& aMetadata) override; // Resolve/reject promise on completion. - virtual bool RecvSetServerCertificate(const uint32_t& aPromiseId, - InfallibleTArray&& aServerCert) override; + bool RecvSetServerCertificate(const uint32_t& aPromiseId, + InfallibleTArray&& aServerCert) override; - virtual bool RecvDecryptingComplete() override; + bool RecvDecryptingComplete() override; template void CallMethod(MethodType, ParamType&&...); diff --git a/dom/media/gmp/GMPDecryptorParent.h b/dom/media/gmp/GMPDecryptorParent.h index 15377e17bf0..2b0c85742f1 100644 --- a/dom/media/gmp/GMPDecryptorParent.h +++ b/dom/media/gmp/GMPDecryptorParent.h @@ -29,37 +29,37 @@ public: // GMPDecryptorProxy - virtual uint32_t GetPluginId() const override { return mPluginId; } + uint32_t GetPluginId() const override { return mPluginId; } - virtual nsresult Init(GMPDecryptorProxyCallback* aCallback) override; + nsresult Init(GMPDecryptorProxyCallback* aCallback) override; - virtual void CreateSession(uint32_t aCreateSessionToken, - uint32_t aPromiseId, - const nsCString& aInitDataType, - const nsTArray& aInitData, - GMPSessionType aSessionType) override; + void CreateSession(uint32_t aCreateSessionToken, + uint32_t aPromiseId, + const nsCString& aInitDataType, + const nsTArray& aInitData, + GMPSessionType aSessionType) override; - virtual void LoadSession(uint32_t aPromiseId, - const nsCString& aSessionId) override; + void LoadSession(uint32_t aPromiseId, + const nsCString& aSessionId) override; - virtual void UpdateSession(uint32_t aPromiseId, - const nsCString& aSessionId, - const nsTArray& aResponse) override; + void UpdateSession(uint32_t aPromiseId, + const nsCString& aSessionId, + const nsTArray& aResponse) override; - virtual void CloseSession(uint32_t aPromiseId, - const nsCString& aSessionId) override; + void CloseSession(uint32_t aPromiseId, + const nsCString& aSessionId) override; - virtual void RemoveSession(uint32_t aPromiseId, - const nsCString& aSessionId) override; + void RemoveSession(uint32_t aPromiseId, + const nsCString& aSessionId) override; - virtual void SetServerCertificate(uint32_t aPromiseId, - const nsTArray& aServerCert) override; + void SetServerCertificate(uint32_t aPromiseId, + const nsTArray& aServerCert) override; - virtual void Decrypt(uint32_t aId, - const CryptoSample& aCrypto, - const nsTArray& aBuffer) override; + void Decrypt(uint32_t aId, + const CryptoSample& aCrypto, + const nsTArray& aBuffer) override; - virtual void Close() override; + void Close() override; void Shutdown(); @@ -68,46 +68,46 @@ private: // PGMPDecryptorParent - virtual bool RecvSetSessionId(const uint32_t& aCreateSessionToken, - const nsCString& aSessionId) override; + bool RecvSetSessionId(const uint32_t& aCreateSessionToken, + const nsCString& aSessionId) override; - virtual bool RecvResolveLoadSessionPromise(const uint32_t& aPromiseId, - const bool& aSuccess) override; + bool RecvResolveLoadSessionPromise(const uint32_t& aPromiseId, + const bool& aSuccess) override; - virtual bool RecvResolvePromise(const uint32_t& aPromiseId) override; + bool RecvResolvePromise(const uint32_t& aPromiseId) override; - virtual bool RecvRejectPromise(const uint32_t& aPromiseId, - const GMPDOMException& aException, - const nsCString& aMessage) override; + bool RecvRejectPromise(const uint32_t& aPromiseId, + const GMPDOMException& aException, + const nsCString& aMessage) override; - virtual bool RecvSessionMessage(const nsCString& aSessionId, - const GMPSessionMessageType& aMessageType, - nsTArray&& aMessage) override; + bool RecvSessionMessage(const nsCString& aSessionId, + const GMPSessionMessageType& aMessageType, + nsTArray&& aMessage) override; - virtual bool RecvExpirationChange(const nsCString& aSessionId, - const double& aExpiryTime) override; + bool RecvExpirationChange(const nsCString& aSessionId, + const double& aExpiryTime) override; - virtual bool RecvSessionClosed(const nsCString& aSessionId) override; + bool RecvSessionClosed(const nsCString& aSessionId) override; - virtual bool RecvSessionError(const nsCString& aSessionId, - const GMPDOMException& aException, - const uint32_t& aSystemCode, - const nsCString& aMessage) override; + bool RecvSessionError(const nsCString& aSessionId, + const GMPDOMException& aException, + const uint32_t& aSystemCode, + const nsCString& aMessage) override; - virtual bool RecvKeyStatusChanged(const nsCString& aSessionId, - InfallibleTArray&& aKeyId, - const GMPMediaKeyStatus& aStatus) override; + bool RecvKeyStatusChanged(const nsCString& aSessionId, + InfallibleTArray&& aKeyId, + const GMPMediaKeyStatus& aStatus) override; - virtual bool RecvDecrypted(const uint32_t& aId, - const GMPErr& aErr, - InfallibleTArray&& aBuffer) override; + bool RecvDecrypted(const uint32_t& aId, + const GMPErr& aErr, + InfallibleTArray&& aBuffer) override; - virtual bool RecvSetCaps(const uint64_t& aCaps) override; + bool RecvSetCaps(const uint64_t& aCaps) override; - virtual bool RecvShutdown() override; + bool RecvShutdown() override; - virtual void ActorDestroy(ActorDestroyReason aWhy) override; - virtual bool Recv__delete__() override; + void ActorDestroy(ActorDestroyReason aWhy) override; + bool Recv__delete__() override; bool mIsOpen; bool mShuttingDown; diff --git a/dom/media/gmp/GMPEncryptedBufferDataImpl.h b/dom/media/gmp/GMPEncryptedBufferDataImpl.h index 023079be7bc..2efc098c11a 100644 --- a/dom/media/gmp/GMPEncryptedBufferDataImpl.h +++ b/dom/media/gmp/GMPEncryptedBufferDataImpl.h @@ -19,9 +19,9 @@ class GMPStringListImpl : public GMPStringList { public: explicit GMPStringListImpl(const nsTArray& aStrings); - virtual uint32_t Size() const override; - virtual void StringAt(uint32_t aIndex, - const char** aOutString, uint32_t *aOutLength) const override; + uint32_t Size() const override; + void StringAt(uint32_t aIndex, + const char** aOutString, uint32_t *aOutLength) const override; virtual ~GMPStringListImpl() override; void RelinquishData(nsTArray& aStrings); @@ -37,14 +37,14 @@ public: void RelinquishData(GMPDecryptionData& aData); - virtual const uint8_t* KeyId() const override; - virtual uint32_t KeyIdSize() const override; - virtual const uint8_t* IV() const override; - virtual uint32_t IVSize() const override; - virtual uint32_t NumSubsamples() const override; - virtual const uint16_t* ClearBytes() const override; - virtual const uint32_t* CipherBytes() const override; - virtual const GMPStringList* SessionIds() const override; + const uint8_t* KeyId() const override; + uint32_t KeyIdSize() const override; + const uint8_t* IV() const override; + uint32_t IVSize() const override; + uint32_t NumSubsamples() const override; + const uint16_t* ClearBytes() const override; + const uint32_t* CipherBytes() const override; + const GMPStringList* SessionIds() const override; private: nsTArray mKeyId; @@ -62,16 +62,16 @@ public: , mData(aData) { } - virtual uint32_t Id() const { + uint32_t Id() const override { return mId; } - virtual uint8_t* Data() { + uint8_t* Data() override { return mData.Elements(); } - virtual uint32_t Size() const { + uint32_t Size() const override { return mData.Length(); } - virtual void Resize(uint32_t aSize) { + void Resize(uint32_t aSize) override { mData.SetLength(aSize); } diff --git a/dom/media/gmp/GMPLoader.cpp b/dom/media/gmp/GMPLoader.cpp index c6a93a7a4c9..20063d8584e 100644 --- a/dom/media/gmp/GMPLoader.cpp +++ b/dom/media/gmp/GMPLoader.cpp @@ -56,20 +56,20 @@ public: {} virtual ~GMPLoaderImpl() {} - virtual bool Load(const char* aUTF8LibPath, - uint32_t aUTF8LibPathLen, - char* aOriginSalt, - uint32_t aOriginSaltLen, - const GMPPlatformAPI* aPlatformAPI) override; + bool Load(const char* aUTF8LibPath, + uint32_t aUTF8LibPathLen, + char* aOriginSalt, + uint32_t aOriginSaltLen, + const GMPPlatformAPI* aPlatformAPI) override; - virtual GMPErr GetAPI(const char* aAPIName, - void* aHostAPI, - void** aPluginAPI) override; + GMPErr GetAPI(const char* aAPIName, + void* aHostAPI, + void** aPluginAPI) override; - virtual void Shutdown() override; + void Shutdown() override; #if defined(XP_MACOSX) && defined(MOZ_GMP_SANDBOX) - virtual void SetSandboxInfo(MacSandboxInfo* aSandboxInfo) override; + void SetSandboxInfo(MacSandboxInfo* aSandboxInfo) override; #endif private: diff --git a/dom/media/gmp/GMPParent.h b/dom/media/gmp/GMPParent.h index ff6372da9ae..bd7e5189646 100644 --- a/dom/media/gmp/GMPParent.h +++ b/dom/media/gmp/GMPParent.h @@ -158,26 +158,26 @@ private: void WriteExtraDataForMinidump(CrashReporter::AnnotationTable& notes); void GetCrashID(nsString& aResult); #endif - virtual void ActorDestroy(ActorDestroyReason aWhy) override; + void ActorDestroy(ActorDestroyReason aWhy) override; - virtual PCrashReporterParent* AllocPCrashReporterParent(const NativeThreadId& aThread) override; - virtual bool DeallocPCrashReporterParent(PCrashReporterParent* aCrashReporter) override; + PCrashReporterParent* AllocPCrashReporterParent(const NativeThreadId& aThread) override; + bool DeallocPCrashReporterParent(PCrashReporterParent* aCrashReporter) override; - virtual bool RecvPGMPStorageConstructor(PGMPStorageParent* actor) override; - virtual PGMPStorageParent* AllocPGMPStorageParent() override; - virtual bool DeallocPGMPStorageParent(PGMPStorageParent* aActor) override; + bool RecvPGMPStorageConstructor(PGMPStorageParent* actor) override; + PGMPStorageParent* AllocPGMPStorageParent() override; + bool DeallocPGMPStorageParent(PGMPStorageParent* aActor) override; - virtual PGMPContentParent* AllocPGMPContentParent(Transport* aTransport, - ProcessId aOtherPid) override; + PGMPContentParent* AllocPGMPContentParent(Transport* aTransport, + ProcessId aOtherPid) override; - virtual bool RecvPGMPTimerConstructor(PGMPTimerParent* actor) override; - virtual PGMPTimerParent* AllocPGMPTimerParent() override; - virtual bool DeallocPGMPTimerParent(PGMPTimerParent* aActor) override; + bool RecvPGMPTimerConstructor(PGMPTimerParent* actor) override; + PGMPTimerParent* AllocPGMPTimerParent() override; + bool DeallocPGMPTimerParent(PGMPTimerParent* aActor) override; - virtual bool RecvAsyncShutdownComplete() override; - virtual bool RecvAsyncShutdownRequired() override; + bool RecvAsyncShutdownComplete() override; + bool RecvAsyncShutdownRequired() override; - virtual bool RecvPGMPContentChildDestroyed() override; + bool RecvPGMPContentChildDestroyed() override; bool IsUsed() { return mGMPContentChildCount > 0; diff --git a/dom/media/gmp/GMPPlatform.h b/dom/media/gmp/GMPPlatform.h index e13e94a226d..79079c3275d 100644 --- a/dom/media/gmp/GMPPlatform.h +++ b/dom/media/gmp/GMPPlatform.h @@ -27,8 +27,8 @@ public: virtual ~GMPThreadImpl(); // GMPThread - virtual void Post(GMPTask* aTask) override; - virtual void Join() override; + void Post(GMPTask* aTask) override; + void Join() override; private: Mutex mMutex; @@ -42,9 +42,9 @@ public: virtual ~GMPMutexImpl(); // GMPMutex - virtual void Acquire() override; - virtual void Release() override; - virtual void Destroy() override; + void Acquire() override; + void Release() override; + void Destroy() override; private: ReentrantMonitor mMonitor; diff --git a/dom/media/gmp/GMPProcessChild.h b/dom/media/gmp/GMPProcessChild.h index 7cefc109437..1a8df765349 100644 --- a/dom/media/gmp/GMPProcessChild.h +++ b/dom/media/gmp/GMPProcessChild.h @@ -22,8 +22,8 @@ public: explicit GMPProcessChild(ProcessId aParentPid); ~GMPProcessChild(); - virtual bool Init() override; - virtual void CleanUp() override; + bool Init() override; + void CleanUp() override; // Set/get the GMPLoader singleton for this child process. // Note: The GMPLoader is not deleted by this object, the caller of diff --git a/dom/media/gmp/GMPProcessParent.h b/dom/media/gmp/GMPProcessParent.h index 6062cb6313f..4d7281cbbb7 100644 --- a/dom/media/gmp/GMPProcessParent.h +++ b/dom/media/gmp/GMPProcessParent.h @@ -32,7 +32,7 @@ public: void Delete(nsCOMPtr aCallback = nullptr); - virtual bool CanShutdown() override { return true; } + bool CanShutdown() override { return true; } const std::string& GetPluginFilePath() { return mGMPPath; } using mozilla::ipc::GeckoChildProcessHost::GetShutDownEvent; diff --git a/dom/media/gmp/GMPService.cpp b/dom/media/gmp/GMPService.cpp index 03dac0fdb81..a81460fd193 100644 --- a/dom/media/gmp/GMPService.cpp +++ b/dom/media/gmp/GMPService.cpp @@ -375,7 +375,7 @@ public: { } - virtual void Done(GMPContentParent* aGMPParent) override + void Done(GMPContentParent* aGMPParent) override { GMPAudioDecoderParent* gmpADP = nullptr; if (aGMPParent) { @@ -419,7 +419,7 @@ public: { } - virtual void Done(GMPContentParent* aGMPParent) override + void Done(GMPContentParent* aGMPParent) override { GMPVideoDecoderParent* gmpVDP = nullptr; GMPVideoHostImpl* videoHost = nullptr; @@ -464,7 +464,7 @@ public: { } - virtual void Done(GMPContentParent* aGMPParent) override + void Done(GMPContentParent* aGMPParent) override { GMPVideoEncoderParent* gmpVEP = nullptr; GMPVideoHostImpl* videoHost = nullptr; @@ -509,7 +509,7 @@ public: { } - virtual void Done(GMPContentParent* aGMPParent) override + void Done(GMPContentParent* aGMPParent) override { GMPDecryptorParent* ksp = nullptr; if (aGMPParent) { diff --git a/dom/media/gmp/GMPServiceChild.cpp b/dom/media/gmp/GMPServiceChild.cpp index 99594223901..ffff8a897bc 100644 --- a/dom/media/gmp/GMPServiceChild.cpp +++ b/dom/media/gmp/GMPServiceChild.cpp @@ -59,7 +59,7 @@ public: { } - virtual void Done(GMPServiceChild* aGMPServiceChild) + void Done(GMPServiceChild* aGMPServiceChild) override { if (!aGMPServiceChild) { mCallback->Done(nullptr); @@ -147,7 +147,7 @@ public: { } - virtual void Done(GMPServiceChild* aGMPServiceChild) + void Done(GMPServiceChild* aGMPServiceChild) override { if (!aGMPServiceChild) { mCallback->Done(NS_ERROR_FAILURE, EmptyCString()); diff --git a/dom/media/gmp/GMPServiceChild.h b/dom/media/gmp/GMPServiceChild.h index 51487208cb0..35a9075706e 100644 --- a/dom/media/gmp/GMPServiceChild.h +++ b/dom/media/gmp/GMPServiceChild.h @@ -58,14 +58,14 @@ public: void RemoveGMPContentParent(GMPContentParent* aGMPContentParent); protected: - virtual void InitializePlugins() override + void InitializePlugins() override { // Nothing to do here. } - virtual bool GetContentParentFrom(const nsACString& aNodeId, - const nsCString& aAPI, - const nsTArray& aTags, - UniquePtr&& aCallback) + bool GetContentParentFrom(const nsACString& aNodeId, + const nsCString& aAPI, + const nsTArray& aTags, + UniquePtr&& aCallback) override; private: @@ -83,9 +83,8 @@ public: explicit GMPServiceChild(); virtual ~GMPServiceChild(); - virtual PGMPContentParent* AllocPGMPContentParent(Transport* aTransport, - ProcessId aOtherPid) - override; + PGMPContentParent* AllocPGMPContentParent(Transport* aTransport, + ProcessId aOtherPid) override; void GetBridgedGMPContentParent(ProcessId aOtherPid, GMPContentParent** aGMPContentParent); diff --git a/dom/media/gmp/GMPServiceParent.cpp b/dom/media/gmp/GMPServiceParent.cpp index c86fc5b08bb..01a1530f5b0 100644 --- a/dom/media/gmp/GMPServiceParent.cpp +++ b/dom/media/gmp/GMPServiceParent.cpp @@ -1578,7 +1578,7 @@ GeckoMediaPluginServiceParent::ForgetThisSiteOnGMPThread(const nsACString& aSite struct OriginFilter : public DirectoryFilter { explicit OriginFilter(const nsACString& aSite) : mSite(aSite) {} - virtual bool operator()(nsIFile* aPath) { + bool operator()(nsIFile* aPath) override { return MatchOrigin(aPath, mSite); } private: @@ -1615,7 +1615,7 @@ GeckoMediaPluginServiceParent::ClearRecentHistoryOnGMPThread(PRTime aSince) } // |aPath| is $profileDir/gmp/$platform/$gmpName/id/$originHash/ - virtual bool operator()(nsIFile* aPath) { + bool operator()(nsIFile* aPath) override { if (IsModifiedAfter(aPath)) { return true; } diff --git a/dom/media/gmp/GMPServiceParent.h b/dom/media/gmp/GMPServiceParent.h index f40f81d9afe..daf983a77bf 100644 --- a/dom/media/gmp/GMPServiceParent.h +++ b/dom/media/gmp/GMPServiceParent.h @@ -30,7 +30,7 @@ public: static already_AddRefed GetSingleton(); GeckoMediaPluginServiceParent(); - virtual nsresult Init() override; + nsresult Init() override; NS_DECL_ISUPPORTS_INHERITED @@ -104,11 +104,11 @@ protected: friend class GMPParent; void ReAddOnGMPThread(const RefPtr& aOld); void PluginTerminated(const RefPtr& aOld); - virtual void InitializePlugins() override; - virtual bool GetContentParentFrom(const nsACString& aNodeId, - const nsCString& aAPI, - const nsTArray& aTags, - UniquePtr&& aCallback) + void InitializePlugins() override; + bool GetContentParentFrom(const nsACString& aNodeId, + const nsCString& aAPI, + const nsTArray& aTags, + UniquePtr&& aCallback) override; private: GMPParent* ClonePlugin(const GMPParent* aOriginal); @@ -207,23 +207,23 @@ public: } virtual ~GMPServiceParent(); - virtual bool RecvLoadGMP(const nsCString& aNodeId, - const nsCString& aApi, - nsTArray&& aTags, - nsTArray&& aAlreadyBridgedTo, - base::ProcessId* aID, - nsCString* aDisplayName, - uint32_t* aPluginId) override; - virtual bool RecvGetGMPNodeId(const nsString& aOrigin, - const nsString& aTopLevelOrigin, - const nsString& aGMPName, - const bool& aInPrivateBrowsing, - nsCString* aID) override; + bool RecvLoadGMP(const nsCString& aNodeId, + const nsCString& aApi, + nsTArray&& aTags, + nsTArray&& aAlreadyBridgedTo, + base::ProcessId* aID, + nsCString* aDisplayName, + uint32_t* aPluginId) override; + bool RecvGetGMPNodeId(const nsString& aOrigin, + const nsString& aTopLevelOrigin, + const nsString& aGMPName, + const bool& aInPrivateBrowsing, + nsCString* aID) override; static bool RecvGetGMPPluginVersionForAPI(const nsCString& aAPI, nsTArray&& aTags, bool* aHasPlugin, nsCString* aVersion); - virtual void ActorDestroy(ActorDestroyReason aWhy) override; + void ActorDestroy(ActorDestroyReason aWhy) override; static PGMPServiceParent* Create(Transport* aTransport, ProcessId aOtherPid); diff --git a/dom/media/gmp/GMPStorageChild.cpp b/dom/media/gmp/GMPStorageChild.cpp index bada867561c..b10858ea43c 100644 --- a/dom/media/gmp/GMPStorageChild.cpp +++ b/dom/media/gmp/GMPStorageChild.cpp @@ -305,7 +305,7 @@ public: mRecordNames.Sort(); } - virtual GMPErr GetName(const char** aOutName, uint32_t* aOutNameLength) override { + GMPErr GetName(const char** aOutName, uint32_t* aOutNameLength) override { if (!aOutName || !aOutNameLength) { return GMPInvalidArgErr; } @@ -317,7 +317,7 @@ public: return GMPNoErr; } - virtual GMPErr NextRecord() override { + GMPErr NextRecord() override { if (mIndex < mRecordNames.Length()) { mIndex++; } @@ -325,7 +325,7 @@ public: : GMPEndOfEnumeration; } - virtual void Close() override { + void Close() override { delete this; } diff --git a/dom/media/gmp/GMPStorageChild.h b/dom/media/gmp/GMPStorageChild.h index 625f4109ae9..3c5948a30cc 100644 --- a/dom/media/gmp/GMPStorageChild.h +++ b/dom/media/gmp/GMPStorageChild.h @@ -30,11 +30,11 @@ public: GMPRecordClient* aClient); // GMPRecord. - virtual GMPErr Open() override; - virtual GMPErr Read() override; - virtual GMPErr Write(const uint8_t* aData, - uint32_t aDataSize) override; - virtual GMPErr Close() override; + GMPErr Open() override; + GMPErr Read() override; + GMPErr Write(const uint8_t* aData, + uint32_t aDataSize) override; + GMPErr Close() override; const nsCString& Name() const { return mName; } @@ -81,16 +81,16 @@ protected: ~GMPStorageChild() {} // PGMPStorageChild - virtual bool RecvOpenComplete(const nsCString& aRecordName, - const GMPErr& aStatus) override; - virtual bool RecvReadComplete(const nsCString& aRecordName, - const GMPErr& aStatus, - InfallibleTArray&& aBytes) override; - virtual bool RecvWriteComplete(const nsCString& aRecordName, - const GMPErr& aStatus) override; - virtual bool RecvRecordNames(InfallibleTArray&& aRecordNames, - const GMPErr& aStatus) override; - virtual bool RecvShutdown() override; + bool RecvOpenComplete(const nsCString& aRecordName, + const GMPErr& aStatus) override; + bool RecvReadComplete(const nsCString& aRecordName, + const GMPErr& aStatus, + InfallibleTArray&& aBytes) override; + bool RecvWriteComplete(const nsCString& aRecordName, + const GMPErr& aStatus) override; + bool RecvRecordNames(InfallibleTArray&& aRecordNames, + const GMPErr& aStatus) override; + bool RecvShutdown() override; private: Monitor mMonitor; diff --git a/dom/media/gmp/GMPStorageParent.h b/dom/media/gmp/GMPStorageParent.h index 8050735aedd..60cbea9d8c9 100644 --- a/dom/media/gmp/GMPStorageParent.h +++ b/dom/media/gmp/GMPStorageParent.h @@ -39,13 +39,13 @@ public: void Shutdown(); protected: - virtual bool RecvOpen(const nsCString& aRecordName) override; - virtual bool RecvRead(const nsCString& aRecordName) override; - virtual bool RecvWrite(const nsCString& aRecordName, - InfallibleTArray&& aBytes) override; - virtual bool RecvGetRecordNames() override; - virtual bool RecvClose(const nsCString& aRecordName) override; - virtual void ActorDestroy(ActorDestroyReason aWhy) override; + bool RecvOpen(const nsCString& aRecordName) override; + bool RecvRead(const nsCString& aRecordName) override; + bool RecvWrite(const nsCString& aRecordName, + InfallibleTArray&& aBytes) override; + bool RecvGetRecordNames() override; + bool RecvClose(const nsCString& aRecordName) override; + void ActorDestroy(ActorDestroyReason aWhy) override; private: ~GMPStorageParent() {} diff --git a/dom/media/gmp/GMPTimerChild.h b/dom/media/gmp/GMPTimerChild.h index acae37cde80..c63a4948090 100644 --- a/dom/media/gmp/GMPTimerChild.h +++ b/dom/media/gmp/GMPTimerChild.h @@ -29,7 +29,7 @@ public: protected: // GMPTimerChild - virtual bool RecvTimerExpired(const uint32_t& aTimerId) override; + bool RecvTimerExpired(const uint32_t& aTimerId) override; private: ~GMPTimerChild(); diff --git a/dom/media/gmp/GMPTimerParent.h b/dom/media/gmp/GMPTimerParent.h index 4bca4e48358..17403887f07 100644 --- a/dom/media/gmp/GMPTimerParent.h +++ b/dom/media/gmp/GMPTimerParent.h @@ -26,9 +26,9 @@ public: void Shutdown(); protected: - virtual bool RecvSetTimer(const uint32_t& aTimerId, - const uint32_t& aTimeoutMs) override; - virtual void ActorDestroy(ActorDestroyReason aWhy) override; + bool RecvSetTimer(const uint32_t& aTimerId, + const uint32_t& aTimeoutMs) override; + void ActorDestroy(ActorDestroyReason aWhy) override; private: ~GMPTimerParent() {} diff --git a/dom/media/gmp/GMPVideoDecoderChild.h b/dom/media/gmp/GMPVideoDecoderChild.h index eb5052fd32c..2271a70a135 100644 --- a/dom/media/gmp/GMPVideoDecoderChild.h +++ b/dom/media/gmp/GMPVideoDecoderChild.h @@ -31,33 +31,33 @@ public: GMPVideoHostImpl& Host(); // GMPVideoDecoderCallback - virtual void Decoded(GMPVideoi420Frame* decodedFrame) override; - virtual void ReceivedDecodedReferenceFrame(const uint64_t pictureId) override; - virtual void ReceivedDecodedFrame(const uint64_t pictureId) override; - virtual void InputDataExhausted() override; - virtual void DrainComplete() override; - virtual void ResetComplete() override; - virtual void Error(GMPErr aError) override; + void Decoded(GMPVideoi420Frame* decodedFrame) override; + void ReceivedDecodedReferenceFrame(const uint64_t pictureId) override; + void ReceivedDecodedFrame(const uint64_t pictureId) override; + void InputDataExhausted() override; + void DrainComplete() override; + void ResetComplete() override; + void Error(GMPErr aError) override; // GMPSharedMemManager - virtual bool Alloc(size_t aSize, Shmem::SharedMemory::SharedMemoryType aType, Shmem* aMem) override; - virtual void Dealloc(Shmem& aMem) override; + bool Alloc(size_t aSize, Shmem::SharedMemory::SharedMemoryType aType, Shmem* aMem) override; + void Dealloc(Shmem& aMem) override; private: virtual ~GMPVideoDecoderChild(); // PGMPVideoDecoderChild - virtual bool RecvInitDecode(const GMPVideoCodec& aCodecSettings, - InfallibleTArray&& aCodecSpecific, - const int32_t& aCoreCount) override; - virtual bool RecvDecode(const GMPVideoEncodedFrameData& aInputFrame, - const bool& aMissingFrames, - InfallibleTArray&& aCodecSpecificInfo, - const int64_t& aRenderTimeMs) override; - virtual bool RecvChildShmemForPool(Shmem&& aFrameBuffer) override; - virtual bool RecvReset() override; - virtual bool RecvDrain() override; - virtual bool RecvDecodingComplete() override; + bool RecvInitDecode(const GMPVideoCodec& aCodecSettings, + InfallibleTArray&& aCodecSpecific, + const int32_t& aCoreCount) override; + bool RecvDecode(const GMPVideoEncodedFrameData& aInputFrame, + const bool& aMissingFrames, + InfallibleTArray&& aCodecSpecificInfo, + const int64_t& aRenderTimeMs) override; + bool RecvChildShmemForPool(Shmem&& aFrameBuffer) override; + bool RecvReset() override; + bool RecvDrain() override; + bool RecvDecodingComplete() override; GMPContentChild* mPlugin; GMPVideoDecoder* mVideoDecoder; diff --git a/dom/media/gmp/GMPVideoDecoderParent.h b/dom/media/gmp/GMPVideoDecoderParent.h index 4b0ebaf466c..bf5b5e0639e 100644 --- a/dom/media/gmp/GMPVideoDecoderParent.h +++ b/dom/media/gmp/GMPVideoDecoderParent.h @@ -34,22 +34,22 @@ public: nsresult Shutdown(); // GMPVideoDecoder - virtual void Close() override; - virtual nsresult InitDecode(const GMPVideoCodec& aCodecSettings, - const nsTArray& aCodecSpecific, - GMPVideoDecoderCallbackProxy* aCallback, - int32_t aCoreCount) override; - virtual nsresult Decode(GMPUniquePtr aInputFrame, - bool aMissingFrames, - const nsTArray& aCodecSpecificInfo, - int64_t aRenderTimeMs = -1) override; - virtual nsresult Reset() override; - virtual nsresult Drain() override; - virtual uint32_t GetPluginId() const override { return mPluginId; } - virtual const nsCString& GetDisplayName() const override; + void Close() override; + nsresult InitDecode(const GMPVideoCodec& aCodecSettings, + const nsTArray& aCodecSpecific, + GMPVideoDecoderCallbackProxy* aCallback, + int32_t aCoreCount) override; + nsresult Decode(GMPUniquePtr aInputFrame, + bool aMissingFrames, + const nsTArray& aCodecSpecificInfo, + int64_t aRenderTimeMs = -1) override; + nsresult Reset() override; + nsresult Drain() override; + uint32_t GetPluginId() const override { return mPluginId; } + const nsCString& GetDisplayName() const override; // GMPSharedMemManager - virtual bool Alloc(size_t aSize, Shmem::SharedMemory::SharedMemoryType aType, Shmem* aMem) override + bool Alloc(size_t aSize, Shmem::SharedMemory::SharedMemoryType aType, Shmem* aMem) override { #ifdef GMP_SAFE_SHMEM return AllocShmem(aSize, aType, aMem); @@ -57,7 +57,7 @@ public: return AllocUnsafeShmem(aSize, aType, aMem); #endif } - virtual void Dealloc(Shmem& aMem) override + void Dealloc(Shmem& aMem) override { DeallocShmem(aMem); } @@ -66,19 +66,19 @@ private: ~GMPVideoDecoderParent(); // PGMPVideoDecoderParent - virtual void ActorDestroy(ActorDestroyReason aWhy) override; - virtual bool RecvDecoded(const GMPVideoi420FrameData& aDecodedFrame) override; - virtual bool RecvReceivedDecodedReferenceFrame(const uint64_t& aPictureId) override; - virtual bool RecvReceivedDecodedFrame(const uint64_t& aPictureId) override; - virtual bool RecvInputDataExhausted() override; - virtual bool RecvDrainComplete() override; - virtual bool RecvResetComplete() override; - virtual bool RecvError(const GMPErr& aError) override; - virtual bool RecvShutdown() override; - virtual bool RecvParentShmemForPool(Shmem&& aEncodedBuffer) override; - virtual bool AnswerNeedShmem(const uint32_t& aFrameBufferSize, - Shmem* aMem) override; - virtual bool Recv__delete__() override; + void ActorDestroy(ActorDestroyReason aWhy) override; + bool RecvDecoded(const GMPVideoi420FrameData& aDecodedFrame) override; + bool RecvReceivedDecodedReferenceFrame(const uint64_t& aPictureId) override; + bool RecvReceivedDecodedFrame(const uint64_t& aPictureId) override; + bool RecvInputDataExhausted() override; + bool RecvDrainComplete() override; + bool RecvResetComplete() override; + bool RecvError(const GMPErr& aError) override; + bool RecvShutdown() override; + bool RecvParentShmemForPool(Shmem&& aEncodedBuffer) override; + bool AnswerNeedShmem(const uint32_t& aFrameBufferSize, + Shmem* aMem) override; + bool Recv__delete__() override; void UnblockResetAndDrain(); void CancelResetCompleteTimeout(); diff --git a/dom/media/gmp/GMPVideoEncodedFrameImpl.h b/dom/media/gmp/GMPVideoEncodedFrameImpl.h index 8383934d8fe..601e48c2543 100644 --- a/dom/media/gmp/GMPVideoEncodedFrameImpl.h +++ b/dom/media/gmp/GMPVideoEncodedFrameImpl.h @@ -65,38 +65,38 @@ public: bool RelinquishFrameData(GMPVideoEncodedFrameData& aFrameData); // GMPVideoFrame - virtual GMPVideoFrameFormat GetFrameFormat() override; - virtual void Destroy() override; + GMPVideoFrameFormat GetFrameFormat() override; + void Destroy() override; // GMPVideoEncodedFrame - virtual GMPErr CreateEmptyFrame(uint32_t aSize) override; - virtual GMPErr CopyFrame(const GMPVideoEncodedFrame& aFrame) override; - virtual void SetEncodedWidth(uint32_t aEncodedWidth) override; - virtual uint32_t EncodedWidth() override; - virtual void SetEncodedHeight(uint32_t aEncodedHeight) override; - virtual uint32_t EncodedHeight() override; + GMPErr CreateEmptyFrame(uint32_t aSize) override; + GMPErr CopyFrame(const GMPVideoEncodedFrame& aFrame) override; + void SetEncodedWidth(uint32_t aEncodedWidth) override; + uint32_t EncodedWidth() override; + void SetEncodedHeight(uint32_t aEncodedHeight) override; + uint32_t EncodedHeight() override; // Microseconds - virtual void SetTimeStamp(uint64_t aTimeStamp) override; - virtual uint64_t TimeStamp() override; + void SetTimeStamp(uint64_t aTimeStamp) override; + uint64_t TimeStamp() override; // Set frame duration (microseconds) // NOTE: next-frame's Timestamp() != this-frame's TimeStamp()+Duration() // depending on rounding to avoid having to track roundoff errors // and dropped/missing frames(!) (which may leave a large gap) - virtual void SetDuration(uint64_t aDuration) override; - virtual uint64_t Duration() const override; - virtual void SetFrameType(GMPVideoFrameType aFrameType) override; - virtual GMPVideoFrameType FrameType() override; - virtual void SetAllocatedSize(uint32_t aNewSize) override; - virtual uint32_t AllocatedSize() override; - virtual void SetSize(uint32_t aSize) override; - virtual uint32_t Size() override; - virtual void SetCompleteFrame(bool aCompleteFrame) override; - virtual bool CompleteFrame() override; - virtual const uint8_t* Buffer() const override; - virtual uint8_t* Buffer() override; - virtual GMPBufferType BufferType() const override; - virtual void SetBufferType(GMPBufferType aBufferType) override; - virtual const GMPEncryptedBufferMetadata* GetDecryptionData() const override; + void SetDuration(uint64_t aDuration) override; + uint64_t Duration() const override; + void SetFrameType(GMPVideoFrameType aFrameType) override; + GMPVideoFrameType FrameType() override; + void SetAllocatedSize(uint32_t aNewSize) override; + uint32_t AllocatedSize() override; + void SetSize(uint32_t aSize) override; + uint32_t Size() override; + void SetCompleteFrame(bool aCompleteFrame) override; + bool CompleteFrame() override; + const uint8_t* Buffer() const override; + uint8_t* Buffer() override; + GMPBufferType BufferType() const override; + void SetBufferType(GMPBufferType aBufferType) override; + const GMPEncryptedBufferMetadata* GetDecryptionData() const override; private: void DestroyBuffer(); diff --git a/dom/media/gmp/GMPVideoEncoderChild.h b/dom/media/gmp/GMPVideoEncoderChild.h index 7ed4935fc15..44e2fe60560 100644 --- a/dom/media/gmp/GMPVideoEncoderChild.h +++ b/dom/media/gmp/GMPVideoEncoderChild.h @@ -30,34 +30,34 @@ public: GMPVideoHostImpl& Host(); // GMPVideoEncoderCallback - virtual void Encoded(GMPVideoEncodedFrame* aEncodedFrame, - const uint8_t* aCodecSpecificInfo, - uint32_t aCodecSpecificInfoLength) override; - virtual void Error(GMPErr aError) override; + void Encoded(GMPVideoEncodedFrame* aEncodedFrame, + const uint8_t* aCodecSpecificInfo, + uint32_t aCodecSpecificInfoLength) override; + void Error(GMPErr aError) override; // GMPSharedMemManager - virtual bool Alloc(size_t aSize, Shmem::SharedMemory::SharedMemoryType aType, + bool Alloc(size_t aSize, Shmem::SharedMemory::SharedMemoryType aType, Shmem* aMem) override; - virtual void Dealloc(Shmem& aMem) override; + void Dealloc(Shmem& aMem) override; private: virtual ~GMPVideoEncoderChild(); // PGMPVideoEncoderChild - virtual bool RecvInitEncode(const GMPVideoCodec& aCodecSettings, - InfallibleTArray&& aCodecSpecific, - const int32_t& aNumberOfCores, - const uint32_t& aMaxPayloadSize) override; - virtual bool RecvEncode(const GMPVideoi420FrameData& aInputFrame, - InfallibleTArray&& aCodecSpecificInfo, - InfallibleTArray&& aFrameTypes) override; - virtual bool RecvChildShmemForPool(Shmem&& aEncodedBuffer) override; - virtual bool RecvSetChannelParameters(const uint32_t& aPacketLoss, - const uint32_t& aRTT) override; - virtual bool RecvSetRates(const uint32_t& aNewBitRate, - const uint32_t& aFrameRate) override; - virtual bool RecvSetPeriodicKeyFrames(const bool& aEnable) override; - virtual bool RecvEncodingComplete() override; + bool RecvInitEncode(const GMPVideoCodec& aCodecSettings, + InfallibleTArray&& aCodecSpecific, + const int32_t& aNumberOfCores, + const uint32_t& aMaxPayloadSize) override; + bool RecvEncode(const GMPVideoi420FrameData& aInputFrame, + InfallibleTArray&& aCodecSpecificInfo, + InfallibleTArray&& aFrameTypes) override; + bool RecvChildShmemForPool(Shmem&& aEncodedBuffer) override; + bool RecvSetChannelParameters(const uint32_t& aPacketLoss, + const uint32_t& aRTT) override; + bool RecvSetRates(const uint32_t& aNewBitRate, + const uint32_t& aFrameRate) override; + bool RecvSetPeriodicKeyFrames(const bool& aEnable) override; + bool RecvEncodingComplete() override; GMPContentChild* mPlugin; GMPVideoEncoder* mVideoEncoder; diff --git a/dom/media/gmp/GMPVideoEncoderParent.h b/dom/media/gmp/GMPVideoEncoderParent.h index 8f6a3f6fa97..e87f9d924b7 100644 --- a/dom/media/gmp/GMPVideoEncoderParent.h +++ b/dom/media/gmp/GMPVideoEncoderParent.h @@ -33,22 +33,22 @@ public: void Shutdown(); // GMPVideoEncoderProxy - virtual void Close() override; - virtual GMPErr InitEncode(const GMPVideoCodec& aCodecSettings, - const nsTArray& aCodecSpecific, - GMPVideoEncoderCallbackProxy* aCallback, - int32_t aNumberOfCores, - uint32_t aMaxPayloadSize) override; - virtual GMPErr Encode(GMPUniquePtr aInputFrame, - const nsTArray& aCodecSpecificInfo, - const nsTArray& aFrameTypes) override; - virtual GMPErr SetChannelParameters(uint32_t aPacketLoss, uint32_t aRTT) override; - virtual GMPErr SetRates(uint32_t aNewBitRate, uint32_t aFrameRate) override; - virtual GMPErr SetPeriodicKeyFrames(bool aEnable) override; - virtual uint32_t GetPluginId() const override { return mPluginId; } + void Close() override; + GMPErr InitEncode(const GMPVideoCodec& aCodecSettings, + const nsTArray& aCodecSpecific, + GMPVideoEncoderCallbackProxy* aCallback, + int32_t aNumberOfCores, + uint32_t aMaxPayloadSize) override; + GMPErr Encode(GMPUniquePtr aInputFrame, + const nsTArray& aCodecSpecificInfo, + const nsTArray& aFrameTypes) override; + GMPErr SetChannelParameters(uint32_t aPacketLoss, uint32_t aRTT) override; + GMPErr SetRates(uint32_t aNewBitRate, uint32_t aFrameRate) override; + GMPErr SetPeriodicKeyFrames(bool aEnable) override; + uint32_t GetPluginId() const override { return mPluginId; } // GMPSharedMemManager - virtual bool Alloc(size_t aSize, Shmem::SharedMemory::SharedMemoryType aType, Shmem* aMem) override + bool Alloc(size_t aSize, Shmem::SharedMemory::SharedMemoryType aType, Shmem* aMem) override { #ifdef GMP_SAFE_SHMEM return AllocShmem(aSize, aType, aMem); @@ -56,7 +56,7 @@ public: return AllocUnsafeShmem(aSize, aType, aMem); #endif } - virtual void Dealloc(Shmem& aMem) override + void Dealloc(Shmem& aMem) override { DeallocShmem(aMem); } @@ -65,15 +65,15 @@ private: virtual ~GMPVideoEncoderParent(); // PGMPVideoEncoderParent - virtual void ActorDestroy(ActorDestroyReason aWhy) override; - virtual bool RecvEncoded(const GMPVideoEncodedFrameData& aEncodedFrame, - InfallibleTArray&& aCodecSpecificInfo) override; - virtual bool RecvError(const GMPErr& aError) override; - virtual bool RecvShutdown() override; - virtual bool RecvParentShmemForPool(Shmem&& aFrameBuffer) override; - virtual bool AnswerNeedShmem(const uint32_t& aEncodedBufferSize, - Shmem* aMem) override; - virtual bool Recv__delete__() override; + void ActorDestroy(ActorDestroyReason aWhy) override; + bool RecvEncoded(const GMPVideoEncodedFrameData& aEncodedFrame, + InfallibleTArray&& aCodecSpecificInfo) override; + bool RecvError(const GMPErr& aError) override; + bool RecvShutdown() override; + bool RecvParentShmemForPool(Shmem&& aFrameBuffer) override; + bool AnswerNeedShmem(const uint32_t& aEncodedBufferSize, + Shmem* aMem) override; + bool Recv__delete__() override; bool mIsOpen; bool mShuttingDown; diff --git a/dom/media/gmp/GMPVideoHost.h b/dom/media/gmp/GMPVideoHost.h index c3cddd28c43..b3e42f08ed7 100644 --- a/dom/media/gmp/GMPVideoHost.h +++ b/dom/media/gmp/GMPVideoHost.h @@ -35,8 +35,8 @@ public: void EncodedFrameDestroyed(GMPVideoEncodedFrameImpl* aFrame); // GMPVideoHost - virtual GMPErr CreateFrame(GMPVideoFrameFormat aFormat, GMPVideoFrame** aFrame) override; - virtual GMPErr CreatePlane(GMPPlane** aPlane) override; + GMPErr CreateFrame(GMPVideoFrameFormat aFormat, GMPVideoFrame** aFrame) override; + GMPErr CreatePlane(GMPPlane** aPlane) override; private: // All shared memory allocations have to be made by an IPDL actor. diff --git a/dom/media/gmp/GMPVideoPlaneImpl.h b/dom/media/gmp/GMPVideoPlaneImpl.h index d2d2e530194..d3a0d753a76 100644 --- a/dom/media/gmp/GMPVideoPlaneImpl.h +++ b/dom/media/gmp/GMPVideoPlaneImpl.h @@ -34,21 +34,21 @@ public: bool InitPlaneData(GMPPlaneData& aPlaneData); // GMPPlane - virtual GMPErr CreateEmptyPlane(int32_t aAllocatedSize, - int32_t aStride, - int32_t aPlaneSize) override; - virtual GMPErr Copy(const GMPPlane& aPlane) override; - virtual GMPErr Copy(int32_t aSize, - int32_t aStride, - const uint8_t* aBuffer) override; - virtual void Swap(GMPPlane& aPlane) override; - virtual int32_t AllocatedSize() const override; - virtual void ResetSize() override; - virtual bool IsZeroSize() const override; - virtual int32_t Stride() const override; - virtual const uint8_t* Buffer() const override; - virtual uint8_t* Buffer() override; - virtual void Destroy() override; + GMPErr CreateEmptyPlane(int32_t aAllocatedSize, + int32_t aStride, + int32_t aPlaneSize) override; + GMPErr Copy(const GMPPlane& aPlane) override; + GMPErr Copy(int32_t aSize, + int32_t aStride, + const uint8_t* aBuffer) override; + void Swap(GMPPlane& aPlane) override; + int32_t AllocatedSize() const override; + void ResetSize() override; + bool IsZeroSize() const override; + int32_t Stride() const override; + const uint8_t* Buffer() const override; + uint8_t* Buffer() override; + void Destroy() override; private: GMPErr MaybeResize(int32_t aNewSize); diff --git a/dom/media/gmp/GMPVideoi420FrameImpl.h b/dom/media/gmp/GMPVideoi420FrameImpl.h index 2089854dae4..f5cb0254b97 100644 --- a/dom/media/gmp/GMPVideoi420FrameImpl.h +++ b/dom/media/gmp/GMPVideoi420FrameImpl.h @@ -30,39 +30,39 @@ public: GMPPlaneImpl* GetPlane(GMPPlaneType aType); // GMPVideoFrame - virtual GMPVideoFrameFormat GetFrameFormat() override; - virtual void Destroy() override; + GMPVideoFrameFormat GetFrameFormat() override; + void Destroy() override; // GMPVideoi420Frame - virtual GMPErr CreateEmptyFrame(int32_t aWidth, - int32_t aHeight, - int32_t aStride_y, - int32_t aStride_u, - int32_t aStride_v) override; - virtual GMPErr CreateFrame(int32_t aSize_y, const uint8_t* aBuffer_y, - int32_t aSize_u, const uint8_t* aBuffer_u, - int32_t aSize_v, const uint8_t* aBuffer_v, - int32_t aWidth, - int32_t aHeight, - int32_t aStride_y, - int32_t aStride_u, - int32_t aStride_v) override; - virtual GMPErr CopyFrame(const GMPVideoi420Frame& aFrame) override; - virtual void SwapFrame(GMPVideoi420Frame* aFrame) override; - virtual uint8_t* Buffer(GMPPlaneType aType) override; - virtual const uint8_t* Buffer(GMPPlaneType aType) const override; - virtual int32_t AllocatedSize(GMPPlaneType aType) const override; - virtual int32_t Stride(GMPPlaneType aType) const override; - virtual GMPErr SetWidth(int32_t aWidth) override; - virtual GMPErr SetHeight(int32_t aHeight) override; - virtual int32_t Width() const override; - virtual int32_t Height() const override; - virtual void SetTimestamp(uint64_t aTimestamp) override; - virtual uint64_t Timestamp() const override; - virtual void SetDuration(uint64_t aDuration) override; - virtual uint64_t Duration() const override; - virtual bool IsZeroSize() const override; - virtual void ResetSize() override; + GMPErr CreateEmptyFrame(int32_t aWidth, + int32_t aHeight, + int32_t aStride_y, + int32_t aStride_u, + int32_t aStride_v) override; + GMPErr CreateFrame(int32_t aSize_y, const uint8_t* aBuffer_y, + int32_t aSize_u, const uint8_t* aBuffer_u, + int32_t aSize_v, const uint8_t* aBuffer_v, + int32_t aWidth, + int32_t aHeight, + int32_t aStride_y, + int32_t aStride_u, + int32_t aStride_v) override; + GMPErr CopyFrame(const GMPVideoi420Frame& aFrame) override; + void SwapFrame(GMPVideoi420Frame* aFrame) override; + uint8_t* Buffer(GMPPlaneType aType) override; + const uint8_t* Buffer(GMPPlaneType aType) const override; + int32_t AllocatedSize(GMPPlaneType aType) const override; + int32_t Stride(GMPPlaneType aType) const override; + GMPErr SetWidth(int32_t aWidth) override; + GMPErr SetHeight(int32_t aHeight) override; + int32_t Width() const override; + int32_t Height() const override; + void SetTimestamp(uint64_t aTimestamp) override; + uint64_t Timestamp() const override; + void SetDuration(uint64_t aDuration) override; + uint64_t Duration() const override; + bool IsZeroSize() const override; + void ResetSize() override; private: bool CheckDimensions(int32_t aWidth, int32_t aHeight, From 7adacda53b40797449b9bf5f62215e5cb6df2b7f Mon Sep 17 00:00:00 2001 From: Jean-Yves Avenard Date: Mon, 18 Jan 2016 14:43:19 +1100 Subject: [PATCH 011/119] Bug 1240411: P6. Clean up OMX headers. r=ayang Remove redundant virtual keyword and add missing override if any. --- dom/media/omx/AudioOffloadPlayer.h | 16 ++++++------- dom/media/omx/AudioOutput.h | 34 +++++++++++++-------------- dom/media/omx/MediaOmxCommonDecoder.h | 26 ++++++++++---------- dom/media/omx/MediaOmxReader.h | 23 +++++++++--------- dom/media/omx/MediaStreamSource.h | 18 +++++++------- dom/media/omx/OMXCodecProxy.h | 12 +++++----- dom/media/omx/RtspExtractor.cpp | 10 ++++---- dom/media/omx/RtspExtractor.h | 8 +++---- dom/media/omx/RtspMediaCodecDecoder.h | 8 +++---- dom/media/omx/RtspOmxDecoder.h | 6 ++--- dom/media/omx/RtspOmxReader.h | 16 ++++++------- 11 files changed, 88 insertions(+), 89 deletions(-) diff --git a/dom/media/omx/AudioOffloadPlayer.h b/dom/media/omx/AudioOffloadPlayer.h index 54842cff049..0ff60089806 100644 --- a/dom/media/omx/AudioOffloadPlayer.h +++ b/dom/media/omx/AudioOffloadPlayer.h @@ -78,27 +78,27 @@ public: ~AudioOffloadPlayer(); // Caller retains ownership of "aSource". - virtual void SetSource(const android::sp &aSource) override; + void SetSource(const android::sp &aSource) override; // Start the source if it's not already started and open the GonkAudioSink to // create an offloaded audio track - virtual status_t Start(bool aSourceAlreadyStarted = false) override; + status_t Start(bool aSourceAlreadyStarted = false) override; - virtual status_t ChangeState(MediaDecoder::PlayState aState) override; + status_t ChangeState(MediaDecoder::PlayState aState) override; - virtual void SetVolume(double aVolume) override; + void SetVolume(double aVolume) override; - virtual int64_t GetMediaTimeUs() override; + int64_t GetMediaTimeUs() override; // To update progress bar when the element is visible - virtual void SetElementVisibility(bool aIsVisible) override;; + void SetElementVisibility(bool aIsVisible) override;; // Update ready state based on current play state. Not checking data // availability since offloading is currently done only when whole compressed // data is available - virtual MediaDecoderOwner::NextFrameStatus GetNextFrameStatus() override; + MediaDecoderOwner::NextFrameStatus GetNextFrameStatus() override; - virtual RefPtr Seek(SeekTarget aTarget) override; + RefPtr Seek(SeekTarget aTarget) override; void TimeUpdate(); diff --git a/dom/media/omx/AudioOutput.h b/dom/media/omx/AudioOutput.h index debf8b5994c..68fc71f5910 100644 --- a/dom/media/omx/AudioOutput.h +++ b/dom/media/omx/AudioOutput.h @@ -47,28 +47,28 @@ public: AudioOutput(int aSessionId, int aUid); virtual ~AudioOutput(); - virtual ssize_t FrameSize() const; - virtual status_t GetPosition(uint32_t* aPosition) const; - virtual status_t SetVolume(float aVolume) const; - virtual status_t SetParameters(const String8& aKeyValuePairs); + ssize_t FrameSize() const override; + status_t GetPosition(uint32_t* aPosition) const override; + status_t SetVolume(float aVolume) const override; + status_t SetParameters(const String8& aKeyValuePairs) override; // Creates an offloaded audio track with the given parameters // TODO: Try to recycle audio tracks instead of creating new audio tracks // every time - virtual status_t Open(uint32_t aSampleRate, - int aChannelCount, - audio_channel_mask_t aChannelMask, - audio_format_t aFormat, - AudioCallback aCb, - void* aCookie, - audio_output_flags_t aFlags = AUDIO_OUTPUT_FLAG_NONE, - const audio_offload_info_t* aOffloadInfo = nullptr); + status_t Open(uint32_t aSampleRate, + int aChannelCount, + audio_channel_mask_t aChannelMask, + audio_format_t aFormat, + AudioCallback aCb, + void* aCookie, + audio_output_flags_t aFlags = AUDIO_OUTPUT_FLAG_NONE, + const audio_offload_info_t* aOffloadInfo = nullptr) override; - virtual status_t Start(); - virtual void Stop(); - virtual void Flush(); - virtual void Pause(); - virtual void Close(); + status_t Start() override; + void Stop() override; + void Flush() override; + void Pause() override; + void Close() override; private: static void CallbackWrapper(int aEvent, void* aMe, void* aInfo); diff --git a/dom/media/omx/MediaOmxCommonDecoder.h b/dom/media/omx/MediaOmxCommonDecoder.h index 71ba4499655..318480f6397 100644 --- a/dom/media/omx/MediaOmxCommonDecoder.h +++ b/dom/media/omx/MediaOmxCommonDecoder.h @@ -23,22 +23,22 @@ class MediaOmxCommonDecoder : public MediaDecoder public: explicit MediaOmxCommonDecoder(MediaDecoderOwner* aOwner); - virtual void FirstFrameLoaded(nsAutoPtr aInfo, - MediaDecoderEventVisibility aEventVisibility) override; - virtual void ChangeState(PlayState aState) override; - virtual void CallSeek(const SeekTarget& aTarget) override; - virtual void SetVolume(double aVolume) override; - virtual int64_t CurrentPosition() override; - virtual MediaDecoderOwner::NextFrameStatus NextFrameStatus() override; - virtual void SetElementVisibility(bool aIsVisible) override; - virtual void SetPlatformCanOffloadAudio(bool aCanOffloadAudio) override; - virtual void AddOutputStream(ProcessedMediaStream* aStream, - bool aFinishWhenEnded) override; - virtual void SetPlaybackRate(double aPlaybackRate) override; + void FirstFrameLoaded(nsAutoPtr aInfo, + MediaDecoderEventVisibility aEventVisibility) override; + void ChangeState(PlayState aState) override; + void CallSeek(const SeekTarget& aTarget) override; + void SetVolume(double aVolume) override; + int64_t CurrentPosition() override; + MediaDecoderOwner::NextFrameStatus NextFrameStatus() override; + void SetElementVisibility(bool aIsVisible) override; + void SetPlatformCanOffloadAudio(bool aCanOffloadAudio) override; + void AddOutputStream(ProcessedMediaStream* aStream, + bool aFinishWhenEnded) override; + void SetPlaybackRate(double aPlaybackRate) override; void AudioOffloadTearDown(); - virtual MediaDecoderStateMachine* CreateStateMachine() override; + MediaDecoderStateMachine* CreateStateMachine() override; virtual MediaOmxCommonReader* CreateReader() = 0; virtual MediaDecoderStateMachine* CreateStateMachineFromReader(MediaOmxCommonReader* aReader) = 0; diff --git a/dom/media/omx/MediaOmxReader.h b/dom/media/omx/MediaOmxReader.h index 57467f8c032..21abbd00810 100644 --- a/dom/media/omx/MediaOmxReader.h +++ b/dom/media/omx/MediaOmxReader.h @@ -71,30 +71,29 @@ public: ~MediaOmxReader(); protected: - virtual void NotifyDataArrivedInternal() override; + void NotifyDataArrivedInternal() override; public: - virtual nsresult ResetDecode() + nsresult ResetDecode() override { mSeekRequest.DisconnectIfExists(); mSeekPromise.RejectIfExists(NS_OK, __func__); return MediaDecoderReader::ResetDecode(); } - virtual bool DecodeAudioData(); - virtual bool DecodeVideoFrame(bool &aKeyframeSkip, - int64_t aTimeThreshold); + bool DecodeAudioData() override; + bool DecodeVideoFrame(bool &aKeyframeSkip, int64_t aTimeThreshold) override; - virtual void ReleaseMediaResources() override; + void ReleaseMediaResources() override; - virtual RefPtr AsyncReadMetadata() override; + RefPtr AsyncReadMetadata() override; - virtual RefPtr + RefPtr Seek(int64_t aTime, int64_t aEndTime) override; - virtual void SetIdle() override; + void SetIdle() override; - virtual RefPtr Shutdown() override; + RefPtr Shutdown() override; android::sp GetAudioOffloadTrack(); @@ -106,8 +105,8 @@ private: class ProcessCachedDataTask; class NotifyDataArrivedRunnable; - virtual bool HasAudio() override { return mHasAudio; } - virtual bool HasVideo() override { return mHasVideo; } + bool HasAudio() override { return mHasAudio; } + bool HasVideo() override { return mHasVideo; } bool IsShutdown() { MutexAutoLock lock(mShutdownMutex); diff --git a/dom/media/omx/MediaStreamSource.h b/dom/media/omx/MediaStreamSource.h index ceae12949cc..4b73214debc 100644 --- a/dom/media/omx/MediaStreamSource.h +++ b/dom/media/omx/MediaStreamSource.h @@ -27,8 +27,16 @@ class MediaStreamSource : public DataSource { public: MediaStreamSource(MediaResource* aResource); - virtual status_t initCheck() const; - virtual ssize_t readAt(off64_t offset, void *data, size_t size); + status_t initCheck() const override; + ssize_t readAt(off64_t offset, void *data, size_t size) override; + status_t getSize(off64_t *size) override; + uint32_t flags() override { + return kWantsPrefetching; + } + + int64_t Tell(); + + // Apparently unused. virtual ssize_t readAt(off_t offset, void *data, size_t size) { return readAt(static_cast(offset), data, size); } @@ -38,12 +46,6 @@ public: *size = size64; return status; } - virtual status_t getSize(off64_t *size); - virtual uint32_t flags() { - return kWantsPrefetching; - } - - int64_t Tell(); virtual ~MediaStreamSource(); diff --git a/dom/media/omx/OMXCodecProxy.h b/dom/media/omx/OMXCodecProxy.h index 6568db5b073..199d5d0d91c 100644 --- a/dom/media/omx/OMXCodecProxy.h +++ b/dom/media/omx/OMXCodecProxy.h @@ -51,15 +51,15 @@ public: void ResourceReserveFailed() override; // MediaSource - virtual status_t start(MetaData *params = nullptr); - virtual status_t stop(); + status_t start(MetaData *params = nullptr) override; + status_t stop() override; - virtual sp getFormat(); + sp getFormat() override; - virtual status_t read( - MediaBuffer **buffer, const ReadOptions *options = nullptr); + status_t read( + MediaBuffer **buffer, const ReadOptions *options = nullptr) override; - virtual status_t pause(); + status_t pause() override; protected: OMXCodecProxy( diff --git a/dom/media/omx/RtspExtractor.cpp b/dom/media/omx/RtspExtractor.cpp index 50cfe73a0e3..8916b1d60ad 100644 --- a/dom/media/omx/RtspExtractor.cpp +++ b/dom/media/omx/RtspExtractor.cpp @@ -35,14 +35,14 @@ public: , mBuffer(nullptr) , mFrameMaxSize(aFrameMaxSize) {} virtual ~RtspMediaSource() {} - virtual status_t start(MetaData* params = nullptr) override; - virtual status_t stop() override; - virtual sp getFormat() override { + status_t start(MetaData* params = nullptr) override; + status_t stop() override; + sp getFormat() override { ReentrantMonitorAutoEnter mon(mMonitor); return mFormat; } - virtual status_t read(MediaBuffer** buffer, - const ReadOptions* options = nullptr) override ; + status_t read(MediaBuffer** buffer, + const ReadOptions* options = nullptr) override ; private: RefPtr mRtspResource; sp mFormat; diff --git a/dom/media/omx/RtspExtractor.h b/dom/media/omx/RtspExtractor.h index c7b7c4b592c..aabd855c4e3 100644 --- a/dom/media/omx/RtspExtractor.h +++ b/dom/media/omx/RtspExtractor.h @@ -25,12 +25,12 @@ namespace mozilla { class RtspExtractor: public android::MediaExtractor { public: - virtual size_t countTracks() final override; - virtual android::sp getTrack(size_t index) + size_t countTracks() final override; + android::sp getTrack(size_t index) final override; - virtual android::sp getTrackMetaData( + android::sp getTrackMetaData( size_t index, uint32_t flag = 0) final override; - virtual uint32_t flags() const final override; + uint32_t flags() const final override; RtspExtractor(RtspMediaResource* aResource) : mRtspResource(aResource) { diff --git a/dom/media/omx/RtspMediaCodecDecoder.h b/dom/media/omx/RtspMediaCodecDecoder.h index 2f20a985e2d..e64f3f1b762 100644 --- a/dom/media/omx/RtspMediaCodecDecoder.h +++ b/dom/media/omx/RtspMediaCodecDecoder.h @@ -17,13 +17,13 @@ public: explicit RtspMediaCodecDecoder(MediaDecoderOwner* aOwner) : MediaOmxCommonDecoder(aOwner) {} - virtual MediaDecoder* Clone(MediaDecoderOwner* aOwner) override; + MediaDecoder* Clone(MediaDecoderOwner* aOwner) override; - virtual MediaOmxCommonReader* CreateReader() override; + MediaOmxCommonReader* CreateReader() override; - virtual MediaDecoderStateMachine* CreateStateMachineFromReader(MediaOmxCommonReader* aReader) override; + MediaDecoderStateMachine* CreateStateMachineFromReader(MediaOmxCommonReader* aReader) override; - virtual void ChangeState(PlayState aState) override; + void ChangeState(PlayState aState) override; }; } // namespace mozilla diff --git a/dom/media/omx/RtspOmxDecoder.h b/dom/media/omx/RtspOmxDecoder.h index 0595553f3b0..d4a69bfd79c 100644 --- a/dom/media/omx/RtspOmxDecoder.h +++ b/dom/media/omx/RtspOmxDecoder.h @@ -29,9 +29,9 @@ public: MOZ_COUNT_DTOR(RtspOmxDecoder); } - virtual MediaDecoder* Clone(MediaDecoderOwner* aOwner) override final; - virtual MediaDecoderStateMachine* CreateStateMachine() override final; - virtual void ChangeState(PlayState aState) override final; + MediaDecoder* Clone(MediaDecoderOwner* aOwner) override final; + MediaDecoderStateMachine* CreateStateMachine() override final; + void ChangeState(PlayState aState) override final; }; } // namespace mozilla diff --git a/dom/media/omx/RtspOmxReader.h b/dom/media/omx/RtspOmxReader.h index fbf745d342e..4da19d81df7 100644 --- a/dom/media/omx/RtspOmxReader.h +++ b/dom/media/omx/RtspOmxReader.h @@ -28,7 +28,7 @@ class RtspOmxReader : public MediaOmxReader protected: // Provide a Rtsp extractor. nsresult InitOmxDecoder() final override; - virtual void EnsureActive() override; + void EnsureActive() override; public: RtspOmxReader(AbstractMediaDecoder* aDecoder) @@ -43,13 +43,12 @@ public: MOZ_ASSERT(mRtspResource); } - virtual ~RtspOmxReader() override { + virtual ~RtspOmxReader() { MOZ_COUNT_DTOR(RtspOmxReader); } // Implement a time-based seek instead of byte-based.. - virtual RefPtr - Seek(int64_t aTime, int64_t aEndTime) final override; + RefPtr Seek(int64_t aTime, int64_t aEndTime) final override; // Override GetBuffered() to do nothing for below reasons: // 1. Because the Rtsp stream is a/v separated. The buffered data in a/v @@ -60,16 +59,15 @@ public: // we returned are not useful for the MediaDecodeStateMachine. Unlike the // ChannelMediaResource, it has a "cache" that can store the whole streaming // data so the |GetBuffered| function can retrieve useful time ranges. - virtual media::TimeIntervals GetBuffered() final override { + media::TimeIntervals GetBuffered() final override { return media::TimeIntervals::Invalid(); } - virtual void SetIdle() override; + void SetIdle() override; - virtual RefPtr AsyncReadMetadata() - override; + RefPtr AsyncReadMetadata() override; - virtual void HandleResourceAllocated() override; + void HandleResourceAllocated() override; private: // A pointer to RtspMediaResource for calling the Rtsp specific function. From 6f5c0b249f1848cf4c19cb2fee5cfca580fb7225 Mon Sep 17 00:00:00 2001 From: Jean-Yves Avenard Date: Mon, 18 Jan 2016 14:45:08 +1100 Subject: [PATCH 012/119] Bug 1240411: P7. Clean up webspeech header declarations. r=rillian Remove redundant virtual keyword and add missing override if any. --- .../webspeech/recognition/SpeechGrammar.h | 2 +- .../webspeech/recognition/SpeechGrammarList.h | 2 +- .../webspeech/recognition/SpeechRecognition.h | 2 +- .../SpeechRecognitionAlternative.h | 2 +- .../recognition/SpeechRecognitionResult.h | 2 +- .../recognition/SpeechRecognitionResultList.h | 2 +- .../recognition/SpeechStreamListener.h | 16 ++++----- dom/media/webspeech/synth/SpeechSynthesis.h | 2 +- .../synth/SpeechSynthesisUtterance.h | 2 +- .../webspeech/synth/SpeechSynthesisVoice.h | 2 +- .../synth/ipc/SpeechSynthesisChild.h | 30 ++++++++-------- .../synth/ipc/SpeechSynthesisParent.h | 34 +++++++++---------- dom/media/webspeech/synth/nsSpeechTask.cpp | 6 ++-- 13 files changed, 52 insertions(+), 52 deletions(-) diff --git a/dom/media/webspeech/recognition/SpeechGrammar.h b/dom/media/webspeech/recognition/SpeechGrammar.h index 5acc41410e5..8a6a14eacb9 100644 --- a/dom/media/webspeech/recognition/SpeechGrammar.h +++ b/dom/media/webspeech/recognition/SpeechGrammar.h @@ -32,7 +32,7 @@ public: nsISupports* GetParentObject() const; - virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; static already_AddRefed Constructor(const GlobalObject& aGlobal, ErrorResult& aRv); diff --git a/dom/media/webspeech/recognition/SpeechGrammarList.h b/dom/media/webspeech/recognition/SpeechGrammarList.h index 208f8d775ee..dbe7117feea 100644 --- a/dom/media/webspeech/recognition/SpeechGrammarList.h +++ b/dom/media/webspeech/recognition/SpeechGrammarList.h @@ -37,7 +37,7 @@ public: nsISupports* GetParentObject() const; - virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; uint32_t Length() const; diff --git a/dom/media/webspeech/recognition/SpeechRecognition.h b/dom/media/webspeech/recognition/SpeechRecognition.h index 6fe4dc3bd98..d4605599f36 100644 --- a/dom/media/webspeech/recognition/SpeechRecognition.h +++ b/dom/media/webspeech/recognition/SpeechRecognition.h @@ -64,7 +64,7 @@ public: nsISupports* GetParentObject() const; - virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; static bool IsAuthorized(JSContext* aCx, JSObject* aGlobal); diff --git a/dom/media/webspeech/recognition/SpeechRecognitionAlternative.h b/dom/media/webspeech/recognition/SpeechRecognitionAlternative.h index efe5571ac1c..790d8d28fa3 100644 --- a/dom/media/webspeech/recognition/SpeechRecognitionAlternative.h +++ b/dom/media/webspeech/recognition/SpeechRecognitionAlternative.h @@ -31,7 +31,7 @@ public: nsISupports* GetParentObject() const; - virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; void GetTranscript(nsString& aRetVal) const; diff --git a/dom/media/webspeech/recognition/SpeechRecognitionResult.h b/dom/media/webspeech/recognition/SpeechRecognitionResult.h index 76c0b62a059..be0997bf6aa 100644 --- a/dom/media/webspeech/recognition/SpeechRecognitionResult.h +++ b/dom/media/webspeech/recognition/SpeechRecognitionResult.h @@ -32,7 +32,7 @@ public: nsISupports* GetParentObject() const; - virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; uint32_t Length() const; diff --git a/dom/media/webspeech/recognition/SpeechRecognitionResultList.h b/dom/media/webspeech/recognition/SpeechRecognitionResultList.h index 85fdf814835..9725d06ce51 100644 --- a/dom/media/webspeech/recognition/SpeechRecognitionResultList.h +++ b/dom/media/webspeech/recognition/SpeechRecognitionResultList.h @@ -33,7 +33,7 @@ public: nsISupports* GetParentObject() const; - virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; uint32_t Length() const; diff --git a/dom/media/webspeech/recognition/SpeechStreamListener.h b/dom/media/webspeech/recognition/SpeechStreamListener.h index 55d51a4e978..7dd596118e1 100644 --- a/dom/media/webspeech/recognition/SpeechStreamListener.h +++ b/dom/media/webspeech/recognition/SpeechStreamListener.h @@ -24,15 +24,15 @@ public: explicit SpeechStreamListener(SpeechRecognition* aRecognition); ~SpeechStreamListener(); - virtual void NotifyQueuedTrackChanges(MediaStreamGraph* aGraph, TrackID aID, - StreamTime aTrackOffset, - uint32_t aTrackEvents, - const MediaSegment& aQueuedMedia, - MediaStream* aInputStream, - TrackID aInputTrackID) override; + void NotifyQueuedTrackChanges(MediaStreamGraph* aGraph, TrackID aID, + StreamTime aTrackOffset, + uint32_t aTrackEvents, + const MediaSegment& aQueuedMedia, + MediaStream* aInputStream, + TrackID aInputTrackID) override; - virtual void NotifyEvent(MediaStreamGraph* aGraph, - MediaStreamListener::MediaStreamGraphEvent event) override; + void NotifyEvent(MediaStreamGraph* aGraph, + MediaStreamListener::MediaStreamGraphEvent event) override; private: template diff --git a/dom/media/webspeech/synth/SpeechSynthesis.h b/dom/media/webspeech/synth/SpeechSynthesis.h index c8b013069a8..340fe574f5b 100644 --- a/dom/media/webspeech/synth/SpeechSynthesis.h +++ b/dom/media/webspeech/synth/SpeechSynthesis.h @@ -39,7 +39,7 @@ public: nsIDOMWindow* GetParentObject() const; - virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; bool Pending() const; diff --git a/dom/media/webspeech/synth/SpeechSynthesisUtterance.h b/dom/media/webspeech/synth/SpeechSynthesisUtterance.h index 7b2d8c75274..ee15070841b 100644 --- a/dom/media/webspeech/synth/SpeechSynthesisUtterance.h +++ b/dom/media/webspeech/synth/SpeechSynthesisUtterance.h @@ -37,7 +37,7 @@ public: nsISupports* GetParentObject() const; - virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; static already_AddRefed Constructor(GlobalObject& aGlobal, diff --git a/dom/media/webspeech/synth/SpeechSynthesisVoice.h b/dom/media/webspeech/synth/SpeechSynthesisVoice.h index f55695d55b7..5c3c651e2fd 100644 --- a/dom/media/webspeech/synth/SpeechSynthesisVoice.h +++ b/dom/media/webspeech/synth/SpeechSynthesisVoice.h @@ -34,7 +34,7 @@ public: nsISupports* GetParentObject() const; - virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; void GetVoiceURI(nsString& aRetval) const; diff --git a/dom/media/webspeech/synth/ipc/SpeechSynthesisChild.h b/dom/media/webspeech/synth/ipc/SpeechSynthesisChild.h index 37e8da3e584..8b40319e393 100644 --- a/dom/media/webspeech/synth/ipc/SpeechSynthesisChild.h +++ b/dom/media/webspeech/synth/ipc/SpeechSynthesisChild.h @@ -50,21 +50,21 @@ public: virtual ~SpeechSynthesisRequestChild(); protected: - virtual bool RecvOnStart(const nsString& aUri) override; + bool RecvOnStart(const nsString& aUri) override; - virtual bool RecvOnEnd(const bool& aIsError, - const float& aElapsedTime, - const uint32_t& aCharIndex) override; + bool RecvOnEnd(const bool& aIsError, + const float& aElapsedTime, + const uint32_t& aCharIndex) override; - virtual bool RecvOnPause(const float& aElapsedTime, const uint32_t& aCharIndex) override; + bool RecvOnPause(const float& aElapsedTime, const uint32_t& aCharIndex) override; - virtual bool RecvOnResume(const float& aElapsedTime, const uint32_t& aCharIndex) override; + bool RecvOnResume(const float& aElapsedTime, const uint32_t& aCharIndex) override; - virtual bool RecvOnBoundary(const nsString& aName, const float& aElapsedTime, - const uint32_t& aCharIndex) override; + bool RecvOnBoundary(const nsString& aName, const float& aElapsedTime, + const uint32_t& aCharIndex) override; - virtual bool RecvOnMark(const nsString& aName, const float& aElapsedTime, - const uint32_t& aCharIndex) override; + bool RecvOnMark(const nsString& aName, const float& aElapsedTime, + const uint32_t& aCharIndex) override; RefPtr mTask; }; @@ -84,15 +84,15 @@ public: NS_IMETHOD SendAudioNative(int16_t* aData, uint32_t aDataLen) override; - virtual void Pause() override; + void Pause() override; - virtual void Resume() override; + void Resume() override; - virtual void Cancel() override; + void Cancel() override; - virtual void ForceEnd() override; + void ForceEnd() override; - virtual void SetAudioOutputVolume(float aVolume) override; + void SetAudioOutputVolume(float aVolume) override; private: SpeechSynthesisRequestChild* mActor; diff --git a/dom/media/webspeech/synth/ipc/SpeechSynthesisParent.h b/dom/media/webspeech/synth/ipc/SpeechSynthesisParent.h index 53379def198..2edd7e28e32 100644 --- a/dom/media/webspeech/synth/ipc/SpeechSynthesisParent.h +++ b/dom/media/webspeech/synth/ipc/SpeechSynthesisParent.h @@ -22,7 +22,7 @@ class SpeechSynthesisParent : public PSpeechSynthesisParent friend class SpeechSynthesisRequestParent; public: - virtual void ActorDestroy(ActorDestroyReason aWhy) override; + void ActorDestroy(ActorDestroyReason aWhy) override; bool RecvReadVoicesAndState(InfallibleTArray* aVoices, InfallibleTArray* aDefaults, @@ -60,19 +60,19 @@ public: protected: - virtual void ActorDestroy(ActorDestroyReason aWhy) override; + void ActorDestroy(ActorDestroyReason aWhy) override; - virtual bool RecvPause() override; + bool RecvPause() override; - virtual bool RecvResume() override; + bool RecvResume() override; - virtual bool RecvCancel() override; + bool RecvCancel() override; - virtual bool RecvForceEnd() override; + bool RecvForceEnd() override; - virtual bool RecvSetAudioOutputVolume(const float& aVolume) override; + bool RecvSetAudioOutputVolume(const float& aVolume) override; - virtual bool Recv__delete__() override; + bool Recv__delete__() override; }; class SpeechTaskParent : public nsSpeechTask @@ -82,21 +82,21 @@ public: SpeechTaskParent(float aVolume, const nsAString& aUtterance) : nsSpeechTask(aVolume, aUtterance) {} - virtual nsresult DispatchStartImpl(const nsAString& aUri); + nsresult DispatchStartImpl(const nsAString& aUri); - virtual nsresult DispatchEndImpl(float aElapsedTime, uint32_t aCharIndex); + nsresult DispatchEndImpl(float aElapsedTime, uint32_t aCharIndex); - virtual nsresult DispatchPauseImpl(float aElapsedTime, uint32_t aCharIndex); + nsresult DispatchPauseImpl(float aElapsedTime, uint32_t aCharIndex); - virtual nsresult DispatchResumeImpl(float aElapsedTime, uint32_t aCharIndex); + nsresult DispatchResumeImpl(float aElapsedTime, uint32_t aCharIndex); - virtual nsresult DispatchErrorImpl(float aElapsedTime, uint32_t aCharIndex); + nsresult DispatchErrorImpl(float aElapsedTime, uint32_t aCharIndex); - virtual nsresult DispatchBoundaryImpl(const nsAString& aName, - float aElapsedTime, uint32_t aCharIndex); + nsresult DispatchBoundaryImpl(const nsAString& aName, + float aElapsedTime, uint32_t aCharIndex); - virtual nsresult DispatchMarkImpl(const nsAString& aName, - float aElapsedTime, uint32_t aCharIndex); + nsresult DispatchMarkImpl(const nsAString& aName, + float aElapsedTime, uint32_t aCharIndex); private: SpeechSynthesisRequestParent* mActor; diff --git a/dom/media/webspeech/synth/nsSpeechTask.cpp b/dom/media/webspeech/synth/nsSpeechTask.cpp index 05066d1cfe8..39fab24ceae 100644 --- a/dom/media/webspeech/synth/nsSpeechTask.cpp +++ b/dom/media/webspeech/synth/nsSpeechTask.cpp @@ -52,8 +52,8 @@ public: } } - virtual void NotifyEvent(MediaStreamGraph* aGraph, - MediaStreamListener::MediaStreamGraphEvent event) override + void NotifyEvent(MediaStreamGraph* aGraph, + MediaStreamListener::MediaStreamGraphEvent event) override { switch (event) { case EVENT_FINISHED: @@ -73,7 +73,7 @@ public: } } - virtual void NotifyBlockingChanged(MediaStreamGraph* aGraph, Blocking aBlocked) override + void NotifyBlockingChanged(MediaStreamGraph* aGraph, Blocking aBlocked) override { if (aBlocked == MediaStreamListener::UNBLOCKED && !mStarted) { mStarted = true; From 6b95f873738f634db8109755d2945e6a64a53cd1 Mon Sep 17 00:00:00 2001 From: Jean-Yves Avenard Date: Mon, 18 Jan 2016 14:46:10 +1100 Subject: [PATCH 013/119] Bug 1240411: P8. Clean up MediaSource headers. r=cpearce Remove redundant virtual keyword and add missing override if any. --- dom/media/mediasource/MediaSourceDecoder.h | 12 ++-- dom/media/mediasource/MediaSourceResource.h | 56 +++++++++---------- dom/media/mediasource/ResourceQueue.cpp | 2 +- .../mediasource/SourceBufferContentManager.h | 2 +- dom/media/mediasource/SourceBufferResource.h | 54 +++++++++--------- 5 files changed, 62 insertions(+), 64 deletions(-) diff --git a/dom/media/mediasource/MediaSourceDecoder.h b/dom/media/mediasource/MediaSourceDecoder.h index 4bfd4161832..eabfe9957b9 100644 --- a/dom/media/mediasource/MediaSourceDecoder.h +++ b/dom/media/mediasource/MediaSourceDecoder.h @@ -36,10 +36,10 @@ class MediaSourceDecoder : public MediaDecoder public: explicit MediaSourceDecoder(dom::HTMLMediaElement* aElement); - virtual MediaDecoder* Clone(MediaDecoderOwner* aOwner) override; - virtual MediaDecoderStateMachine* CreateStateMachine() override; - virtual nsresult Load(nsIStreamListener**) override; - virtual media::TimeIntervals GetSeekable() override; + MediaDecoder* Clone(MediaDecoderOwner* aOwner) override; + MediaDecoderStateMachine* CreateStateMachine() override; + nsresult Load(nsIStreamListener**) override; + media::TimeIntervals GetSeekable() override; media::TimeIntervals GetBuffered() override; // We can't do this in the constructor because we don't know what type of @@ -50,7 +50,7 @@ public: mDormantSupported = aSupported; } - virtual RefPtr Shutdown() override; + RefPtr Shutdown() override; static already_AddRefed CreateResource(nsIPrincipal* aPrincipal = nullptr); @@ -60,7 +60,7 @@ public: void Ended(bool aEnded); // Return the duration of the video in seconds. - virtual double GetDuration() override; + double GetDuration() override; void SetInitialDuration(int64_t aDuration); void SetMediaSourceDuration(double aDuration, MSRangeRemovalAction aAction); diff --git a/dom/media/mediasource/MediaSourceResource.h b/dom/media/mediasource/MediaSourceResource.h index 6349f81d4a3..3ce4ebb5208 100644 --- a/dom/media/mediasource/MediaSourceResource.h +++ b/dom/media/mediasource/MediaSourceResource.h @@ -28,43 +28,43 @@ public: , mEnded(false) {} - virtual nsresult Close() override { return NS_OK; } - virtual void Suspend(bool aCloseImmediately) override { UNIMPLEMENTED(); } - virtual void Resume() override { UNIMPLEMENTED(); } - virtual bool CanClone() override { UNIMPLEMENTED(); return false; } - virtual already_AddRefed CloneData(MediaResourceCallback*) override { UNIMPLEMENTED(); return nullptr; } - virtual void SetReadMode(MediaCacheStream::ReadMode aMode) override { UNIMPLEMENTED(); } - virtual void SetPlaybackRate(uint32_t aBytesPerSecond) override { UNIMPLEMENTED(); } - virtual nsresult ReadAt(int64_t aOffset, char* aBuffer, uint32_t aCount, uint32_t* aBytes) override { UNIMPLEMENTED(); return NS_ERROR_FAILURE; } - virtual int64_t Tell() override { UNIMPLEMENTED(); return -1; } - virtual void Pin() override { UNIMPLEMENTED(); } - virtual void Unpin() override { UNIMPLEMENTED(); } - virtual double GetDownloadRate(bool* aIsReliable) override { UNIMPLEMENTED(); *aIsReliable = false; return 0; } - virtual int64_t GetLength() override { UNIMPLEMENTED(); return -1; } - virtual int64_t GetNextCachedData(int64_t aOffset) override { UNIMPLEMENTED(); return -1; } - virtual int64_t GetCachedDataEnd(int64_t aOffset) override { UNIMPLEMENTED(); return -1; } - virtual bool IsDataCachedToEndOfResource(int64_t aOffset) override { UNIMPLEMENTED(); return false; } - virtual bool IsSuspendedByCache() override { UNIMPLEMENTED(); return false; } - virtual bool IsSuspended() override { UNIMPLEMENTED(); return false; } - virtual nsresult ReadFromCache(char* aBuffer, int64_t aOffset, uint32_t aCount) override { UNIMPLEMENTED(); return NS_ERROR_FAILURE; } - virtual nsresult Open(nsIStreamListener** aStreamListener) override { UNIMPLEMENTED(); return NS_ERROR_FAILURE; } + nsresult Close() override { return NS_OK; } + void Suspend(bool aCloseImmediately) override { UNIMPLEMENTED(); } + void Resume() override { UNIMPLEMENTED(); } + bool CanClone() override { UNIMPLEMENTED(); return false; } + already_AddRefed CloneData(MediaResourceCallback*) override { UNIMPLEMENTED(); return nullptr; } + void SetReadMode(MediaCacheStream::ReadMode aMode) override { UNIMPLEMENTED(); } + void SetPlaybackRate(uint32_t aBytesPerSecond) override { UNIMPLEMENTED(); } + nsresult ReadAt(int64_t aOffset, char* aBuffer, uint32_t aCount, uint32_t* aBytes) override { UNIMPLEMENTED(); return NS_ERROR_FAILURE; } + int64_t Tell() override { UNIMPLEMENTED(); return -1; } + void Pin() override { UNIMPLEMENTED(); } + void Unpin() override { UNIMPLEMENTED(); } + double GetDownloadRate(bool* aIsReliable) override { UNIMPLEMENTED(); *aIsReliable = false; return 0; } + int64_t GetLength() override { UNIMPLEMENTED(); return -1; } + int64_t GetNextCachedData(int64_t aOffset) override { UNIMPLEMENTED(); return -1; } + int64_t GetCachedDataEnd(int64_t aOffset) override { UNIMPLEMENTED(); return -1; } + bool IsDataCachedToEndOfResource(int64_t aOffset) override { UNIMPLEMENTED(); return false; } + bool IsSuspendedByCache() override { UNIMPLEMENTED(); return false; } + bool IsSuspended() override { UNIMPLEMENTED(); return false; } + nsresult ReadFromCache(char* aBuffer, int64_t aOffset, uint32_t aCount) override { UNIMPLEMENTED(); return NS_ERROR_FAILURE; } + nsresult Open(nsIStreamListener** aStreamListener) override { UNIMPLEMENTED(); return NS_ERROR_FAILURE; } - virtual already_AddRefed GetCurrentPrincipal() override + already_AddRefed GetCurrentPrincipal() override { return RefPtr(mPrincipal).forget(); } - virtual nsresult GetCachedRanges(MediaByteRangeSet& aRanges) override + nsresult GetCachedRanges(MediaByteRangeSet& aRanges) override { UNIMPLEMENTED(); aRanges += MediaByteRange(0, GetLength()); return NS_OK; } - virtual bool IsTransportSeekable() override { return true; } - virtual const nsCString& GetContentType() const override { return mType; } + bool IsTransportSeekable() override { return true; } + const nsCString& GetContentType() const override { return mType; } - virtual bool IsLiveStream() override + bool IsLiveStream() override { MonitorAutoLock mon(mMonitor); return !mEnded; @@ -75,14 +75,14 @@ public: mEnded = aEnded; } - virtual bool IsExpectingMoreData() override + bool IsExpectingMoreData() override { MonitorAutoLock mon(mMonitor); return !mEnded; } private: - virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override + size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override { size_t size = MediaResource::SizeOfExcludingThis(aMallocSizeOf); size += mType.SizeOfExcludingThisIfUnshared(aMallocSizeOf); @@ -90,7 +90,7 @@ private: return size; } - virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override + size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override { return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf); } diff --git a/dom/media/mediasource/ResourceQueue.cpp b/dom/media/mediasource/ResourceQueue.cpp index 58cc0a2fb58..95b0ee3c419 100644 --- a/dom/media/mediasource/ResourceQueue.cpp +++ b/dom/media/mediasource/ResourceQueue.cpp @@ -35,7 +35,7 @@ ResourceItem::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const } class ResourceQueueDeallocator : public nsDequeFunctor { - virtual void* operator() (void* aObject) { + void* operator() (void* aObject) override { delete static_cast(aObject); return nullptr; } diff --git a/dom/media/mediasource/SourceBufferContentManager.h b/dom/media/mediasource/SourceBufferContentManager.h index 7132779eb59..e1bbd4a73fa 100644 --- a/dom/media/mediasource/SourceBufferContentManager.h +++ b/dom/media/mediasource/SourceBufferContentManager.h @@ -54,7 +54,7 @@ public: // Runs MSE range removal algorithm. // http://w3c.github.io/media-source/#sourcebuffer-coded-frame-removal virtual RefPtr RangeRemoval(media::TimeUnit aStart, - media::TimeUnit aEnd) = 0; + media::TimeUnit aEnd) = 0; enum class EvictDataResult : int8_t { diff --git a/dom/media/mediasource/SourceBufferResource.h b/dom/media/mediasource/SourceBufferResource.h index 0faea0ad2aa..32253c14056 100644 --- a/dom/media/mediasource/SourceBufferResource.h +++ b/dom/media/mediasource/SourceBufferResource.h @@ -39,20 +39,20 @@ class SourceBufferResource final : public MediaResource { public: explicit SourceBufferResource(const nsACString& aType); - virtual nsresult Close() override; - virtual void Suspend(bool aCloseImmediately) override { UNIMPLEMENTED(); } - virtual void Resume() override { UNIMPLEMENTED(); } - virtual already_AddRefed GetCurrentPrincipal() override { UNIMPLEMENTED(); return nullptr; } - virtual already_AddRefed CloneData(MediaResourceCallback*) override { UNIMPLEMENTED(); return nullptr; } - virtual void SetReadMode(MediaCacheStream::ReadMode aMode) override { UNIMPLEMENTED(); } - virtual void SetPlaybackRate(uint32_t aBytesPerSecond) override { UNIMPLEMENTED(); } - virtual nsresult ReadAt(int64_t aOffset, char* aBuffer, uint32_t aCount, uint32_t* aBytes) override; - virtual int64_t Tell() override { return mOffset; } - virtual void Pin() override { UNIMPLEMENTED(); } - virtual void Unpin() override { UNIMPLEMENTED(); } - virtual double GetDownloadRate(bool* aIsReliable) override { UNIMPLEMENTED(); *aIsReliable = false; return 0; } - virtual int64_t GetLength() override { return mInputBuffer.GetLength(); } - virtual int64_t GetNextCachedData(int64_t aOffset) override { + nsresult Close() override; + void Suspend(bool aCloseImmediately) override { UNIMPLEMENTED(); } + void Resume() override { UNIMPLEMENTED(); } + already_AddRefed GetCurrentPrincipal() override { UNIMPLEMENTED(); return nullptr; } + already_AddRefed CloneData(MediaResourceCallback*) override { UNIMPLEMENTED(); return nullptr; } + void SetReadMode(MediaCacheStream::ReadMode aMode) override { UNIMPLEMENTED(); } + void SetPlaybackRate(uint32_t aBytesPerSecond) override { UNIMPLEMENTED(); } + nsresult ReadAt(int64_t aOffset, char* aBuffer, uint32_t aCount, uint32_t* aBytes) override; + int64_t Tell() override { return mOffset; } + void Pin() override { UNIMPLEMENTED(); } + void Unpin() override { UNIMPLEMENTED(); } + double GetDownloadRate(bool* aIsReliable) override { UNIMPLEMENTED(); *aIsReliable = false; return 0; } + int64_t GetLength() override { return mInputBuffer.GetLength(); } + int64_t GetNextCachedData(int64_t aOffset) override { ReentrantMonitorAutoEnter mon(mMonitor); MOZ_ASSERT(aOffset >= 0); if (uint64_t(aOffset) < mInputBuffer.GetOffset()) { @@ -62,15 +62,15 @@ public: } return aOffset; } - virtual int64_t GetCachedDataEnd(int64_t aOffset) override { UNIMPLEMENTED(); return -1; } - virtual bool IsDataCachedToEndOfResource(int64_t aOffset) override { return false; } - virtual bool IsSuspendedByCache() override { UNIMPLEMENTED(); return false; } - virtual bool IsSuspended() override { UNIMPLEMENTED(); return false; } - virtual nsresult ReadFromCache(char* aBuffer, int64_t aOffset, uint32_t aCount) override; - virtual bool IsTransportSeekable() override { UNIMPLEMENTED(); return true; } - virtual nsresult Open(nsIStreamListener** aStreamListener) override { UNIMPLEMENTED(); return NS_ERROR_FAILURE; } + int64_t GetCachedDataEnd(int64_t aOffset) override { UNIMPLEMENTED(); return -1; } + bool IsDataCachedToEndOfResource(int64_t aOffset) override { return false; } + bool IsSuspendedByCache() override { UNIMPLEMENTED(); return false; } + bool IsSuspended() override { UNIMPLEMENTED(); return false; } + nsresult ReadFromCache(char* aBuffer, int64_t aOffset, uint32_t aCount) override; + bool IsTransportSeekable() override { UNIMPLEMENTED(); return true; } + nsresult Open(nsIStreamListener** aStreamListener) override { UNIMPLEMENTED(); return NS_ERROR_FAILURE; } - virtual nsresult GetCachedRanges(MediaByteRangeSet& aRanges) override + nsresult GetCachedRanges(MediaByteRangeSet& aRanges) override { ReentrantMonitorAutoEnter mon(mMonitor); if (mInputBuffer.GetLength()) { @@ -80,10 +80,9 @@ public: return NS_OK; } - virtual const nsCString& GetContentType() const override { return mType; } + const nsCString& GetContentType() const override { return mType; } - virtual size_t SizeOfExcludingThis( - MallocSizeOf aMallocSizeOf) const override + size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override { ReentrantMonitorAutoEnter mon(mMonitor); @@ -94,13 +93,12 @@ public: return size; } - virtual size_t SizeOfIncludingThis( - MallocSizeOf aMallocSizeOf) const override + size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override { return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf); } - virtual bool IsExpectingMoreData() override + bool IsExpectingMoreData() override { return false; } From bf3fcbbca3ff4ca002102b81ef5821e43b73491a Mon Sep 17 00:00:00 2001 From: Jean-Yves Avenard Date: Mon, 18 Jan 2016 14:50:29 +1100 Subject: [PATCH 014/119] Bug 1240411: P9. Clean up media headers. r=jwwang Remove redundant virtual keyword and add missing override if any. --- dom/media/AudioSegment.h | 6 +- dom/media/AudioStreamTrack.h | 6 +- dom/media/AudioTrack.h | 6 +- dom/media/AudioTrackList.h | 4 +- dom/media/BufferMediaResource.h | 58 +++++++++---------- dom/media/CanvasCaptureMediaStream.cpp | 2 +- dom/media/CanvasCaptureMediaStream.h | 2 +- dom/media/GetUserMediaRequest.h | 3 +- dom/media/GraphDriver.h | 58 +++++++++---------- dom/media/MediaFormatReader.h | 2 +- dom/media/MediaInfo.h | 16 +++--- dom/media/MediaManager.cpp | 20 +++---- dom/media/MediaRecorder.h | 2 +- dom/media/MediaResource.cpp | 54 +++++++++--------- dom/media/MediaResource.h | 76 ++++++++++++------------- dom/media/MediaSegment.h | 24 ++++---- dom/media/MediaStreamError.h | 2 +- dom/media/MediaStreamGraph.cpp | 58 +++++++++---------- dom/media/MediaStreamGraph.h | 16 +++--- dom/media/RtspMediaResource.h | 57 +++++++++---------- dom/media/SharedBuffer.h | 2 +- dom/media/TextTrack.h | 2 +- dom/media/TextTrackCue.h | 2 +- dom/media/TextTrackCueList.h | 2 +- dom/media/TextTrackList.h | 2 +- dom/media/TextTrackRegion.h | 2 +- dom/media/TrackUnionStream.h | 4 +- dom/media/VideoSegment.h | 4 +- dom/media/VideoStreamTrack.h | 6 +- dom/media/VideoTrack.h | 6 +- dom/media/VideoTrackList.h | 6 +- dom/media/encoder/MediaEncoder.h | 16 +++--- dom/media/encoder/TrackEncoder.h | 24 ++++---- dom/media/gtest/MockMediaDecoderOwner.h | 48 ++++++++-------- dom/media/gtest/MockMediaResource.h | 55 +++++++++--------- dom/media/gtest/TestAudioCompactor.cpp | 2 +- dom/media/gtest/TestGMPCrossOrigin.cpp | 60 +++++++++---------- dom/media/imagecapture/CaptureTask.h | 18 +++--- dom/media/imagecapture/ImageCapture.h | 2 +- dom/media/systemservices/LoadManager.h | 10 ++-- 40 files changed, 366 insertions(+), 379 deletions(-) diff --git a/dom/media/AudioSegment.h b/dom/media/AudioSegment.h index 295c235ebf6..e2880dadc37 100644 --- a/dom/media/AudioSegment.h +++ b/dom/media/AudioSegment.h @@ -26,7 +26,7 @@ public: mBuffers.SwapElements(*aBuffers); } - virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override + size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override { size_t amount = 0; amount += mBuffers.ShallowSizeOfExcludingThis(aMallocSizeOf); @@ -37,7 +37,7 @@ public: return amount; } - virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override + size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override { return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf); } @@ -384,7 +384,7 @@ public: static Type StaticType() { return AUDIO; } - virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override + size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override { return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf); } diff --git a/dom/media/AudioStreamTrack.h b/dom/media/AudioStreamTrack.h index ce427463300..cca21b5f422 100644 --- a/dom/media/AudioStreamTrack.h +++ b/dom/media/AudioStreamTrack.h @@ -17,12 +17,12 @@ public: AudioStreamTrack(DOMMediaStream* aStream, TrackID aTrackID, const nsString& aLabel) : MediaStreamTrack(aStream, aTrackID, aLabel) {} - virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; - virtual AudioStreamTrack* AsAudioStreamTrack() override { return this; } + AudioStreamTrack* AsAudioStreamTrack() override { return this; } // WebIDL - virtual void GetKind(nsAString& aKind) override { aKind.AssignLiteral("audio"); } + void GetKind(nsAString& aKind) override { aKind.AssignLiteral("audio"); } }; } // namespace dom diff --git a/dom/media/AudioTrack.h b/dom/media/AudioTrack.h index ae8389e4324..4047c34f862 100644 --- a/dom/media/AudioTrack.h +++ b/dom/media/AudioTrack.h @@ -21,14 +21,14 @@ public: const nsAString& aLanguage, bool aEnabled); - virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; - virtual AudioTrack* AsAudioTrack() override + AudioTrack* AsAudioTrack() override { return this; } - virtual void SetEnabledInternal(bool aEnabled, int aFlags) override; + void SetEnabledInternal(bool aEnabled, int aFlags) override; // WebIDL bool Enabled() const diff --git a/dom/media/AudioTrackList.h b/dom/media/AudioTrackList.h index 5785f6c990b..9ce21e1fff0 100644 --- a/dom/media/AudioTrackList.h +++ b/dom/media/AudioTrackList.h @@ -21,7 +21,7 @@ public: AudioTrackList(nsPIDOMWindow* aOwnerWindow, HTMLMediaElement* aMediaElement) : MediaTrackList(aOwnerWindow, aMediaElement) {} - virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; AudioTrack* operator[](uint32_t aIndex); @@ -31,7 +31,7 @@ public: AudioTrack* GetTrackById(const nsAString& aId); protected: - virtual AudioTrackList* AsAudioTrackList() override { return this; } + AudioTrackList* AsAudioTrackList() override { return this; } }; } // namespace dom diff --git a/dom/media/BufferMediaResource.h b/dom/media/BufferMediaResource.h index 755d1da9b90..5633ddf9c77 100644 --- a/dom/media/BufferMediaResource.h +++ b/dom/media/BufferMediaResource.h @@ -40,27 +40,27 @@ protected: } private: - virtual nsresult Close() override { return NS_OK; } - virtual void Suspend(bool aCloseImmediately) override {} - virtual void Resume() override {} + nsresult Close() override { return NS_OK; } + void Suspend(bool aCloseImmediately) override {} + void Resume() override {} // Get the current principal for the channel - virtual already_AddRefed GetCurrentPrincipal() override + already_AddRefed GetCurrentPrincipal() override { nsCOMPtr principal = mPrincipal; return principal.forget(); } - virtual bool CanClone() override { return false; } - virtual already_AddRefed CloneData(MediaResourceCallback*) override + bool CanClone() override { return false; } + already_AddRefed CloneData(MediaResourceCallback*) override { return nullptr; } // These methods are called off the main thread. // The mode is initially MODE_PLAYBACK. - virtual void SetReadMode(MediaCacheStream::ReadMode aMode) override {} - virtual void SetPlaybackRate(uint32_t aBytesPerSecond) override {} - virtual nsresult ReadAt(int64_t aOffset, char* aBuffer, - uint32_t aCount, uint32_t* aBytes) override + void SetReadMode(MediaCacheStream::ReadMode aMode) override {} + void SetPlaybackRate(uint32_t aBytesPerSecond) override {} + nsresult ReadAt(int64_t aOffset, char* aBuffer, + uint32_t aCount, uint32_t* aBytes) override { if (aOffset < 0 || aOffset > mLength) { return NS_ERROR_FAILURE; @@ -70,20 +70,20 @@ private: mOffset = aOffset + *aBytes; return NS_OK; } - virtual int64_t Tell() override { return mOffset; } + int64_t Tell() override { return mOffset; } - virtual void Pin() override {} - virtual void Unpin() override {} - virtual double GetDownloadRate(bool* aIsReliable) override { *aIsReliable = false; return 0.; } - virtual int64_t GetLength() override { return mLength; } - virtual int64_t GetNextCachedData(int64_t aOffset) override { return aOffset; } - virtual int64_t GetCachedDataEnd(int64_t aOffset) override { return mLength; } - virtual bool IsDataCachedToEndOfResource(int64_t aOffset) override { return true; } - virtual bool IsSuspendedByCache() override { return false; } - virtual bool IsSuspended() override { return false; } - virtual nsresult ReadFromCache(char* aBuffer, - int64_t aOffset, - uint32_t aCount) override + void Pin() override {} + void Unpin() override {} + double GetDownloadRate(bool* aIsReliable) override { *aIsReliable = false; return 0.; } + int64_t GetLength() override { return mLength; } + int64_t GetNextCachedData(int64_t aOffset) override { return aOffset; } + int64_t GetCachedDataEnd(int64_t aOffset) override { return mLength; } + bool IsDataCachedToEndOfResource(int64_t aOffset) override { return true; } + bool IsSuspendedByCache() override { return false; } + bool IsSuspended() override { return false; } + nsresult ReadFromCache(char* aBuffer, + int64_t aOffset, + uint32_t aCount) override { if (aOffset < 0) { return NS_ERROR_FAILURE; @@ -94,12 +94,12 @@ private: return NS_OK; } - virtual nsresult Open(nsIStreamListener** aStreamListener) override + nsresult Open(nsIStreamListener** aStreamListener) override { return NS_ERROR_FAILURE; } - virtual nsresult GetCachedRanges(MediaByteRangeSet& aRanges) override + nsresult GetCachedRanges(MediaByteRangeSet& aRanges) override { aRanges += MediaByteRange(0, int64_t(mLength)); return NS_OK; @@ -107,13 +107,12 @@ private: bool IsTransportSeekable() override { return true; } - virtual const nsCString& GetContentType() const override + const nsCString& GetContentType() const override { return mContentType; } - virtual size_t SizeOfExcludingThis( - MallocSizeOf aMallocSizeOf) const override + size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override { // Not owned: // - mBuffer @@ -124,8 +123,7 @@ private: return size; } - virtual size_t SizeOfIncludingThis( - MallocSizeOf aMallocSizeOf) const override + size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override { return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf); } diff --git a/dom/media/CanvasCaptureMediaStream.cpp b/dom/media/CanvasCaptureMediaStream.cpp index aa136284d93..96322742b6e 100644 --- a/dom/media/CanvasCaptureMediaStream.cpp +++ b/dom/media/CanvasCaptureMediaStream.cpp @@ -44,7 +44,7 @@ public: mImage = aImage; } - virtual void NotifyPull(MediaStreamGraph* aGraph, StreamTime aDesiredTime) override + void NotifyPull(MediaStreamGraph* aGraph, StreamTime aDesiredTime) override { // Called on the MediaStreamGraph thread. StreamTime delta = aDesiredTime - mSourceStream->GetEndOfAppendedData(mTrackId); diff --git a/dom/media/CanvasCaptureMediaStream.h b/dom/media/CanvasCaptureMediaStream.h index 47b722e70d4..8ec00e1d1f9 100644 --- a/dom/media/CanvasCaptureMediaStream.h +++ b/dom/media/CanvasCaptureMediaStream.h @@ -103,7 +103,7 @@ public: nsresult Init(const dom::Optional& aFPS, const TrackID& aTrackId); - virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; // WebIDL HTMLCanvasElement* Canvas() const { return mCanvas; } diff --git a/dom/media/GetUserMediaRequest.h b/dom/media/GetUserMediaRequest.h index e7b0118e679..b88f98b480d 100644 --- a/dom/media/GetUserMediaRequest.h +++ b/dom/media/GetUserMediaRequest.h @@ -28,8 +28,7 @@ public: NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(GetUserMediaRequest) - virtual JSObject* WrapObject(JSContext* cx, JS::Handle aGivenProto) - override; + JSObject* WrapObject(JSContext* cx, JS::Handle aGivenProto) override; nsISupports* GetParentObject(); uint64_t WindowID(); diff --git a/dom/media/GraphDriver.h b/dom/media/GraphDriver.h index 9604064f995..0f626da4c03 100644 --- a/dom/media/GraphDriver.h +++ b/dom/media/GraphDriver.h @@ -258,21 +258,21 @@ class ThreadedDriver : public GraphDriver public: explicit ThreadedDriver(MediaStreamGraphImpl* aGraphImpl); virtual ~ThreadedDriver(); - virtual void Start() override; - virtual void Stop() override; - virtual void Resume() override; - virtual void Revive() override; + void Start() override; + void Stop() override; + void Resume() override; + void Revive() override; /** * Runs main control loop on the graph thread. Normally a single invocation * of this runs for the entire lifetime of the graph thread. */ void RunThread(); friend class MediaStreamGraphInitThreadRunnable; - virtual uint32_t IterationDuration() override { + uint32_t IterationDuration() override { return MEDIA_GRAPH_TARGET_PERIOD_MS; } - virtual bool OnThread() override { return !mThread || NS_GetCurrentThread() == mThread; } + bool OnThread() override { return !mThread || NS_GetCurrentThread() == mThread; } /* When the graph wakes up to do an iteration, implementations return the * range of time that will be processed. This is called only once per @@ -292,9 +292,9 @@ class SystemClockDriver : public ThreadedDriver public: explicit SystemClockDriver(MediaStreamGraphImpl* aGraphImpl); virtual ~SystemClockDriver(); - virtual MediaTime GetIntervalForIteration() override; - virtual void WaitForNextIteration() override; - virtual void WakeUp() override; + MediaTime GetIntervalForIteration() override; + void WaitForNextIteration() override; + void WakeUp() override; private: @@ -313,11 +313,11 @@ class OfflineClockDriver : public ThreadedDriver public: OfflineClockDriver(MediaStreamGraphImpl* aGraphImpl, GraphTime aSlice); virtual ~OfflineClockDriver(); - virtual MediaTime GetIntervalForIteration() override; - virtual void WaitForNextIteration() override; - virtual void WakeUp() override; - virtual TimeStamp GetCurrentTimeStamp() override; - virtual OfflineClockDriver* AsOfflineClockDriver() override { + MediaTime GetIntervalForIteration() override; + void WaitForNextIteration() override; + void WakeUp() override; + TimeStamp GetCurrentTimeStamp() override; + OfflineClockDriver* AsOfflineClockDriver() override { return this; } @@ -368,13 +368,13 @@ public: explicit AudioCallbackDriver(MediaStreamGraphImpl* aGraphImpl); virtual ~AudioCallbackDriver(); - virtual void Destroy() override; - virtual void Start() override; - virtual void Stop() override; - virtual void Resume() override; - virtual void Revive() override; - virtual void WaitForNextIteration() override; - virtual void WakeUp() override; + void Destroy() override; + void Start() override; + void Stop() override; + void Resume() override; + void Revive() override; + void WaitForNextIteration() override; + void WakeUp() override; /* Static wrapper function cubeb calls back. */ static long DataCallback_s(cubeb_stream * aStream, @@ -394,17 +394,17 @@ public: void StateCallback(cubeb_state aState); /* This is an approximation of the number of millisecond there are between two * iterations of the graph. */ - virtual uint32_t IterationDuration() override; + uint32_t IterationDuration() override; /* This function gets called when the graph has produced the audio frames for * this iteration. */ - virtual void MixerCallback(AudioDataValue* aMixedBuffer, - AudioSampleFormat aFormat, - uint32_t aChannels, - uint32_t aFrames, - uint32_t aSampleRate) override; + void MixerCallback(AudioDataValue* aMixedBuffer, + AudioSampleFormat aFormat, + uint32_t aChannels, + uint32_t aFrames, + uint32_t aSampleRate) override; - virtual AudioCallbackDriver* AsAudioCallbackDriver() override { + AudioCallbackDriver* AsAudioCallbackDriver() override { return this; } @@ -427,7 +427,7 @@ public: */ bool InCallback(); - virtual bool OnThread() override { return !mStarted || InCallback(); } + bool OnThread() override { return !mStarted || InCallback(); } /* Whether the underlying cubeb stream has been started. See comment for * mStarted for details. */ diff --git a/dom/media/MediaFormatReader.h b/dom/media/MediaFormatReader.h index c2e4680dccd..5a49f8bafa9 100644 --- a/dom/media/MediaFormatReader.h +++ b/dom/media/MediaFormatReader.h @@ -55,7 +55,7 @@ protected: public: media::TimeIntervals GetBuffered() override; - virtual bool ForceZeroStartTime() const override; + bool ForceZeroStartTime() const override; // For Media Resource Management void ReleaseMediaResources() override; diff --git a/dom/media/MediaInfo.h b/dom/media/MediaInfo.h index 540fa9547ab..a1427d6221d 100644 --- a/dom/media/MediaInfo.h +++ b/dom/media/MediaInfo.h @@ -200,22 +200,22 @@ public: { } - virtual bool IsValid() const override + bool IsValid() const override { return mDisplay.width > 0 && mDisplay.height > 0; } - virtual VideoInfo* GetAsVideoInfo() override + VideoInfo* GetAsVideoInfo() override { return this; } - virtual const VideoInfo* GetAsVideoInfo() const override + const VideoInfo* GetAsVideoInfo() const override { return this; } - virtual UniquePtr Clone() const override + UniquePtr Clone() const override { return MakeUnique(*this); } @@ -260,22 +260,22 @@ public: { } - virtual bool IsValid() const override + bool IsValid() const override { return mChannels > 0 && mRate > 0; } - virtual AudioInfo* GetAsAudioInfo() override + AudioInfo* GetAsAudioInfo() override { return this; } - virtual const AudioInfo* GetAsAudioInfo() const override + const AudioInfo* GetAsAudioInfo() const override { return this; } - virtual UniquePtr Clone() const override + UniquePtr Clone() const override { return MakeUnique(*this); } diff --git a/dom/media/MediaManager.cpp b/dom/media/MediaManager.cpp index f11237be9b6..dcbfc325b29 100644 --- a/dom/media/MediaManager.cpp +++ b/dom/media/MediaManager.cpp @@ -703,7 +703,7 @@ public: // single-source trackunion like we have here, the TrackUnion will assign trackids // that match the source's trackids, so we can avoid needing a mapping function. // XXX This will not handle more complex cases well. - virtual void StopTrack(TrackID aTrackID) override + void StopTrack(TrackID aTrackID) override { if (GetSourceStream()) { GetSourceStream()->EndTrack(aTrackID); @@ -719,7 +719,7 @@ public: } } - virtual already_AddRefed + already_AddRefed ApplyConstraintsToTrack(TrackID aTrackID, const MediaTrackConstraints& aConstraints, ErrorResult &aRv) override @@ -781,7 +781,7 @@ public: #endif // Allow getUserMedia to pass input data directly to PeerConnection/MediaPipeline - virtual bool AddDirectListener(MediaStreamDirectListener *aListener) override + bool AddDirectListener(MediaStreamDirectListener *aListener) override { if (GetSourceStream()) { GetSourceStream()->AddDirectListener(aListener); @@ -790,7 +790,7 @@ public: return false; } - virtual void + void AudioConfig(bool aEchoOn, uint32_t aEcho, bool aAgcOn, uint32_t aAgc, bool aNoiseOn, uint32_t aNoise, @@ -805,19 +805,19 @@ public: mPlayoutDelay = aPlayoutDelay; } - virtual void RemoveDirectListener(MediaStreamDirectListener *aListener) override + void RemoveDirectListener(MediaStreamDirectListener *aListener) override { if (GetSourceStream()) { GetSourceStream()->RemoveDirectListener(aListener); } } - virtual DOMLocalMediaStream* AsDOMLocalMediaStream() override + DOMLocalMediaStream* AsDOMLocalMediaStream() override { return this; } - virtual MediaEngineSource* GetMediaEngine(TrackID aTrackID) override + MediaEngineSource* GetMediaEngine(TrackID aTrackID) override { // MediaEngine supports only one video and on video track now and TrackID is // fixed in MediaEngine. @@ -920,7 +920,7 @@ public: DOMMediaStream* aStream) : mWindowID(aWindowID), mOnSuccess(aSuccess), mManager(aManager), mStream(aStream) {} - virtual void NotifyTracksAvailable(DOMMediaStream* aStream) override + void NotifyTracksAvailable(DOMMediaStream* aStream) override { // We're in the main thread, so no worries here. if (!(mManager->IsWindowStillActive(mWindowID))) { @@ -2667,8 +2667,8 @@ MediaManager::Shutdown() : mManager(aManager) , mReply(aReply) {} private: - virtual void - Run() + void + Run() override { LOG(("MediaManager Thread Shutdown")); MOZ_ASSERT(MediaManager::IsInMediaThread()); diff --git a/dom/media/MediaRecorder.h b/dom/media/MediaRecorder.h index 28c307c7f6c..02edfed3af7 100644 --- a/dom/media/MediaRecorder.h +++ b/dom/media/MediaRecorder.h @@ -48,7 +48,7 @@ public: MediaRecorder(AudioNode& aSrcAudioNode, uint32_t aSrcOutput, nsPIDOMWindow* aOwnerWindow); // nsWrapperCache - virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; nsPIDOMWindow* GetParentObject() { return GetOwner(); } diff --git a/dom/media/MediaResource.cpp b/dom/media/MediaResource.cpp index 5d72e928ca2..7eb27afed20 100644 --- a/dom/media/MediaResource.cpp +++ b/dom/media/MediaResource.cpp @@ -1151,70 +1151,68 @@ public: } // Main thread - virtual nsresult Open(nsIStreamListener** aStreamListener) override; - virtual nsresult Close() override; - virtual void Suspend(bool aCloseImmediately) override {} - virtual void Resume() override {} - virtual already_AddRefed GetCurrentPrincipal() override; - virtual bool CanClone() override; - virtual already_AddRefed CloneData(MediaResourceCallback* aCallback) override; - virtual nsresult ReadFromCache(char* aBuffer, int64_t aOffset, uint32_t aCount) override; + nsresult Open(nsIStreamListener** aStreamListener) override; + nsresult Close() override; + void Suspend(bool aCloseImmediately) override {} + void Resume() override {} + already_AddRefed GetCurrentPrincipal() override; + bool CanClone() override; + already_AddRefed CloneData(MediaResourceCallback* aCallback) override; + nsresult ReadFromCache(char* aBuffer, int64_t aOffset, uint32_t aCount) override; // These methods are called off the main thread. // Other thread - virtual void SetReadMode(MediaCacheStream::ReadMode aMode) override {} - virtual void SetPlaybackRate(uint32_t aBytesPerSecond) override {} - virtual nsresult ReadAt(int64_t aOffset, char* aBuffer, - uint32_t aCount, uint32_t* aBytes) override; - virtual already_AddRefed MediaReadAt(int64_t aOffset, uint32_t aCount) override; - virtual int64_t Tell() override; + void SetReadMode(MediaCacheStream::ReadMode aMode) override {} + void SetPlaybackRate(uint32_t aBytesPerSecond) override {} + nsresult ReadAt(int64_t aOffset, char* aBuffer, + uint32_t aCount, uint32_t* aBytes) override; + already_AddRefed MediaReadAt(int64_t aOffset, uint32_t aCount) override; + int64_t Tell() override; // Any thread - virtual void Pin() override {} - virtual void Unpin() override {} - virtual double GetDownloadRate(bool* aIsReliable) override + void Pin() override {} + void Unpin() override {} + double GetDownloadRate(bool* aIsReliable) override { // The data's all already here *aIsReliable = true; return 100*1024*1024; // arbitray, use 100MB/s } - virtual int64_t GetLength() override { + int64_t GetLength() override { MutexAutoLock lock(mLock); EnsureSizeInitialized(); return mSizeInitialized ? mSize : 0; } - virtual int64_t GetNextCachedData(int64_t aOffset) override + int64_t GetNextCachedData(int64_t aOffset) override { MutexAutoLock lock(mLock); EnsureSizeInitialized(); return (aOffset < mSize) ? aOffset : -1; } - virtual int64_t GetCachedDataEnd(int64_t aOffset) override { + int64_t GetCachedDataEnd(int64_t aOffset) override { MutexAutoLock lock(mLock); EnsureSizeInitialized(); return std::max(aOffset, mSize); } - virtual bool IsDataCachedToEndOfResource(int64_t aOffset) override { return true; } - virtual bool IsSuspendedByCache() override { return true; } - virtual bool IsSuspended() override { return true; } - virtual bool IsTransportSeekable() override { return true; } + bool IsDataCachedToEndOfResource(int64_t aOffset) override { return true; } + bool IsSuspendedByCache() override { return true; } + bool IsSuspended() override { return true; } + bool IsTransportSeekable() override { return true; } nsresult GetCachedRanges(MediaByteRangeSet& aRanges) override; - virtual size_t SizeOfExcludingThis( - MallocSizeOf aMallocSizeOf) const override + size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override { // Might be useful to track in the future: // - mInput return BaseMediaResource::SizeOfExcludingThis(aMallocSizeOf); } - virtual size_t SizeOfIncludingThis( - MallocSizeOf aMallocSizeOf) const override + size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override { return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf); } diff --git a/dom/media/MediaResource.h b/dom/media/MediaResource.h index cd2f4e6a146..9e93c431398 100644 --- a/dom/media/MediaResource.h +++ b/dom/media/MediaResource.h @@ -380,11 +380,10 @@ private: class BaseMediaResource : public MediaResource { public: - virtual nsIURI* URI() const override { return mURI; } - virtual void SetLoadInBackground(bool aLoadInBackground) override; + nsIURI* URI() const override { return mURI; } + void SetLoadInBackground(bool aLoadInBackground) override; - virtual size_t SizeOfExcludingThis( - MallocSizeOf aMallocSizeOf) const override + size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override { // Might be useful to track in the future: // - mChannel @@ -397,8 +396,7 @@ public: return size; } - virtual size_t SizeOfIncludingThis( - MallocSizeOf aMallocSizeOf) const override + size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override { return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf); } @@ -429,7 +427,7 @@ protected: MOZ_COUNT_DTOR(BaseMediaResource); } - virtual const nsCString& GetContentType() const override + const nsCString& GetContentType() const override { return mContentType; } @@ -556,21 +554,21 @@ public: // Ensure that the media cache writes any data held in its partial block. // Called on the main thread. - virtual void FlushCache() override; + void FlushCache() override; // Notify that the last data byte range was loaded. - virtual void NotifyLastByteRange() override; + void NotifyLastByteRange() override; // Main thread - virtual nsresult Open(nsIStreamListener** aStreamListener) override; - virtual nsresult Close() override; - virtual void Suspend(bool aCloseImmediately) override; - virtual void Resume() override; - virtual already_AddRefed GetCurrentPrincipal() override; + nsresult Open(nsIStreamListener** aStreamListener) override; + nsresult Close() override; + void Suspend(bool aCloseImmediately) override; + void Resume() override; + already_AddRefed GetCurrentPrincipal() override; // Return true if the stream has been closed. - bool IsClosed() const { return mCacheStream.IsClosed(); } - virtual bool CanClone() override; - virtual already_AddRefed CloneData(MediaResourceCallback* aDecoder) override; + bool IsClosed() const { return mCacheStream.IsClosed(); } + bool CanClone() override; + already_AddRefed CloneData(MediaResourceCallback* aDecoder) override; // Set statistics to be recorded to the object passed in. If not called, // |ChannelMediaResource| will create it's own statistics objects in |Open|. void RecordStatisticsTo(MediaChannelStatistics *aStatistics) override { @@ -580,31 +578,30 @@ public: mChannelStatistics = aStatistics; } } - virtual nsresult ReadFromCache(char* aBuffer, int64_t aOffset, uint32_t aCount) override; - virtual void EnsureCacheUpToDate() override; + nsresult ReadFromCache(char* aBuffer, int64_t aOffset, uint32_t aCount) override; + void EnsureCacheUpToDate() override; // Other thread - virtual void SetReadMode(MediaCacheStream::ReadMode aMode) override; - virtual void SetPlaybackRate(uint32_t aBytesPerSecond) override; - virtual nsresult ReadAt(int64_t offset, char* aBuffer, - uint32_t aCount, uint32_t* aBytes) override; - virtual already_AddRefed MediaReadAt(int64_t aOffset, uint32_t aCount) override; - virtual int64_t Tell() override; + void SetReadMode(MediaCacheStream::ReadMode aMode) override; + void SetPlaybackRate(uint32_t aBytesPerSecond) override; + nsresult ReadAt(int64_t offset, char* aBuffer, + uint32_t aCount, uint32_t* aBytes) override; + already_AddRefed MediaReadAt(int64_t aOffset, uint32_t aCount) override; + int64_t Tell() override; // Any thread - virtual void Pin() override; - virtual void Unpin() override; - virtual double GetDownloadRate(bool* aIsReliable) override; - virtual int64_t GetLength() override; - virtual int64_t GetNextCachedData(int64_t aOffset) override; - virtual int64_t GetCachedDataEnd(int64_t aOffset) override; - virtual bool IsDataCachedToEndOfResource(int64_t aOffset) override; - virtual bool IsSuspendedByCache() override; - virtual bool IsSuspended() override; - virtual bool IsTransportSeekable() override; + void Pin() override; + void Unpin() override; + double GetDownloadRate(bool* aIsReliable) override; + int64_t GetLength() override; + int64_t GetNextCachedData(int64_t aOffset) override; + int64_t GetCachedDataEnd(int64_t aOffset) override; + bool IsDataCachedToEndOfResource(int64_t aOffset) override; + bool IsSuspendedByCache() override; + bool IsSuspended() override; + bool IsTransportSeekable() override; - virtual size_t SizeOfExcludingThis( - MallocSizeOf aMallocSizeOf) const override { + size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override { // Might be useful to track in the future: // - mListener (seems minor) // - mChannelStatistics (seems minor) @@ -616,8 +613,7 @@ public: return size; } - virtual size_t SizeOfIncludingThis( - MallocSizeOf aMallocSizeOf) const override { + size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override { return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf); } @@ -642,7 +638,7 @@ public: }; friend class Listener; - virtual nsresult GetCachedRanges(MediaByteRangeSet& aRanges) override; + nsresult GetCachedRanges(MediaByteRangeSet& aRanges) override; protected: // These are called on the main thread by Listener. diff --git a/dom/media/MediaSegment.h b/dom/media/MediaSegment.h index 423ad91b1a9..25546797ed7 100644 --- a/dom/media/MediaSegment.h +++ b/dom/media/MediaSegment.h @@ -149,11 +149,11 @@ protected: */ template class MediaSegmentBase : public MediaSegment { public: - virtual MediaSegment* CreateEmptyClone() const override + MediaSegment* CreateEmptyClone() const override { return new C(); } - virtual void AppendFrom(MediaSegment* aSource) override + void AppendFrom(MediaSegment* aSource) override { NS_ASSERTION(aSource->GetType() == C::StaticType(), "Wrong type"); AppendFromInternal(static_cast(aSource)); @@ -162,8 +162,8 @@ public: { AppendFromInternal(aSource); } - virtual void AppendSlice(const MediaSegment& aSource, - StreamTime aStart, StreamTime aEnd) override + void AppendSlice(const MediaSegment& aSource, + StreamTime aStart, StreamTime aEnd) override { NS_ASSERTION(aSource.GetType() == C::StaticType(), "Wrong type"); AppendSliceInternal(static_cast(aSource), aStart, aEnd); @@ -176,7 +176,7 @@ public: * Replace the first aDuration ticks with null media data, because the data * will not be required again. */ - virtual void ForgetUpTo(StreamTime aDuration) override + void ForgetUpTo(StreamTime aDuration) override { if (mChunks.IsEmpty() || aDuration <= 0) { return; @@ -194,7 +194,7 @@ public: mChunks.InsertElementAt(0)->SetNull(aDuration); mDuration += aDuration; } - virtual void FlushAfter(StreamTime aNewEnd) override + void FlushAfter(StreamTime aNewEnd) override { if (mChunks.IsEmpty()) { return; @@ -217,7 +217,7 @@ public: } mDuration = aNewEnd; } - virtual void InsertNullDataAtStart(StreamTime aDuration) override + void InsertNullDataAtStart(StreamTime aDuration) override { if (aDuration <= 0) { return; @@ -232,7 +232,7 @@ public: #endif mDuration += aDuration; } - virtual void AppendNullData(StreamTime aDuration) override + void AppendNullData(StreamTime aDuration) override { if (aDuration <= 0) { return; @@ -244,7 +244,7 @@ public: } mDuration += aDuration; } - virtual void ReplaceWithDisabled() override + void ReplaceWithDisabled() override { if (GetType() != AUDIO) { MOZ_CRASH("Disabling unknown segment type"); @@ -253,7 +253,7 @@ public: Clear(); AppendNullData(duration); } - virtual void Clear() override + void Clear() override { mDuration = 0; mChunks.Clear(); @@ -315,7 +315,7 @@ public: } #endif - virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override + size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override { size_t amount = mChunks.ShallowSizeOfExcludingThis(aMallocSizeOf); for (size_t i = 0; i < mChunks.Length(); i++) { @@ -324,7 +324,7 @@ public: return amount; } - virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override + size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override { return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf); } diff --git a/dom/media/MediaStreamError.h b/dom/media/MediaStreamError.h index 4004c2f6428..6f6bf09a90b 100644 --- a/dom/media/MediaStreamError.h +++ b/dom/media/MediaStreamError.h @@ -75,7 +75,7 @@ public: NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(MediaStreamError) NS_DECLARE_STATIC_IID_ACCESSOR(MOZILLA_DOM_MEDIASTREAMERROR_IMPLEMENTATION_IID) - virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; nsPIDOMWindow* GetParentObject() const { diff --git a/dom/media/MediaStreamGraph.cpp b/dom/media/MediaStreamGraph.cpp index 7d7c8c62df3..417effba1e2 100644 --- a/dom/media/MediaStreamGraph.cpp +++ b/dom/media/MediaStreamGraph.cpp @@ -1383,11 +1383,11 @@ private: class CreateMessage : public ControlMessage { public: explicit CreateMessage(MediaStream* aStream) : ControlMessage(aStream) {} - virtual void Run() override + void Run() override { mStream->GraphImpl()->AddStreamGraphThread(mStream); } - virtual void RunDuringShutdown() override + void RunDuringShutdown() override { // Make sure to run this message during shutdown too, to make sure // that we balance the number of streams registered with the graph @@ -1797,14 +1797,14 @@ MediaStream::Destroy() class Message : public ControlMessage { public: explicit Message(MediaStream* aStream) : ControlMessage(aStream) {} - virtual void Run() + void Run() override { mStream->RemoveAllListenersImpl(); auto graph = mStream->GraphImpl(); mStream->DestroyImpl(); graph->RemoveStreamGraphThread(mStream); } - virtual void RunDuringShutdown() + void RunDuringShutdown() override { Run(); } }; mWrapper = nullptr; @@ -1821,7 +1821,7 @@ MediaStream::AddAudioOutput(void* aKey) class Message : public ControlMessage { public: Message(MediaStream* aStream, void* aKey) : ControlMessage(aStream), mKey(aKey) {} - virtual void Run() + void Run() override { mStream->AddAudioOutputImpl(mKey); } @@ -1849,7 +1849,7 @@ MediaStream::SetAudioOutputVolume(void* aKey, float aVolume) public: Message(MediaStream* aStream, void* aKey, float aVolume) : ControlMessage(aStream), mKey(aKey), mVolume(aVolume) {} - virtual void Run() + void Run() override { mStream->SetAudioOutputVolumeImpl(mKey, mVolume); } @@ -1888,7 +1888,7 @@ MediaStream::RemoveAudioOutput(void* aKey) public: Message(MediaStream* aStream, void* aKey) : ControlMessage(aStream), mKey(aKey) {} - virtual void Run() + void Run() override { mStream->RemoveAudioOutputImpl(mKey); } @@ -1924,7 +1924,7 @@ MediaStream::AddVideoOutput(VideoFrameContainer* aContainer) public: Message(MediaStream* aStream, VideoFrameContainer* aContainer) : ControlMessage(aStream), mContainer(aContainer) {} - virtual void Run() + void Run() override { mStream->AddVideoOutputImpl(mContainer.forget()); } @@ -1940,7 +1940,7 @@ MediaStream::RemoveVideoOutput(VideoFrameContainer* aContainer) public: Message(MediaStream* aStream, VideoFrameContainer* aContainer) : ControlMessage(aStream), mContainer(aContainer) {} - virtual void Run() + void Run() override { mStream->RemoveVideoOutputImpl(mContainer); } @@ -1956,7 +1956,7 @@ MediaStream::Suspend() public: explicit Message(MediaStream* aStream) : ControlMessage(aStream) {} - virtual void Run() + void Run() override { mStream->GraphImpl()->IncrementSuspendCount(mStream); } @@ -1977,7 +1977,7 @@ MediaStream::Resume() public: explicit Message(MediaStream* aStream) : ControlMessage(aStream) {} - virtual void Run() + void Run() override { mStream->GraphImpl()->DecrementSuspendCount(mStream); } @@ -2012,7 +2012,7 @@ MediaStream::AddListener(MediaStreamListener* aListener) public: Message(MediaStream* aStream, MediaStreamListener* aListener) : ControlMessage(aStream), mListener(aListener) {} - virtual void Run() + void Run() override { mStream->AddListenerImpl(mListener.forget()); } @@ -2037,7 +2037,7 @@ MediaStream::RemoveListener(MediaStreamListener* aListener) public: Message(MediaStream* aStream, MediaStreamListener* aListener) : ControlMessage(aStream), mListener(aListener) {} - virtual void Run() + void Run() override { mStream->RemoveListenerImpl(mListener); } @@ -2070,12 +2070,12 @@ MediaStream::RunAfterPendingUpdates(already_AddRefed aRunnable) already_AddRefed aRunnable) : ControlMessage(aStream) , mRunnable(aRunnable) {} - virtual void Run() override + void Run() override { mStream->Graph()-> DispatchToMainThreadAfterStreamStateUpdate(mRunnable.forget()); } - virtual void RunDuringShutdown() override + void RunDuringShutdown() override { // Don't run mRunnable now as it may call AppendMessage() which would // assume that there are no remaining controlMessagesToRunDuringShutdown. @@ -2108,7 +2108,7 @@ MediaStream::SetTrackEnabled(TrackID aTrackID, bool aEnabled) public: Message(MediaStream* aStream, TrackID aTrackID, bool aEnabled) : ControlMessage(aStream), mTrackID(aTrackID), mEnabled(aEnabled) {} - virtual void Run() + void Run() override { mStream->SetTrackEnabledImpl(mTrackID, mEnabled); } @@ -2316,7 +2316,7 @@ SourceMediaStream::NotifyListenersEvent(MediaStreamListener::MediaStreamGraphEve public: Message(SourceMediaStream* aStream, MediaStreamListener::MediaStreamGraphEvent aEvent) : ControlMessage(aStream), mEvent(aEvent) {} - virtual void Run() + void Run() override { mStream->AsSourceStream()->NotifyListenersEventImpl(mEvent); } @@ -2481,14 +2481,14 @@ MediaInputPort::Destroy() public: explicit Message(MediaInputPort* aPort) : ControlMessage(nullptr), mPort(aPort) {} - virtual void Run() + void Run() override { mPort->Disconnect(); --mPort->GraphImpl()->mPortCount; mPort->SetGraphImpl(nullptr); NS_RELEASE(mPort); } - virtual void RunDuringShutdown() + void RunDuringShutdown() override { Run(); } @@ -2530,11 +2530,11 @@ MediaInputPort::BlockTrackId(TrackID aTrackId) explicit Message(MediaInputPort* aPort, TrackID aTrackId) : ControlMessage(aPort->GetDestination()), mPort(aPort), mTrackId(aTrackId) {} - virtual void Run() + void Run() override { mPort->BlockTrackIdImpl(mTrackId); } - virtual void RunDuringShutdown() + void RunDuringShutdown() override { Run(); } @@ -2558,14 +2558,14 @@ ProcessedMediaStream::AllocateInputPort(MediaStream* aStream, TrackID aTrackID, explicit Message(MediaInputPort* aPort) : ControlMessage(aPort->GetDestination()), mPort(aPort) {} - virtual void Run() + void Run() override { mPort->Init(); // The graph holds its reference implicitly mPort->GraphImpl()->SetStreamOrderDirty(); Unused << mPort.forget(); } - virtual void RunDuringShutdown() + void RunDuringShutdown() override { Run(); } @@ -2589,7 +2589,7 @@ ProcessedMediaStream::Finish() public: explicit Message(ProcessedMediaStream* aStream) : ControlMessage(aStream) {} - virtual void Run() + void Run() override { mStream->GraphImpl()->FinishStream(mStream); } @@ -2604,7 +2604,7 @@ ProcessedMediaStream::SetAutofinish(bool aAutofinish) public: Message(ProcessedMediaStream* aStream, bool aAutofinish) : ControlMessage(aStream), mAutofinish(aAutofinish) {} - virtual void Run() + void Run() override { static_cast(mStream)->SetAutofinishImpl(mAutofinish); } @@ -2919,7 +2919,7 @@ MediaStreamGraph::NotifyWhenGraphStarted(AudioNodeStream* aStream) : ControlMessage(aStream) { } - virtual void Run() + void Run() override { // This runs on the graph thread, so when this runs, and the current // driver is an AudioCallbackDriver, we know the audio hardware is @@ -2936,7 +2936,7 @@ MediaStreamGraph::NotifyWhenGraphStarted(AudioNodeStream* aStream) NS_DispatchToMainThread(event.forget()); } } - virtual void RunDuringShutdown() + void RunDuringShutdown() override { } }; @@ -3144,12 +3144,12 @@ MediaStreamGraph::ApplyAudioContextOperation(MediaStream* aDestinationStream, , mPromise(aPromise) { } - virtual void Run() + void Run() override { mStream->GraphImpl()->ApplyAudioContextOperationImpl(mStream, mStreams, mAudioContextOperation, mPromise); } - virtual void RunDuringShutdown() + void RunDuringShutdown() override { MOZ_ASSERT(false, "We should be reviving the graph?"); } diff --git a/dom/media/MediaStreamGraph.h b/dom/media/MediaStreamGraph.h index 0ea27ff2b00..bc8576fd056 100644 --- a/dom/media/MediaStreamGraph.h +++ b/dom/media/MediaStreamGraph.h @@ -698,10 +698,10 @@ public: mNeedsMixing(false) {} - virtual SourceMediaStream* AsSourceStream() override { return this; } + SourceMediaStream* AsSourceStream() override { return this; } // Media graph thread only - virtual void DestroyImpl() override; + void DestroyImpl() override; // Call these on any thread. /** @@ -796,14 +796,14 @@ public: } // Overriding allows us to hold the mMutex lock while changing the track enable status - virtual void + void SetTrackEnabledImpl(TrackID aTrackID, bool aEnabled) override { MutexAutoLock lock(mMutex); MediaStream::SetTrackEnabledImpl(aTrackID, aEnabled); } // Overriding allows us to ensure mMutex is locked while changing the track enable status - virtual void + void ApplyTrackDisabling(TrackID aTrackID, MediaSegment* aSegment, MediaSegment* aRawSegment = nullptr) override { mMutex.AssertCurrentThreadOwns(); @@ -1071,7 +1071,7 @@ public: */ void SetAutofinish(bool aAutofinish); - virtual ProcessedMediaStream* AsProcessedStream() override { return this; } + ProcessedMediaStream* AsProcessedStream() override { return this; } friend class MediaStreamGraphImpl; @@ -1089,7 +1089,7 @@ public: { return mInputs.Length(); } - virtual void DestroyImpl() override; + void DestroyImpl() override; /** * This gets called after we've computed the blocking states for all * streams (mBlocked is up to date up to mStateComputedTime). @@ -1117,7 +1117,7 @@ public: // true for echo loops, only for muted cycles. bool InMutedCycle() const { return mCycleMarker; } - virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override + size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override { size_t amount = MediaStream::SizeOfExcludingThis(aMallocSizeOf); // Not owned: @@ -1126,7 +1126,7 @@ public: return amount; } - virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override + size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override { return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf); } diff --git a/dom/media/RtspMediaResource.h b/dom/media/RtspMediaResource.h index 04ed36c00f0..9207e69b62a 100644 --- a/dom/media/RtspMediaResource.h +++ b/dom/media/RtspMediaResource.h @@ -79,7 +79,7 @@ public: // Get the RtspMediaResource pointer if this MediaResource is a // RtspMediaResource. For calling Rtsp specific functions. - virtual RtspMediaResource* GetRtspPointer() override final { + RtspMediaResource* GetRtspPointer() override final { return this; } @@ -94,7 +94,7 @@ public: // Even it is a live stream, as long as it provides valid timestamps, // we tell state machine it's not a live stream. - virtual bool IsRealTime() override { + bool IsRealTime() override { return !mHasTimestamp; } @@ -124,29 +124,29 @@ public: void DisablePlayoutDelay(); // dummy - virtual nsresult ReadAt(int64_t aOffset, char* aBuffer, - uint32_t aCount, uint32_t* aBytes) override{ + nsresult ReadAt(int64_t aOffset, char* aBuffer, + uint32_t aCount, uint32_t* aBytes) override{ return NS_ERROR_FAILURE; } // dummy - virtual void SetReadMode(MediaCacheStream::ReadMode aMode) override {} + void SetReadMode(MediaCacheStream::ReadMode aMode) override {} // dummy - virtual void SetPlaybackRate(uint32_t aBytesPerSecond) override {} + void SetPlaybackRate(uint32_t aBytesPerSecond) override {} // dummy - virtual int64_t Tell() override { return 0; } + int64_t Tell() override { return 0; } // Any thread - virtual void Pin() override {} - virtual void Unpin() override {} + void Pin() override {} + void Unpin() override {} - virtual bool IsSuspendedByCache() override { return mIsSuspend; } + bool IsSuspendedByCache() override { return mIsSuspend; } - virtual bool IsSuspended() override { return false; } - virtual bool IsTransportSeekable() override { return true; } + bool IsSuspended() override { return false; } + bool IsTransportSeekable() override { return true; } // dummy - virtual double GetDownloadRate(bool* aIsReliable) override { *aIsReliable = false; return 0; } + double GetDownloadRate(bool* aIsReliable) override { *aIsReliable = false; return 0; } - virtual int64_t GetLength() override { + int64_t GetLength() override { if (mIsLiveStream) { return -1; } @@ -154,11 +154,11 @@ public: } // dummy - virtual int64_t GetNextCachedData(int64_t aOffset) override { return 0; } + int64_t GetNextCachedData(int64_t aOffset) override { return 0; } // dummy - virtual int64_t GetCachedDataEnd(int64_t aOffset) override { return 0; } + int64_t GetCachedDataEnd(int64_t aOffset) override { return 0; } // dummy - virtual bool IsDataCachedToEndOfResource(int64_t aOffset) override { + bool IsDataCachedToEndOfResource(int64_t aOffset) override { return false; } // dummy @@ -168,29 +168,26 @@ public: // The following methods can be called on main thread only. - virtual nsresult Open(nsIStreamListener** aStreamListener) override; - virtual nsresult Close() override; - virtual void Suspend(bool aCloseImmediately) override; - virtual void Resume() override; - virtual already_AddRefed GetCurrentPrincipal() override; - virtual bool CanClone() override { + nsresult Open(nsIStreamListener** aStreamListener) override; + nsresult Close() override; + void Suspend(bool aCloseImmediately) override; + void Resume() override; + already_AddRefed GetCurrentPrincipal() override; + bool CanClone() override { return false; } - virtual already_AddRefed CloneData(MediaResourceCallback*) - override { + already_AddRefed CloneData(MediaResourceCallback*) override { return nullptr; } // dummy - virtual nsresult ReadFromCache(char* aBuffer, int64_t aOffset, + nsresult ReadFromCache(char* aBuffer, int64_t aOffset, uint32_t aCount) override { return NS_ERROR_FAILURE; } - virtual size_t SizeOfExcludingThis( - MallocSizeOf aMallocSizeOf) const override; + size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override; - virtual size_t SizeOfIncludingThis( - MallocSizeOf aMallocSizeOf) const override { + size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override { return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf); } diff --git a/dom/media/SharedBuffer.h b/dom/media/SharedBuffer.h index d7a0320fb01..cc710c2ab4a 100644 --- a/dom/media/SharedBuffer.h +++ b/dom/media/SharedBuffer.h @@ -67,7 +67,7 @@ public: return p.forget(); } - virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override + size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override { return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf); } diff --git a/dom/media/TextTrack.h b/dom/media/TextTrack.h index 6b9795cbc34..3ba86ab4bc1 100644 --- a/dom/media/TextTrack.h +++ b/dom/media/TextTrack.h @@ -59,7 +59,7 @@ public: void SetDefaultSettings(); - virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; TextTrackKind Kind() const { diff --git a/dom/media/TextTrackCue.h b/dom/media/TextTrackCue.h index 7d5d0f0d0b0..0f5ed06764c 100644 --- a/dom/media/TextTrackCue.h +++ b/dom/media/TextTrackCue.h @@ -50,7 +50,7 @@ public: const nsAString& aText, HTMLTrackElement* aTrackElement, ErrorResult& aRv); - virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; TextTrack* GetTrack() const { diff --git a/dom/media/TextTrackCueList.h b/dom/media/TextTrackCueList.h index 3c30d84cf18..0fe435bb98c 100644 --- a/dom/media/TextTrackCueList.h +++ b/dom/media/TextTrackCueList.h @@ -28,7 +28,7 @@ public: // TextTrackCueList WebIDL explicit TextTrackCueList(nsISupports* aParent); - virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; nsISupports* GetParentObject() const { diff --git a/dom/media/TextTrackList.h b/dom/media/TextTrackList.h index 5d442598795..8fda45ecae8 100644 --- a/dom/media/TextTrackList.h +++ b/dom/media/TextTrackList.h @@ -29,7 +29,7 @@ public: explicit TextTrackList(nsPIDOMWindow* aOwnerWindow); TextTrackList(nsPIDOMWindow* aOwnerWindow, TextTrackManager* aTextTrackManager); - virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; uint32_t Length() const { diff --git a/dom/media/TextTrackRegion.h b/dom/media/TextTrackRegion.h index c6f5c7cce93..a4e6069f76e 100644 --- a/dom/media/TextTrackRegion.h +++ b/dom/media/TextTrackRegion.h @@ -35,7 +35,7 @@ public: Preferences::GetBool("media.webvtt.regions.enabled"); } - virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; nsISupports* GetParentObject() const { diff --git a/dom/media/TrackUnionStream.h b/dom/media/TrackUnionStream.h index 009a3fac1e4..d7fb9efa32c 100644 --- a/dom/media/TrackUnionStream.h +++ b/dom/media/TrackUnionStream.h @@ -18,8 +18,8 @@ class TrackUnionStream : public ProcessedMediaStream { public: explicit TrackUnionStream(DOMMediaStream* aWrapper); - virtual void RemoveInput(MediaInputPort* aPort) override; - virtual void ProcessInput(GraphTime aFrom, GraphTime aTo, uint32_t aFlags) override; + void RemoveInput(MediaInputPort* aPort) override; + void ProcessInput(GraphTime aFrom, GraphTime aTo, uint32_t aFlags) override; protected: // Only non-ended tracks are allowed to persist in this map. diff --git a/dom/media/VideoSegment.h b/dom/media/VideoSegment.h index a37fb3eda55..9f90bd9c49e 100644 --- a/dom/media/VideoSegment.h +++ b/dom/media/VideoSegment.h @@ -129,7 +129,7 @@ public: return &c->mFrame; } // Override default impl - virtual void ReplaceWithDisabled() override { + void ReplaceWithDisabled() override { for (ChunkIterator i(*this); !i.IsEnded(); i.Next()) { VideoChunk& chunk = *i; @@ -140,7 +140,7 @@ public: // Segment-generic methods not in MediaSegmentBase static Type StaticType() { return VIDEO; } - virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override + size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override { return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf); } diff --git a/dom/media/VideoStreamTrack.h b/dom/media/VideoStreamTrack.h index 89cb677a359..5d76bb6b2b0 100644 --- a/dom/media/VideoStreamTrack.h +++ b/dom/media/VideoStreamTrack.h @@ -17,12 +17,12 @@ public: VideoStreamTrack(DOMMediaStream* aStream, TrackID aTrackID, const nsString& aLabel) : MediaStreamTrack(aStream, aTrackID, aLabel) {} - virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; - virtual VideoStreamTrack* AsVideoStreamTrack() override { return this; } + VideoStreamTrack* AsVideoStreamTrack() override { return this; } // WebIDL - virtual void GetKind(nsAString& aKind) override { aKind.AssignLiteral("video"); } + void GetKind(nsAString& aKind) override { aKind.AssignLiteral("video"); } }; } // namespace dom diff --git a/dom/media/VideoTrack.h b/dom/media/VideoTrack.h index 933c8a8f7c6..94f5b362f1f 100644 --- a/dom/media/VideoTrack.h +++ b/dom/media/VideoTrack.h @@ -22,9 +22,9 @@ public: const nsAString& aLabel, const nsAString& aLanguage); - virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; - virtual VideoTrack* AsVideoTrack() override + VideoTrack* AsVideoTrack() override { return this; } @@ -34,7 +34,7 @@ public: // default. If multiple video tracks are selected by its media resource at // fetching phase, then the first enabled video track is set selected. // aFlags contains FIRE_NO_EVENTS because no events are fired in such cases. - virtual void SetEnabledInternal(bool aEnabled, int aFlags) override; + void SetEnabledInternal(bool aEnabled, int aFlags) override; // WebIDL bool Selected() const diff --git a/dom/media/VideoTrackList.h b/dom/media/VideoTrackList.h index 38f95cc9cd8..971ba7d35b5 100644 --- a/dom/media/VideoTrackList.h +++ b/dom/media/VideoTrackList.h @@ -23,11 +23,11 @@ public: , mSelectedIndex(-1) {} - virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; VideoTrack* operator[](uint32_t aIndex); - virtual void EmptyTracks() override; + void EmptyTracks() override; // WebIDL int32_t SelectedIndex() const @@ -42,7 +42,7 @@ public: friend class VideoTrack; protected: - virtual VideoTrackList* AsVideoTrackList() override { return this; } + VideoTrackList* AsVideoTrackList() override { return this; } private: int32_t mSelectedIndex; diff --git a/dom/media/encoder/MediaEncoder.h b/dom/media/encoder/MediaEncoder.h index 2922a3ad865..6e632250f43 100644 --- a/dom/media/encoder/MediaEncoder.h +++ b/dom/media/encoder/MediaEncoder.h @@ -82,18 +82,18 @@ public : * Notified by the control loop of MediaStreamGraph; aQueueMedia is the raw * track data in form of MediaSegment. */ - virtual void NotifyQueuedTrackChanges(MediaStreamGraph* aGraph, TrackID aID, - StreamTime aTrackOffset, - uint32_t aTrackEvents, - const MediaSegment& aQueuedMedia, - MediaStream* aInputStream, - TrackID aInputTrackID) override; + void NotifyQueuedTrackChanges(MediaStreamGraph* aGraph, TrackID aID, + StreamTime aTrackOffset, + uint32_t aTrackEvents, + const MediaSegment& aQueuedMedia, + MediaStream* aInputStream, + TrackID aInputTrackID) override; /** * Notified the stream is being removed. */ - virtual void NotifyEvent(MediaStreamGraph* aGraph, - MediaStreamListener::MediaStreamGraphEvent event) override; + void NotifyEvent(MediaStreamGraph* aGraph, + MediaStreamListener::MediaStreamGraphEvent event) override; /** * Creates an encoder with a given MIME type. Returns null if we are unable diff --git a/dom/media/encoder/TrackEncoder.h b/dom/media/encoder/TrackEncoder.h index be496f97b87..6b3b9dc6e77 100644 --- a/dom/media/encoder/TrackEncoder.h +++ b/dom/media/encoder/TrackEncoder.h @@ -146,10 +146,10 @@ public: , mAudioBitrate(0) {} - virtual void NotifyQueuedTrackChanges(MediaStreamGraph* aGraph, TrackID aID, - StreamTime aTrackOffset, - uint32_t aTrackEvents, - const MediaSegment& aQueuedMedia) override; + void NotifyQueuedTrackChanges(MediaStreamGraph* aGraph, TrackID aID, + StreamTime aTrackOffset, + uint32_t aTrackEvents, + const MediaSegment& aQueuedMedia) override; template static @@ -194,7 +194,7 @@ public: */ size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const; - virtual void SetBitrate(const uint32_t aBitrate) override + void SetBitrate(const uint32_t aBitrate) override { mAudioBitrate = aBitrate; } @@ -227,7 +227,7 @@ protected: * Notifies the audio encoder that we have reached the end of source stream, * and wakes up mReentrantMonitor if encoder is waiting for more track data. */ - virtual void NotifyEndOfStream() override; + void NotifyEndOfStream() override; /** * The number of channels are used for processing PCM data in the audio encoder. @@ -268,16 +268,16 @@ public: * Notified by the same callback of MediaEncoder when it has received a track * change from MediaStreamGraph. Called on the MediaStreamGraph thread. */ - virtual void NotifyQueuedTrackChanges(MediaStreamGraph* aGraph, TrackID aID, - StreamTime aTrackOffset, - uint32_t aTrackEvents, - const MediaSegment& aQueuedMedia) override; + void NotifyQueuedTrackChanges(MediaStreamGraph* aGraph, TrackID aID, + StreamTime aTrackOffset, + uint32_t aTrackEvents, + const MediaSegment& aQueuedMedia) override; /** * Measure size of mRawSegment */ size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const; - virtual void SetBitrate(const uint32_t aBitrate) override + void SetBitrate(const uint32_t aBitrate) override { mVideoBitrate = aBitrate; } @@ -303,7 +303,7 @@ protected: * and wakes up mReentrantMonitor if encoder is waiting for more track data. * Called on the MediaStreamGraph thread. */ - virtual void NotifyEndOfStream() override; + void NotifyEndOfStream() override; /** * The width of source video frame, ceiled if the source width is odd. diff --git a/dom/media/gtest/MockMediaDecoderOwner.h b/dom/media/gtest/MockMediaDecoderOwner.h index 148dfe879e6..fafd088dfe0 100644 --- a/dom/media/gtest/MockMediaDecoderOwner.h +++ b/dom/media/gtest/MockMediaDecoderOwner.h @@ -13,40 +13,40 @@ namespace mozilla class MockMediaDecoderOwner : public MediaDecoderOwner { public: - virtual nsresult DispatchAsyncEvent(const nsAString& aName) override + nsresult DispatchAsyncEvent(const nsAString& aName) override { return NS_OK; } - virtual void FireTimeUpdate(bool aPeriodic) override {} - virtual bool GetPaused() override { return false; } - virtual void MetadataLoaded(const MediaInfo* aInfo, - nsAutoPtr aTags) override + void FireTimeUpdate(bool aPeriodic) override {} + bool GetPaused() override { return false; } + void MetadataLoaded(const MediaInfo* aInfo, + nsAutoPtr aTags) override { } - virtual void NetworkError() override {} - virtual void DecodeError() override {} - virtual void LoadAborted() override {} - virtual void PlaybackEnded() override {} - virtual void SeekStarted() override {} - virtual void SeekCompleted() override {} - virtual void DownloadProgressed() override {} - virtual void UpdateReadyState() override {} - virtual void FirstFrameLoaded() override {} + void NetworkError() override {} + void DecodeError() override {} + void LoadAborted() override {} + void PlaybackEnded() override {} + void SeekStarted() override {} + void SeekCompleted() override {} + void DownloadProgressed() override {} + void UpdateReadyState() override {} + void FirstFrameLoaded() override {} #ifdef MOZ_EME - virtual void DispatchEncrypted(const nsTArray& aInitData, - const nsAString& aInitDataType) override {} + void DispatchEncrypted(const nsTArray& aInitData, + const nsAString& aInitDataType) override {} #endif // MOZ_EME - virtual bool IsActive() const override { return true; } - virtual bool IsHidden() const override { return false; } - virtual void DownloadSuspended() override {} - virtual void DownloadResumed(bool aForceNetworkLoading) override {} - virtual void NotifySuspendedByCache(bool aIsSuspended) override {} - virtual void NotifyDecoderPrincipalChanged() override {} - virtual VideoFrameContainer* GetVideoFrameContainer() override + bool IsActive() const override { return true; } + bool IsHidden() const override { return false; } + void DownloadSuspended() override {} + void DownloadResumed(bool aForceNetworkLoading) override {} + void NotifySuspendedByCache(bool aIsSuspended) override {} + void NotifyDecoderPrincipalChanged() override {} + VideoFrameContainer* GetVideoFrameContainer() override { return nullptr; } - virtual void ResetConnectionState() override {} + void ResetConnectionState() override {} }; } diff --git a/dom/media/gtest/MockMediaResource.h b/dom/media/gtest/MockMediaResource.h index 331e32640f6..65048a1e2f6 100644 --- a/dom/media/gtest/MockMediaResource.h +++ b/dom/media/gtest/MockMediaResource.h @@ -16,39 +16,39 @@ class MockMediaResource : public MediaResource { public: explicit MockMediaResource(const char* aFileName); - virtual nsIURI* URI() const override { return nullptr; } - virtual nsresult Close() override { return NS_OK; } - virtual void Suspend(bool aCloseImmediately) override {} - virtual void Resume() override {} - virtual already_AddRefed GetCurrentPrincipal() override + nsIURI* URI() const override { return nullptr; } + nsresult Close() override { return NS_OK; } + void Suspend(bool aCloseImmediately) override {} + void Resume() override {} + already_AddRefed GetCurrentPrincipal() override { return nullptr; } - virtual bool CanClone() override { return false; } - virtual already_AddRefed CloneData(MediaResourceCallback*) + bool CanClone() override { return false; } + already_AddRefed CloneData(MediaResourceCallback*) override { return nullptr; } - virtual void SetReadMode(MediaCacheStream::ReadMode aMode) override {} - virtual void SetPlaybackRate(uint32_t aBytesPerSecond) override {} - virtual nsresult ReadAt(int64_t aOffset, char* aBuffer, uint32_t aCount, - uint32_t* aBytes) override; - virtual int64_t Tell() override { return 0; } - virtual void Pin() override {} - virtual void Unpin() override {} - virtual double GetDownloadRate(bool* aIsReliable) override { return 0; } - virtual int64_t GetLength() override; - virtual int64_t GetNextCachedData(int64_t aOffset) override; - virtual int64_t GetCachedDataEnd(int64_t aOffset) override; - virtual bool IsDataCachedToEndOfResource(int64_t aOffset) override + void SetReadMode(MediaCacheStream::ReadMode aMode) override {} + void SetPlaybackRate(uint32_t aBytesPerSecond) override {} + nsresult ReadAt(int64_t aOffset, char* aBuffer, uint32_t aCount, + uint32_t* aBytes) override; + int64_t Tell() override { return 0; } + void Pin() override {} + void Unpin() override {} + double GetDownloadRate(bool* aIsReliable) override { return 0; } + int64_t GetLength() override; + int64_t GetNextCachedData(int64_t aOffset) override; + int64_t GetCachedDataEnd(int64_t aOffset) override; + bool IsDataCachedToEndOfResource(int64_t aOffset) override { return false; } - virtual bool IsSuspendedByCache() override { return false; } - virtual bool IsSuspended() override { return false; } - virtual nsresult ReadFromCache(char* aBuffer, int64_t aOffset, - uint32_t aCount) override + bool IsSuspendedByCache() override { return false; } + bool IsSuspended() override { return false; } + nsresult ReadFromCache(char* aBuffer, int64_t aOffset, + uint32_t aCount) override { uint32_t bytesRead = 0; nsresult rv = ReadAt(aOffset, aBuffer, aCount, &bytesRead); @@ -56,11 +56,10 @@ public: return bytesRead == aCount ? NS_OK : NS_ERROR_FAILURE; } - virtual bool IsTransportSeekable() override { return true; } - virtual nsresult Open(nsIStreamListener** aStreamListener) override; - virtual nsresult GetCachedRanges(MediaByteRangeSet& aRanges) - override; - virtual const nsCString& GetContentType() const override + bool IsTransportSeekable() override { return true; } + nsresult Open(nsIStreamListener** aStreamListener) override; + nsresult GetCachedRanges(MediaByteRangeSet& aRanges) override; + const nsCString& GetContentType() const override { return mContentType; } diff --git a/dom/media/gtest/TestAudioCompactor.cpp b/dom/media/gtest/TestAudioCompactor.cpp index 5b25339f33e..9a28254b35c 100644 --- a/dom/media/gtest/TestAudioCompactor.cpp +++ b/dom/media/gtest/TestAudioCompactor.cpp @@ -18,7 +18,7 @@ public: MemoryFunctor() : mSize(0) {} MOZ_DEFINE_MALLOC_SIZE_OF(MallocSizeOf); - virtual void* operator()(void* aObject) { + void* operator()(void* aObject) override { const AudioData* audioData = static_cast(aObject); mSize += audioData->SizeOfIncludingThis(MallocSizeOf); return nullptr; diff --git a/dom/media/gtest/TestGMPCrossOrigin.cpp b/dom/media/gtest/TestGMPCrossOrigin.cpp index 9b67f9084f8..326232523e4 100644 --- a/dom/media/gtest/TestGMPCrossOrigin.cpp +++ b/dom/media/gtest/TestGMPCrossOrigin.cpp @@ -53,7 +53,7 @@ template class RunTestGMPCrossOrigin : public Base { public: - virtual void Done(typename Base::GMPCodecType* aGMP, GMPVideoHost* aHost) + void Done(typename Base::GMPCodecType* aGMP, GMPVideoHost* aHost) override { EXPECT_TRUE(aGMP); @@ -170,7 +170,7 @@ private: mShouldBeEqual(aShouldBeEqual) { } - virtual void Done(typename Base::GMPCodecType* aGMP, GMPVideoHost* aHost) + void Done(typename Base::GMPCodecType* aGMP, GMPVideoHost* aHost) override { EXPECT_TRUE(aGMP); if (aGMP) { @@ -595,7 +595,7 @@ class GMPStorageTest : public GMPDecryptorProxyCallback { } - virtual void Done(GMPDecryptorProxy* aDecryptor) override + void Done(GMPDecryptorProxy* aDecryptor) override { mRunner->mDecryptor = aDecryptor; EXPECT_TRUE(!!mRunner->mDecryptor); @@ -1312,9 +1312,9 @@ class GMPStorageTest : public GMPDecryptorProxyCallback NS_DispatchToMainThread(NS_NewRunnableMethod(this, &GMPStorageTest::Dummy)); } - virtual void SessionMessage(const nsCString& aSessionId, - GMPSessionMessageType aMessageType, - const nsTArray& aMessage) override + void SessionMessage(const nsCString& aSessionId, + GMPSessionMessageType aMessageType, + const nsTArray& aMessage) override { MonitorAutoLock mon(mMonitor); @@ -1331,29 +1331,29 @@ class GMPStorageTest : public GMPDecryptorProxyCallback } } - virtual void SetSessionId(uint32_t aCreateSessionToken, - const nsCString& aSessionId) override { } - virtual void ResolveLoadSessionPromise(uint32_t aPromiseId, - bool aSuccess) override {} - virtual void ResolvePromise(uint32_t aPromiseId) override {} - virtual void RejectPromise(uint32_t aPromiseId, - nsresult aException, - const nsCString& aSessionId) override { } - virtual void ExpirationChange(const nsCString& aSessionId, - GMPTimestamp aExpiryTime) override {} - virtual void SessionClosed(const nsCString& aSessionId) override {} - virtual void SessionError(const nsCString& aSessionId, - nsresult aException, - uint32_t aSystemCode, - const nsCString& aMessage) override {} - virtual void KeyStatusChanged(const nsCString& aSessionId, - const nsTArray& aKeyId, - GMPMediaKeyStatus aStatus) override { } - virtual void SetCaps(uint64_t aCaps) override {} - virtual void Decrypted(uint32_t aId, - GMPErr aResult, - const nsTArray& aDecryptedData) override { } - virtual void Terminated() override { + void SetSessionId(uint32_t aCreateSessionToken, + const nsCString& aSessionId) override { } + void ResolveLoadSessionPromise(uint32_t aPromiseId, + bool aSuccess) override {} + void ResolvePromise(uint32_t aPromiseId) override {} + void RejectPromise(uint32_t aPromiseId, + nsresult aException, + const nsCString& aSessionId) override { } + void ExpirationChange(const nsCString& aSessionId, + GMPTimestamp aExpiryTime) override {} + void SessionClosed(const nsCString& aSessionId) override {} + void SessionError(const nsCString& aSessionId, + nsresult aException, + uint32_t aSystemCode, + const nsCString& aMessage) override {} + void KeyStatusChanged(const nsCString& aSessionId, + const nsTArray& aKeyId, + GMPMediaKeyStatus aStatus) override { } + void SetCaps(uint64_t aCaps) override {} + void Decrypted(uint32_t aId, + GMPErr aResult, + const nsTArray& aDecryptedData) override { } + void Terminated() override { if (mDecryptor) { mDecryptor->Close(); mDecryptor = nullptr; diff --git a/dom/media/imagecapture/CaptureTask.h b/dom/media/imagecapture/CaptureTask.h index d8957aed837..396ff532969 100644 --- a/dom/media/imagecapture/CaptureTask.h +++ b/dom/media/imagecapture/CaptureTask.h @@ -32,18 +32,18 @@ class CaptureTask : public MediaStreamListener, { public: // MediaStreamListener methods. - virtual void NotifyQueuedTrackChanges(MediaStreamGraph* aGraph, TrackID aID, - StreamTime aTrackOffset, - uint32_t aTrackEvents, - const MediaSegment& aQueuedMedia, - MediaStream* aInputStream, - TrackID aInputTrackID) override; + void NotifyQueuedTrackChanges(MediaStreamGraph* aGraph, TrackID aID, + StreamTime aTrackOffset, + uint32_t aTrackEvents, + const MediaSegment& aQueuedMedia, + MediaStream* aInputStream, + TrackID aInputTrackID) override; - virtual void NotifyEvent(MediaStreamGraph* aGraph, - MediaStreamGraphEvent aEvent) override; + void NotifyEvent(MediaStreamGraph* aGraph, + MediaStreamGraphEvent aEvent) override; // DOMMediaStream::PrincipalChangeObserver method. - virtual void PrincipalChanged(DOMMediaStream* aMediaStream) override; + void PrincipalChanged(DOMMediaStream* aMediaStream) override; // CaptureTask methods. diff --git a/dom/media/imagecapture/ImageCapture.h b/dom/media/imagecapture/ImageCapture.h index fc8f5385acb..246b1560eec 100644 --- a/dom/media/imagecapture/ImageCapture.h +++ b/dom/media/imagecapture/ImageCapture.h @@ -53,7 +53,7 @@ public: VideoStreamTrack* GetVideoStreamTrack() const; // nsWrapperCache member - virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override { return ImageCaptureBinding::Wrap(aCx, this, aGivenProto); } diff --git a/dom/media/systemservices/LoadManager.h b/dom/media/systemservices/LoadManager.h index 2ede35dbb2d..69182002845 100644 --- a/dom/media/systemservices/LoadManager.h +++ b/dom/media/systemservices/LoadManager.h @@ -33,15 +33,15 @@ public: NS_DECL_NSIOBSERVER // LoadNotificationCallback interface - virtual void LoadChanged(float aSystemLoad, float aProcessLoad) override; + void LoadChanged(float aSystemLoad, float aProcessLoad) override; // CpuOveruseObserver interface // Called as soon as an overuse is detected. - virtual void OveruseDetected() override; + void OveruseDetected() override; // Called periodically when the system is not overused any longer. - virtual void NormalUsage() override; + void NormalUsage() override; // CPULoadStateCallbackInvoker interface - virtual void AddObserver(webrtc::CPULoadStateObserver * aObserver) override; - virtual void RemoveObserver(webrtc::CPULoadStateObserver * aObserver) override; + void AddObserver(webrtc::CPULoadStateObserver * aObserver) override; + void RemoveObserver(webrtc::CPULoadStateObserver * aObserver) override; private: LoadManagerSingleton(int aLoadMeasurementInterval, From d5d5b88d034acd849891a1ce03347aebfb807bd7 Mon Sep 17 00:00:00 2001 From: Jean-Yves Avenard Date: Mon, 18 Jan 2016 17:56:31 +1100 Subject: [PATCH 015/119] Bug 1240411: P10. Remove obsolete members. r=ayang --- dom/media/omx/MediaStreamSource.h | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/dom/media/omx/MediaStreamSource.h b/dom/media/omx/MediaStreamSource.h index 4b73214debc..c10151602cc 100644 --- a/dom/media/omx/MediaStreamSource.h +++ b/dom/media/omx/MediaStreamSource.h @@ -36,17 +36,6 @@ public: int64_t Tell(); - // Apparently unused. - virtual ssize_t readAt(off_t offset, void *data, size_t size) { - return readAt(static_cast(offset), data, size); - } - virtual status_t getSize(off_t *size) { - off64_t size64; - status_t status = getSize(&size64); - *size = size64; - return status; - } - virtual ~MediaStreamSource(); private: From c3adaaaf2f7dd65d1c7711a8387fc5b5a2d789af Mon Sep 17 00:00:00 2001 From: Nicolas Silva Date: Tue, 19 Jan 2016 09:48:51 +0100 Subject: [PATCH 016/119] Bug 1239288 - Fix a race in the win32 job scheduler's shutdown. r=jrmuizel --- gfx/2d/JobScheduler_win32.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gfx/2d/JobScheduler_win32.cpp b/gfx/2d/JobScheduler_win32.cpp index 9c8e925fd35..989965adc31 100644 --- a/gfx/2d/JobScheduler_win32.cpp +++ b/gfx/2d/JobScheduler_win32.cpp @@ -132,9 +132,14 @@ MultiThreadedJobQueue::RegisterThread() void MultiThreadedJobQueue::UnregisterThread() { - CriticalSectionAutoEnter lock(&mSection); + mSection.Enter(); mThreadsCount -= 1; - if (mThreadsCount == 0) { + bool finishShutdown = mThreadsCount == 0; + mSection.Leave(); + + if (finishShutdown) { + // Can't touch mSection or any other member from now on because this object + // may get deleted on the main thread after mShutdownEvent is set. ::SetEvent(mShutdownEvent); } } From 314276ea80dc9af155a11fc01365dccdf036d5b6 Mon Sep 17 00:00:00 2001 From: Nicolas Silva Date: Thu, 14 Jan 2016 13:34:46 +0100 Subject: [PATCH 017/119] Bug 1239288 - Add a shutdown test to the gfx job scheduler. r=jrmuizel --- gfx/tests/gtest/TestJobScheduler.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gfx/tests/gtest/TestJobScheduler.cpp b/gfx/tests/gtest/TestJobScheduler.cpp index 0480365872f..b7c5aa5237b 100644 --- a/gfx/tests/gtest/TestJobScheduler.cpp +++ b/gfx/tests/gtest/TestJobScheduler.cpp @@ -220,6 +220,16 @@ void TestSchedulerChain(uint32_t aNumThreads, uint32_t aNumCmdBuffers) } // namespace test_scheduler +TEST(Moz2D, JobScheduler_Shutdown) { + srand(time(nullptr)); + for (uint32_t threads = 1; threads < 16; ++threads) { + for (uint32_t i = 1; i < 1000; ++i) { + mozilla::gfx::JobScheduler::Init(threads, threads); + mozilla::gfx::JobScheduler::ShutDown(); + } + } +} + TEST(Moz2D, JobScheduler_Join) { srand(time(nullptr)); for (uint32_t threads = 1; threads < 8; ++threads) { From 595fb493d70732849b6352f5986321801f4dee39 Mon Sep 17 00:00:00 2001 From: Jon Coppeard Date: Tue, 19 Jan 2016 10:05:07 +0000 Subject: [PATCH 018/119] Bug 1234410 - Fix JIT spew assertion when we've hit OOM r=lth --- js/src/jit-test/tests/gc/bug-1234410.js | 10 ++++++++++ js/src/jit/JitcodeMap.cpp | 3 +++ 2 files changed, 13 insertions(+) create mode 100644 js/src/jit-test/tests/gc/bug-1234410.js diff --git a/js/src/jit-test/tests/gc/bug-1234410.js b/js/src/jit-test/tests/gc/bug-1234410.js new file mode 100644 index 00000000000..11ae164f4b0 --- /dev/null +++ b/js/src/jit-test/tests/gc/bug-1234410.js @@ -0,0 +1,10 @@ +if (!('oomTest' in this)) + quit(); + +enableSPSProfiling(); +oomTest(() => { + try { + for (var quit of oomTest.gcparam("//").ArrayBuffer(1)) {} + } catch (e) {} +}); + diff --git a/js/src/jit/JitcodeMap.cpp b/js/src/jit/JitcodeMap.cpp index 34659524d8d..1ef357ab288 100644 --- a/js/src/jit/JitcodeMap.cpp +++ b/js/src/jit/JitcodeMap.cpp @@ -1276,6 +1276,9 @@ struct JitcodeMapBufferWriteSpewer {} void spewAndAdvance(const char* name) { + if (writer->oom()) + return; + uint32_t curPos = writer->length(); const uint8_t* start = writer->buffer() + startPos; const uint8_t* end = writer->buffer() + curPos; From a745ec7b3ed51f10e365ccc0dcbe476af1515c41 Mon Sep 17 00:00:00 2001 From: Jonathan Kew Date: Tue, 19 Jan 2016 10:29:50 +0000 Subject: [PATCH 019/119] Bug 1221976 - Use -moz-appearance:none on textarea and input elements in mochitest test_input_textarea_set_value_no_scroll.html to work around unreliable Gtk3 themed-widget rendering. r=dholbert --- .../test/forms/test_input_textarea_set_value_no_scroll.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dom/html/test/forms/test_input_textarea_set_value_no_scroll.html b/dom/html/test/forms/test_input_textarea_set_value_no_scroll.html index cd3b97fb827..829daa8c97b 100644 --- a/dom/html/test/forms/test_input_textarea_set_value_no_scroll.html +++ b/dom/html/test/forms/test_input_textarea_set_value_no_scroll.html @@ -113,8 +113,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=829606 Mozilla Bug 829606

- - + +
 
From 8e008f972949bedd138487108d9adc1f03a5475a Mon Sep 17 00:00:00 2001 From: Dan Minor Date: Mon, 18 Jan 2016 08:51:29 -0500 Subject: [PATCH 020/119] Bug 1240054 - Only rebuild BandLimitedTables if more partials are required r=padenot We currently rebuild the BandLimitedTables whenever we encounter a lower fundamental frequency but it is only necessary to rebuild the tables if we can fit more partials below the Nyquist frequency. Rebuilding the tables unnecessarily can cause performance problems, particularly in the case where the frequency is continually lowered. --- dom/media/webaudio/blink/PeriodicWave.cpp | 12 +++++++++--- dom/media/webaudio/blink/PeriodicWave.h | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/dom/media/webaudio/blink/PeriodicWave.cpp b/dom/media/webaudio/blink/PeriodicWave.cpp index 2ab143795db..eea7f620b98 100644 --- a/dom/media/webaudio/blink/PeriodicWave.cpp +++ b/dom/media/webaudio/blink/PeriodicWave.cpp @@ -109,7 +109,7 @@ PeriodicWave::createTriangle(float sampleRate) PeriodicWave::PeriodicWave(float sampleRate, size_t numberOfComponents) : m_sampleRate(sampleRate) , m_centsPerRange(CentsPerRange) - , m_lowestRequestedFundamentalFrequency(std::numeric_limits::max()) + , m_maxPartialsInBandLimitedTable(0) , m_normalizationScale(1.0f) { float nyquist = 0.5 * m_sampleRate; @@ -148,7 +148,13 @@ void PeriodicWave::waveDataForFundamentalFrequency(float fundamentalFrequency, f // to the positive frequency. fundamentalFrequency = fabsf(fundamentalFrequency); - if (fundamentalFrequency < m_lowestRequestedFundamentalFrequency) { + // We only need to rebuild to the tables if the new fundamental + // frequency is low enough to allow for more partials below the + // Nyquist frequency. + unsigned numberOfPartials = numberOfPartialsForRange(0); + float nyquist = 0.5 * m_sampleRate; + numberOfPartials = std::min(numberOfPartials, (unsigned)(nyquist / fundamentalFrequency)); + if (numberOfPartials > m_maxPartialsInBandLimitedTable) { for (unsigned rangeIndex = 0; rangeIndex < m_numberOfRanges; ++rangeIndex) { m_bandLimitedTables[rangeIndex] = 0; } @@ -156,7 +162,7 @@ void PeriodicWave::waveDataForFundamentalFrequency(float fundamentalFrequency, f // We need to create the first table to determine the normalization // constant. createBandLimitedTables(fundamentalFrequency, 0); - m_lowestRequestedFundamentalFrequency = fundamentalFrequency; + m_maxPartialsInBandLimitedTable = numberOfPartials; } // Calculate the pitch range. diff --git a/dom/media/webaudio/blink/PeriodicWave.h b/dom/media/webaudio/blink/PeriodicWave.h index a0b6cdd111f..26a948355d1 100644 --- a/dom/media/webaudio/blink/PeriodicWave.h +++ b/dom/media/webaudio/blink/PeriodicWave.h @@ -106,7 +106,7 @@ private: // Creates table for specified index based on fundamental frequency. void createBandLimitedTables(float fundamentalFrequency, unsigned rangeIndex); - float m_lowestRequestedFundamentalFrequency; + unsigned m_maxPartialsInBandLimitedTable; float m_normalizationScale; nsTArray > m_bandLimitedTables; }; From 49fd71a8f57670a116141e1bd1a6b3d279513ece Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Tue, 19 Jan 2016 12:48:59 +0000 Subject: [PATCH 021/119] Bug 1240490 - Fix console prefix used by the App Manifest processor. r=marcosc --- dom/manifest/ManifestProcessor.jsm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dom/manifest/ManifestProcessor.jsm b/dom/manifest/ManifestProcessor.jsm index 7b0c3b026bc..1c0d0cc366c 100644 --- a/dom/manifest/ManifestProcessor.jsm +++ b/dom/manifest/ManifestProcessor.jsm @@ -61,7 +61,7 @@ this.ManifestProcessor = { // jshint ignore:line docURL: aDocURL }) { const console = new ConsoleAPI({ - prefix: 'Web Manifest: ' + prefix: 'Web Manifest' }); const manifestURL = new URL(aManifestURL); const docURL = new URL(aDocURL); From 3cd04f9c5110a9bf8207ccf42d684b11b6fbb5f2 Mon Sep 17 00:00:00 2001 From: Edgar Chen Date: Mon, 18 Jan 2016 18:13:25 +0800 Subject: [PATCH 022/119] Bug 1239903 - Retrieve the xulrunner-sdk from tooltool instead of a task artifact; r=garndt --- testing/taskcluster/tasks/tests/b2g_emulator_cpp_unit.yml | 2 +- testing/taskcluster/tasks/tests/b2g_emulator_crashtest.yml | 2 +- testing/taskcluster/tasks/tests/b2g_emulator_js_reftest.yml | 2 +- testing/taskcluster/tasks/tests/b2g_emulator_mochitest.yml | 2 +- .../taskcluster/tasks/tests/b2g_emulator_mochitest_media.yml | 2 +- testing/taskcluster/tasks/tests/b2g_emulator_reftest.yml | 2 +- .../taskcluster/tasks/tests/b2g_emulator_xpcshell_chunked.yml | 2 +- testing/taskcluster/tasks/tests/b2g_gaia_unit_oop.yml | 2 +- testing/taskcluster/tasks/tests/mulet_build_test.yml | 2 +- testing/taskcluster/tasks/tests/mulet_gaia_unit.yml | 2 +- testing/taskcluster/tasks/tests/mulet_gaia_unit_oop.yml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/testing/taskcluster/tasks/tests/b2g_emulator_cpp_unit.yml b/testing/taskcluster/tasks/tests/b2g_emulator_cpp_unit.yml index 12605d883e1..3391bc9afb8 100644 --- a/testing/taskcluster/tasks/tests/b2g_emulator_cpp_unit.yml +++ b/testing/taskcluster/tasks/tests/b2g_emulator_cpp_unit.yml @@ -19,7 +19,7 @@ task: --test-suite cppunittest --installer-url {{build_url}} --test-packages-url {{test_packages_url}} - --xre-url https://queue.taskcluster.net/v1/task/wXAHAaxDQpqxoWF1iljJjg/runs/0/artifacts/public/cache/xulrunner-sdk-40.zip + --xre-url https://api.pub.build.mozilla.org/tooltool/sha512/cefa8c00db04969d3a50e2a5509bd4ea1dc17d256a651a9518cb28dad72e87a1dbbcd3c88ef770be0edf0ab73d2d73925140df93618ffb7fab81b789d312f547 --symbols-url {{symbols_url}} artifacts: 'public/build': diff --git a/testing/taskcluster/tasks/tests/b2g_emulator_crashtest.yml b/testing/taskcluster/tasks/tests/b2g_emulator_crashtest.yml index 92551a9064c..d9d86ad0b3e 100644 --- a/testing/taskcluster/tasks/tests/b2g_emulator_crashtest.yml +++ b/testing/taskcluster/tasks/tests/b2g_emulator_crashtest.yml @@ -20,7 +20,7 @@ task: --test-suite crashtest --installer-url {{build_url}} --test-packages-url {{test_packages_url}} - --xre-url https://queue.taskcluster.net/v1/task/YNNF94qRSyCXiSU_AQgFOQ/runs/0/artifacts/public/cache/xulrunner-sdk-40.zip + --xre-url https://api.pub.build.mozilla.org/tooltool/sha512/cefa8c00db04969d3a50e2a5509bd4ea1dc17d256a651a9518cb28dad72e87a1dbbcd3c88ef770be0edf0ab73d2d73925140df93618ffb7fab81b789d312f547 --symbols-url {{symbols_url}} --this-chunk {{chunk}} --total-chunk {{total_chunks}} diff --git a/testing/taskcluster/tasks/tests/b2g_emulator_js_reftest.yml b/testing/taskcluster/tasks/tests/b2g_emulator_js_reftest.yml index e6f37fe3038..e54d8335d6d 100644 --- a/testing/taskcluster/tasks/tests/b2g_emulator_js_reftest.yml +++ b/testing/taskcluster/tasks/tests/b2g_emulator_js_reftest.yml @@ -19,7 +19,7 @@ task: --test-suite jsreftest --installer-url {{build_url}} --test-packages-url {{test_packages_url}} - --xre-url https://queue.taskcluster.net/v1/task/wXAHAaxDQpqxoWF1iljJjg/runs/0/artifacts/public/cache/xulrunner-sdk-40.zip + --xre-url https://api.pub.build.mozilla.org/tooltool/sha512/cefa8c00db04969d3a50e2a5509bd4ea1dc17d256a651a9518cb28dad72e87a1dbbcd3c88ef770be0edf0ab73d2d73925140df93618ffb7fab81b789d312f547 --this-chunk {{chunk}} --total-chunk {{total_chunks}} artifacts: diff --git a/testing/taskcluster/tasks/tests/b2g_emulator_mochitest.yml b/testing/taskcluster/tasks/tests/b2g_emulator_mochitest.yml index 3211fdf123a..cc496a15d20 100644 --- a/testing/taskcluster/tasks/tests/b2g_emulator_mochitest.yml +++ b/testing/taskcluster/tasks/tests/b2g_emulator_mochitest.yml @@ -22,7 +22,7 @@ task: --test-suite mochitest --installer-url {{build_url}} --test-packages-url {{test_packages_url}} - --xre-url https://queue.taskcluster.net/v1/task/YNNF94qRSyCXiSU_AQgFOQ/runs/0/artifacts/public/cache/xulrunner-sdk-40.zip + --xre-url https://api.pub.build.mozilla.org/tooltool/sha512/cefa8c00db04969d3a50e2a5509bd4ea1dc17d256a651a9518cb28dad72e87a1dbbcd3c88ef770be0edf0ab73d2d73925140df93618ffb7fab81b789d312f547 --symbols-url {{symbols_url}} --this-chunk {{chunk}} --total-chunk {{total_chunks}} diff --git a/testing/taskcluster/tasks/tests/b2g_emulator_mochitest_media.yml b/testing/taskcluster/tasks/tests/b2g_emulator_mochitest_media.yml index bb01a78a976..f1d51c0adec 100644 --- a/testing/taskcluster/tasks/tests/b2g_emulator_mochitest_media.yml +++ b/testing/taskcluster/tasks/tests/b2g_emulator_mochitest_media.yml @@ -21,7 +21,7 @@ task: --test-suite mochitest --installer-url {{build_url}} --test-packages-url {{test_packages_url}} - --xre-url https://queue.taskcluster.net/v1/task/YNNF94qRSyCXiSU_AQgFOQ/runs/0/artifacts/public/cache/xulrunner-sdk-40.zip + --xre-url https://api.pub.build.mozilla.org/tooltool/sha512/cefa8c00db04969d3a50e2a5509bd4ea1dc17d256a651a9518cb28dad72e87a1dbbcd3c88ef770be0edf0ab73d2d73925140df93618ffb7fab81b789d312f547 dom/media/tests artifacts: 'public/build': diff --git a/testing/taskcluster/tasks/tests/b2g_emulator_reftest.yml b/testing/taskcluster/tasks/tests/b2g_emulator_reftest.yml index b6db1ec058d..5bd8b041695 100644 --- a/testing/taskcluster/tasks/tests/b2g_emulator_reftest.yml +++ b/testing/taskcluster/tasks/tests/b2g_emulator_reftest.yml @@ -19,7 +19,7 @@ task: --test-suite reftest --installer-url {{build_url}} --test-packages-url {{test_packages_url}} - --xre-url https://queue.taskcluster.net/v1/task/YNNF94qRSyCXiSU_AQgFOQ/runs/0/artifacts/public/cache/xulrunner-sdk-40.zip + --xre-url https://api.pub.build.mozilla.org/tooltool/sha512/cefa8c00db04969d3a50e2a5509bd4ea1dc17d256a651a9518cb28dad72e87a1dbbcd3c88ef770be0edf0ab73d2d73925140df93618ffb7fab81b789d312f547 --symbols-url {{symbols_url}} --this-chunk {{chunk}} --total-chunk {{total_chunks}} diff --git a/testing/taskcluster/tasks/tests/b2g_emulator_xpcshell_chunked.yml b/testing/taskcluster/tasks/tests/b2g_emulator_xpcshell_chunked.yml index e747736340c..99eed3e98d2 100644 --- a/testing/taskcluster/tasks/tests/b2g_emulator_xpcshell_chunked.yml +++ b/testing/taskcluster/tasks/tests/b2g_emulator_xpcshell_chunked.yml @@ -19,7 +19,7 @@ task: --test-suite xpcshell --installer-url {{build_url}} --test-packages-url {{test_packages_url}} - --xre-url https://queue.taskcluster.net/v1/task/wXAHAaxDQpqxoWF1iljJjg/runs/0/artifacts/public/cache/xulrunner-sdk-40.zip + --xre-url https://api.pub.build.mozilla.org/tooltool/sha512/cefa8c00db04969d3a50e2a5509bd4ea1dc17d256a651a9518cb28dad72e87a1dbbcd3c88ef770be0edf0ab73d2d73925140df93618ffb7fab81b789d312f547 --busybox-url {{busybox_url}} --symbols-url {{symbols_url}} --this-chunk {{chunk}} diff --git a/testing/taskcluster/tasks/tests/b2g_gaia_unit_oop.yml b/testing/taskcluster/tasks/tests/b2g_gaia_unit_oop.yml index aac1920d306..3c16c326423 100644 --- a/testing/taskcluster/tasks/tests/b2g_gaia_unit_oop.yml +++ b/testing/taskcluster/tasks/tests/b2g_gaia_unit_oop.yml @@ -23,7 +23,7 @@ task: --test-url {{tests_url}} --gaia-repo https://hg.mozilla.org/integration/gaia-central --gaia-dir /home/worker - --xre-url https://queue.taskcluster.net/v1/task/wXAHAaxDQpqxoWF1iljJjg/runs/0/artifacts/public/cache/xulrunner-sdk-40.zip + --xre-url https://api.pub.build.mozilla.org/tooltool/sha512/cefa8c00db04969d3a50e2a5509bd4ea1dc17d256a651a9518cb28dad72e87a1dbbcd3c88ef770be0edf0ab73d2d73925140df93618ffb7fab81b789d312f547 artifacts: 'public/build': type: directory diff --git a/testing/taskcluster/tasks/tests/mulet_build_test.yml b/testing/taskcluster/tasks/tests/mulet_build_test.yml index 8cc1dff49eb..3f50a27fce9 100644 --- a/testing/taskcluster/tasks/tests/mulet_build_test.yml +++ b/testing/taskcluster/tasks/tests/mulet_build_test.yml @@ -23,7 +23,7 @@ task: --download-symbols ondemand --gaia-repo https://hg.mozilla.org/integration/gaia-central --gaia-dir /home/worker - --xre-url https://queue.taskcluster.net/v1/task/wXAHAaxDQpqxoWF1iljJjg/runs/0/artifacts/public/cache/xulrunner-sdk-40.zip + --xre-url https://api.pub.build.mozilla.org/tooltool/sha512/cefa8c00db04969d3a50e2a5509bd4ea1dc17d256a651a9518cb28dad72e87a1dbbcd3c88ef770be0edf0ab73d2d73925140df93618ffb7fab81b789d312f547 artifacts: 'public/build': type: directory diff --git a/testing/taskcluster/tasks/tests/mulet_gaia_unit.yml b/testing/taskcluster/tasks/tests/mulet_gaia_unit.yml index ebdc9c0d25c..2841ca4ad4c 100644 --- a/testing/taskcluster/tasks/tests/mulet_gaia_unit.yml +++ b/testing/taskcluster/tasks/tests/mulet_gaia_unit.yml @@ -23,7 +23,7 @@ task: --download-symbols ondemand --gaia-repo {{gaia_head_repository}} --gaia-dir /home/worker - --xre-url https://queue.taskcluster.net/v1/task/wXAHAaxDQpqxoWF1iljJjg/runs/0/artifacts/public/cache/xulrunner-sdk-40.zip + --xre-url https://api.pub.build.mozilla.org/tooltool/sha512/cefa8c00db04969d3a50e2a5509bd4ea1dc17d256a651a9518cb28dad72e87a1dbbcd3c88ef770be0edf0ab73d2d73925140df93618ffb7fab81b789d312f547 --total-chunk={{total_chunks}} --this-chunk={{chunk}} artifacts: diff --git a/testing/taskcluster/tasks/tests/mulet_gaia_unit_oop.yml b/testing/taskcluster/tasks/tests/mulet_gaia_unit_oop.yml index 7fd910ffac5..63e52e981f1 100644 --- a/testing/taskcluster/tasks/tests/mulet_gaia_unit_oop.yml +++ b/testing/taskcluster/tasks/tests/mulet_gaia_unit_oop.yml @@ -24,7 +24,7 @@ task: --download-symbols ondemand --gaia-repo {{gaia_head_repository}} --gaia-dir /home/worker - --xre-url https://queue.taskcluster.net/v1/task/wXAHAaxDQpqxoWF1iljJjg/runs/0/artifacts/public/cache/xulrunner-sdk-40.zip + --xre-url https://api.pub.build.mozilla.org/tooltool/sha512/cefa8c00db04969d3a50e2a5509bd4ea1dc17d256a651a9518cb28dad72e87a1dbbcd3c88ef770be0edf0ab73d2d73925140df93618ffb7fab81b789d312f547 --total-chunk={{total_chunks}} --this-chunk={{chunk}} artifacts: From 6135544a3f8813ce59a45d68b066e01e2791006b Mon Sep 17 00:00:00 2001 From: Andreas Tolfsen Date: Mon, 18 Jan 2016 18:55:52 +0000 Subject: [PATCH 023/119] Bug 1240550 - Make fnName, file, and line optional arguments; r=automatedtester Previously fnName and line was tested as the entry requirement for printing the filename to the trace information. Testing line here was premature since it is meant to be an optional argument. This patch rectifies this behaviour by testing for each of the optional arguments sequentially. This means the file argument is required to print the line, and the fnName argument is required to print any of those two. --- testing/marionette/error.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/testing/marionette/error.js b/testing/marionette/error.js index eabcc528160..d06529169d7 100644 --- a/testing/marionette/error.js +++ b/testing/marionette/error.js @@ -168,25 +168,29 @@ InvalidSessionIdError.prototype = Object.create(WebDriverError.prototype); * * @param {Error} err * An Error object passed to a catch block or a message. - * @param {string} fnName + * @param {string=} fnName * The name of the function to use in the stack trace message * (e.g. execute_script). - * @param {string} file + * @param {string=} file * The filename of the test file containing the Marionette * command that caused this error to occur. - * @param {number} line + * @param {number=} line * The line number of the above test file. * @param {string=} script * The JS script being executed in text form. */ -this.JavaScriptError = function(err, fnName, file, line, script) { +this.JavaScriptError = function( + err, fnName = null, file = null, line = null, script = null) { let msg = String(err); let trace = ""; - if (fnName && line) { - trace += `${fnName} @${file}`; - if (line) { - trace += `, line ${line}`; + if (fnName) { + trace += fnName; + if (file) { + trace += ` @${file}`; + if (line) { + trace += `, line ${line}`; + } } } From 4e5dbca80923f4424e292af8e5a8dea308af528d Mon Sep 17 00:00:00 2001 From: Geoff Brown Date: Tue, 19 Jan 2016 07:22:02 -0700 Subject: [PATCH 024/119] Bug 1207877 - Make robocop addTab(url) more robust; r=margaret --- mobile/android/tests/browser/robocop/robocop.ini | 2 -- .../browser/robocop/src/org/mozilla/gecko/tests/BaseTest.java | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/mobile/android/tests/browser/robocop/robocop.ini b/mobile/android/tests/browser/robocop/robocop.ini index 4d685b383b5..8fa16f44758 100644 --- a/mobile/android/tests/browser/robocop/robocop.ini +++ b/mobile/android/tests/browser/robocop/robocop.ini @@ -58,8 +58,6 @@ skip-if = android_version == "18" [src/org/mozilla/gecko/tests/testLoad.java] [src/org/mozilla/gecko/tests/testMailToContextMenu.java] [src/org/mozilla/gecko/tests/testNewTab.java] -# disabled on 4.3, bug 1145851 -skip-if = android_version == "18" [src/org/mozilla/gecko/tests/testPanCorrectness.java] # disabled on 4.3, bug 1144874 skip-if = android_version == "18" diff --git a/mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/BaseTest.java b/mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/BaseTest.java index 3742932c841..12b25b26f6b 100644 --- a/mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/BaseTest.java +++ b/mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/BaseTest.java @@ -582,7 +582,7 @@ abstract class BaseTest extends BaseRobocopTest { addTab(); // Adding a new tab opens about:home, so now we just need to load the url in it. - inputAndLoadUrl(url); + loadUrlAndWait(url); } public void closeAddedTabs() { From b18eaf164639b132418a160ea505f0522cb3b29f Mon Sep 17 00:00:00 2001 From: Neil Deakin Date: Tue, 19 Jan 2016 09:29:10 -0500 Subject: [PATCH 025/119] Bug 1234828, re-enable browser_quickfind_editable.js in e10s, r=mikedeboer --- toolkit/content/tests/browser/browser.ini | 1 - toolkit/content/tests/browser/browser_quickfind_editable.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/toolkit/content/tests/browser/browser.ini b/toolkit/content/tests/browser/browser.ini index e5cf42bf8f9..72951c8fa90 100644 --- a/toolkit/content/tests/browser/browser.ini +++ b/toolkit/content/tests/browser/browser.ini @@ -48,4 +48,3 @@ skip-if = buildapp == 'mulet' || buildapp == 'b2g' [browser_mute2.js] skip-if = buildapp == 'mulet' || buildapp == 'b2g' [browser_quickfind_editable.js] -skip-if = e10s # synthesizeKey() doesn't work in e10s mode diff --git a/toolkit/content/tests/browser/browser_quickfind_editable.js b/toolkit/content/tests/browser/browser_quickfind_editable.js index 66298dbc4cb..d4ab5974488 100644 --- a/toolkit/content/tests/browser/browser_quickfind_editable.js +++ b/toolkit/content/tests/browser/browser_quickfind_editable.js @@ -6,7 +6,7 @@ function* test_hotkeys(browser, expected) { let findbar = gBrowser.getFindBar(); for (let key of HOTKEYS) { is(findbar.hidden, true, "findbar is hidden"); - EventUtils.synthesizeKey(key, {}, browser.contentWindow); + yield BrowserTestUtils.sendChar(key, gBrowser.selectedBrowser); is(findbar.hidden, expected, "findbar should" + (expected ? "" : " not") + " be hidden"); if (!expected) { yield closeFindbarAndWait(findbar); From e8dc69108fc7869649cd16db9e48d1039ddff9ad Mon Sep 17 00:00:00 2001 From: Neil Deakin Date: Tue, 19 Jan 2016 09:29:37 -0500 Subject: [PATCH 026/119] Bug 1234828, re-enable browser_bug594509.js in e10s, r=gijs --- toolkit/content/tests/browser/browser.ini | 1 - .../tests/browser/browser_bug594509.js | 24 ++++++------------- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/toolkit/content/tests/browser/browser.ini b/toolkit/content/tests/browser/browser.ini index 72951c8fa90..d16cbec5da9 100644 --- a/toolkit/content/tests/browser/browser.ini +++ b/toolkit/content/tests/browser/browser.ini @@ -8,7 +8,6 @@ support-files = skip-if = buildapp == 'mulet' || e10s # Relies on drop to be handled in the parent process [browser_bug295977_autoscroll_overflow.js] [browser_bug594509.js] -skip-if = e10s # Bug ?????? - intermittent crash of child process reported when run under e10s [browser_bug982298.js] skip-if = e10s # Bug 1064580 [browser_bug1198465.js] diff --git a/toolkit/content/tests/browser/browser_bug594509.js b/toolkit/content/tests/browser/browser_bug594509.js index 000e2f0c83e..f436c3c00da 100644 --- a/toolkit/content/tests/browser/browser_bug594509.js +++ b/toolkit/content/tests/browser/browser_bug594509.js @@ -1,19 +1,9 @@ -function check_about_rights(tab) { - let doc = gBrowser.getBrowserForTab(tab).contentDocument; - ok(doc.getElementById("your-rights"), "about:rights content loaded"); - gBrowser.removeTab(tab); - finish(); -} +add_task(function* () { + let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, "about:rights"); -function test() { - waitForExplicitFinish(); - let tab = gBrowser.selectedTab = gBrowser.addTab("about:blank"); - let browser = gBrowser.getBrowserForTab(tab); - browser.addEventListener("load", function() { - browser.removeEventListener("load", arguments.callee, true); + yield ContentTask.spawn(tab.linkedBrowser, null, function* () { + ok(content.document.getElementById("your-rights"), "about:rights content loaded"); + }); - ok(true, "about:rights loaded"); - executeSoon(function() { check_about_rights(tab); }); - }, true); - browser.loadURI("about:rights", null, null); -} + yield BrowserTestUtils.removeTab(tab); +}); From 9adcd02ac41d4353763cce67f4215069113c32c2 Mon Sep 17 00:00:00 2001 From: Neil Deakin Date: Tue, 19 Jan 2016 09:29:38 -0500 Subject: [PATCH 027/119] Bug 1234828, re-enable browser_Finder.js in e10s, r=mikedeboer --- toolkit/modules/tests/browser/browser.ini | 1 - .../modules/tests/browser/browser_Finder.js | 98 ++++++++----------- 2 files changed, 41 insertions(+), 58 deletions(-) diff --git a/toolkit/modules/tests/browser/browser.ini b/toolkit/modules/tests/browser/browser.ini index 21fbae63141..cd8d2350152 100644 --- a/toolkit/modules/tests/browser/browser.ini +++ b/toolkit/modules/tests/browser/browser.ini @@ -24,7 +24,6 @@ support-files = [browser_Battery.js] [browser_Deprecated.js] [browser_Finder.js] -skip-if = e10s # Bug ?????? - test already uses content scripts, but still fails only under e10s. [browser_Geometry.js] [browser_InlineSpellChecker.js] [browser_WebNavigation.js] diff --git a/toolkit/modules/tests/browser/browser_Finder.js b/toolkit/modules/tests/browser/browser_Finder.js index d9c9f8f76d7..14572faf78d 100644 --- a/toolkit/modules/tests/browser/browser_Finder.js +++ b/toolkit/modules/tests/browser/browser_Finder.js @@ -4,29 +4,13 @@ var Ci = Components.interfaces; -var tab, browser; +add_task(function* () { + const url = "data:text/html;base64," + + btoa("" + + "test link"); + let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, url); -function test () { - waitForExplicitFinish(); - - tab = gBrowser.addTab("data:text/html;base64," + - btoa("" + - "test link")); - browser = gBrowser.getBrowserForTab(tab); - gBrowser.selectedTab = tab; - - browser.addEventListener("load", startTests, true); -} - -var outlineTest = "sendAsyncMessage(\"OutlineTest\", " + - "{ ok : !!content.document." + - "getElementsByTagName(\"a\")[0].style.outline }" + - ");"; - -function startTests () { - browser.removeEventListener("load", startTests, true); - - let finder = browser.finder; + let finder = tab.linkedBrowser.finder; let listener = { onFindResult: function () { ok(false, "callback wasn't replaced"); @@ -34,42 +18,42 @@ function startTests () { }; finder.addResultListener(listener); - listener.onFindResult = function ({result}) { - ok(result == Ci.nsITypeAheadFind.FIND_FOUND, "should find string"); + function waitForFind() { + return new Promise(resolve => { + listener.onFindResult = resolve; + }) + }; - listener.onFindResult = function ({result}) { - ok(result == Ci.nsITypeAheadFind.FIND_NOTFOUND, "should not find string"); - - let first = true; - listener.onFindResult = function ({result}) { - ok(result == Ci.nsITypeAheadFind.FIND_FOUND, "should find link"); - - browser.messageManager.addMessageListener("OutlineTest", function f(aMessage) { - browser.messageManager.removeMessageListener("OutlineTest", f); - - - if (first) { - ok(aMessage.data.ok, "content script should send okay"); - first = false; - - // Just a simple search for "test link". - finder.fastFind("test link", false, false); - } else { - ok(!aMessage.data.ok, "content script should not send okay"); - cleanup(); - } - }) - browser.messageManager.loadFrameScript("data:," + outlineTest, false) - } - // Search only for links and draw outlines. - finder.fastFind("test link", true, true); - } - finder.highlight(true, "Bla"); - } + let promiseFind = waitForFind(); finder.highlight(true, "content"); -} + let findResult = yield promiseFind; + is(findResult.result, Ci.nsITypeAheadFind.FIND_FOUND, "should find string"); -function cleanup() { + promiseFind = waitForFind(); + finder.highlight(true, "Bla"); + findResult = yield promiseFind; + is(findResult.result, Ci.nsITypeAheadFind.FIND_NOTFOUND, "should not find string"); + + // Search only for links and draw outlines. + promiseFind = waitForFind(); + finder.fastFind("test link", true, true); + findResult = yield promiseFind; + is(findResult.result, Ci.nsITypeAheadFind.FIND_FOUND, "should find link"); + + yield ContentTask.spawn(tab.linkedBrowser, {}, function* (arg) { + ok(!!content.document.getElementsByTagName("a")[0].style.outline, "outline set"); + }); + + // Just a simple search for "test link". + promiseFind = waitForFind(); + finder.fastFind("test link", false, false); + findResult = yield promiseFind; + is(findResult.result, Ci.nsITypeAheadFind.FIND_FOUND, "should find link again"); + + yield ContentTask.spawn(tab.linkedBrowser, {}, function* (arg) { + ok(!content.document.getElementsByTagName("a")[0].style.outline, "outline not set"); + }); + + finder.removeResultListener(listener); gBrowser.removeTab(tab); - finish(); -} +}); From 097a9317ca9a53d6fb29e0d7087789921de40181 Mon Sep 17 00:00:00 2001 From: peter chang Date: Mon, 11 Jan 2016 19:56:00 +0100 Subject: [PATCH 028/119] Bug 1236395 - [WebGL2] pass getFramebufferAttachmentParameter in gl-object-get-calls.html, r=jgilbert --- dom/canvas/WebGLContextGL.cpp | 6 +++--- dom/canvas/WebGLRenderbuffer.cpp | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/dom/canvas/WebGLContextGL.cpp b/dom/canvas/WebGLContextGL.cpp index 2c26b353b6f..91cbdaee163 100644 --- a/dom/canvas/WebGLContextGL.cpp +++ b/dom/canvas/WebGLContextGL.cpp @@ -736,7 +736,7 @@ WebGLContext::GetFramebufferAttachmentParameter(JSContext* cx, } switch (attachment) { - case LOCAL_GL_COLOR: + case LOCAL_GL_BACK: case LOCAL_GL_DEPTH: case LOCAL_GL_STENCIL: break; @@ -760,12 +760,12 @@ WebGLContext::GetFramebufferAttachmentParameter(JSContext* cx, case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE: case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: - if (attachment == LOCAL_GL_COLOR) + if (attachment == LOCAL_GL_BACK) return JS::NumberValue(8); return JS::NumberValue(0); case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: - if (attachment == LOCAL_GL_COLOR) + if (attachment == LOCAL_GL_BACK) return JS::NumberValue(mOptions.alpha ? 8 : 0); return JS::NumberValue(0); diff --git a/dom/canvas/WebGLRenderbuffer.cpp b/dom/canvas/WebGLRenderbuffer.cpp index a555d449849..dda39dd4b2b 100644 --- a/dom/canvas/WebGLRenderbuffer.cpp +++ b/dom/canvas/WebGLRenderbuffer.cpp @@ -27,8 +27,7 @@ DepthStencilDepthFormat(gl::GLContext* gl) static bool SupportsDepthStencil(gl::GLContext* gl) { - return gl->IsExtensionSupported(gl::GLContext::EXT_packed_depth_stencil) || - gl->IsExtensionSupported(gl::GLContext::OES_packed_depth_stencil); + return gl->IsSupported(gl::GLFeature::packed_depth_stencil); } static bool From 5549c0fc54a984596945282a32bf726227ec7573 Mon Sep 17 00:00:00 2001 From: Bogdan Postelnicu Date: Tue, 19 Jan 2016 12:33:56 +0200 Subject: [PATCH 029/119] Bug 1240479 - pass values for mReversePortion and mStartForReversingTestin through constructor. r=heycam --- layout/style/nsTransitionManager.cpp | 5 ++--- layout/style/nsTransitionManager.h | 6 +++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/layout/style/nsTransitionManager.cpp b/layout/style/nsTransitionManager.cpp index 835b554ecc1..145cdcb4c7e 100644 --- a/layout/style/nsTransitionManager.cpp +++ b/layout/style/nsTransitionManager.cpp @@ -657,9 +657,8 @@ nsTransitionManager::ConsiderStartingTransition( RefPtr pt = new ElementPropertyTransition(aElement->OwnerDoc(), aElement, - aNewStyleContext->GetPseudoType(), timing); - pt->mStartForReversingTest = startForReversingTest; - pt->mReversePortion = reversePortion; + aNewStyleContext->GetPseudoType(), timing, + startForReversingTest, reversePortion); AnimationProperty& prop = *pt->Properties().AppendElement(); prop.mProperty = aProperty; diff --git a/layout/style/nsTransitionManager.h b/layout/style/nsTransitionManager.h index 23084d657cb..65a68771c26 100644 --- a/layout/style/nsTransitionManager.h +++ b/layout/style/nsTransitionManager.h @@ -38,8 +38,12 @@ struct ElementPropertyTransition : public dom::KeyframeEffectReadOnly ElementPropertyTransition(nsIDocument* aDocument, dom::Element* aTarget, nsCSSPseudoElements::Type aPseudoType, - const TimingParams &aTiming) + const TimingParams &aTiming, + StyleAnimationValue aStartForReversingTest, + double aReversePortion) : dom::KeyframeEffectReadOnly(aDocument, aTarget, aPseudoType, aTiming) + , mStartForReversingTest(aStartForReversingTest) + , mReversePortion(aReversePortion) { } ElementPropertyTransition* AsTransition() override { return this; } From 7df0c9686b3bc93a60f8b0c02f0639cbf9e0482b Mon Sep 17 00:00:00 2001 From: Andrew Halberstadt Date: Wed, 13 Jan 2016 10:37:00 -0500 Subject: [PATCH 030/119] Bug 1239330 - Support AddonManager.installTemporaryAddon() in marionette_driver.addons, r=ato --- ...rtless.xpi => mn-restartless-unsigned.xpi} | Bin .../marionette/tests/unit/test_addons.py | 26 ++++++---- .../driver/marionette_driver/addons.py | 49 ++++++++---------- .../driver/marionette_driver/marionette.py | 6 --- 4 files changed, 40 insertions(+), 41 deletions(-) rename testing/marionette/client/marionette/tests/unit/{mn-restartless.xpi => mn-restartless-unsigned.xpi} (100%) diff --git a/testing/marionette/client/marionette/tests/unit/mn-restartless.xpi b/testing/marionette/client/marionette/tests/unit/mn-restartless-unsigned.xpi similarity index 100% rename from testing/marionette/client/marionette/tests/unit/mn-restartless.xpi rename to testing/marionette/client/marionette/tests/unit/mn-restartless-unsigned.xpi diff --git a/testing/marionette/client/marionette/tests/unit/test_addons.py b/testing/marionette/client/marionette/tests/unit/test_addons.py index f1ebe851f81..cf87c12bc5c 100644 --- a/testing/marionette/client/marionette/tests/unit/test_addons.py +++ b/testing/marionette/client/marionette/tests/unit/test_addons.py @@ -3,6 +3,7 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. import os +import unittest from marionette import MarionetteTestCase from marionette_driver.addons import Addons, AddonInstallException @@ -14,7 +15,6 @@ class TestAddons(MarionetteTestCase): def setUp(self): MarionetteTestCase.setUp(self) self.addons = Addons(self.marionette) - self.addon_path = os.path.join(here, 'mn-restartless.xpi') @property @@ -32,19 +32,27 @@ class TestAddons(MarionetteTestCase): return addons - def test_install_and_remove_unsigned_addon(self): - self.addons.signature_required = False + def test_install_and_remove_temporary_unsigned_addon(self): + addon_path = os.path.join(here, 'mn-restartless-unsigned.xpi') - addon_id = self.addons.install(self.addon_path) + addon_id = self.addons.install(addon_path, temp=True) self.assertIn(addon_id, self.all_addon_ids) self.addons.uninstall(addon_id) self.assertNotIn(addon_id, self.all_addon_ids) - self.addons.signature_required = True - - def test_install_unsigned_addon_with_signature_required(self): - self.signature_required = True + def test_install_unsigned_addon(self): + addon_path = os.path.join(here, 'mn-restartless-unsigned.xpi') with self.assertRaises(AddonInstallException): - self.addons.install(self.addon_path) + self.addons.install(addon_path) + + @unittest.skip("need to get the test extension signed") + def test_install_and_remove_signed_addon(self): + addon_path = os.path.join(here, 'mn-restartless-signed.xpi') + + addon_id = self.addons.install(addon_path) + self.assertIn(addon_id, self.all_addon_ids) + + self.addons.uninstall(addon_id) + self.assertNotIn(addon_id, self.all_addon_ids) diff --git a/testing/marionette/driver/marionette_driver/addons.py b/testing/marionette/driver/marionette_driver/addons.py index 480914ba6d5..de0fbc08185 100644 --- a/testing/marionette/driver/marionette_driver/addons.py +++ b/testing/marionette/driver/marionette_driver/addons.py @@ -37,25 +37,8 @@ class Addons(object): def __init__(self, marionette): self._mn = marionette - self._signature_required = True - def on_restart(): - self.signature_required = self._signature_required - self._mn.restart_handlers.append(on_restart) - - @property - def signature_required(self): - """ - Whether or not addons must be signed. - """ - return self._signature_required - - @signature_required.setter - def signature_required(self, val): - self._mn.set_pref('xpinstall.signatures.required', val) - self._signature_required = val - - def install(self, path): + def install(self, path, temp=False): """Install an addon. If the addon is restartless, it can be used right away. Otherwise @@ -63,6 +46,9 @@ class Addons(object): will be needed. :param path: A file path to the extension to be installed. + :param temp: Install a temporary addon. Temporary addons will + automatically be uninstalled on shutdown and do not need + to be signed, though they must be restartless. :returns: The addon ID string of the newly installed addon. :raises: :exc:`AddonInstallException` """ @@ -77,18 +63,29 @@ class Addons(object): onInstallFailed: function(install) { marionetteScriptFinished([null, install.error]); + }, + + onInstalled: function(addon) { + marionetteScriptFinished([addon.id, 0]); } } let file = new FileUtils.File(arguments[0]); - AddonManager.getInstallForFile(file, function(aInstall) { - if (aInstall.error != 0) { - marionetteScriptFinished([null, aInstall.error]); - } - aInstall.addListener(listener); - aInstall.install(); - }); - """, script_args=[path], debug_script=True) + let temp = arguments[1]; + + if (!temp) { + AddonManager.getInstallForFile(file, function(aInstall) { + if (aInstall.error != 0) { + marionetteScriptFinished([null, aInstall.error]); + } + aInstall.addListener(listener); + aInstall.install(); + }); + } else { + AddonManager.addAddonListener(listener); + AddonManager.installTemporaryAddon(file); + } + """, script_args=[path, temp], debug_script=True) if status: if status in ADDON_INSTALL_ERRORS: diff --git a/testing/marionette/driver/marionette_driver/marionette.py b/testing/marionette/driver/marionette_driver/marionette.py index 420fab88d67..e935da32d88 100644 --- a/testing/marionette/driver/marionette_driver/marionette.py +++ b/testing/marionette/driver/marionette_driver/marionette.py @@ -564,7 +564,6 @@ class Marionette(object): self.device_serial = device_serial self.adb_host = adb_host self.adb_port = adb_port - self.restart_handlers = [] startup_timeout = startup_timeout or self.DEFAULT_STARTUP_TIMEOUT @@ -1145,11 +1144,6 @@ class Marionette(object): self.start_session(session_id=self.session_id) self._reset_timeouts() - # Give consumers who depended on the old session a - # chance to re-initialize and/or restore state. - for handler in self.restart_handlers: - handler() - def absolute_url(self, relative_url): ''' Returns an absolute url for files served from Marionette's www directory. From e2d868135964f81a207b8d078ffcef8dfcf200ba Mon Sep 17 00:00:00 2001 From: Hannes Verschore Date: Tue, 19 Jan 2016 10:11:33 -0500 Subject: [PATCH 031/119] Bug 1238859: ARM: MoveEmitter should only copying float32 instead of double during spilling, r=nbp --- js/src/jit/arm/MoveEmitter-arm.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/js/src/jit/arm/MoveEmitter-arm.cpp b/js/src/jit/arm/MoveEmitter-arm.cpp index 8d8a5b43400..d26cd37993c 100644 --- a/js/src/jit/arm/MoveEmitter-arm.cpp +++ b/js/src/jit/arm/MoveEmitter-arm.cpp @@ -170,14 +170,27 @@ MoveEmitterARM::completeCycle(const MoveOperand& from, const MoveOperand& to, Mo // saved value of B, to A. switch (type) { case MoveOp::FLOAT32: - case MoveOp::DOUBLE: + MOZ_ASSERT(!to.isGeneralRegPair()); if (to.isMemory()) { - ScratchDoubleScope scratch(masm); + ScratchFloat32Scope scratch(masm); masm.ma_vldr(cycleSlot(slotId, 0), scratch); masm.ma_vstr(scratch, toAddress(to)); } else if (to.isGeneralReg()) { MOZ_ASSERT(type == MoveOp::FLOAT32); masm.ma_ldr(toAddress(from), to.reg()); + } else { + uint32_t offset = 0; + if ((!from.isMemory()) && from.floatReg().numAlignedAliased() == 1) + offset = sizeof(float); + masm.ma_vldr(cycleSlot(slotId, offset), to.floatReg()); + } + break; + case MoveOp::DOUBLE: + MOZ_ASSERT(!to.isGeneralReg()); + if (to.isMemory()) { + ScratchDoubleScope scratch(masm); + masm.ma_vldr(cycleSlot(slotId, 0), scratch); + masm.ma_vstr(scratch, toAddress(to)); } else if (to.isGeneralRegPair()) { MOZ_ASSERT(type == MoveOp::DOUBLE); ScratchDoubleScope scratch(masm); From 047786024795c1f7bf61b0bd0c7a1dbb67449032 Mon Sep 17 00:00:00 2001 From: Eugen Sawin Date: Tue, 5 Jan 2016 01:10:51 +0100 Subject: [PATCH 032/119] Bug 1232335 - [1.3] Fix test_can_play_type_mpeg for Android. r=snorp --- dom/media/test/manifest.js | 3 ++- dom/media/test/test_can_play_type_mpeg.html | 13 ++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/dom/media/test/manifest.js b/dom/media/test/manifest.js index e7c7a07af7f..88da24fa794 100644 --- a/dom/media/test/manifest.js +++ b/dom/media/test/manifest.js @@ -507,7 +507,8 @@ var gUnseekableTests = [ ]; var androidVersion = -1; // non-Android platforms -if (manifestNavigator().userAgent.indexOf("Mobile") != -1) { +if (manifestNavigator().userAgent.indexOf("Mobile") != -1 || + manifestNavigator().userAgent.indexOf("Tablet") != -1) { // See nsSystemInfo.cpp, the getProperty('version') returns different value // on each platforms, so we need to distinguish the android and B2G platform. var versionString = manifestNavigator().userAgent.indexOf("Android") != -1 ? diff --git a/dom/media/test/test_can_play_type_mpeg.html b/dom/media/test/test_can_play_type_mpeg.html index cd1e2196d36..eced0790a84 100644 --- a/dom/media/test/test_can_play_type_mpeg.html +++ b/dom/media/test/test_can_play_type_mpeg.html @@ -124,13 +124,18 @@ function getPref(name) { return pref; } +function IsSupportedAndroid() { + return getAndroidVersion() >= 14; +} + function IsJellyBeanOrLater() { - return androidVersion >= 16; + return getAndroidVersion() >= 16; } var haveMp4 = (getPref("media.wmf.enabled") && IsWindowsVistaOrLater()) || IsMacOSSnowLeopardOrLater() || - IsJellyBeanOrLater() || + (IsAndroid() && + (IsJellyBeanOrLater() || getPref("media.plugins.enabled"))) || getPref("media.omx.enabled") || (IsLinux() && getPref("media.ffmpeg.enabled")); @@ -138,8 +143,10 @@ check_mp4(document.getElementById('v'), haveMp4); var haveMp3 = getPref("media.directshow.enabled") || (getPref("media.wmf.enabled") && IsWindowsVistaOrLater()) || - (IsJellyBeanOrLater() && getPref("media.android-media-codec.enabled")) || (IsLinux() && getPref("media.ffmpeg.enabled")) || + (IsSupportedAndroid() && + ((IsJellyBeanOrLater() && getPref("media.android-media-codec.enabled")) || + getPref("media.plugins.enabled"))) || getPref("media.apple.mp3.enabled"); check_mp3(document.getElementById('v'), haveMp3); From 2689e4d9d87b4ecf638abea85dac4cc3c33a0b63 Mon Sep 17 00:00:00 2001 From: Patrick McManus Date: Fri, 15 Jan 2016 22:56:06 -0500 Subject: [PATCH 033/119] Bug 1240254 - necko tests assumed synchronous error reporting r=dragana --- netwerk/test/unit/test_speculative_connect.js | 101 +++++++++--------- 1 file changed, 52 insertions(+), 49 deletions(-) diff --git a/netwerk/test/unit/test_speculative_connect.js b/netwerk/test/unit/test_speculative_connect.js index 2e0111d1f43..51ae8248828 100644 --- a/netwerk/test/unit/test_speculative_connect.js +++ b/netwerk/test/unit/test_speculative_connect.js @@ -80,61 +80,60 @@ TestServer.prototype = { onStopListening: function(socket) {} }; -/** TestOutputStreamCallback +/** TestFailedStreamCallback * - * Implements nsIOutputStreamCallback for socket layer tests. + * Implements nsI[Input|Output]StreamCallback for socket layer tests. + * Expect failure in all cases */ -function TestOutputStreamCallback(transport, hostname, proxied, expectSuccess, next) { +function TestFailedStreamCallback(transport, hostname, next) { this.transport = transport; this.hostname = hostname; - this.proxied = proxied; - this.expectSuccess = expectSuccess; this.next = next; - this.dummyContent = "Dummy content"; + this.dummyContent = "G"; } -TestOutputStreamCallback.prototype = { +TestFailedStreamCallback.prototype = { QueryInterface: function(iid) { - if (iid.equals(Ci.nsIOutputStreamCallback) || + if (iid.equals(Ci.nsIInputStreamCallback) || + iid.equals(Ci.nsIOutputStreamCallback) || iid.equals(Ci.nsISupports)) return this; throw Cr.NS_ERROR_NO_INTERFACE; }, - onOutputStreamReady: function(stream) { - do_check_neq(typeof(stream), undefined); + processException: function(e) { + do_check_instanceof(e, Ci.nsIException); + // A refusal to connect speculatively should throw an error. + do_check_eq(e.result, Cr.NS_ERROR_CONNECTION_REFUSED); + this.transport.close(Cr.NS_BINDING_ABORTED); + return true; + }, + onOutputStreamReady: function(outstream) { + do_print("outputstream handler."); + do_check_neq(typeof(outstream), undefined); try { - stream.write(this.dummyContent, this.dummyContent.length); + outstream.write(this.dummyContent, this.dummyContent.length); } catch (e) { - // Spec Connect FAILED. - do_check_instanceof(e, Ci.nsIException); - if (this.expectSuccess) { - // We may expect success, but the address could be unreachable - // in the test environment, so expect errors. - if (this.proxied) { - do_check_true(e.result == Cr.NS_ERROR_NET_TIMEOUT || - e.result == Cr.NS_ERROR_PROXY_CONNECTION_REFUSED); - } else { - do_check_true(e.result == Cr.NS_ERROR_NET_TIMEOUT || - e.result == Cr.NS_ERROR_CONNECTION_REFUSED); - } - } else { - // A refusal to connect speculatively should throw an error. - do_check_eq(e.result, Cr.NS_ERROR_CONNECTION_REFUSED); - } - this.transport.close(Cr.NS_BINDING_ABORTED); + this.processException(e); this.next(); return; } - // Spec Connect SUCCEEDED. - if (this.expectSuccess) { - do_check_true(true, "Success for " + this.hostname); - } else { - do_throw("Speculative Connect should have failed for " + - this.hostname); + do_print("no exception on write. Wait for read."); + }, + onInputStreamReady: function(instream) { + do_print("inputstream handler."); + do_check_neq(typeof(instream), undefined); + try { + instream.available(); + } catch (e) { + this.processException(e); + this.next(); + return; } + do_throw("Speculative Connect should have failed for " + + this.hostname); this.transport.close(Cr.NS_BINDING_ABORTED); this.next(); - } + }, }; /** test_speculative_connect @@ -165,7 +164,7 @@ function test_speculative_connect() { * boolean to determine if the test is expected to succeed or fail, and a * function to call the next test case. */ -function test_hostnames_resolving_to_addresses(host, expectSuccess, next) { +function test_hostnames_resolving_to_addresses(host, next) { do_print(host); var sts = Cc["@mozilla.org/network/socket-transport-service;1"] .getService(Ci.nsISocketTransportService); @@ -179,15 +178,15 @@ function test_hostnames_resolving_to_addresses(host, expectSuccess, next) { do_check_eq(1, transport.getTimeout(Ci.nsISocketTransport.TIMEOUT_CONNECT)); var outStream = transport.openOutputStream(Ci.nsITransport.OPEN_UNBUFFERED,0,0); + var inStream = transport.openInputStream(0,0,0); do_check_neq(typeof(outStream), undefined); + do_check_neq(typeof(inStream), undefined); - var callback = new TestOutputStreamCallback(transport, host, false, - expectSuccess, - next); + var callback = new TestFailedStreamCallback(transport, host, next); do_check_neq(typeof(callback), undefined); // Need to get main thread pointer to ensure nsSocketTransport::AsyncWait - // adds callback to nsOutputStreamReadyEvent on main thread, and doesn't + // adds callback to ns*StreamReadyEvent on main thread, and doesn't // addref off the main thread. var gThreadManager = Cc["@mozilla.org/thread-manager;1"] .getService(Ci.nsIThreadManager); @@ -195,7 +194,9 @@ function test_hostnames_resolving_to_addresses(host, expectSuccess, next) { try { outStream.QueryInterface(Ci.nsIAsyncOutputStream) - .asyncWait(callback, 0, 0, mainThread); + .asyncWait(callback, 0, 0, mainThread); + inStream.QueryInterface(Ci.nsIAsyncInputStream) + .asyncWait(callback, 0, 0, mainThread); } catch (e) { do_throw("asyncWait should not fail!"); } @@ -222,7 +223,7 @@ function test_hostnames_resolving_to_local_addresses() { var host = localIPLiterals[hostIdx++]; // Test another local IP address when the current one is done. var next = test_hostnames_resolving_to_local_addresses; - test_hostnames_resolving_to_addresses(host, false, next); + test_hostnames_resolving_to_addresses(host, next); } /** test_speculative_connect_with_host_list @@ -231,7 +232,7 @@ function test_hostnames_resolving_to_local_addresses() { * boolean to determine if the test is expected to succeed or fail, and a * function to call the next test case. */ -function test_proxies(proxyHost, expectSuccess, next) { +function test_proxies(proxyHost, next) { do_print("Proxy: " + proxyHost); var sts = Cc["@mozilla.org/network/socket-transport-service;1"] .getService(Ci.nsISocketTransportService); @@ -253,15 +254,15 @@ function test_proxies(proxyHost, expectSuccess, next) { transport.setTimeout(Ci.nsISocketTransport.TIMEOUT_READ_WRITE, 1); var outStream = transport.openOutputStream(Ci.nsITransport.OPEN_UNBUFFERED,0,0); + var inStream = transport.openInputStream(0,0,0); do_check_neq(typeof(outStream), undefined); + do_check_neq(typeof(inStream), undefined); - var callback = new TestOutputStreamCallback(transport, proxyHost, true, - expectSuccess, - next); + var callback = new TestFailedStreamCallback(transport, proxyHost, next); do_check_neq(typeof(callback), undefined); // Need to get main thread pointer to ensure nsSocketTransport::AsyncWait - // adds callback to nsOutputStreamReadyEvent on main thread, and doesn't + // adds callback to ns*StreamReadyEvent on main thread, and doesn't // addref off the main thread. var gThreadManager = Cc["@mozilla.org/thread-manager;1"] .getService(Ci.nsIThreadManager); @@ -269,7 +270,9 @@ function test_proxies(proxyHost, expectSuccess, next) { try { outStream.QueryInterface(Ci.nsIAsyncOutputStream) - .asyncWait(callback, 0, 0, mainThread); + .asyncWait(callback, 0, 0, mainThread); + inStream.QueryInterface(Ci.nsIAsyncInputStream) + .asyncWait(callback, 0, 0, mainThread); } catch (e) { do_throw("asyncWait should not fail!"); } @@ -296,7 +299,7 @@ function test_proxies_with_local_addresses() { var host = localIPLiterals[hostIdx++]; // Test another local IP address when the current one is done. var next = test_proxies_with_local_addresses; - test_proxies(host, false, next); + test_proxies(host, next); } /** next_test From 33f0ec8a5b927b0659a4dd07affc354a652a105e Mon Sep 17 00:00:00 2001 From: Mike Shal Date: Thu, 14 Jan 2016 14:46:25 -0500 Subject: [PATCH 034/119] Bug 1239824 - Remove toolkit/components/feeds/Makefile.in; r=gps ABS_SRCDIR is no longer used. --- toolkit/components/feeds/Makefile.in | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 toolkit/components/feeds/Makefile.in diff --git a/toolkit/components/feeds/Makefile.in b/toolkit/components/feeds/Makefile.in deleted file mode 100644 index 4567907d1ad..00000000000 --- a/toolkit/components/feeds/Makefile.in +++ /dev/null @@ -1,8 +0,0 @@ -# -# 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 $(topsrcdir)/config/rules.mk - -ABS_SRCDIR := $(abspath $(srcdir)) From 5bce5a1bea1e489c7d5c9879aceb827fc06bdd88 Mon Sep 17 00:00:00 2001 From: Jason Orendorff Date: Sun, 1 Mar 2015 13:37:42 -0600 Subject: [PATCH 035/119] Bug 603201 - Enable primitive receivers in [[Set]]. r=jorendorff --- addon-sdk/source/lib/toolkit/loader.js | 3 +- js/src/jit/BaselineIC.cpp | 9 ++- js/src/jsapi-tests/testForwardSetProperty.cpp | 56 ++++++------------- js/src/tests/ecma_6/Symbol/as-base-value.js | 5 +- js/src/vm/Interpreter.cpp | 43 ++++++++------ js/src/vm/Interpreter.h | 4 ++ 6 files changed, 58 insertions(+), 62 deletions(-) diff --git a/addon-sdk/source/lib/toolkit/loader.js b/addon-sdk/source/lib/toolkit/loader.js index cfef008cb37..6cc554db104 100644 --- a/addon-sdk/source/lib/toolkit/loader.js +++ b/addon-sdk/source/lib/toolkit/loader.js @@ -1059,7 +1059,8 @@ function traverse (node, cb) { cb(node); keys(node).map(key => { if (key === 'parent' || !node[key]) return; - node[key].parent = node; + if (typeof node[key] === "object") + node[key].parent = node; traverse(node[key], cb); }); } diff --git a/js/src/jit/BaselineIC.cpp b/js/src/jit/BaselineIC.cpp index 922ac367f16..cd8282ac35b 100644 --- a/js/src/jit/BaselineIC.cpp +++ b/js/src/jit/BaselineIC.cpp @@ -2766,7 +2766,7 @@ DoSetElemFallback(JSContext* cx, BaselineFrame* frame, ICSetElem_Fallback* stub_ if (!InitArrayElemOperation(cx, pc, obj, index.toInt32(), rhs)) return false; } else { - if (!SetObjectElement(cx, obj, index, rhs, JSOp(*pc) == JSOP_STRICTSETELEM, script, pc)) + if (!SetObjectElement(cx, obj, index, rhs, objv, JSOp(*pc) == JSOP_STRICTSETELEM, script, pc)) return false; } @@ -4777,9 +4777,12 @@ DoSetPropFallback(JSContext* cx, BaselineFrame* frame, ICSetProp_Fallback* stub_ } else { MOZ_ASSERT(op == JSOP_SETPROP || op == JSOP_STRICTSETPROP); - RootedValue v(cx, rhs); - if (!PutProperty(cx, obj, id, v, op == JSOP_STRICTSETPROP)) + ObjectOpResult result; + if (!SetProperty(cx, obj, id, rhs, lhs, result) || + !result.checkStrictErrorOrWarning(cx, obj, id, op == JSOP_STRICTSETPROP)) + { return false; + } } // Leave the RHS on the stack. diff --git a/js/src/jsapi-tests/testForwardSetProperty.cpp b/js/src/jsapi-tests/testForwardSetProperty.cpp index 04d537f990f..eea07c279c3 100644 --- a/js/src/jsapi-tests/testForwardSetProperty.cpp +++ b/js/src/jsapi-tests/testForwardSetProperty.cpp @@ -7,34 +7,36 @@ #include "jsapi-tests/tests.h" +using namespace JS; + BEGIN_TEST(testForwardSetProperty) { - JS::RootedValue v1(cx); + RootedValue v1(cx); EVAL("var foundValue; \n" "var obj1 = { set prop(val) { foundValue = this; } }; \n" "obj1;", &v1); - JS::RootedValue v2(cx); + RootedValue v2(cx); EVAL("var obj2 = Object.create(obj1); \n" "obj2;", &v2); - JS::RootedValue v3(cx); + RootedValue v3(cx); EVAL("var obj3 = {}; \n" "obj3;", &v3); - JS::RootedObject obj1(cx, &v1.toObject()); - JS::RootedObject obj2(cx, &v2.toObject()); - JS::RootedObject obj3(cx, &v3.toObject()); + RootedObject obj1(cx, &v1.toObject()); + RootedObject obj2(cx, &v2.toObject()); + RootedObject obj3(cx, &v3.toObject()); - JS::RootedValue setval(cx, JS::Int32Value(42)); + RootedValue setval(cx, Int32Value(42)); - JS::RootedValue propkey(cx); + RootedValue propkey(cx); EVAL("'prop';", &propkey); - JS::RootedId prop(cx); + RootedId prop(cx); CHECK(JS_ValueToId(cx, propkey, &prop)); EXEC("function assertEq(a, b, msg) \n" @@ -68,42 +70,20 @@ BEGIN_TEST(testForwardSetProperty) // Strict setter - EVAL("obj1 = { set prop(val) { 'use strict'; foundValue = this; } }; \n" - "obj1;", - &v1); + RootedValue v4(cx); + EVAL("({ set prop(val) { 'use strict'; foundValue = this; } })", &v4); + RootedObject obj4(cx, &v4.toObject()); - CHECK(JS_ForwardSetPropertyTo(cx, obj2, prop, setval, v3, result)); + CHECK(JS_ForwardSetPropertyTo(cx, obj4, prop, setval, v3, result)); CHECK(result); EXEC("assertEq(foundValue, obj3, 'wrong receiver passed to strict setter');"); - CHECK(JS_ForwardSetPropertyTo(cx, obj2, prop, setval, setval, result)); + CHECK(JS_ForwardSetPropertyTo(cx, obj4, prop, setval, setval, result)); CHECK(result); - JS::RootedValue strictSetSupported(cx); - EVAL("var strictSetSupported = false; \n" - "Object.defineProperty(Object.prototype, \n" - " 'strictSetter', \n" - " { \n" - " set(v) { \n" - " 'use strict'; \n" - " strictSetSupported = \n" - " typeof this === 'number'; \n" - " } \n" - " }); \n" - "17..strictSetter = 42; \n" - "strictSetSupported;", - &strictSetSupported); - CHECK(strictSetSupported.isBoolean()); - - if (strictSetSupported.toBoolean()) { - // XXX Bug 603201 will fix this. - MOZ_ASSERT(false, - "remove the support-testing check when bug 603201 is fixt"); - EXEC("assertEq(foundValue, 42, \n" - " '42 passed as receiver to strict setter ' + \n" - " 'was mangled');"); - } + EXEC("assertEq(foundValue, 42, \n" + " '42 passed as receiver to strict setter was mangled');"); return true; } diff --git a/js/src/tests/ecma_6/Symbol/as-base-value.js b/js/src/tests/ecma_6/Symbol/as-base-value.js index 4b2ec126bb9..f0e8400a22d 100644 --- a/js/src/tests/ecma_6/Symbol/as-base-value.js +++ b/js/src/tests/ecma_6/Symbol/as-base-value.js @@ -27,9 +27,8 @@ Object.defineProperty(Symbol.prototype, "prop", { set: function (v) { "use strict"; sets++; - assertEq(typeof this, "object"); - assertEq(this instanceof Symbol, true); - assertEq(this.valueOf(), sym); + assertEq(typeof this, "symbol"); + assertEq(this, sym); assertEq(v, "newvalue"); } }); diff --git a/js/src/vm/Interpreter.cpp b/js/src/vm/Interpreter.cpp index 9ad9be37f39..4f6a4243722 100644 --- a/js/src/vm/Interpreter.cpp +++ b/js/src/vm/Interpreter.cpp @@ -282,11 +282,8 @@ SetPropertyOperation(JSContext* cx, JSOp op, HandleValue lval, HandleId id, Hand if (!obj) return false; - // Note: ES6 specifies that the value lval, not obj, is passed as receiver - // to obj's [[Set]] internal method. See bug 603201. - RootedValue receiver(cx, ObjectValue(*obj)); ObjectOpResult result; - return SetProperty(cx, obj, id, rval, receiver, result) && + return SetProperty(cx, obj, id, rval, lval, result) && result.checkStrictErrorOrWarning(cx, obj, id, op == JSOP_STRICTSETPROP); } @@ -1409,9 +1406,9 @@ ModOperation(JSContext* cx, HandleValue lhs, HandleValue rhs, MutableHandleValue } static MOZ_ALWAYS_INLINE bool -SetObjectElementOperation(JSContext* cx, HandleObject obj, HandleValue receiver, HandleId id, - const Value& value, bool strict, JSScript* script = nullptr, - jsbytecode* pc = nullptr) +SetObjectElementOperation(JSContext* cx, HandleObject obj, HandleId id, HandleValue value, + HandleValue receiver, bool strict, + JSScript* script = nullptr, jsbytecode* pc = nullptr) { // receiver != obj happens only at super[expr], where we expect to find the property // People probably aren't building hashtables with |super| anyway. @@ -1430,9 +1427,8 @@ SetObjectElementOperation(JSContext* cx, HandleObject obj, HandleValue receiver, if (obj->isNative() && !JSID_IS_INT(id) && !obj->setHadElementsAccess(cx)) return false; - RootedValue tmp(cx, value); ObjectOpResult result; - return SetProperty(cx, obj, id, tmp, receiver, result) && + return SetProperty(cx, obj, id, value, receiver, result) && result.checkStrictErrorOrWarning(cx, obj, id, strict); } @@ -2677,13 +2673,15 @@ CASE(JSOP_STRICTSETELEM) { static_assert(JSOP_SETELEM_LENGTH == JSOP_STRICTSETELEM_LENGTH, "setelem and strictsetelem must be the same size"); + HandleValue receiver = REGS.stackHandleAt(-3); ReservedRooted obj(&rootObject0); - FETCH_OBJECT(cx, -3, obj); + obj = ToObjectFromStack(cx, receiver); + if (!obj) + goto error; ReservedRooted id(&rootId0); FETCH_ELEMENT_ID(-2, id); - Value& value = REGS.sp[-1]; - ReservedRooted receiver(&rootValue0, ObjectValue(*obj)); - if (!SetObjectElementOperation(cx, obj, receiver, id, value, *REGS.pc == JSOP_STRICTSETELEM)) + HandleValue value = REGS.stackHandleAt(-1); + if (!SetObjectElementOperation(cx, obj, id, value, receiver, *REGS.pc == JSOP_STRICTSETELEM)) goto error; REGS.sp[-3] = value; REGS.sp -= 2; @@ -2700,10 +2698,10 @@ CASE(JSOP_STRICTSETELEM_SUPER) FETCH_ELEMENT_ID(-4, id); ReservedRooted receiver(&rootValue0, REGS.sp[-3]); ReservedRooted obj(&rootObject1, ®S.sp[-2].toObject()); - Value& value = REGS.sp[-1]; + HandleValue value = REGS.stackHandleAt(-1); bool strict = JSOp(*REGS.pc) == JSOP_STRICTSETELEM_SUPER; - if (!SetObjectElementOperation(cx, obj, receiver, id, value, strict)) + if (!SetObjectElementOperation(cx, obj, id, value, receiver, strict)) goto error; REGS.sp[-4] = value; REGS.sp -= 3; @@ -4333,7 +4331,7 @@ js::SetObjectElement(JSContext* cx, HandleObject obj, HandleValue index, HandleV if (!ToPropertyKey(cx, index, &id)) return false; RootedValue receiver(cx, ObjectValue(*obj)); - return SetObjectElementOperation(cx, obj, receiver, id, value, strict); + return SetObjectElementOperation(cx, obj, id, value, receiver, strict); } bool @@ -4345,7 +4343,18 @@ js::SetObjectElement(JSContext* cx, HandleObject obj, HandleValue index, HandleV if (!ToPropertyKey(cx, index, &id)) return false; RootedValue receiver(cx, ObjectValue(*obj)); - return SetObjectElementOperation(cx, obj, receiver, id, value, strict, script, pc); + return SetObjectElementOperation(cx, obj, id, value, receiver, strict, script, pc); +} + +bool +js::SetObjectElement(JSContext* cx, HandleObject obj, HandleValue index, HandleValue value, + HandleValue receiver, bool strict, HandleScript script, jsbytecode* pc) +{ + MOZ_ASSERT(pc); + RootedId id(cx); + if (!ToPropertyKey(cx, index, &id)) + return false; + return SetObjectElementOperation(cx, obj, id, value, receiver, strict, script, pc); } bool diff --git a/js/src/vm/Interpreter.h b/js/src/vm/Interpreter.h index a77ac4453f6..ecdb0f83738 100644 --- a/js/src/vm/Interpreter.h +++ b/js/src/vm/Interpreter.h @@ -369,6 +369,10 @@ bool SetObjectElement(JSContext* cx, HandleObject obj, HandleValue index, HandleValue value, bool strict, HandleScript script, jsbytecode* pc); +bool +SetObjectElement(JSContext* cx, HandleObject obj, HandleValue index, HandleValue value, + HandleValue receiver, bool strict, HandleScript script, jsbytecode* pc); + bool InitElementArray(JSContext* cx, jsbytecode* pc, HandleObject obj, uint32_t index, HandleValue value); From ead71b02e51e6c1ff35459d814414239039d4046 Mon Sep 17 00:00:00 2001 From: Milan Sreckovic Date: Mon, 18 Jan 2016 11:32:41 -0500 Subject: [PATCH 036/119] Bug 1239835: Do nothing when rectangle given to ClearRect has zero width or height. (Also mixing in some minor white space changes while in the file.) r=dholbert --- dom/canvas/CanvasRenderingContext2D.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/dom/canvas/CanvasRenderingContext2D.cpp b/dom/canvas/CanvasRenderingContext2D.cpp index 819b03015c8..105fbbfdd13 100644 --- a/dom/canvas/CanvasRenderingContext2D.cpp +++ b/dom/canvas/CanvasRenderingContext2D.cpp @@ -2488,8 +2488,11 @@ CanvasRenderingContext2D::UpdateFilter() // static bool -ValidateRect(double& aX, double& aY, double& aWidth, double& aHeight) +ValidateRect(double& aX, double& aY, double& aWidth, double& aHeight, bool aIsZeroSizeValid) { + if (!aIsZeroSizeValid && (aWidth == 0.0 || aHeight == 0.0)) { + return false; + } // bug 1018527 // The values of canvas API input are in double precision, but Moz2D APIs are @@ -2520,7 +2523,8 @@ void CanvasRenderingContext2D::ClearRect(double x, double y, double w, double h) { - if(!ValidateRect(x, y, w, h)) { + // Do not allow zeros - it's a no-op at that point per spec. + if (!ValidateRect(x, y, w, h, false)) { return; } @@ -2537,7 +2541,7 @@ CanvasRenderingContext2D::FillRect(double x, double y, double w, { const ContextState &state = CurrentState(); - if(!ValidateRect(x, y, w, h)) { + if (!ValidateRect(x, y, w, h, true)) { return; } @@ -2615,7 +2619,7 @@ CanvasRenderingContext2D::StrokeRect(double x, double y, double w, return; } - if(!ValidateRect(x, y, w, h)) { + if (!ValidateRect(x, y, w, h, true)) { return; } @@ -2804,7 +2808,7 @@ void CanvasRenderingContext2D::DrawFocusIfNeeded(mozilla::dom::Element& aElement return; } - if(DrawCustomFocusRing(aElement)) { + if (DrawCustomFocusRing(aElement)) { Save(); // set state to conforming focus state @@ -3051,7 +3055,7 @@ void CanvasRenderingContext2D::EnsureUserSpacePath(const CanvasWindingRule& winding) { FillRule fillRule = CurrentState().fillRule; - if(winding == CanvasWindingRule::Evenodd) + if (winding == CanvasWindingRule::Evenodd) fillRule = FillRule::FILL_EVEN_ODD; EnsureTarget(); @@ -3342,7 +3346,7 @@ CanvasRenderingContext2D::AddHitRegion(const HitRegionOptions& options, ErrorRes path = mPath; } - if(!path) { + if (!path) { error.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR); return; } @@ -4396,8 +4400,8 @@ CanvasRenderingContext2D::DrawImage(const CanvasImageSource& image, MOZ_ASSERT(optional_argc == 0 || optional_argc == 2 || optional_argc == 6); if (optional_argc == 6) { - if (!ValidateRect(sx, sy, sw, sh) || - !ValidateRect(dx, dy, dw, dh)) { + if (!ValidateRect(sx, sy, sw, sh, true) || + !ValidateRect(dx, dy, dw, dh, true)) { return; } } From 2a4a84fa8000d4c00d028851a7e3d21e868b6a52 Mon Sep 17 00:00:00 2001 From: Maja Frydrychowicz Date: Thu, 14 Jan 2016 10:21:50 -0500 Subject: [PATCH 037/119] Bug 1238996 - Release marionette-driver 1.2, marionette-transport 1.1, and marionette-client 2.1; r=automatedtester --- testing/marionette/client/marionette/__init__.py | 2 +- testing/marionette/client/requirements.txt | 2 +- testing/marionette/driver/marionette_driver/__init__.py | 2 +- testing/marionette/driver/requirements.txt | 2 +- testing/marionette/transport/marionette_transport/__init__.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/testing/marionette/client/marionette/__init__.py b/testing/marionette/client/marionette/__init__.py index cda1e0d5550..ef3445003d7 100644 --- a/testing/marionette/client/marionette/__init__.py +++ b/testing/marionette/client/marionette/__init__.py @@ -2,7 +2,7 @@ # 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/. -__version__ = '2.0.0' +__version__ = '2.1.0' from .marionette_test import ( CommonTestCase, diff --git a/testing/marionette/client/requirements.txt b/testing/marionette/client/requirements.txt index 67dce7b022c..5dc1cfc07a4 100644 --- a/testing/marionette/client/requirements.txt +++ b/testing/marionette/client/requirements.txt @@ -1,4 +1,4 @@ -marionette-driver >= 1.1.1 +marionette-driver >= 1.2.0 browsermob-proxy >= 0.6.0 manifestparser >= 1.1 wptserve >= 1.3.0 diff --git a/testing/marionette/driver/marionette_driver/__init__.py b/testing/marionette/driver/marionette_driver/__init__.py index f3a03679b9f..8cfaa201da5 100644 --- a/testing/marionette/driver/marionette_driver/__init__.py +++ b/testing/marionette/driver/marionette_driver/__init__.py @@ -2,7 +2,7 @@ # 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/. -__version__ = '1.1.1' +__version__ = '1.2.0' from marionette_driver import ( addons, diff --git a/testing/marionette/driver/requirements.txt b/testing/marionette/driver/requirements.txt index 44f895e7865..d104bda4baa 100644 --- a/testing/marionette/driver/requirements.txt +++ b/testing/marionette/driver/requirements.txt @@ -1,2 +1,2 @@ -marionette-transport == 1.0.0 +marionette-transport == 1.1.0 mozrunner >= 6.9 diff --git a/testing/marionette/transport/marionette_transport/__init__.py b/testing/marionette/transport/marionette_transport/__init__.py index da9d39fb9c4..4433219d4ea 100644 --- a/testing/marionette/transport/marionette_transport/__init__.py +++ b/testing/marionette/transport/marionette_transport/__init__.py @@ -2,6 +2,6 @@ # 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/ -__version__ = '1.0.0' +__version__ = '1.1.0' from transport import * From 8138e54f00a68c2342bc624a178a88292fd21e2d Mon Sep 17 00:00:00 2001 From: Nicolas Silva Date: Tue, 19 Jan 2016 18:36:36 +0100 Subject: [PATCH 038/119] Bug 1180942 - Use cairo's image backend for drawing on linux. r=jrmuizel --- dom/canvas/test/test_canvas.html | 17 +---------------- gfx/thebes/gfxPrefs.h | 2 +- layout/reftests/border-image/reftest.list | 2 +- layout/reftests/border-radius/reftest.list | 8 ++++---- layout/reftests/forms/input/color/reftest.list | 2 +- layout/reftests/svg/reftest.list | 2 +- layout/reftests/text/reftest.list | 2 +- ...nvas_complexshapes_beziercurveto_001.htm.ini | 4 ++++ .../path-objects/2d.path.arc.shape.1.html.ini | 9 --------- 9 files changed, 14 insertions(+), 34 deletions(-) delete mode 100644 testing/web-platform/meta/2dcontext/path-objects/2d.path.arc.shape.1.html.ini diff --git a/dom/canvas/test/test_canvas.html b/dom/canvas/test/test_canvas.html index a8b67b3e209..3f64b6f5044 100644 --- a/dom/canvas/test/test_canvas.html +++ b/dom/canvas/test/test_canvas.html @@ -11265,22 +11265,7 @@ isPixel(ctx, 50,25, 0,255,0,255, 0); isPixel(ctx, 1,1, 0,255,0,255, 0); isPixel(ctx, 98,1, 0,255,0,255, 0); isPixel(ctx, 1,48, 0,255,0,255, 0); -// Fails on Linux with Azure/Cairo only -// The arc is drawn badly due to Cairo limitations, the error only becomes -// apparent on Linux because of anti-aliasing, probably due to X. -// The limitation is that Cairo draws arcs by stroking perpendicular to the arc, -// and at very large stroke thicknesses, this becomes a fan. Where exactly the -// 'blades' of the fan appear seems to depend on exactly how the arc is defined -// and the platform. So if the blades of the fan are where pixels are tested it -// passes the test, if the testing pixels fall in between the blades, then we fail. -// With Thebes/Cairo, we were rendering wrong, but got lucky with the test, now -// we are not so lucky. -// Bug 764125 -if (IsAzureCairo() && IsLinux()) { - todo_isPixel(ctx, 20,48, 0,255,0,255, 0); -} else { - isPixel(ctx, 20,48, 0,255,0,255, 0); -} +isPixel(ctx, 20,48, 0,255,0,255, 0); isPixel(ctx, 98,48, 0,255,0,255, 0); } diff --git a/gfx/thebes/gfxPrefs.h b/gfx/thebes/gfxPrefs.h index 1f603fee7df..e27a4b7db4e 100644 --- a/gfx/thebes/gfxPrefs.h +++ b/gfx/thebes/gfxPrefs.h @@ -373,7 +373,7 @@ private: DECL_GFX_PREF(Once, "layers.tiles.edge-padding", TileEdgePaddingEnabled, bool, true); DECL_GFX_PREF(Live, "layers.transaction.warning-ms", LayerTransactionWarning, uint32_t, 200); DECL_GFX_PREF(Once, "layers.uniformity-info", UniformityInfo, bool, false); - DECL_GFX_PREF(Once, "layers.use-image-offscreen-surfaces", UseImageOffscreenSurfaces, bool, false); + DECL_GFX_PREF(Once, "layers.use-image-offscreen-surfaces", UseImageOffscreenSurfaces, bool, true); DECL_GFX_PREF(Live, "layers.single-tile.enabled", LayersSingleTileEnabled, bool, true); DECL_GFX_PREF(Live, "layout.css.scroll-behavior.damping-ratio", ScrollBehaviorDampingRatio, float, 1.0f); diff --git a/layout/reftests/border-image/reftest.list b/layout/reftests/border-image/reftest.list index 67a3aedd4e4..54453f2fb0e 100644 --- a/layout/reftests/border-image/reftest.list +++ b/layout/reftests/border-image/reftest.list @@ -54,7 +54,7 @@ fuzzy(1,12) == border-image-linear-gradient-repeat-repeat-1.html border-image-li fuzzy(1,13) == border-image-linear-gradient-repeat-round-1.html border-image-linear-gradient-repeat-round-1-ref.html == border-image-linear-gradient-repeat-repeat-2.html border-image-linear-gradient-repeat-repeat-2-ref.html fuzzy(1,576) == border-image-linear-gradient-repeat-round-2.html border-image-linear-gradient-repeat-round-2-ref.html -fuzzy(1,6440) == border-image-linear-gradient-repeat-repeat-3.html border-image-linear-gradient-repeat-repeat-3-ref.html +fuzzy(1,8533) == border-image-linear-gradient-repeat-repeat-3.html border-image-linear-gradient-repeat-repeat-3-ref.html fuzzy(1,7161) == border-image-linear-gradient-repeat-round-3.html border-image-linear-gradient-repeat-round-3-ref.html == border-image-radial-gradient.html border-image-radial-gradient-ref.html diff --git a/layout/reftests/border-radius/reftest.list b/layout/reftests/border-radius/reftest.list index 7bdb35dca37..ccff157ca61 100644 --- a/layout/reftests/border-radius/reftest.list +++ b/layout/reftests/border-radius/reftest.list @@ -24,12 +24,12 @@ # more serious tests, using SVG reference == border-circle-2.html border-circle-2-ref.xhtml -fuzzy-if(gtkWidget,7,437) fuzzy-if(cocoaWidget,4,582) fuzzy-if(Android||B2G,36,264) fuzzy-if(d2d,51,323) fuzzy-if(winWidget&&!d2d,16,377) == curved-stripe-border.html curved-stripe-border-ref.svg # bug 459945 +fuzzy-if(gtkWidget,14,280) fuzzy-if(cocoaWidget,4,582) fuzzy-if(Android||B2G,36,264) fuzzy-if(d2d,51,323) fuzzy-if(winWidget&&!d2d,16,377) == curved-stripe-border.html curved-stripe-border-ref.svg # bug 459945 # Corners == corner-1.html corner-1-ref.svg # bottom corners different radius than top corners -fuzzy-if(winWidget&&!d2d,23,5) fuzzy-if(d2d,32,8) fuzzy-if(Android||B2G,10,8) == corner-2.html corner-2-ref.svg # right corners different radius than left corners; see bug 500804 -fuzzy-if(winWidget&&!d2d,3,10) fuzzy-if(d2d,15,32) fuzzy-if(Android||B2G,3,15) == corner-3.html corner-3-ref.svg +fuzzy-if(gtkWidget,23,5) fuzzy-if(winWidget&&!d2d,23,5) fuzzy-if(d2d,32,8) fuzzy-if(Android||B2G,10,8) == corner-2.html corner-2-ref.svg # right corners different radius than left corners; see bug 500804 +fuzzy-if(gtkWidget,3,10) fuzzy-if(winWidget&&!d2d,3,10) fuzzy-if(d2d,15,32) fuzzy-if(Android||B2G,3,15) == corner-3.html corner-3-ref.svg == corner-4.html corner-4-ref.svg # Test that radii too long are reduced @@ -87,7 +87,7 @@ skip-if(B2G||Mulet) fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu)||/^Windo == iframe-1.html iframe-1-ref.html # Test for antialiasing gaps between background and border -fuzzy-if(winWidget&&!d2d,1,9) fuzzy-if(d2d,5,40) fuzzy-if(Android||B2G,1,5) == curved-border-background-nogap.html curved-border-background-nogap-ref.html +fuzzy-if(gtkWidget,1,9) fuzzy-if(winWidget&&!d2d,1,9) fuzzy-if(d2d,5,40) fuzzy-if(Android||B2G,1,5) == curved-border-background-nogap.html curved-border-background-nogap-ref.html == color-layer-1a.html color-layer-1-ref.html diff --git a/layout/reftests/forms/input/color/reftest.list b/layout/reftests/forms/input/color/reftest.list index 48c8e11edcb..0a263064d06 100644 --- a/layout/reftests/forms/input/color/reftest.list +++ b/layout/reftests/forms/input/color/reftest.list @@ -9,6 +9,6 @@ default-preferences pref(dom.forms.color,true) fails-if(B2G||Mulet||Android) == margin-padding-1.html margin-padding-1-ref.html # Initial mulet triage: parity with B2G/B2G Desktop == block-invalidate-1.html block-invalidate-1-ref.html == block-invalidate-2.html block-invalidate-2-ref.html -fails-if(B2G||Mulet||Android) == transformations-1.html transformations-1-ref.html # Initial mulet triage: parity with B2G/B2G Desktop +fuzzy-if(gtkWidget,8,33) fails-if(B2G||Mulet||Android) == transformations-1.html transformations-1-ref.html # Initial mulet triage: parity with B2G/B2G Desktop fails-if(B2G||Mulet||Android) == custom-style-1.html custom-style-1-ref.html # Initial mulet triage: parity with B2G/B2G Desktop fails-if(B2G||Mulet||Android) == custom-style-2.html custom-style-2-ref.html # Initial mulet triage: parity with B2G/B2G Desktop diff --git a/layout/reftests/svg/reftest.list b/layout/reftests/svg/reftest.list index 14897338dfa..212c59c198a 100644 --- a/layout/reftests/svg/reftest.list +++ b/layout/reftests/svg/reftest.list @@ -222,7 +222,7 @@ pref(layout.css.masking.enabled,true) fuzzy-if(d2d,1,6400) == mask-type-04.svg m == nested-viewBox-01.svg pass.svg == nesting-invalid-01.svg nesting-invalid-01-ref.svg fuzzy-if(d2d&&/^Windows\x20NT\x20(6\.1|10\.0)/.test(http.oscpu),63,168) fuzzy-if(cocoaWidget,1,122) == non-scaling-stroke-01.svg non-scaling-stroke-01-ref.svg # bug 1074161 for Win7 and OSX 10.8 -fuzzy-if(!contentSameGfxBackendAsCanvas,9,99) fuzzy-if(Android||B2G,9,586) == non-scaling-stroke-02.svg non-scaling-stroke-02-ref.svg +fuzzy-if(gtkWidget,1,99) fuzzy-if(!contentSameGfxBackendAsCanvas,9,99) fuzzy-if(Android||B2G,9,586) == non-scaling-stroke-02.svg non-scaling-stroke-02-ref.svg == non-scaling-stroke-03.svg non-scaling-stroke-03-ref.svg == objectBoundingBox-and-clipPath.svg pass.svg # Bug 588684 diff --git a/layout/reftests/text/reftest.list b/layout/reftests/text/reftest.list index fab1274ef91..a41999759fb 100644 --- a/layout/reftests/text/reftest.list +++ b/layout/reftests/text/reftest.list @@ -123,7 +123,7 @@ fails HTTP(..) == wordbreak-7b.html wordbreak-7b-ref.html # bug 479829 pref(gfx.font_rendering.graphite.enabled,true) HTTP(..) == wordbreak-9.html wordbreak-9-ref.html == wordwrap-01.html wordwrap-01-ref.html HTTP(..) == wordwrap-02.html wordwrap-02-ref.html -skip-if(B2G||Mulet) HTTP(..) == wordwrap-03.html wordwrap-03-ref.html # Initial mulet triage: parity with B2G/B2G Desktop +fuzzy-if(gtkWidget,1,44) skip-if(B2G||Mulet) HTTP(..) == wordwrap-03.html wordwrap-03-ref.html # Initial mulet triage: parity with B2G/B2G Desktop == wordwrap-04.html wordwrap-04-ref.html == wordwrap-05.html wordwrap-05-ref.html == wordwrap-06.html wordwrap-06-ref.html diff --git a/testing/web-platform/meta/2dcontext/building-paths/canvas_complexshapes_beziercurveto_001.htm.ini b/testing/web-platform/meta/2dcontext/building-paths/canvas_complexshapes_beziercurveto_001.htm.ini index 419938ab332..de46cf635e8 100644 --- a/testing/web-platform/meta/2dcontext/building-paths/canvas_complexshapes_beziercurveto_001.htm.ini +++ b/testing/web-platform/meta/2dcontext/building-paths/canvas_complexshapes_beziercurveto_001.htm.ini @@ -1,6 +1,10 @@ [canvas_complexshapes_beziercurveto_001.htm] type: reftest expected: + if not debug and (os == "linux") and (version == "Ubuntu 12.04") and (processor == "x86") and (bits == 32): FAIL + if not debug and (os == "linux") and (version == "Ubuntu 12.04") and (processor == "x86_64") and (bits == 64): FAIL + if debug and (os == "linux") and (version == "Ubuntu 12.04") and (processor == "x86_64") and (bits == 64): FAIL + if debug and (os == "linux") and (version == "Ubuntu 12.04") and (processor == "x86") and (bits == 32): FAIL if not debug and (os == "mac") and (version == "OS X 10.8") and (processor == "x86_64") and (bits == 64): FAIL if not debug and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL if not debug and (os == "mac") and (version == "OS X 10.10.2") and (processor == "x86") and (bits == 32): FAIL diff --git a/testing/web-platform/meta/2dcontext/path-objects/2d.path.arc.shape.1.html.ini b/testing/web-platform/meta/2dcontext/path-objects/2d.path.arc.shape.1.html.ini deleted file mode 100644 index b27dcaf7fa9..00000000000 --- a/testing/web-platform/meta/2dcontext/path-objects/2d.path.arc.shape.1.html.ini +++ /dev/null @@ -1,9 +0,0 @@ -[2d.path.arc.shape.1.html] - type: testharness - [arc() from 0 to pi does not draw anything in the wrong half] - expected: - if not debug and (os == "linux") and (version == "Ubuntu 12.04") and (processor == "x86") and (bits == 32): FAIL - if not debug and (os == "linux") and (version == "Ubuntu 12.04") and (processor == "x86_64") and (bits == 64): FAIL - if debug and (os == "linux") and (version == "Ubuntu 12.04") and (processor == "x86_64") and (bits == 64): FAIL - if debug and (os == "linux") and (version == "Ubuntu 12.04") and (processor == "x86") and (bits == 32): FAIL - From 375197b0a6e09028b37f37058452f8e2a19d7c51 Mon Sep 17 00:00:00 2001 From: Christoph Kerschbaumer Date: Tue, 19 Jan 2016 09:10:50 -0800 Subject: [PATCH 039/119] Bug 1239397: Send Internal ContentPolicyType to CSP and MixedContent (r=sicking) --- dom/base/nsContentPolicy.cpp | 29 ++----------------- dom/base/nsContentUtils.cpp | 40 -------------------------- dom/base/nsContentUtils.h | 27 ----------------- dom/security/nsCSPService.cpp | 8 ------ dom/security/nsMixedContentBlocker.cpp | 10 ++----- 5 files changed, 6 insertions(+), 108 deletions(-) diff --git a/dom/base/nsContentPolicy.cpp b/dom/base/nsContentPolicy.cpp index 9a2ee818122..33faadbdd52 100644 --- a/dom/base/nsContentPolicy.cpp +++ b/dom/base/nsContentPolicy.cpp @@ -116,12 +116,6 @@ nsContentPolicy::CheckPolicy(CPMethod policyMethod, nsContentPolicyType externalType = nsContentUtils::InternalContentPolicyTypeToExternal(contentType); - nsContentPolicyType externalTypeOrMCBInternal = - nsContentUtils::InternalContentPolicyTypeToExternalOrMCBInternal(contentType); - - nsContentPolicyType externalTypeOrCSPInternal = - nsContentUtils::InternalContentPolicyTypeToExternalOrCSPInternal(contentType); - nsCOMPtr mixedContentBlocker = do_GetService(NS_MIXEDCONTENTBLOCKER_CONTRACTID); @@ -138,27 +132,10 @@ nsContentPolicy::CheckPolicy(CPMethod policyMethod, int32_t count = entries.Count(); for (int32_t i = 0; i < count; i++) { /* check the appropriate policy */ - // Send the internal content policy type to the mixed content blocker - // which needs to know about TYPE_INTERNAL_WORKER, - // TYPE_INTERNAL_SHARED_WORKER and TYPE_INTERNAL_SERVICE_WORKER - // and also preloads: TYPE_INTERNAL_SCRIPT_PRELOAD, - // TYPE_INTERNAL_IMAGE_PRELOAD, TYPE_INTERNAL_STYLESHEET_PRELOAD - bool isMixedContentBlocker = mixedContentBlocker == entries[i]; + // Send internal content policy type to CSP and mixed content blocker nsContentPolicyType type = externalType; - if (isMixedContentBlocker) { - type = externalTypeOrMCBInternal; - } - // Send the internal content policy type for CSP which needs to - // know about preloads and workers, in particular: - // * TYPE_INTERNAL_SCRIPT_PRELOAD - // * TYPE_INTERNAL_IMAGE_PRELOAD - // * TYPE_INTERNAL_STYLESHEET_PRELOAD - // * TYPE_INTERNAL_WORKER - // * TYPE_INTERNAL_SHARED_WORKER - // * TYPE_INTERNAL_SERVICE_WORKER - bool isCSP = cspService == entries[i]; - if (isCSP) { - type = externalTypeOrCSPInternal; + if (mixedContentBlocker == entries[i] || cspService == entries[i]) { + type = contentType; } rv = (entries[i]->*policyMethod)(type, contentLocation, requestingLocation, requestingContext, diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp index ba7aacb7f84..d9a804b6ed7 100644 --- a/dom/base/nsContentUtils.cpp +++ b/dom/base/nsContentUtils.cpp @@ -8035,35 +8035,6 @@ nsContentUtils::InternalContentPolicyTypeToExternal(nsContentPolicyType aType) } } -/* static */ -nsContentPolicyType -nsContentUtils::InternalContentPolicyTypeToExternalOrMCBInternal(nsContentPolicyType aType) -{ - switch (aType) { - case nsIContentPolicy::TYPE_INTERNAL_SCRIPT: - case nsIContentPolicy::TYPE_INTERNAL_WORKER: - case nsIContentPolicy::TYPE_INTERNAL_SHARED_WORKER: - case nsIContentPolicy::TYPE_INTERNAL_SERVICE_WORKER: - return aType; - - default: - return InternalContentPolicyTypeToExternalOrPreload(aType); - } -} - -/* static */ -nsContentPolicyType -nsContentUtils::InternalContentPolicyTypeToExternalOrPreload(nsContentPolicyType aType) -{ - if (aType == nsIContentPolicy::TYPE_INTERNAL_SCRIPT_PRELOAD || - aType == nsIContentPolicy::TYPE_INTERNAL_IMAGE_PRELOAD || - aType == nsIContentPolicy::TYPE_INTERNAL_STYLESHEET_PRELOAD) { - return aType; - } - return InternalContentPolicyTypeToExternal(aType); -} - - /* static */ nsContentPolicyType nsContentUtils::InternalContentPolicyTypeToExternalOrWorker(nsContentPolicyType aType) @@ -8091,17 +8062,6 @@ nsContentUtils::IsPreloadType(nsContentPolicyType aType) return false; } -/* static */ -nsContentPolicyType -nsContentUtils::InternalContentPolicyTypeToExternalOrCSPInternal(nsContentPolicyType aType) -{ - if (aType == InternalContentPolicyTypeToExternalOrWorker(aType) || - aType == InternalContentPolicyTypeToExternalOrPreload(aType)) { - return aType; - } - return InternalContentPolicyTypeToExternal(aType); -} - nsresult nsContentUtils::SetFetchReferrerURIWithPolicy(nsIPrincipal* aPrincipal, nsIDocument* aDoc, diff --git a/dom/base/nsContentUtils.h b/dom/base/nsContentUtils.h index 8636a79785f..913f8e4579e 100644 --- a/dom/base/nsContentUtils.h +++ b/dom/base/nsContentUtils.h @@ -985,20 +985,6 @@ public: */ static nsContentPolicyType InternalContentPolicyTypeToExternal(nsContentPolicyType aType); - /** - * Map internal content policy types to external ones or script types or preload types: - * * TYPE_INTERNAL_SCRIPT - * * TYPE_INTERNAL_WORKER - * * TYPE_INTERNAL_SHARED_WORKER - * * TYPE_INTERNAL_SERVICE_WORKER - * * TYPE_INTERNAL_SCRIPT_PRELOAD - * * TYPE_INTERNAL_IMAGE_PRELOAD - * * TYPE_INTERNAL_STYLESHEET_PRELOAD - * - * Note: DO NOT call this function unless you know what you're doing! - */ - static nsContentPolicyType InternalContentPolicyTypeToExternalOrMCBInternal(nsContentPolicyType aType); - /** * Map internal content policy types to external ones or preload types: * * TYPE_INTERNAL_SCRIPT_PRELOAD @@ -1009,19 +995,6 @@ public: */ static nsContentPolicyType InternalContentPolicyTypeToExternalOrPreload(nsContentPolicyType aType); - /** - * Map internal content policy types to external ones, worker, or preload types: - * * TYPE_INTERNAL_WORKER - * * TYPE_INTERNAL_SHARED_WORKER - * * TYPE_INTERNAL_SERVICE_WORKER - * * TYPE_INTERNAL_SCRIPT_PRELOAD - * * TYPE_INTERNAL_IMAGE_PRELOAD - * * TYPE_INTERNAL_STYLESHEET_PRELOAD - * - * Note: DO NOT call this function unless you know what you're doing! - */ - static nsContentPolicyType InternalContentPolicyTypeToExternalOrCSPInternal(nsContentPolicyType aType); - /** * Map internal content policy types to external ones, worker, or preload types: * * TYPE_INTERNAL_WORKER diff --git a/dom/security/nsCSPService.cpp b/dom/security/nsCSPService.cpp index ecb67f80930..a4979306372 100644 --- a/dom/security/nsCSPService.cpp +++ b/dom/security/nsCSPService.cpp @@ -102,10 +102,6 @@ CSPService::ShouldLoad(uint32_t aContentType, nsIPrincipal *aRequestPrincipal, int16_t *aDecision) { - MOZ_ASSERT(aContentType == - nsContentUtils::InternalContentPolicyTypeToExternalOrCSPInternal(aContentType), - "We should only see external content policy types or CSP special types (preloads or workers) here."); - if (!aContentLocation) { return NS_ERROR_FAILURE; } @@ -209,10 +205,6 @@ CSPService::ShouldProcess(uint32_t aContentType, nsIPrincipal *aRequestPrincipal, int16_t *aDecision) { - MOZ_ASSERT(aContentType == - nsContentUtils::InternalContentPolicyTypeToExternalOrCSPInternal(aContentType), - "We should only see external content policy types or preloads here."); - if (!aContentLocation) return NS_ERROR_FAILURE; diff --git a/dom/security/nsMixedContentBlocker.cpp b/dom/security/nsMixedContentBlocker.cpp index a394dfe8cc9..2dda70a7ccf 100644 --- a/dom/security/nsMixedContentBlocker.cpp +++ b/dom/security/nsMixedContentBlocker.cpp @@ -310,7 +310,7 @@ nsMixedContentBlocker::AsyncOnChannelRedirect(nsIChannel* aOldChannel, } int16_t decision = REJECT_REQUEST; - rv = ShouldLoad(nsContentUtils::InternalContentPolicyTypeToExternalOrMCBInternal(contentPolicyType), + rv = ShouldLoad(contentPolicyType, newUri, requestingLocation, loadInfo->LoadingNode(), @@ -378,10 +378,7 @@ nsMixedContentBlocker::ShouldLoad(bool aHadInsecureImageRedirect, // to them. MOZ_ASSERT(NS_IsMainThread()); - MOZ_ASSERT(aContentType == nsContentUtils::InternalContentPolicyTypeToExternalOrMCBInternal(aContentType), - "We should only see external content policy types here."); - - bool isPreload = nsContentUtils::IsPreloadType(aContentType); + bool isPreload = nsContentUtils::IsPreloadType(aContentType); // The content policy type that we receive may be an internal type for // scripts. Let's remember if we have seen a worker type, and reset it to the @@ -897,8 +894,7 @@ nsMixedContentBlocker::ShouldProcess(uint32_t aContentType, nsIPrincipal* aRequestPrincipal, int16_t* aDecision) { - MOZ_ASSERT(aContentType == nsContentUtils::InternalContentPolicyTypeToExternal(aContentType), - "We should only see external content policy types here."); + aContentType = nsContentUtils::InternalContentPolicyTypeToExternal(aContentType); if (!aContentLocation) { // aContentLocation may be null when a plugin is loading without an associated URI resource From 9f9cfa0e222047fabafb9bc84e5cfabbcb4d97b7 Mon Sep 17 00:00:00 2001 From: Sebastian Hengst Date: Tue, 19 Jan 2016 19:01:53 +0100 Subject: [PATCH 040/119] Backed out changeset 4f090efcb1b6 (bug 1232335) for failing modified test due to calling undefined function. r=bustage --- dom/media/test/manifest.js | 3 +-- dom/media/test/test_can_play_type_mpeg.html | 13 +++---------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/dom/media/test/manifest.js b/dom/media/test/manifest.js index 88da24fa794..e7c7a07af7f 100644 --- a/dom/media/test/manifest.js +++ b/dom/media/test/manifest.js @@ -507,8 +507,7 @@ var gUnseekableTests = [ ]; var androidVersion = -1; // non-Android platforms -if (manifestNavigator().userAgent.indexOf("Mobile") != -1 || - manifestNavigator().userAgent.indexOf("Tablet") != -1) { +if (manifestNavigator().userAgent.indexOf("Mobile") != -1) { // See nsSystemInfo.cpp, the getProperty('version') returns different value // on each platforms, so we need to distinguish the android and B2G platform. var versionString = manifestNavigator().userAgent.indexOf("Android") != -1 ? diff --git a/dom/media/test/test_can_play_type_mpeg.html b/dom/media/test/test_can_play_type_mpeg.html index eced0790a84..cd1e2196d36 100644 --- a/dom/media/test/test_can_play_type_mpeg.html +++ b/dom/media/test/test_can_play_type_mpeg.html @@ -124,18 +124,13 @@ function getPref(name) { return pref; } -function IsSupportedAndroid() { - return getAndroidVersion() >= 14; -} - function IsJellyBeanOrLater() { - return getAndroidVersion() >= 16; + return androidVersion >= 16; } var haveMp4 = (getPref("media.wmf.enabled") && IsWindowsVistaOrLater()) || IsMacOSSnowLeopardOrLater() || - (IsAndroid() && - (IsJellyBeanOrLater() || getPref("media.plugins.enabled"))) || + IsJellyBeanOrLater() || getPref("media.omx.enabled") || (IsLinux() && getPref("media.ffmpeg.enabled")); @@ -143,10 +138,8 @@ check_mp4(document.getElementById('v'), haveMp4); var haveMp3 = getPref("media.directshow.enabled") || (getPref("media.wmf.enabled") && IsWindowsVistaOrLater()) || + (IsJellyBeanOrLater() && getPref("media.android-media-codec.enabled")) || (IsLinux() && getPref("media.ffmpeg.enabled")) || - (IsSupportedAndroid() && - ((IsJellyBeanOrLater() && getPref("media.android-media-codec.enabled")) || - getPref("media.plugins.enabled"))) || getPref("media.apple.mp3.enabled"); check_mp3(document.getElementById('v'), haveMp3); From 6af9f9c66d1a2ac0284888fda4ac8ce2ca32037e Mon Sep 17 00:00:00 2001 From: Nick Alexander Date: Wed, 18 Nov 2015 15:55:13 -0800 Subject: [PATCH 041/119] Bug 1240615 - Make PushService protocol init method return a Promise. r=kitcambridge I'd like to make `PushService.init` fallible, but it's not obvious how to act on failure. This patch at least allows each service to block _startService until service-specific work initialization is complete. --- dom/push/PushService.jsm | 10 ++++++---- dom/push/PushServiceHttp2.jsm | 2 ++ dom/push/PushServiceWebSocket.jsm | 2 ++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/dom/push/PushService.jsm b/dom/push/PushService.jsm index 58df708b8cb..ae5417a1973 100644 --- a/dom/push/PushService.jsm +++ b/dom/push/PushService.jsm @@ -513,7 +513,7 @@ this.PushService = { console.debug("startService()"); if (this._state != PUSH_SERVICE_ACTIVATING) { - return; + return Promise.reject(); } this._service = service; @@ -523,9 +523,11 @@ this.PushService = { this._db = this._service.newPushDB(); } - this._service.init(options, this, serverURI); - this._startObservers(); - return this._dropExpiredRegistrations(); + return this._service.init(options, this, serverURI) + .then(() => { + this._startObservers(); + return this._dropExpiredRegistrations(); + }); }, /** diff --git a/dom/push/PushServiceHttp2.jsm b/dom/push/PushServiceHttp2.jsm index 10d2112da4c..57d7ad52232 100644 --- a/dom/push/PushServiceHttp2.jsm +++ b/dom/push/PushServiceHttp2.jsm @@ -572,6 +572,8 @@ this.PushServiceHttp2 = { console.debug("init()"); this._mainPushService = aMainPushService; this._serverURI = aServerURL; + + return Promise.resolve(); }, _retryAfterBackoff: function(aSubscriptionUri, retryAfter) { diff --git a/dom/push/PushServiceWebSocket.jsm b/dom/push/PushServiceWebSocket.jsm index 0d443331de1..edf22ff1c5b 100644 --- a/dom/push/PushServiceWebSocket.jsm +++ b/dom/push/PushServiceWebSocket.jsm @@ -299,6 +299,8 @@ this.PushServiceWebSocket = { this._requestTimeout = prefs.get("requestTimeout"); this._adaptiveEnabled = prefs.get('adaptive.enabled'); this._upperLimit = prefs.get('adaptive.upperLimit'); + + return Promise.resolve(); }, _reconnect: function () { From 34ba2acc989f472d8b8b4e1f7d5fa19fdce3364d Mon Sep 17 00:00:00 2001 From: Jim Chen Date: Tue, 19 Jan 2016 13:14:48 -0500 Subject: [PATCH 042/119] Bug 1240506 - Check for null listener in GeckoEditable; r=esawin It's possible for the listener to be null before nsWindow attaches to a GeckoView or after it detaches from a GeckoView. --- .../base/java/org/mozilla/gecko/GeckoEditable.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/mobile/android/base/java/org/mozilla/gecko/GeckoEditable.java b/mobile/android/base/java/org/mozilla/gecko/GeckoEditable.java index 57a0e9c3e79..d92d6e0ed57 100644 --- a/mobile/android/base/java/org/mozilla/gecko/GeckoEditable.java +++ b/mobile/android/base/java/org/mozilla/gecko/GeckoEditable.java @@ -907,7 +907,9 @@ final class GeckoEditable extends JNIObject // Action.TYPE_ACKNOWLEDGE_FOCUS, this line also makes us // wait for Gecko to update us on the newly focused content mActionQueue.syncWithGecko(); - mListener.notifyIME(type); + if (mListener != null) { + mListener.notifyIME(type); + } // Unset mFocused after we call syncWithGecko because // syncWithGecko becomes a no-op when mFocused is false. @@ -947,6 +949,9 @@ final class GeckoEditable extends JNIObject geckoPostToIc(new Runnable() { @Override public void run() { + if (mListener == null) { + return; + } mListener.notifyIMEContext(state, typeHint, modeHint, actionHint); } }); @@ -979,6 +984,9 @@ final class GeckoEditable extends JNIObject geckoPostToIc(new Runnable() { @Override public void run() { + if (mListener == null) { + return; + } mListener.onSelectionChange(newStart, newEnd); } }); @@ -1089,6 +1097,9 @@ final class GeckoEditable extends JNIObject geckoPostToIc(new Runnable() { @Override public void run() { + if (mListener == null) { + return; + } mListener.onTextChange(text, start, oldEnd, newEnd); } }); From 3e392abae720f20e6be5ac0a2828b05cf4b7bac9 Mon Sep 17 00:00:00 2001 From: Jeff Muizelaar Date: Mon, 4 Jan 2016 15:58:27 -0500 Subject: [PATCH 043/119] Bug 1239126. Handle gl_InstanceID attribute with no location. r=jgilbert This patch avoids a crash when querying program info when gl_InstanceID is used. ANGLE will return -1 from GetAttribLocation("gl_InstanceID") (this location is hardcoded in the ANGLE source) but still includes gl_InstanceID in it's attribute list. --- dom/canvas/WebGLProgram.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dom/canvas/WebGLProgram.cpp b/dom/canvas/WebGLProgram.cpp index d30cfe126e2..3f256bcf3f6 100644 --- a/dom/canvas/WebGLProgram.cpp +++ b/dom/canvas/WebGLProgram.cpp @@ -172,10 +172,12 @@ QueryProgramInfo(WebGLProgram* prog, gl::GLContext* gl) // Collect active locations: GLint loc = gl->fGetAttribLocation(prog->mGLName, mappedName.BeginReading()); - if (loc == -1) - MOZ_CRASH("Active attrib has no location."); - - info->activeAttribLocs.insert(loc); + if (loc == -1) { + if (mappedName != "gl_InstanceID") + MOZ_CRASH("Active attrib has no location."); + } else { + info->activeAttribLocs.insert(loc); + } } // Uniforms From 042fdef5b5bb9ab31037ec912c75e200ac36fc0e Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Tue, 19 Jan 2016 18:16:02 +0000 Subject: [PATCH 044/119] Bug 1195018 - Support 'background_color' member in the manifest processor. r=marcosc --- dom/manifest/ManifestProcessor.jsm | 12 ++++++++++++ dom/manifest/ValueExtractor.jsm | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/dom/manifest/ManifestProcessor.jsm b/dom/manifest/ManifestProcessor.jsm index 1c0d0cc366c..71b1e9066c3 100644 --- a/dom/manifest/ManifestProcessor.jsm +++ b/dom/manifest/ManifestProcessor.jsm @@ -90,6 +90,7 @@ this.ManifestProcessor = { // jshint ignore:line ), 'short_name': processShortNameMember(), 'theme_color': processThemeColorMember(), + 'background_color': processBackgroundColorMember(), }; processedManifest.scope = processScopeMember(); return processedManifest; @@ -224,6 +225,17 @@ this.ManifestProcessor = { // jshint ignore:line return extractor.extractColorValue(spec); } + function processBackgroundColorMember() { + const spec = { + objectName: 'manifest', + object: rawManifest, + property: 'background_color', + expectedType: 'string', + trim: true + }; + return extractor.extractColorValue(spec); + } + function processLangMember() { const spec = { objectName: 'manifest', diff --git a/dom/manifest/ValueExtractor.jsm b/dom/manifest/ValueExtractor.jsm index 69f924e3bfc..b1dd034a3a8 100644 --- a/dom/manifest/ValueExtractor.jsm +++ b/dom/manifest/ValueExtractor.jsm @@ -53,7 +53,7 @@ ValueExtractor.prototype = { if (DOMUtils.isValidCSSColor(value)) { color = value; } else if (value) { - const msg = `background_color: ${value} is not a valid CSS color.`; + const msg = `${spec.property}: ${value} is not a valid CSS color.`; this.console.warn(msg); } return color; From b97d1797838507cb58a571bd2fe2ff73391f4b0c Mon Sep 17 00:00:00 2001 From: "Dustin J. Mitchell" Date: Fri, 15 Jan 2016 20:33:18 +0000 Subject: [PATCH 045/119] Bug 1239766: make additive-1.svg a tiny bit fuzzier; r=birtles --- layout/reftests/svg/smil/transform/reftest.list | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layout/reftests/svg/smil/transform/reftest.list b/layout/reftests/svg/smil/transform/reftest.list index 86ac2b08d77..e6d6b00567e 100644 --- a/layout/reftests/svg/smil/transform/reftest.list +++ b/layout/reftests/svg/smil/transform/reftest.list @@ -1,7 +1,7 @@ # Tests related to SVG Animation (using SMIL), focusing on the animateTransform # element. -fuzzy(110,1802) == additive-1.svg additive-1-ref.svg # bug 981344 +fuzzy(111,1802) == additive-1.svg additive-1-ref.svg # bug 981344, bug 1239766 == animate-width-1.svg lime.svg fuzzy-if(cocoaWidget,1,32) fuzzy-if(winWidget,15,4) == paced-1.svg paced-1-ref.svg # bug 981640 == rotate-angle-1.svg rotate-angle-ref.svg From 18b3e7765b5c036785205f7f1aee165f523207c2 Mon Sep 17 00:00:00 2001 From: Eugen Sawin Date: Tue, 5 Jan 2016 01:10:51 +0100 Subject: [PATCH 046/119] Bug 1232335 - [1.4] Fix test_can_play_type_mpeg for Android. r=snorp --- dom/media/test/manifest.js | 3 ++- dom/media/test/test_can_play_type_mpeg.html | 13 ++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/dom/media/test/manifest.js b/dom/media/test/manifest.js index e7c7a07af7f..88da24fa794 100644 --- a/dom/media/test/manifest.js +++ b/dom/media/test/manifest.js @@ -507,7 +507,8 @@ var gUnseekableTests = [ ]; var androidVersion = -1; // non-Android platforms -if (manifestNavigator().userAgent.indexOf("Mobile") != -1) { +if (manifestNavigator().userAgent.indexOf("Mobile") != -1 || + manifestNavigator().userAgent.indexOf("Tablet") != -1) { // See nsSystemInfo.cpp, the getProperty('version') returns different value // on each platforms, so we need to distinguish the android and B2G platform. var versionString = manifestNavigator().userAgent.indexOf("Android") != -1 ? diff --git a/dom/media/test/test_can_play_type_mpeg.html b/dom/media/test/test_can_play_type_mpeg.html index cd1e2196d36..c73ad078f53 100644 --- a/dom/media/test/test_can_play_type_mpeg.html +++ b/dom/media/test/test_can_play_type_mpeg.html @@ -124,13 +124,18 @@ function getPref(name) { return pref; } +function IsSupportedAndroid() { + return getAndroidVersion() >= 14; +} + function IsJellyBeanOrLater() { - return androidVersion >= 16; + return getAndroidVersion() >= 16; } var haveMp4 = (getPref("media.wmf.enabled") && IsWindowsVistaOrLater()) || IsMacOSSnowLeopardOrLater() || - IsJellyBeanOrLater() || + (IsSupportedAndroid() && + (IsJellyBeanOrLater() || getPref("media.plugins.enabled"))) || getPref("media.omx.enabled") || (IsLinux() && getPref("media.ffmpeg.enabled")); @@ -138,8 +143,10 @@ check_mp4(document.getElementById('v'), haveMp4); var haveMp3 = getPref("media.directshow.enabled") || (getPref("media.wmf.enabled") && IsWindowsVistaOrLater()) || - (IsJellyBeanOrLater() && getPref("media.android-media-codec.enabled")) || (IsLinux() && getPref("media.ffmpeg.enabled")) || + (IsSupportedAndroid() && + ((IsJellyBeanOrLater() && getPref("media.android-media-codec.enabled")) || + getPref("media.plugins.enabled"))) || getPref("media.apple.mp3.enabled"); check_mp3(document.getElementById('v'), haveMp3); From 57c63dcf2e86cd15d2f93d1aeb2655404b27a26b Mon Sep 17 00:00:00 2001 From: Nicolas Silva Date: Tue, 19 Jan 2016 20:14:22 +0100 Subject: [PATCH 047/119] Bug 1240708 - Various trivial coverity warning fixes. r=kats --- gfx/layers/ImageContainer.cpp | 4 ++++ gfx/layers/ImageContainer.h | 1 - gfx/layers/Layers.h | 12 +++++++----- gfx/layers/apz/src/HitTestingTreeNode.cpp | 5 ++++- gfx/layers/client/ClientLayerManager.cpp | 2 +- gfx/layers/client/SingleTiledContentClient.cpp | 2 ++ gfx/layers/client/TiledContentClient.cpp | 2 ++ 7 files changed, 20 insertions(+), 8 deletions(-) diff --git a/gfx/layers/ImageContainer.cpp b/gfx/layers/ImageContainer.cpp index b01e3ad9095..25b836f0972 100644 --- a/gfx/layers/ImageContainer.cpp +++ b/gfx/layers/ImageContainer.cpp @@ -58,6 +58,10 @@ ImageFactory::CreatePlanarYCbCrImage(const gfx::IntSize& aScaleHint, BufferRecyc BufferRecycleBin::BufferRecycleBin() : mLock("mozilla.layers.BufferRecycleBin.mLock") + // This member is only valid when the bin is not empty and will be properly + // initialized in RecycleBuffer, but initializing it here avoids static analysis + // noise. + , mRecycledBufferSize(0) { } diff --git a/gfx/layers/ImageContainer.h b/gfx/layers/ImageContainer.h index 2b507811965..4826ebab13d 100644 --- a/gfx/layers/ImageContainer.h +++ b/gfx/layers/ImageContainer.h @@ -251,7 +251,6 @@ protected: void* mImplData; int32_t mSerial; ImageFormat mFormat; - bool mSent; static mozilla::Atomic sSerialCounter; }; diff --git a/gfx/layers/Layers.h b/gfx/layers/Layers.h index dd7b0c749a9..c74296e6bf2 100644 --- a/gfx/layers/Layers.h +++ b/gfx/layers/Layers.h @@ -693,15 +693,17 @@ private: // Stores state and data for frame intervals and paint times recording. // see LayerManager::StartFrameTimeRecording() at Layers.cpp for more details. FramesTimingRecording() - : mIsPaused(true) - , mNextIndex(0) + : mNextIndex(0) + , mLatestStartIndex(0) + , mCurrentRunStartIndex(0) + , mIsPaused(true) {} - bool mIsPaused; - uint32_t mNextIndex; - TimeStamp mLastFrameTime; nsTArray mIntervals; + TimeStamp mLastFrameTime; + uint32_t mNextIndex; uint32_t mLatestStartIndex; uint32_t mCurrentRunStartIndex; + bool mIsPaused; }; FramesTimingRecording mRecording; diff --git a/gfx/layers/apz/src/HitTestingTreeNode.cpp b/gfx/layers/apz/src/HitTestingTreeNode.cpp index 77b146ea35c..17f302aa5c5 100644 --- a/gfx/layers/apz/src/HitTestingTreeNode.cpp +++ b/gfx/layers/apz/src/HitTestingTreeNode.cpp @@ -24,9 +24,12 @@ HitTestingTreeNode::HitTestingTreeNode(AsyncPanZoomController* aApzc, : mApzc(aApzc) , mIsPrimaryApzcHolder(aIsPrimaryHolder) , mLayersId(aLayersId) + , mScrollViewId(FrameMetrics::NULL_SCROLL_ID) + , mScrollDir(Layer::NONE) + , mScrollSize(0) , mOverride(EventRegionsOverride::NoOverride) { - if (mIsPrimaryApzcHolder) { +if (mIsPrimaryApzcHolder) { MOZ_ASSERT(mApzc); } MOZ_ASSERT(!mApzc || mApzc->GetLayersId() == mLayersId); diff --git a/gfx/layers/client/ClientLayerManager.cpp b/gfx/layers/client/ClientLayerManager.cpp index 0cf254d1f30..66797a935eb 100644 --- a/gfx/layers/client/ClientLayerManager.cpp +++ b/gfx/layers/client/ClientLayerManager.cpp @@ -652,7 +652,7 @@ ClientLayerManager::ForwardTransaction(bool aScheduleComposite) // PLayer::Send__delete__() and DeallocShmem() mKeepAlive.Clear(); - TabChild* window = mWidget->GetOwningTabChild(); + TabChild* window = mWidget ? mWidget->GetOwningTabChild() : nullptr; if (window) { TimeStamp end = TimeStamp::Now(); window->DidRequestComposite(start, end); diff --git a/gfx/layers/client/SingleTiledContentClient.cpp b/gfx/layers/client/SingleTiledContentClient.cpp index 86af9427f1a..6ef05f165fc 100644 --- a/gfx/layers/client/SingleTiledContentClient.cpp +++ b/gfx/layers/client/SingleTiledContentClient.cpp @@ -57,6 +57,7 @@ ClientSingleTiledLayerBuffer::ClientSingleTiledLayerBuffer(ClientTiledPaintedLay ClientLayerManager* aManager) : ClientTiledLayerBuffer(aPaintedLayer, aCompositableClient) , mManager(aManager) + , mFormat(gfx::SurfaceFormat::UNKNOWN) { } @@ -107,6 +108,7 @@ ClientSingleTiledLayerBuffer::GetSurfaceDescriptorTiles() already_AddRefed ClientSingleTiledLayerBuffer::GetTextureClient() { + MOZ_ASSERT(mFormat != gfx::SurfaceFormat::UNKNOWN); return mCompositableClient->CreateTextureClientForDrawing( gfx::ImageFormatToSurfaceFormat(mFormat), mSize, BackendSelector::Content, TextureFlags::DISALLOW_BIGIMAGE | TextureFlags::IMMEDIATE_UPLOAD); diff --git a/gfx/layers/client/TiledContentClient.cpp b/gfx/layers/client/TiledContentClient.cpp index 5f6fa9a2bb2..e302f4b9488 100644 --- a/gfx/layers/client/TiledContentClient.cpp +++ b/gfx/layers/client/TiledContentClient.cpp @@ -293,6 +293,8 @@ ClientMultiTiledLayerBuffer::ClientMultiTiledLayerBuffer(ClientTiledPaintedLayer SharedFrameMetricsHelper* aHelper) : ClientTiledLayerBuffer(aPaintedLayer, aCompositableClient) , mManager(aManager) + , mCallback(nullptr) + , mCallbackData(nullptr) , mSharedFrameMetricsHelper(aHelper) { } From 10f13c9e265da4c08c811908848cfb328e288fea Mon Sep 17 00:00:00 2001 From: Nicolas Silva Date: Tue, 19 Jan 2016 20:14:27 +0100 Subject: [PATCH 048/119] Bug 1240708 - Various trivial coverity warning fixes (part 2). r=kats --- gfx/gl/GLContext.cpp | 4 +++- gfx/gl/GLContext.h | 1 - gfx/gl/GLLibraryEGL.cpp | 5 +++-- gfx/gl/GLLibraryLoader.cpp | 3 ++- gfx/gl/GLTextureImage.cpp | 2 ++ 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/gfx/gl/GLContext.cpp b/gfx/gl/GLContext.cpp index 56398101b1f..6bf485c1bbb 100644 --- a/gfx/gl/GLContext.cpp +++ b/gfx/gl/GLContext.cpp @@ -418,11 +418,14 @@ GLContext::GLContext(const SurfaceCaps& caps, mMaxCubeMapTextureSize(0), mMaxTextureImageSize(0), mMaxRenderbufferSize(0), + mMaxSamples(0), mNeedsTextureSizeChecks(false), mNeedsFlushBeforeDeleteFB(false), mWorkAroundDriverBugs(true), mHeavyGLCallsSinceLastFlush(false) { + mMaxViewportDims[0] = 0; + mMaxViewportDims[1] = 0; mOwningThreadId = PlatformThread::CurrentId(); } @@ -1739,7 +1742,6 @@ GLContext::InitWithPrefix(const char *prefix, bool trygl) mMaxTextureImageSize = mMaxTextureSize; - mMaxSamples = 0; if (IsSupported(GLFeature::framebuffer_multisample)) { fGetIntegerv(LOCAL_GL_MAX_SAMPLES, (GLint*)&mMaxSamples); } diff --git a/gfx/gl/GLContext.h b/gfx/gl/GLContext.h index 5c735986364..f2ffc7b27e5 100644 --- a/gfx/gl/GLContext.h +++ b/gfx/gl/GLContext.h @@ -341,7 +341,6 @@ public: protected: bool mInitialized; bool mIsOffscreen; - bool mIsGlobalSharedContext; bool mContextLost; /** diff --git a/gfx/gl/GLLibraryEGL.cpp b/gfx/gl/GLLibraryEGL.cpp index 15cf58886df..585324a3b97 100644 --- a/gfx/gl/GLLibraryEGL.cpp +++ b/gfx/gl/GLLibraryEGL.cpp @@ -8,6 +8,7 @@ #include "gfxUtils.h" #include "mozilla/Preferences.h" #include "mozilla/Assertions.h" +#include "mozilla/unused.h" #include "nsDirectoryServiceDefs.h" #include "nsDirectoryServiceUtils.h" #include "nsIGfxInfo.h" @@ -306,8 +307,8 @@ GLLibraryEGL::EnsureInitialized(bool forceAccel) }; // Do not warn about the failure to load this - see bug 1092191 - GLLibraryLoader::LoadSymbols(mEGLLibrary, &optionalSymbols[0], nullptr, nullptr, - false); + Unused << GLLibraryLoader::LoadSymbols(mEGLLibrary, &optionalSymbols[0], + nullptr, nullptr, false); #if defined(MOZ_WIDGET_GONK) && ANDROID_VERSION >= 18 MOZ_RELEASE_ASSERT(mSymbols.fQueryStringImplementationANDROID, diff --git a/gfx/gl/GLLibraryLoader.cpp b/gfx/gl/GLLibraryLoader.cpp index a66bd372b16..1f0eeec2b84 100644 --- a/gfx/gl/GLLibraryLoader.cpp +++ b/gfx/gl/GLLibraryLoader.cpp @@ -95,8 +95,9 @@ GLLibraryLoader::LoadSymbols(PRLibrary *lib, } if (*ss->symPointer == 0) { - if (warnOnFailure) + if (warnOnFailure) { printf_stderr("Can't find symbol '%s'.\n", ss->symNames[0]); + } failCount++; } diff --git a/gfx/gl/GLTextureImage.cpp b/gfx/gl/GLTextureImage.cpp index fa81ba30dd1..6973231126e 100644 --- a/gfx/gl/GLTextureImage.cpp +++ b/gfx/gl/GLTextureImage.cpp @@ -270,6 +270,7 @@ TextureImage::TextureImage(const gfx::IntSize& aSize, : mSize(aSize) , mWrapMode(aWrapMode) , mContentType(aContentType) + , mTextureFormat(gfx::SurfaceFormat::UNKNOWN) , mFilter(Filter::GOOD) , mFlags(aFlags) {} @@ -313,6 +314,7 @@ TiledTextureImage::TiledTextureImage(GLContext* aGL, : TextureImage(aSize, LOCAL_GL_CLAMP_TO_EDGE, aContentType, aFlags) , mCurrentImage(0) , mIterationCallback(nullptr) + , mIterationCallbackData(nullptr) , mInUpdate(false) , mRows(0) , mColumns(0) From 2f1db3e4c372125f5006ef07d41116fa616a8e2f Mon Sep 17 00:00:00 2001 From: Andreas Tolfsen Date: Tue, 19 Jan 2016 13:48:53 +0000 Subject: [PATCH 049/119] Bug 1240723 - Harmonise xpcshell head- and tail list computation; r=ted.mielczarek Head- and tail entries in manifest files are not mandatory on local/desktop xpcshell tests, and they should not be on remote/B2G either. This change makes remotexpcshelltests and runxpcshelltests agree on how to get head- and tail files. --- testing/xpcshell/remotexpcshelltests.py | 13 +++++++++---- testing/xpcshell/runxpcshelltests.py | 14 ++++++-------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/testing/xpcshell/remotexpcshelltests.py b/testing/xpcshell/remotexpcshelltests.py index f221386e07b..056e7c6e7f4 100644 --- a/testing/xpcshell/remotexpcshelltests.py +++ b/testing/xpcshell/remotexpcshelltests.py @@ -87,7 +87,11 @@ class RemoteXPCShellTestThread(xpcshell.XPCShellTestThread): self.log.info("%s | environment: %s" % (name, self.env)) def getHeadAndTailFiles(self, test): - """Override parent method to find files on remote device.""" + """Override parent method to find files on remote device. + + Obtains lists of head- and tail files. Returns a tuple containing + a list of head files and a list of tail files. + """ def sanitize_list(s, kind): for f in s.strip().split(' '): f = f.strip() @@ -99,13 +103,14 @@ class RemoteXPCShellTestThread(xpcshell.XPCShellTestThread): # skip check for file existence: the convenience of discovering # a missing file does not justify the time cost of the round trip # to the device - yield path self.remoteHere = self.remoteForLocal(test['here']) - return (list(sanitize_list(test['head'], 'head')), - list(sanitize_list(test['tail'], 'tail'))) + headlist = test.get('head', '') + taillist = test.get('tail', '') + return (list(sanitize_list(headlist, 'head')), + list(sanitize_list(taillist, 'tail'))) def buildXpcsCmd(self): # change base class' paths to remote paths and use base class to build command diff --git a/testing/xpcshell/runxpcshelltests.py b/testing/xpcshell/runxpcshelltests.py index b174351edb0..270c4b57f84 100755 --- a/testing/xpcshell/runxpcshelltests.py +++ b/testing/xpcshell/runxpcshelltests.py @@ -390,11 +390,9 @@ class XPCShellTestThread(Thread): '-e', 'const _JSDEBUGGER_PORT = %d;' % dbgport, ] - def getHeadAndTailFiles(self, test_object): - """Obtain the list of head and tail files. - - Returns a 2-tuple. The first element is a list of head files. The second - is a list of tail files. + def getHeadAndTailFiles(self, test): + """Obtain lists of head- and tail files. Returns a tuple + containing a list of head files and a list of tail files. """ def sanitize_list(s, kind): for f in s.strip().split(' '): @@ -402,7 +400,7 @@ class XPCShellTestThread(Thread): if len(f) < 1: continue - path = os.path.normpath(os.path.join(test_object['here'], f)) + path = os.path.normpath(os.path.join(test['here'], f)) if not os.path.exists(path): raise Exception('%s file does not exist: %s' % (kind, path)) @@ -411,8 +409,8 @@ class XPCShellTestThread(Thread): yield path - headlist = test_object['head'] if 'head' in test_object else '' - taillist = test_object['tail'] if 'tail' in test_object else '' + headlist = test.get('head', '') + taillist = test.get('tail', '') return (list(sanitize_list(headlist, 'head')), list(sanitize_list(taillist, 'tail'))) From a50a3b6067eecc335f486e49b2a8d20e52efe0c5 Mon Sep 17 00:00:00 2001 From: David Rajchenbach-Teller Date: Thu, 14 Jan 2016 23:03:11 +0100 Subject: [PATCH 050/119] Bug 1224374 - Profiler labels for the 25 top chrome hangs;r=BenWa,MarcoZ Experience shows that we do not have enough profiler labels to make BHR hang reports meaningful. This patch adds enough labels to let us exploit hang reports matching the 25 topmost chrome hangs. --- accessible/base/NotificationController.cpp | 1 + dom/base/nsFrameLoader.cpp | 1 + dom/base/nsJSEnvironment.cpp | 2 ++ dom/base/nsObjectLoadingContent.cpp | 1 + dom/ipc/ContentParent.cpp | 6 ++++++ dom/plugins/base/nsPluginHost.cpp | 1 + dom/plugins/ipc/PluginModuleParent.cpp | 1 + gfx/layers/client/TextureClient.cpp | 1 + js/xpconnect/wrappers/AddonWrapper.cpp | 4 ++++ layout/generic/nsSubDocumentFrame.cpp | 1 + 10 files changed, 19 insertions(+) diff --git a/accessible/base/NotificationController.cpp b/accessible/base/NotificationController.cpp index b566dd43d33..1c078a16e08 100644 --- a/accessible/base/NotificationController.cpp +++ b/accessible/base/NotificationController.cpp @@ -141,6 +141,7 @@ NotificationController::IsUpdatePending() void NotificationController::WillRefresh(mozilla::TimeStamp aTime) { + PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); Telemetry::AutoTimer updateTimer; // If the document accessible that notification collector was created for is diff --git a/dom/base/nsFrameLoader.cpp b/dom/base/nsFrameLoader.cpp index c4477afd18a..2261c2f0114 100644 --- a/dom/base/nsFrameLoader.cpp +++ b/dom/base/nsFrameLoader.cpp @@ -781,6 +781,7 @@ bool nsFrameLoader::ShowRemoteFrame(const ScreenIntSize& size, nsSubDocumentFrame *aFrame) { + PROFILER_LABEL_FUNC(js::ProfileEntry::Category::GRAPHICS); NS_ASSERTION(IsRemoteFrame(), "ShowRemote only makes sense on remote frames."); if (!mRemoteBrowser && !TryRemoteBrowser()) { diff --git a/dom/base/nsJSEnvironment.cpp b/dom/base/nsJSEnvironment.cpp index 08c8e6af565..3cda5200b47 100644 --- a/dom/base/nsJSEnvironment.cpp +++ b/dom/base/nsJSEnvironment.cpp @@ -1335,6 +1335,8 @@ nsJSContext::ShrinkGCBuffersNow() static void FinishAnyIncrementalGC() { + PROFILER_LABEL_FUNC(js::ProfileEntry::Category::GC); + if (sCCLockedOut) { // We're in the middle of an incremental GC, so finish it. JS::PrepareForIncrementalGC(sRuntime); diff --git a/dom/base/nsObjectLoadingContent.cpp b/dom/base/nsObjectLoadingContent.cpp index 035a019883e..fa8eb49f65a 100644 --- a/dom/base/nsObjectLoadingContent.cpp +++ b/dom/base/nsObjectLoadingContent.cpp @@ -3102,6 +3102,7 @@ nsObjectLoadingContent::DoStopPlugin(nsPluginInstanceOwner* aInstanceOwner, NS_IMETHODIMP nsObjectLoadingContent::StopPluginInstance() { + PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); // Clear any pending events mPendingInstantiateEvent = nullptr; mPendingCheckPluginStopEvent = nullptr; diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp index f9ff4f409a7..0a68b209e31 100644 --- a/dom/ipc/ContentParent.cpp +++ b/dom/ipc/ContentParent.cpp @@ -1237,6 +1237,8 @@ ContentParent::CreateBrowserOrApp(const TabContext& aContext, Element* aFrameElement, ContentParent* aOpenerContentParent) { + PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); + if (!sCanLaunchSubprocesses) { return nullptr; } @@ -2386,6 +2388,8 @@ ContentParent::InitializeMembers() bool ContentParent::LaunchSubprocess(ProcessPriority aInitialPriority /* = PROCESS_PRIORITY_FOREGROUND */) { + PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); + std::vector extraArgs; if (mIsNuwaProcess) { extraArgs.push_back("-nuwa"); @@ -3642,6 +3646,8 @@ ContentParent::ForceKillTimerCallback(nsITimer* aTimer, void* aClosure) void ContentParent::KillHard(const char* aReason) { + PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); + // On Windows, calling KillHard multiple times causes problems - the // process handle becomes invalid on the first call, causing a second call // to crash our process - more details in bug 890840. diff --git a/dom/plugins/base/nsPluginHost.cpp b/dom/plugins/base/nsPluginHost.cpp index b132753d90a..171ee97b5c6 100644 --- a/dom/plugins/base/nsPluginHost.cpp +++ b/dom/plugins/base/nsPluginHost.cpp @@ -1366,6 +1366,7 @@ nsresult nsPluginHost::EnsurePluginLoaded(nsPluginTag* aPluginTag) nsresult nsPluginHost::GetPluginForContentProcess(uint32_t aPluginId, nsNPAPIPlugin** aPlugin) { + PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); MOZ_ASSERT(XRE_IsParentProcess()); // If plugins haven't been scanned yet, do so now diff --git a/dom/plugins/ipc/PluginModuleParent.cpp b/dom/plugins/ipc/PluginModuleParent.cpp index 485a12e824d..4ee3198bc4f 100755 --- a/dom/plugins/ipc/PluginModuleParent.cpp +++ b/dom/plugins/ipc/PluginModuleParent.cpp @@ -110,6 +110,7 @@ mozilla::plugins::SetupBridge(uint32_t aPluginId, nsresult* rv, uint32_t* runID) { + PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); if (NS_WARN_IF(!rv) || NS_WARN_IF(!runID)) { return false; } diff --git a/gfx/layers/client/TextureClient.cpp b/gfx/layers/client/TextureClient.cpp index fb64b5657fd..0922ea2d319 100644 --- a/gfx/layers/client/TextureClient.cpp +++ b/gfx/layers/client/TextureClient.cpp @@ -206,6 +206,7 @@ static void DestroyTextureData(TextureData* aTextureData, ISurfaceAllocator* aAl void TextureChild::ActorDestroy(ActorDestroyReason why) { + PROFILER_LABEL_FUNC(js::ProfileEntry::Category::GRAPHICS); mWaitForRecycle = nullptr; if (mTextureData) { diff --git a/js/xpconnect/wrappers/AddonWrapper.cpp b/js/xpconnect/wrappers/AddonWrapper.cpp index bfc3e2e5937..46645b2c4bb 100644 --- a/js/xpconnect/wrappers/AddonWrapper.cpp +++ b/js/xpconnect/wrappers/AddonWrapper.cpp @@ -14,6 +14,8 @@ #include "mozilla/dom/BindingUtils.h" #include "nsGlobalWindow.h" +#include "GeckoProfiler.h" + #include "nsID.h" using namespace js; @@ -172,6 +174,8 @@ bool AddonWrapper::get(JSContext* cx, JS::Handle wrapper, JS::Handle receiver, JS::Handle id, JS::MutableHandle vp) const { + PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); + Rooted desc(cx); if (!InterposeProperty(cx, wrapper, nullptr, id, &desc)) return false; diff --git a/layout/generic/nsSubDocumentFrame.cpp b/layout/generic/nsSubDocumentFrame.cpp index ebb6f787cd9..9f4703b7295 100644 --- a/layout/generic/nsSubDocumentFrame.cpp +++ b/layout/generic/nsSubDocumentFrame.cpp @@ -82,6 +82,7 @@ public: explicit AsyncFrameInit(nsIFrame* aFrame) : mFrame(aFrame) {} NS_IMETHOD Run() { + PROFILER_LABEL("mozilla", "AsyncFrameInit::Run", js::ProfileEntry::Category::OTHER); if (mFrame.IsAlive()) { static_cast(mFrame.GetFrame())->ShowViewer(); } From e50137d33cc2d024df8199da21e49f1fa3ce5a74 Mon Sep 17 00:00:00 2001 From: David Rajchenbach-Teller Date: Fri, 15 Jan 2016 11:38:03 +0100 Subject: [PATCH 051/119] Bug 1224374 - Profiler labels for the top 26-100 chrome hangs;r=BenWa --- dom/media/webspeech/synth/windows/SapiService.cpp | 2 ++ dom/plugins/base/nsJSNPRuntime.cpp | 4 ++++ dom/plugins/base/nsNPAPIPlugin.cpp | 3 +++ dom/plugins/base/nsNPAPIPluginInstance.cpp | 3 +++ dom/plugins/base/nsNPAPIPluginStreamListener.cpp | 1 + dom/plugins/base/nsPluginHost.cpp | 1 + dom/plugins/base/nsPluginInstanceOwner.cpp | 2 ++ dom/storage/DOMStorageDBThread.cpp | 1 + gfx/thebes/gfxDWriteFontList.cpp | 2 ++ gfx/thebes/gfxGDIFontList.cpp | 2 ++ gfx/thebes/gfxWindowsPlatform.cpp | 2 ++ image/FrameAnimator.cpp | 1 + ipc/glue/GeckoChildProcessHost.cpp | 2 ++ js/ipc/WrapperOwner.cpp | 1 + js/xpconnect/src/XPCComponents.cpp | 1 + startupcache/StartupCache.cpp | 3 +++ .../components/url-classifier/nsUrlClassifierDBService.cpp | 1 + toolkit/system/windowsproxy/nsWindowsSystemProxySettings.cpp | 1 + toolkit/xre/nsXREDirProvider.cpp | 2 ++ widget/nsBaseDragService.cpp | 2 ++ widget/windows/nsFilePicker.cpp | 1 + xpcom/io/FileUtilsWin.cpp | 2 ++ xpcom/io/nsLocalFileWin.cpp | 1 + xpfe/appshell/nsXULWindow.cpp | 2 ++ 24 files changed, 43 insertions(+) diff --git a/dom/media/webspeech/synth/windows/SapiService.cpp b/dom/media/webspeech/synth/windows/SapiService.cpp index 22f5fa4cdd8..1aa58cfbca5 100644 --- a/dom/media/webspeech/synth/windows/SapiService.cpp +++ b/dom/media/webspeech/synth/windows/SapiService.cpp @@ -196,6 +196,8 @@ SapiService::~SapiService() bool SapiService::Init() { + PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); + MOZ_ASSERT(!mInitialized); if (Preferences::GetBool("media.webspeech.synth.test") || diff --git a/dom/plugins/base/nsJSNPRuntime.cpp b/dom/plugins/base/nsJSNPRuntime.cpp index 8b91297e56d..130ab7d89b4 100644 --- a/dom/plugins/base/nsJSNPRuntime.cpp +++ b/dom/plugins/base/nsJSNPRuntime.cpp @@ -1646,6 +1646,8 @@ NPObjWrapper_Resolve(JSContext *cx, JS::Handle obj, JS::Handle if (JSID_IS_SYMBOL(id)) return true; + PROFILER_LABEL_FUNC(js::ProfileEntry::Category::JS); + NPObject *npobj = GetNPObject(cx, obj); if (!npobj || !npobj->_class || !npobj->_class->hasProperty || @@ -2110,6 +2112,8 @@ static bool NPObjectMember_GetProperty(JSContext *cx, JS::HandleObject obj, JS::HandleId id, JS::MutableHandleValue vp) { + PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); + if (JSID_IS_SYMBOL(id)) { JS::RootedSymbol sym(cx, JSID_TO_SYMBOL(id)); if (JS::GetSymbolCode(sym) == JS::SymbolCode::toPrimitive) { diff --git a/dom/plugins/base/nsNPAPIPlugin.cpp b/dom/plugins/base/nsNPAPIPlugin.cpp index 2438da164be..c437147aca9 100644 --- a/dom/plugins/base/nsNPAPIPlugin.cpp +++ b/dom/plugins/base/nsNPAPIPlugin.cpp @@ -265,6 +265,8 @@ nsNPAPIPlugin::RunPluginOOP(const nsPluginTag *aPluginTag) inline PluginLibrary* GetNewPluginLibrary(nsPluginTag *aPluginTag) { + PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); + if (!aPluginTag) { return nullptr; } @@ -283,6 +285,7 @@ GetNewPluginLibrary(nsPluginTag *aPluginTag) nsresult nsNPAPIPlugin::CreatePlugin(nsPluginTag *aPluginTag, nsNPAPIPlugin** aResult) { + PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); *aResult = nullptr; if (!aPluginTag) { diff --git a/dom/plugins/base/nsNPAPIPluginInstance.cpp b/dom/plugins/base/nsNPAPIPluginInstance.cpp index b2f1ad374b6..e99010ead15 100644 --- a/dom/plugins/base/nsNPAPIPluginInstance.cpp +++ b/dom/plugins/base/nsNPAPIPluginInstance.cpp @@ -280,6 +280,7 @@ nsNPAPIPluginInstance::StopTime() nsresult nsNPAPIPluginInstance::Initialize(nsNPAPIPlugin *aPlugin, nsPluginInstanceOwner* aOwner, const nsACString& aMIMEType) { + PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); PLUGIN_LOG(PLUGIN_LOG_NORMAL, ("nsNPAPIPluginInstance::Initialize this=%p\n",this)); NS_ENSURE_ARG_POINTER(aPlugin); @@ -655,6 +656,8 @@ nsresult nsNPAPIPluginInstance::HandleEvent(void* event, int16_t* result, if (RUNNING != mRunning) return NS_OK; + PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); + if (!event) return NS_ERROR_FAILURE; diff --git a/dom/plugins/base/nsNPAPIPluginStreamListener.cpp b/dom/plugins/base/nsNPAPIPluginStreamListener.cpp index f5f0c40007a..0f500a1ae45 100644 --- a/dom/plugins/base/nsNPAPIPluginStreamListener.cpp +++ b/dom/plugins/base/nsNPAPIPluginStreamListener.cpp @@ -286,6 +286,7 @@ nsNPAPIPluginStreamListener::CallURLNotify(NPReason reason) nsresult nsNPAPIPluginStreamListener::OnStartBinding(nsPluginStreamListenerPeer* streamPeer) { + PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); if (!mInst || !mInst->CanFireNotifications() || mStreamCleanedUp) return NS_ERROR_FAILURE; diff --git a/dom/plugins/base/nsPluginHost.cpp b/dom/plugins/base/nsPluginHost.cpp index 171ee97b5c6..9b36fa542df 100644 --- a/dom/plugins/base/nsPluginHost.cpp +++ b/dom/plugins/base/nsPluginHost.cpp @@ -3522,6 +3522,7 @@ nsPluginHost::AddHeadersToChannel(const char *aHeadersData, nsresult nsPluginHost::StopPluginInstance(nsNPAPIPluginInstance* aInstance) { + PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); if (PluginDestructionGuard::DelayDestroy(aInstance)) { return NS_OK; } diff --git a/dom/plugins/base/nsPluginInstanceOwner.cpp b/dom/plugins/base/nsPluginInstanceOwner.cpp index 31446ad2811..b29981bae22 100644 --- a/dom/plugins/base/nsPluginInstanceOwner.cpp +++ b/dom/plugins/base/nsPluginInstanceOwner.cpp @@ -3600,6 +3600,8 @@ nsPluginInstanceOwner::UpdateWindowVisibility(bool aVisible) void nsPluginInstanceOwner::UpdateDocumentActiveState(bool aIsActive) { + PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); + mPluginDocumentActiveState = aIsActive; #ifndef XP_MACOSX UpdateWindowPositionAndClipRect(true); diff --git a/dom/storage/DOMStorageDBThread.cpp b/dom/storage/DOMStorageDBThread.cpp index 69142203cb8..37adce11f8f 100644 --- a/dom/storage/DOMStorageDBThread.cpp +++ b/dom/storage/DOMStorageDBThread.cpp @@ -154,6 +154,7 @@ DOMStorageDBThread::Shutdown() void DOMStorageDBThread::SyncPreload(DOMStorageCacheBridge* aCache, bool aForceSync) { + PROFILER_LABEL_FUNC(js::ProfileEntry::Category::STORAGE); if (!aForceSync && aCache->LoadedCount()) { // Preload already started for this cache, just wait for it to finish. // LoadWait will exit after LoadDone on the cache has been called. diff --git a/gfx/thebes/gfxDWriteFontList.cpp b/gfx/thebes/gfxDWriteFontList.cpp index 269b87084d2..808341a445b 100644 --- a/gfx/thebes/gfxDWriteFontList.cpp +++ b/gfx/thebes/gfxDWriteFontList.cpp @@ -524,6 +524,8 @@ gfxDWriteFontEntry::GetFontTable(uint32_t aTag) nsresult gfxDWriteFontEntry::ReadCMAP(FontInfoData *aFontInfoData) { + PROFILER_LABEL_FUNC(js::ProfileEntry::Category::GRAPHICS); + // attempt this once, if errors occur leave a blank cmap if (mCharacterMap) { return NS_OK; diff --git a/gfx/thebes/gfxGDIFontList.cpp b/gfx/thebes/gfxGDIFontList.cpp index acb29b644ec..51e3c98db22 100644 --- a/gfx/thebes/gfxGDIFontList.cpp +++ b/gfx/thebes/gfxGDIFontList.cpp @@ -143,6 +143,8 @@ GDIFontEntry::GDIFontEntry(const nsAString& aFaceName, nsresult GDIFontEntry::ReadCMAP(FontInfoData *aFontInfoData) { + PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); + // attempt this once, if errors occur leave a blank cmap if (mCharacterMap) { return NS_OK; diff --git a/gfx/thebes/gfxWindowsPlatform.cpp b/gfx/thebes/gfxWindowsPlatform.cpp index 6d1867daf06..b9230d211b6 100755 --- a/gfx/thebes/gfxWindowsPlatform.cpp +++ b/gfx/thebes/gfxWindowsPlatform.cpp @@ -1205,6 +1205,8 @@ InvalidateWindowForDeviceReset(HWND aWnd, LPARAM aMsg) bool gfxWindowsPlatform::UpdateForDeviceReset() { + PROFILER_LABEL_FUNC(js::ProfileEntry::Category::GRAPHICS); + if (!DidRenderingDeviceReset()) { return false; } diff --git a/image/FrameAnimator.cpp b/image/FrameAnimator.cpp index f87ce242e0b..f1d8faea740 100644 --- a/image/FrameAnimator.cpp +++ b/image/FrameAnimator.cpp @@ -79,6 +79,7 @@ FrameAnimator::AdvanceFrame(TimeStamp aTime) { NS_ASSERTION(aTime <= TimeStamp::Now(), "Given time appears to be in the future"); + PROFILER_LABEL_FUNC(js::ProfileEntry::Category::GRAPHICS); uint32_t currentFrameIndex = mCurrentAnimationFrameIndex; uint32_t nextFrameIndex = currentFrameIndex + 1; diff --git a/ipc/glue/GeckoChildProcessHost.cpp b/ipc/glue/GeckoChildProcessHost.cpp index f140d000b0b..0c3f6da1b32 100644 --- a/ipc/glue/GeckoChildProcessHost.cpp +++ b/ipc/glue/GeckoChildProcessHost.cpp @@ -381,6 +381,8 @@ GeckoChildProcessHost::AsyncLaunch(std::vector aExtraOpts, bool GeckoChildProcessHost::WaitUntilConnected(int32_t aTimeoutMs) { + PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); + // NB: this uses a different mechanism than the chromium parent // class. PRIntervalTime timeoutTicks = (aTimeoutMs > 0) ? diff --git a/js/ipc/WrapperOwner.cpp b/js/ipc/WrapperOwner.cpp index 60093070352..93426e7ed8f 100644 --- a/js/ipc/WrapperOwner.cpp +++ b/js/ipc/WrapperOwner.cpp @@ -145,6 +145,7 @@ const char CPOWProxyHandler::family = 0; const CPOWProxyHandler CPOWProxyHandler::singleton; #define FORWARD(call, args) \ + PROFILER_LABEL_FUNC(js::ProfileEntry::Category::JS); \ WrapperOwner* owner = OwnerOf(proxy); \ if (!owner->active()) { \ JS_ReportError(cx, "cannot use a CPOW whose process is gone"); \ diff --git a/js/xpconnect/src/XPCComponents.cpp b/js/xpconnect/src/XPCComponents.cpp index 982c615cdac..fad59a1ff58 100644 --- a/js/xpconnect/src/XPCComponents.cpp +++ b/js/xpconnect/src/XPCComponents.cpp @@ -3010,6 +3010,7 @@ nsXPCComponents_Utils::SetGCZeal(int32_t aValue, JSContext* cx) NS_IMETHODIMP nsXPCComponents_Utils::NukeSandbox(HandleValue obj, JSContext* cx) { + PROFILER_LABEL_FUNC(js::ProfileEntry::Category::JS); NS_ENSURE_TRUE(obj.isObject(), NS_ERROR_INVALID_ARG); JSObject* wrapper = &obj.toObject(); NS_ENSURE_TRUE(IsWrapper(wrapper), NS_ERROR_INVALID_ARG); diff --git a/startupcache/StartupCache.cpp b/startupcache/StartupCache.cpp index bf505c42e53..5bd92624557 100644 --- a/startupcache/StartupCache.cpp +++ b/startupcache/StartupCache.cpp @@ -305,7 +305,10 @@ GetBufferFromZipArchive(nsZipArchive *zip, bool doCRC, const char* id, nsresult StartupCache::GetBuffer(const char* id, char** outbuf, uint32_t* length) { + PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); + NS_ASSERTION(NS_IsMainThread(), "Startup cache only available on main thread"); + WaitOnWriteThread(); if (!mStartupWriteInitiated) { CacheEntry* entry; diff --git a/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp b/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp index 7250cb889dd..47e9d4faf78 100644 --- a/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp +++ b/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp @@ -1310,6 +1310,7 @@ nsUrlClassifierDBService::ClassifyLocalWithTables(nsIURI *aURI, const nsACString & aTables, nsACString & aTableResults) { + PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); MOZ_ASSERT(NS_IsMainThread(), "ClassifyLocalWithTables must be on main thread"); nsCOMPtr uri = NS_GetInnermostURI(aURI); diff --git a/toolkit/system/windowsproxy/nsWindowsSystemProxySettings.cpp b/toolkit/system/windowsproxy/nsWindowsSystemProxySettings.cpp index 941de81e1ae..160965b81b0 100644 --- a/toolkit/system/windowsproxy/nsWindowsSystemProxySettings.cpp +++ b/toolkit/system/windowsproxy/nsWindowsSystemProxySettings.cpp @@ -203,6 +203,7 @@ nsWindowsSystemProxySettings::PatternMatch(const nsACString& aHost, nsresult nsWindowsSystemProxySettings::GetPACURI(nsACString& aResult) { + PROFILER_LABEL_FUNC(js::ProfileEntry::Category::STORAGE); nsresult rv; uint32_t flags = 0; nsAutoString buf; diff --git a/toolkit/xre/nsXREDirProvider.cpp b/toolkit/xre/nsXREDirProvider.cpp index d90887964bb..fe6d7826cb5 100644 --- a/toolkit/xre/nsXREDirProvider.cpp +++ b/toolkit/xre/nsXREDirProvider.cpp @@ -910,6 +910,8 @@ nsXREDirProvider::DoStartup() void nsXREDirProvider::DoShutdown() { + PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); + if (mProfileNotified) { nsCOMPtr obsSvc = mozilla::services::GetObserverService(); diff --git a/widget/nsBaseDragService.cpp b/widget/nsBaseDragService.cpp index 97e315706ad..eff398cd69d 100644 --- a/widget/nsBaseDragService.cpp +++ b/widget/nsBaseDragService.cpp @@ -211,6 +211,8 @@ nsBaseDragService::InvokeDragSession(nsIDOMNode *aDOMNode, nsIScriptableRegion* aDragRgn, uint32_t aActionType) { + PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); + NS_ENSURE_TRUE(aDOMNode, NS_ERROR_INVALID_ARG); NS_ENSURE_TRUE(mSuppressLevel == 0, NS_ERROR_FAILURE); diff --git a/widget/windows/nsFilePicker.cpp b/widget/windows/nsFilePicker.cpp index 0a1fb327f75..caa473ad755 100644 --- a/widget/windows/nsFilePicker.cpp +++ b/widget/windows/nsFilePicker.cpp @@ -868,6 +868,7 @@ nsFilePicker::ShowXPFilePicker(const nsString& aInitialDir) bool nsFilePicker::ShowFilePicker(const nsString& aInitialDir, bool &aWasInitError) { + PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); RefPtr dialog; if (mMode != modeSave) { if (FAILED(CoCreateInstance(CLSID_FileOpenDialog, nullptr, CLSCTX_INPROC, diff --git a/xpcom/io/FileUtilsWin.cpp b/xpcom/io/FileUtilsWin.cpp index 6781264ecf6..349bd8496e3 100644 --- a/xpcom/io/FileUtilsWin.cpp +++ b/xpcom/io/FileUtilsWin.cpp @@ -36,6 +36,8 @@ bool HandleToFilename(HANDLE aHandle, const LARGE_INTEGER& aOffset, nsAString& aFilename) { + PROFILER_LABEL_FUNC(js::ProfileEntry::Category::NETWORK); + aFilename.Truncate(); // This implementation is nice because it uses fully documented APIs that // are available on all Windows versions that we support. diff --git a/xpcom/io/nsLocalFileWin.cpp b/xpcom/io/nsLocalFileWin.cpp index 7eec0280ae1..bdf28b7d8d0 100644 --- a/xpcom/io/nsLocalFileWin.cpp +++ b/xpcom/io/nsLocalFileWin.cpp @@ -1070,6 +1070,7 @@ nsLocalFile::ResolveAndStat() return NS_OK; } + PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); // we can't resolve/stat anything that isn't a valid NSPR addressable path if (mWorkingPath.IsEmpty()) { return NS_ERROR_FILE_INVALID_PATH; diff --git a/xpfe/appshell/nsXULWindow.cpp b/xpfe/appshell/nsXULWindow.cpp index 221f1b66934..675a2ff4ce0 100644 --- a/xpfe/appshell/nsXULWindow.cpp +++ b/xpfe/appshell/nsXULWindow.cpp @@ -383,6 +383,8 @@ NS_IMETHODIMP nsXULWindow::RemoveChildWindow(nsIXULWindow *aChild) NS_IMETHODIMP nsXULWindow::ShowModal() { + PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); + // Store locally so it doesn't die on us nsCOMPtr window = mWindow; nsCOMPtr tempRef = this; From 8dec19e1a86dc41fc1ba78aece13034c7e3e3709 Mon Sep 17 00:00:00 2001 From: Robert Longson Date: Tue, 19 Jan 2016 19:44:10 +0000 Subject: [PATCH 052/119] Bug 1239952 - Incorrect test for feGaussianBlur elements r=james --- .../web-platform/meta/svg/interfaces.html.ini | 36 ------------------- .../web-platform/tests/svg/interfaces.html | 7 ---- 2 files changed, 43 deletions(-) diff --git a/testing/web-platform/meta/svg/interfaces.html.ini b/testing/web-platform/meta/svg/interfaces.html.ini index bf6250fa27c..adecab5a095 100644 --- a/testing/web-platform/meta/svg/interfaces.html.ini +++ b/testing/web-platform/meta/svg/interfaces.html.ini @@ -2124,12 +2124,6 @@ [SVGFEGaussianBlurElement interface: attribute edgeMode] expected: FAIL - [SVGFEGaussianBlurElement must be primary interface of feGaussianBlur] - expected: FAIL - - [Stringification of feGaussianBlur] - expected: FAIL - [SVGFEGaussianBlurElement interface: feGaussianBlur must inherit property "SVG_EDGEMODE_UNKNOWN" with the proper type (0)] expected: FAIL @@ -2142,39 +2136,9 @@ [SVGFEGaussianBlurElement interface: feGaussianBlur must inherit property "SVG_EDGEMODE_NONE" with the proper type (3)] expected: FAIL - [SVGFEGaussianBlurElement interface: feGaussianBlur must inherit property "in1" with the proper type (4)] - expected: FAIL - - [SVGFEGaussianBlurElement interface: feGaussianBlur must inherit property "stdDeviationX" with the proper type (5)] - expected: FAIL - - [SVGFEGaussianBlurElement interface: feGaussianBlur must inherit property "stdDeviationY" with the proper type (6)] - expected: FAIL - [SVGFEGaussianBlurElement interface: feGaussianBlur must inherit property "edgeMode" with the proper type (7)] expected: FAIL - [SVGFEGaussianBlurElement interface: feGaussianBlur must inherit property "setStdDeviation" with the proper type (8)] - expected: FAIL - - [SVGFEGaussianBlurElement interface: calling setStdDeviation(float,float) on feGaussianBlur with too few arguments must throw TypeError] - expected: FAIL - - [SVGFEGaussianBlurElement interface: feGaussianBlur must inherit property "x" with the proper type (9)] - expected: FAIL - - [SVGFEGaussianBlurElement interface: feGaussianBlur must inherit property "y" with the proper type (10)] - expected: FAIL - - [SVGFEGaussianBlurElement interface: feGaussianBlur must inherit property "width" with the proper type (11)] - expected: FAIL - - [SVGFEGaussianBlurElement interface: feGaussianBlur must inherit property "height" with the proper type (12)] - expected: FAIL - - [SVGFEGaussianBlurElement interface: feGaussianBlur must inherit property "result" with the proper type (13)] - expected: FAIL - [SVGElement interface: feGaussianBlur must inherit property "tabIndex" with the proper type (3)] expected: FAIL diff --git a/testing/web-platform/tests/svg/interfaces.html b/testing/web-platform/tests/svg/interfaces.html index 15c44773486..e5509ac58df 100644 --- a/testing/web-platform/tests/svg/interfaces.html +++ b/testing/web-platform/tests/svg/interfaces.html @@ -1333,8 +1333,6 @@ var altGlyphItem = document.createElementNS("http://www.w3.org/2000/svg", "altGlyphItem"); var glyphRef = document.createElementNS("http://www.w3.org/2000/svg", "glyphRef"); -var glyphRef = document.createElementNS("http://www.w3.org/2000/svg", - "glyphRef"); var marker = document.createElementNS("http://www.w3.org/2000/svg", "marker"); var colorProfile = document.createElementNS("http://www.w3.org/2000/svg", "color-profile"); @@ -1384,8 +1382,6 @@ var foreignObject = document.createElementNS("http://www.w3.org/2000/svg", "foreignObject"); var filter = document.createElementNS("http://www.w3.org/2000/svg", "filter"); var feBlend = document.createElementNS("http://www.w3.org/2000/svg", "feBlend"); -var feColorMatrix = document.createElementNS("http://www.w3.org/2000/svg", - "feColorMatrix"); var feColorMatrix = document.createElementNS("http://www.w3.org/2000/svg", "feColorMatrix"); var feComponentTransfer = document.createElementNS("http://www.w3.org/2000/svg", @@ -1415,9 +1411,6 @@ var feDisplacementMap = document.createElementNS("http://www.w3.org/2000/svg", "feDisplacementMap"); var feDropShadow = document.createElementNS("http://www.w3.org/2000/svg", "feDropShadow"); -var feFlood = document.createElementNS("http://www.w3.org/2000/svg", "feFlood"); -var feGaussianBlur = document.createElementNS("http://www.w3.org/2000/svg", - "feGaussianBlue"); var feImage = document.createElementNS("http://www.w3.org/2000/svg", "feImage"); var feMerge = document.createElementNS("http://www.w3.org/2000/svg", "feMerge"); var feMergeNode = document.createElementNS("http://www.w3.org/2000/svg", From 9deebde3d3a130ea72bbed138dfb6a7806225eef Mon Sep 17 00:00:00 2001 From: James Willcox Date: Tue, 19 Jan 2016 10:39:24 -0600 Subject: [PATCH 053/119] Bug 1162248 - Use the correct dimensions when resizing the compositor r=kats --- .../base/java/org/mozilla/gecko/gfx/GeckoLayerClient.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mobile/android/base/java/org/mozilla/gecko/gfx/GeckoLayerClient.java b/mobile/android/base/java/org/mozilla/gecko/gfx/GeckoLayerClient.java index d8b746b261e..23dd13e1790 100644 --- a/mobile/android/base/java/org/mozilla/gecko/gfx/GeckoLayerClient.java +++ b/mobile/android/base/java/org/mozilla/gecko/gfx/GeckoLayerClient.java @@ -766,7 +766,7 @@ class GeckoLayerClient implements LayerView.Listener, PanZoomTarget // We need to make sure a draw happens synchronously at this point, // but resizing the surface before the SurfaceView has resized will // cause a visible jump. - mView.getGLController().resumeCompositor(mWindowSize.width, mWindowSize.height); + mView.getGLController().resumeCompositor(width, height); } /** Implementation of LayerView.Listener */ From 16a4ee8333a61260e5c6924edb97337332277b58 Mon Sep 17 00:00:00 2001 From: Armen Zambrano Gasparnian Date: Tue, 19 Jan 2016 11:17:27 -0500 Subject: [PATCH 054/119] Bug 1239410 - Replace mochitest-other with a11y & chrome (3 chunks). DONTBUILD. r=jmaher --- .../tasks/branches/base_job_flags.yml | 10 ++++---- .../taskcluster/tasks/branches/base_jobs.yml | 8 +++++++ .../tasks/branches/try/job_flags.yml | 8 +++++++ ...ther.yml => fx_linux64_mochitest_a11y.yml} | 8 +++---- .../tests/fx_linux64_mochitest_chrome.yml | 24 +++++++++++++++++++ 5 files changed, 49 insertions(+), 9 deletions(-) rename testing/taskcluster/tasks/tests/{fx_linux64_mochitest_other.yml => fx_linux64_mochitest_a11y.yml} (77%) create mode 100644 testing/taskcluster/tasks/tests/fx_linux64_mochitest_chrome.yml diff --git a/testing/taskcluster/tasks/branches/base_job_flags.yml b/testing/taskcluster/tasks/branches/base_job_flags.yml index 520d06da349..278bb50be89 100644 --- a/testing/taskcluster/tasks/branches/base_job_flags.yml +++ b/testing/taskcluster/tasks/branches/base_job_flags.yml @@ -43,16 +43,15 @@ flags: mochitest-e10s: /mochitest-e10s.*/ mochitests-e10s: /mochitest-e10s.*/ mochitest-debug: /mochitest-debug-.*/ - mochitest-a11y: /.*mochitest-o.*/ + mochitest-a11y: /.*mochitest-a11y.*/ mochitest-bc: /mochitest-browser-chrome.*/ - mochitest-browser-chrome: /mochitest-browser-chrome.*/ mochitest-bc-e10s: /mochitest-browser-chrome-e10s.*/ + mochitest-browser-chrome: /mochitest-browser-chrome.*/ mochitest-browser-chrome-e10s: /mochitest-browser-chrome-e10s.*/ + mochitest-chrome: /.*mochitest-chrome.*/ mochitest-dt: /mochitest-devtools-chrome.*/ mochitest-dt-e10s: /mochitest-devtools-chrome-e10s.*/ mochitest-gl: /mochitest-webgl.*/ - mochitest-o: /.*mochitest-o.*/ - mochitest-other: /mochitest-other.*/ mochitest-push: /mochitest-push.*/ reftest: /(plain-)?reftest.*/ reftest-no-accel: /(plain-)?reftest-no-accel.*/ @@ -130,15 +129,16 @@ flags: - marionette - marionette-webapi - mochitest + - mochitest-a11y - mochitest-browser-chrome - mochitest-browser-chrome-e10s + - mochitest-chrome - mochitest-devtools-chrome - mochitest-devtools-chrome-e10s - mochitest-e10s - mochitest-jetpack - mochitest-media - mochitest-oop - - mochitest-other - mochitest-push - mochitest-webgl - mozmill diff --git a/testing/taskcluster/tasks/branches/base_jobs.yml b/testing/taskcluster/tasks/branches/base_jobs.yml index 19ceef6da7b..0dbfbe22855 100644 --- a/testing/taskcluster/tasks/branches/base_jobs.yml +++ b/testing/taskcluster/tasks/branches/base_jobs.yml @@ -232,6 +232,14 @@ tests: task: tasks/tests/mulet_mochitests.yml tasks/builds/b2g_emulator_x86_kk_opt.yml: task: tasks/tests/b2g_emulator_mochitest.yml + mochitest-a11y: + allowed_build_tasks: + tasks/builds/dbg_linux64.yml: + task: tasks/tests/fx_linux64_mochitest_a11y.yml + mochitest-chrome: + allowed_build_tasks: + tasks/builds/dbg_linux64.yml: + task: tasks/tests/fx_linux64_mochitest_chrome.yml mochitest-push: allowed_build_tasks: tasks/builds/dbg_linux64.yml: diff --git a/testing/taskcluster/tasks/branches/try/job_flags.yml b/testing/taskcluster/tasks/branches/try/job_flags.yml index e1e3bc51929..a3bc8d06309 100644 --- a/testing/taskcluster/tasks/branches/try/job_flags.yml +++ b/testing/taskcluster/tasks/branches/try/job_flags.yml @@ -170,6 +170,14 @@ tests: task: tasks/tests/b2g_emulator_mochitest.yml tasks/builds/b2g_emulator_x86_kk_opt.yml: task: tasks/tests/b2g_emulator_mochitest.yml + mochitest-a11y: + allowed_build_tasks: + tasks/builds/dbg_linux64_clobber.yml: + task: tasks/tests/fx_linux64_mochitest_a11y.yml + mochitest-chrome: + allowed_build_tasks: + tasks/builds/dbg_linux64_clobber.yml: + task: tasks/tests/fx_linux64_mochitest_chrome.yml mochitest-push: allowed_build_tasks: tasks/builds/dbg_linux64_clobber.yml: diff --git a/testing/taskcluster/tasks/tests/fx_linux64_mochitest_other.yml b/testing/taskcluster/tasks/tests/fx_linux64_mochitest_a11y.yml similarity index 77% rename from testing/taskcluster/tasks/tests/fx_linux64_mochitest_other.yml rename to testing/taskcluster/tasks/tests/fx_linux64_mochitest_a11y.yml index 411df6d8245..480cf00c38e 100644 --- a/testing/taskcluster/tasks/tests/fx_linux64_mochitest_other.yml +++ b/testing/taskcluster/tasks/tests/fx_linux64_mochitest_a11y.yml @@ -5,8 +5,8 @@ task: - 'docker-worker:capability:device:loopbackVideo' - 'docker-worker:capability:device:loopbackAudio' metadata: - name: '[TC] Linux64 mochitest-other' - description: Mochitest other run + name: '[TC] Linux64 mochitest-a11y' + description: Mochitest a11y run payload: capabilities: devices: @@ -15,8 +15,8 @@ task: extra: suite: name: mochitest - flavor: chrome,a11y + flavor: a11y treeherder: groupName: Desktop mochitests groupSymbol: tc-M - symbol: oth + symbol: a11y diff --git a/testing/taskcluster/tasks/tests/fx_linux64_mochitest_chrome.yml b/testing/taskcluster/tasks/tests/fx_linux64_mochitest_chrome.yml new file mode 100644 index 00000000000..a25cb059c4b --- /dev/null +++ b/testing/taskcluster/tasks/tests/fx_linux64_mochitest_chrome.yml @@ -0,0 +1,24 @@ +$inherits: + from: 'tasks/tests/fx_desktop_unittest.yml' +task: + scopes: + - 'docker-worker:capability:device:loopbackVideo' + - 'docker-worker:capability:device:loopbackAudio' + metadata: + name: '[TC] Linux64 mochitest-chrome {{chunk}}' + description: Mochitest chrome run {{chunk}} + payload: + capabilities: + devices: + loopbackVideo: true + loopbackAudio: true + extra: + chunks: + total: 3 + suite: + name: mochitest + flavor: chrome + treeherder: + groupName: Desktop mochitests + groupSymbol: tc-M + symbol: c{{chunk}} From 389e5b86420031fd3f45ad3d130b36efa20c733b Mon Sep 17 00:00:00 2001 From: Armen Zambrano Gasparnian Date: Tue, 19 Jan 2016 08:06:46 -0500 Subject: [PATCH 055/119] Bug 1239410 - Add Linux64 debug tier2 GTest jobs + use desktop-test-xlarge workerType. DONTBUILD. r=jmaher --- .../tasks/branches/base_job_flags.yml | 2 ++ .../taskcluster/tasks/branches/base_jobs.yml | 4 +++ .../tasks/branches/try/job_flags.yml | 4 +++ .../tasks/tests/fx_linux64_gtest.yml | 26 +++++++++++++++++++ 4 files changed, 36 insertions(+) create mode 100644 testing/taskcluster/tasks/tests/fx_linux64_gtest.yml diff --git a/testing/taskcluster/tasks/branches/base_job_flags.yml b/testing/taskcluster/tasks/branches/base_job_flags.yml index 278bb50be89..78abd68ff5f 100644 --- a/testing/taskcluster/tasks/branches/base_job_flags.yml +++ b/testing/taskcluster/tasks/branches/base_job_flags.yml @@ -32,6 +32,7 @@ flags: e10s: /.*e10s.*/ gaia-js-integration: /.*gaia-js-integration.*/ gaia-ui-test: /.*gaia-ui-test.*/ + gtest: /gtest.*/ jittest: /jittest.*/ jittests: /jittest.*/ jsreftest: /jsreftest.*/ @@ -121,6 +122,7 @@ flags: - gaia-ui-test-functional - gaia-ui-test-functional-dsds - gaia-ui-test-unit + - gtest - jetpack - jittests - jsreftest diff --git a/testing/taskcluster/tasks/branches/base_jobs.yml b/testing/taskcluster/tasks/branches/base_jobs.yml index 0dbfbe22855..514b82b35c3 100644 --- a/testing/taskcluster/tasks/branches/base_jobs.yml +++ b/testing/taskcluster/tasks/branches/base_jobs.yml @@ -214,6 +214,10 @@ tests: allowed_build_tasks: tasks/builds/mulet_linux.yml: task: tasks/tests/mulet_gaia_unit_oop.yml + gtest: + allowed_build_tasks: + tasks/builds/dbg_linux64.yml: + task: tasks/tests/fx_linux64_gtest.yml jittests: allowed_build_tasks: tasks/builds/dbg_linux64.yml: diff --git a/testing/taskcluster/tasks/branches/try/job_flags.yml b/testing/taskcluster/tasks/branches/try/job_flags.yml index a3bc8d06309..096d9d0bb3c 100644 --- a/testing/taskcluster/tasks/branches/try/job_flags.yml +++ b/testing/taskcluster/tasks/branches/try/job_flags.yml @@ -152,6 +152,10 @@ tests: allowed_build_tasks: tasks/builds/dbg_linux64_clobber.yml: task: tasks/tests/fx_linux64_crashtest.yml + gtest: + allowed_build_tasks: + tasks/builds/dbg_linux64_clobber.yml: + task: tasks/tests/fx_linux64_gtest.yml jittests: allowed_build_tasks: tasks/builds/dbg_linux64_clobber.yml: diff --git a/testing/taskcluster/tasks/tests/fx_linux64_gtest.yml b/testing/taskcluster/tasks/tests/fx_linux64_gtest.yml new file mode 100644 index 00000000000..2f961130b3f --- /dev/null +++ b/testing/taskcluster/tasks/tests/fx_linux64_gtest.yml @@ -0,0 +1,26 @@ +--- +$inherits: + from: 'tasks/tests/fx_desktop_generic.yml' +task: + workerType: desktop-test-xlarge + payload: + command: + - --no-read-buildbot-config + - --installer-url={{build_url}} + - --test-packages-url={{test_packages_url}} + - --download-symbols=ondemand + - --{{suite}}-suite={{flavor}} + env: + MOZHARNESS_SCRIPT: 'mozharness/scripts/desktop_unittest.py' + MOZHARNESS_CONFIG: > + mozharness/configs/unittests/linux_unittest.py + mozharness/configs/remove_executables.py + metadata: + name: '[TC] Linux64 gtest' + description: Gtests run {{chunk}} + extra: + suite: + name: gtest + flavor: gtest + treeherder: + symbol: GTest From 1eb13214bf0009601e3bda586a33decc432c73ed Mon Sep 17 00:00:00 2001 From: Sebastian Hengst Date: Tue, 19 Jan 2016 21:30:41 +0100 Subject: [PATCH 056/119] Backed out 2 changesets (bug 1224374) for Windows bustage. r=bustage on a CLOSED TREE Backed out changeset 5f458e6e4997 (bug 1224374) Backed out changeset 0dc02cb0b604 (bug 1224374) --- accessible/base/NotificationController.cpp | 1 - dom/base/nsFrameLoader.cpp | 1 - dom/base/nsJSEnvironment.cpp | 2 -- dom/base/nsObjectLoadingContent.cpp | 1 - dom/ipc/ContentParent.cpp | 6 ------ dom/media/webspeech/synth/windows/SapiService.cpp | 2 -- dom/plugins/base/nsJSNPRuntime.cpp | 4 ---- dom/plugins/base/nsNPAPIPlugin.cpp | 3 --- dom/plugins/base/nsNPAPIPluginInstance.cpp | 3 --- dom/plugins/base/nsNPAPIPluginStreamListener.cpp | 1 - dom/plugins/base/nsPluginHost.cpp | 2 -- dom/plugins/base/nsPluginInstanceOwner.cpp | 2 -- dom/plugins/ipc/PluginModuleParent.cpp | 1 - dom/storage/DOMStorageDBThread.cpp | 1 - gfx/layers/client/TextureClient.cpp | 1 - gfx/thebes/gfxDWriteFontList.cpp | 2 -- gfx/thebes/gfxGDIFontList.cpp | 2 -- gfx/thebes/gfxWindowsPlatform.cpp | 2 -- image/FrameAnimator.cpp | 1 - ipc/glue/GeckoChildProcessHost.cpp | 2 -- js/ipc/WrapperOwner.cpp | 1 - js/xpconnect/src/XPCComponents.cpp | 1 - js/xpconnect/wrappers/AddonWrapper.cpp | 4 ---- layout/generic/nsSubDocumentFrame.cpp | 1 - startupcache/StartupCache.cpp | 3 --- .../components/url-classifier/nsUrlClassifierDBService.cpp | 1 - .../system/windowsproxy/nsWindowsSystemProxySettings.cpp | 1 - toolkit/xre/nsXREDirProvider.cpp | 2 -- widget/nsBaseDragService.cpp | 2 -- widget/windows/nsFilePicker.cpp | 1 - xpcom/io/FileUtilsWin.cpp | 2 -- xpcom/io/nsLocalFileWin.cpp | 1 - xpfe/appshell/nsXULWindow.cpp | 2 -- 33 files changed, 62 deletions(-) diff --git a/accessible/base/NotificationController.cpp b/accessible/base/NotificationController.cpp index 1c078a16e08..b566dd43d33 100644 --- a/accessible/base/NotificationController.cpp +++ b/accessible/base/NotificationController.cpp @@ -141,7 +141,6 @@ NotificationController::IsUpdatePending() void NotificationController::WillRefresh(mozilla::TimeStamp aTime) { - PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); Telemetry::AutoTimer updateTimer; // If the document accessible that notification collector was created for is diff --git a/dom/base/nsFrameLoader.cpp b/dom/base/nsFrameLoader.cpp index 2261c2f0114..c4477afd18a 100644 --- a/dom/base/nsFrameLoader.cpp +++ b/dom/base/nsFrameLoader.cpp @@ -781,7 +781,6 @@ bool nsFrameLoader::ShowRemoteFrame(const ScreenIntSize& size, nsSubDocumentFrame *aFrame) { - PROFILER_LABEL_FUNC(js::ProfileEntry::Category::GRAPHICS); NS_ASSERTION(IsRemoteFrame(), "ShowRemote only makes sense on remote frames."); if (!mRemoteBrowser && !TryRemoteBrowser()) { diff --git a/dom/base/nsJSEnvironment.cpp b/dom/base/nsJSEnvironment.cpp index 3cda5200b47..08c8e6af565 100644 --- a/dom/base/nsJSEnvironment.cpp +++ b/dom/base/nsJSEnvironment.cpp @@ -1335,8 +1335,6 @@ nsJSContext::ShrinkGCBuffersNow() static void FinishAnyIncrementalGC() { - PROFILER_LABEL_FUNC(js::ProfileEntry::Category::GC); - if (sCCLockedOut) { // We're in the middle of an incremental GC, so finish it. JS::PrepareForIncrementalGC(sRuntime); diff --git a/dom/base/nsObjectLoadingContent.cpp b/dom/base/nsObjectLoadingContent.cpp index fa8eb49f65a..035a019883e 100644 --- a/dom/base/nsObjectLoadingContent.cpp +++ b/dom/base/nsObjectLoadingContent.cpp @@ -3102,7 +3102,6 @@ nsObjectLoadingContent::DoStopPlugin(nsPluginInstanceOwner* aInstanceOwner, NS_IMETHODIMP nsObjectLoadingContent::StopPluginInstance() { - PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); // Clear any pending events mPendingInstantiateEvent = nullptr; mPendingCheckPluginStopEvent = nullptr; diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp index 0a68b209e31..f9ff4f409a7 100644 --- a/dom/ipc/ContentParent.cpp +++ b/dom/ipc/ContentParent.cpp @@ -1237,8 +1237,6 @@ ContentParent::CreateBrowserOrApp(const TabContext& aContext, Element* aFrameElement, ContentParent* aOpenerContentParent) { - PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); - if (!sCanLaunchSubprocesses) { return nullptr; } @@ -2388,8 +2386,6 @@ ContentParent::InitializeMembers() bool ContentParent::LaunchSubprocess(ProcessPriority aInitialPriority /* = PROCESS_PRIORITY_FOREGROUND */) { - PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); - std::vector extraArgs; if (mIsNuwaProcess) { extraArgs.push_back("-nuwa"); @@ -3646,8 +3642,6 @@ ContentParent::ForceKillTimerCallback(nsITimer* aTimer, void* aClosure) void ContentParent::KillHard(const char* aReason) { - PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); - // On Windows, calling KillHard multiple times causes problems - the // process handle becomes invalid on the first call, causing a second call // to crash our process - more details in bug 890840. diff --git a/dom/media/webspeech/synth/windows/SapiService.cpp b/dom/media/webspeech/synth/windows/SapiService.cpp index 1aa58cfbca5..22f5fa4cdd8 100644 --- a/dom/media/webspeech/synth/windows/SapiService.cpp +++ b/dom/media/webspeech/synth/windows/SapiService.cpp @@ -196,8 +196,6 @@ SapiService::~SapiService() bool SapiService::Init() { - PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); - MOZ_ASSERT(!mInitialized); if (Preferences::GetBool("media.webspeech.synth.test") || diff --git a/dom/plugins/base/nsJSNPRuntime.cpp b/dom/plugins/base/nsJSNPRuntime.cpp index 130ab7d89b4..8b91297e56d 100644 --- a/dom/plugins/base/nsJSNPRuntime.cpp +++ b/dom/plugins/base/nsJSNPRuntime.cpp @@ -1646,8 +1646,6 @@ NPObjWrapper_Resolve(JSContext *cx, JS::Handle obj, JS::Handle if (JSID_IS_SYMBOL(id)) return true; - PROFILER_LABEL_FUNC(js::ProfileEntry::Category::JS); - NPObject *npobj = GetNPObject(cx, obj); if (!npobj || !npobj->_class || !npobj->_class->hasProperty || @@ -2112,8 +2110,6 @@ static bool NPObjectMember_GetProperty(JSContext *cx, JS::HandleObject obj, JS::HandleId id, JS::MutableHandleValue vp) { - PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); - if (JSID_IS_SYMBOL(id)) { JS::RootedSymbol sym(cx, JSID_TO_SYMBOL(id)); if (JS::GetSymbolCode(sym) == JS::SymbolCode::toPrimitive) { diff --git a/dom/plugins/base/nsNPAPIPlugin.cpp b/dom/plugins/base/nsNPAPIPlugin.cpp index c437147aca9..2438da164be 100644 --- a/dom/plugins/base/nsNPAPIPlugin.cpp +++ b/dom/plugins/base/nsNPAPIPlugin.cpp @@ -265,8 +265,6 @@ nsNPAPIPlugin::RunPluginOOP(const nsPluginTag *aPluginTag) inline PluginLibrary* GetNewPluginLibrary(nsPluginTag *aPluginTag) { - PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); - if (!aPluginTag) { return nullptr; } @@ -285,7 +283,6 @@ GetNewPluginLibrary(nsPluginTag *aPluginTag) nsresult nsNPAPIPlugin::CreatePlugin(nsPluginTag *aPluginTag, nsNPAPIPlugin** aResult) { - PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); *aResult = nullptr; if (!aPluginTag) { diff --git a/dom/plugins/base/nsNPAPIPluginInstance.cpp b/dom/plugins/base/nsNPAPIPluginInstance.cpp index e99010ead15..b2f1ad374b6 100644 --- a/dom/plugins/base/nsNPAPIPluginInstance.cpp +++ b/dom/plugins/base/nsNPAPIPluginInstance.cpp @@ -280,7 +280,6 @@ nsNPAPIPluginInstance::StopTime() nsresult nsNPAPIPluginInstance::Initialize(nsNPAPIPlugin *aPlugin, nsPluginInstanceOwner* aOwner, const nsACString& aMIMEType) { - PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); PLUGIN_LOG(PLUGIN_LOG_NORMAL, ("nsNPAPIPluginInstance::Initialize this=%p\n",this)); NS_ENSURE_ARG_POINTER(aPlugin); @@ -656,8 +655,6 @@ nsresult nsNPAPIPluginInstance::HandleEvent(void* event, int16_t* result, if (RUNNING != mRunning) return NS_OK; - PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); - if (!event) return NS_ERROR_FAILURE; diff --git a/dom/plugins/base/nsNPAPIPluginStreamListener.cpp b/dom/plugins/base/nsNPAPIPluginStreamListener.cpp index 0f500a1ae45..f5f0c40007a 100644 --- a/dom/plugins/base/nsNPAPIPluginStreamListener.cpp +++ b/dom/plugins/base/nsNPAPIPluginStreamListener.cpp @@ -286,7 +286,6 @@ nsNPAPIPluginStreamListener::CallURLNotify(NPReason reason) nsresult nsNPAPIPluginStreamListener::OnStartBinding(nsPluginStreamListenerPeer* streamPeer) { - PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); if (!mInst || !mInst->CanFireNotifications() || mStreamCleanedUp) return NS_ERROR_FAILURE; diff --git a/dom/plugins/base/nsPluginHost.cpp b/dom/plugins/base/nsPluginHost.cpp index 9b36fa542df..b132753d90a 100644 --- a/dom/plugins/base/nsPluginHost.cpp +++ b/dom/plugins/base/nsPluginHost.cpp @@ -1366,7 +1366,6 @@ nsresult nsPluginHost::EnsurePluginLoaded(nsPluginTag* aPluginTag) nsresult nsPluginHost::GetPluginForContentProcess(uint32_t aPluginId, nsNPAPIPlugin** aPlugin) { - PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); MOZ_ASSERT(XRE_IsParentProcess()); // If plugins haven't been scanned yet, do so now @@ -3522,7 +3521,6 @@ nsPluginHost::AddHeadersToChannel(const char *aHeadersData, nsresult nsPluginHost::StopPluginInstance(nsNPAPIPluginInstance* aInstance) { - PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); if (PluginDestructionGuard::DelayDestroy(aInstance)) { return NS_OK; } diff --git a/dom/plugins/base/nsPluginInstanceOwner.cpp b/dom/plugins/base/nsPluginInstanceOwner.cpp index b29981bae22..31446ad2811 100644 --- a/dom/plugins/base/nsPluginInstanceOwner.cpp +++ b/dom/plugins/base/nsPluginInstanceOwner.cpp @@ -3600,8 +3600,6 @@ nsPluginInstanceOwner::UpdateWindowVisibility(bool aVisible) void nsPluginInstanceOwner::UpdateDocumentActiveState(bool aIsActive) { - PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); - mPluginDocumentActiveState = aIsActive; #ifndef XP_MACOSX UpdateWindowPositionAndClipRect(true); diff --git a/dom/plugins/ipc/PluginModuleParent.cpp b/dom/plugins/ipc/PluginModuleParent.cpp index 4ee3198bc4f..485a12e824d 100755 --- a/dom/plugins/ipc/PluginModuleParent.cpp +++ b/dom/plugins/ipc/PluginModuleParent.cpp @@ -110,7 +110,6 @@ mozilla::plugins::SetupBridge(uint32_t aPluginId, nsresult* rv, uint32_t* runID) { - PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); if (NS_WARN_IF(!rv) || NS_WARN_IF(!runID)) { return false; } diff --git a/dom/storage/DOMStorageDBThread.cpp b/dom/storage/DOMStorageDBThread.cpp index 37adce11f8f..69142203cb8 100644 --- a/dom/storage/DOMStorageDBThread.cpp +++ b/dom/storage/DOMStorageDBThread.cpp @@ -154,7 +154,6 @@ DOMStorageDBThread::Shutdown() void DOMStorageDBThread::SyncPreload(DOMStorageCacheBridge* aCache, bool aForceSync) { - PROFILER_LABEL_FUNC(js::ProfileEntry::Category::STORAGE); if (!aForceSync && aCache->LoadedCount()) { // Preload already started for this cache, just wait for it to finish. // LoadWait will exit after LoadDone on the cache has been called. diff --git a/gfx/layers/client/TextureClient.cpp b/gfx/layers/client/TextureClient.cpp index 0922ea2d319..fb64b5657fd 100644 --- a/gfx/layers/client/TextureClient.cpp +++ b/gfx/layers/client/TextureClient.cpp @@ -206,7 +206,6 @@ static void DestroyTextureData(TextureData* aTextureData, ISurfaceAllocator* aAl void TextureChild::ActorDestroy(ActorDestroyReason why) { - PROFILER_LABEL_FUNC(js::ProfileEntry::Category::GRAPHICS); mWaitForRecycle = nullptr; if (mTextureData) { diff --git a/gfx/thebes/gfxDWriteFontList.cpp b/gfx/thebes/gfxDWriteFontList.cpp index 808341a445b..269b87084d2 100644 --- a/gfx/thebes/gfxDWriteFontList.cpp +++ b/gfx/thebes/gfxDWriteFontList.cpp @@ -524,8 +524,6 @@ gfxDWriteFontEntry::GetFontTable(uint32_t aTag) nsresult gfxDWriteFontEntry::ReadCMAP(FontInfoData *aFontInfoData) { - PROFILER_LABEL_FUNC(js::ProfileEntry::Category::GRAPHICS); - // attempt this once, if errors occur leave a blank cmap if (mCharacterMap) { return NS_OK; diff --git a/gfx/thebes/gfxGDIFontList.cpp b/gfx/thebes/gfxGDIFontList.cpp index 51e3c98db22..acb29b644ec 100644 --- a/gfx/thebes/gfxGDIFontList.cpp +++ b/gfx/thebes/gfxGDIFontList.cpp @@ -143,8 +143,6 @@ GDIFontEntry::GDIFontEntry(const nsAString& aFaceName, nsresult GDIFontEntry::ReadCMAP(FontInfoData *aFontInfoData) { - PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); - // attempt this once, if errors occur leave a blank cmap if (mCharacterMap) { return NS_OK; diff --git a/gfx/thebes/gfxWindowsPlatform.cpp b/gfx/thebes/gfxWindowsPlatform.cpp index b9230d211b6..6d1867daf06 100755 --- a/gfx/thebes/gfxWindowsPlatform.cpp +++ b/gfx/thebes/gfxWindowsPlatform.cpp @@ -1205,8 +1205,6 @@ InvalidateWindowForDeviceReset(HWND aWnd, LPARAM aMsg) bool gfxWindowsPlatform::UpdateForDeviceReset() { - PROFILER_LABEL_FUNC(js::ProfileEntry::Category::GRAPHICS); - if (!DidRenderingDeviceReset()) { return false; } diff --git a/image/FrameAnimator.cpp b/image/FrameAnimator.cpp index f1d8faea740..f87ce242e0b 100644 --- a/image/FrameAnimator.cpp +++ b/image/FrameAnimator.cpp @@ -79,7 +79,6 @@ FrameAnimator::AdvanceFrame(TimeStamp aTime) { NS_ASSERTION(aTime <= TimeStamp::Now(), "Given time appears to be in the future"); - PROFILER_LABEL_FUNC(js::ProfileEntry::Category::GRAPHICS); uint32_t currentFrameIndex = mCurrentAnimationFrameIndex; uint32_t nextFrameIndex = currentFrameIndex + 1; diff --git a/ipc/glue/GeckoChildProcessHost.cpp b/ipc/glue/GeckoChildProcessHost.cpp index 0c3f6da1b32..f140d000b0b 100644 --- a/ipc/glue/GeckoChildProcessHost.cpp +++ b/ipc/glue/GeckoChildProcessHost.cpp @@ -381,8 +381,6 @@ GeckoChildProcessHost::AsyncLaunch(std::vector aExtraOpts, bool GeckoChildProcessHost::WaitUntilConnected(int32_t aTimeoutMs) { - PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); - // NB: this uses a different mechanism than the chromium parent // class. PRIntervalTime timeoutTicks = (aTimeoutMs > 0) ? diff --git a/js/ipc/WrapperOwner.cpp b/js/ipc/WrapperOwner.cpp index 93426e7ed8f..60093070352 100644 --- a/js/ipc/WrapperOwner.cpp +++ b/js/ipc/WrapperOwner.cpp @@ -145,7 +145,6 @@ const char CPOWProxyHandler::family = 0; const CPOWProxyHandler CPOWProxyHandler::singleton; #define FORWARD(call, args) \ - PROFILER_LABEL_FUNC(js::ProfileEntry::Category::JS); \ WrapperOwner* owner = OwnerOf(proxy); \ if (!owner->active()) { \ JS_ReportError(cx, "cannot use a CPOW whose process is gone"); \ diff --git a/js/xpconnect/src/XPCComponents.cpp b/js/xpconnect/src/XPCComponents.cpp index fad59a1ff58..982c615cdac 100644 --- a/js/xpconnect/src/XPCComponents.cpp +++ b/js/xpconnect/src/XPCComponents.cpp @@ -3010,7 +3010,6 @@ nsXPCComponents_Utils::SetGCZeal(int32_t aValue, JSContext* cx) NS_IMETHODIMP nsXPCComponents_Utils::NukeSandbox(HandleValue obj, JSContext* cx) { - PROFILER_LABEL_FUNC(js::ProfileEntry::Category::JS); NS_ENSURE_TRUE(obj.isObject(), NS_ERROR_INVALID_ARG); JSObject* wrapper = &obj.toObject(); NS_ENSURE_TRUE(IsWrapper(wrapper), NS_ERROR_INVALID_ARG); diff --git a/js/xpconnect/wrappers/AddonWrapper.cpp b/js/xpconnect/wrappers/AddonWrapper.cpp index 46645b2c4bb..bfc3e2e5937 100644 --- a/js/xpconnect/wrappers/AddonWrapper.cpp +++ b/js/xpconnect/wrappers/AddonWrapper.cpp @@ -14,8 +14,6 @@ #include "mozilla/dom/BindingUtils.h" #include "nsGlobalWindow.h" -#include "GeckoProfiler.h" - #include "nsID.h" using namespace js; @@ -174,8 +172,6 @@ bool AddonWrapper::get(JSContext* cx, JS::Handle wrapper, JS::Handle receiver, JS::Handle id, JS::MutableHandle vp) const { - PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); - Rooted desc(cx); if (!InterposeProperty(cx, wrapper, nullptr, id, &desc)) return false; diff --git a/layout/generic/nsSubDocumentFrame.cpp b/layout/generic/nsSubDocumentFrame.cpp index 9f4703b7295..ebb6f787cd9 100644 --- a/layout/generic/nsSubDocumentFrame.cpp +++ b/layout/generic/nsSubDocumentFrame.cpp @@ -82,7 +82,6 @@ public: explicit AsyncFrameInit(nsIFrame* aFrame) : mFrame(aFrame) {} NS_IMETHOD Run() { - PROFILER_LABEL("mozilla", "AsyncFrameInit::Run", js::ProfileEntry::Category::OTHER); if (mFrame.IsAlive()) { static_cast(mFrame.GetFrame())->ShowViewer(); } diff --git a/startupcache/StartupCache.cpp b/startupcache/StartupCache.cpp index 5bd92624557..bf505c42e53 100644 --- a/startupcache/StartupCache.cpp +++ b/startupcache/StartupCache.cpp @@ -305,10 +305,7 @@ GetBufferFromZipArchive(nsZipArchive *zip, bool doCRC, const char* id, nsresult StartupCache::GetBuffer(const char* id, char** outbuf, uint32_t* length) { - PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); - NS_ASSERTION(NS_IsMainThread(), "Startup cache only available on main thread"); - WaitOnWriteThread(); if (!mStartupWriteInitiated) { CacheEntry* entry; diff --git a/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp b/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp index 47e9d4faf78..7250cb889dd 100644 --- a/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp +++ b/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp @@ -1310,7 +1310,6 @@ nsUrlClassifierDBService::ClassifyLocalWithTables(nsIURI *aURI, const nsACString & aTables, nsACString & aTableResults) { - PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); MOZ_ASSERT(NS_IsMainThread(), "ClassifyLocalWithTables must be on main thread"); nsCOMPtr uri = NS_GetInnermostURI(aURI); diff --git a/toolkit/system/windowsproxy/nsWindowsSystemProxySettings.cpp b/toolkit/system/windowsproxy/nsWindowsSystemProxySettings.cpp index 160965b81b0..941de81e1ae 100644 --- a/toolkit/system/windowsproxy/nsWindowsSystemProxySettings.cpp +++ b/toolkit/system/windowsproxy/nsWindowsSystemProxySettings.cpp @@ -203,7 +203,6 @@ nsWindowsSystemProxySettings::PatternMatch(const nsACString& aHost, nsresult nsWindowsSystemProxySettings::GetPACURI(nsACString& aResult) { - PROFILER_LABEL_FUNC(js::ProfileEntry::Category::STORAGE); nsresult rv; uint32_t flags = 0; nsAutoString buf; diff --git a/toolkit/xre/nsXREDirProvider.cpp b/toolkit/xre/nsXREDirProvider.cpp index fe6d7826cb5..d90887964bb 100644 --- a/toolkit/xre/nsXREDirProvider.cpp +++ b/toolkit/xre/nsXREDirProvider.cpp @@ -910,8 +910,6 @@ nsXREDirProvider::DoStartup() void nsXREDirProvider::DoShutdown() { - PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); - if (mProfileNotified) { nsCOMPtr obsSvc = mozilla::services::GetObserverService(); diff --git a/widget/nsBaseDragService.cpp b/widget/nsBaseDragService.cpp index eff398cd69d..97e315706ad 100644 --- a/widget/nsBaseDragService.cpp +++ b/widget/nsBaseDragService.cpp @@ -211,8 +211,6 @@ nsBaseDragService::InvokeDragSession(nsIDOMNode *aDOMNode, nsIScriptableRegion* aDragRgn, uint32_t aActionType) { - PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); - NS_ENSURE_TRUE(aDOMNode, NS_ERROR_INVALID_ARG); NS_ENSURE_TRUE(mSuppressLevel == 0, NS_ERROR_FAILURE); diff --git a/widget/windows/nsFilePicker.cpp b/widget/windows/nsFilePicker.cpp index caa473ad755..0a1fb327f75 100644 --- a/widget/windows/nsFilePicker.cpp +++ b/widget/windows/nsFilePicker.cpp @@ -868,7 +868,6 @@ nsFilePicker::ShowXPFilePicker(const nsString& aInitialDir) bool nsFilePicker::ShowFilePicker(const nsString& aInitialDir, bool &aWasInitError) { - PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); RefPtr dialog; if (mMode != modeSave) { if (FAILED(CoCreateInstance(CLSID_FileOpenDialog, nullptr, CLSCTX_INPROC, diff --git a/xpcom/io/FileUtilsWin.cpp b/xpcom/io/FileUtilsWin.cpp index 349bd8496e3..6781264ecf6 100644 --- a/xpcom/io/FileUtilsWin.cpp +++ b/xpcom/io/FileUtilsWin.cpp @@ -36,8 +36,6 @@ bool HandleToFilename(HANDLE aHandle, const LARGE_INTEGER& aOffset, nsAString& aFilename) { - PROFILER_LABEL_FUNC(js::ProfileEntry::Category::NETWORK); - aFilename.Truncate(); // This implementation is nice because it uses fully documented APIs that // are available on all Windows versions that we support. diff --git a/xpcom/io/nsLocalFileWin.cpp b/xpcom/io/nsLocalFileWin.cpp index bdf28b7d8d0..7eec0280ae1 100644 --- a/xpcom/io/nsLocalFileWin.cpp +++ b/xpcom/io/nsLocalFileWin.cpp @@ -1070,7 +1070,6 @@ nsLocalFile::ResolveAndStat() return NS_OK; } - PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); // we can't resolve/stat anything that isn't a valid NSPR addressable path if (mWorkingPath.IsEmpty()) { return NS_ERROR_FILE_INVALID_PATH; diff --git a/xpfe/appshell/nsXULWindow.cpp b/xpfe/appshell/nsXULWindow.cpp index 675a2ff4ce0..221f1b66934 100644 --- a/xpfe/appshell/nsXULWindow.cpp +++ b/xpfe/appshell/nsXULWindow.cpp @@ -383,8 +383,6 @@ NS_IMETHODIMP nsXULWindow::RemoveChildWindow(nsIXULWindow *aChild) NS_IMETHODIMP nsXULWindow::ShowModal() { - PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER); - // Store locally so it doesn't die on us nsCOMPtr window = mWindow; nsCOMPtr tempRef = this; From 2e1a6c80e137a3904ec26b5d57003d104e278d4e Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Tue, 19 Jan 2016 12:48:22 -0800 Subject: [PATCH 057/119] Bug 1233831 - Part 0: JSAPI plumbing for nursery collection callbacks; r=terrence This commit adds the relatively boring plumbing needed to expose methods to set callbacks that get fired on nursery collection start and end, as well as storing said callbacks internally. --- js/public/GCAPI.h | 28 ++++++++++++++++++++++++++++ js/src/gc/GCRuntime.h | 2 ++ js/src/gc/Statistics.cpp | 9 +++++++++ js/src/gc/Statistics.h | 3 +++ js/src/jsgc.cpp | 11 +++++++++++ 5 files changed, 53 insertions(+) diff --git a/js/public/GCAPI.h b/js/public/GCAPI.h index eddd7b04d85..ff31654b17e 100644 --- a/js/public/GCAPI.h +++ b/js/public/GCAPI.h @@ -351,6 +351,34 @@ typedef void extern JS_PUBLIC_API(GCSliceCallback) SetGCSliceCallback(JSRuntime* rt, GCSliceCallback callback); +/** + * Describes the progress of an observed nursery collection. + */ +enum class GCNurseryProgress { + /** + * The nursery collection is starting. + */ + GC_NURSERY_COLLECTION_START, + /** + * The nursery collection is ending. + */ + GC_NURSERY_COLLECTION_END +}; + +/** + * A nursery collection callback receives the progress of the nursery collection + * and the reason for the collection. + */ +using GCNurseryCollectionCallback = void(*)(JSRuntime* rt, GCNurseryProgress progress, + gcreason::Reason reason); + +/** + * Set the nursery collection callback for the given runtime. When set, it will + * be called at the start and end of every nursery collection. + */ +extern JS_PUBLIC_API(GCNurseryCollectionCallback) +SetGCNurseryCollectionCallback(JSRuntime* rt, GCNurseryCollectionCallback callback); + /** * Incremental GC defaults to enabled, but may be disabled for testing or in * embeddings that have not yet implemented barriers on their native classes. diff --git a/js/src/gc/GCRuntime.h b/js/src/gc/GCRuntime.h index 035006b5a89..f47fb5cafe3 100644 --- a/js/src/gc/GCRuntime.h +++ b/js/src/gc/GCRuntime.h @@ -766,6 +766,8 @@ class GCRuntime bool addWeakPointerCompartmentCallback(JSWeakPointerCompartmentCallback callback, void* data); void removeWeakPointerCompartmentCallback(JSWeakPointerCompartmentCallback callback); JS::GCSliceCallback setSliceCallback(JS::GCSliceCallback callback); + JS::GCNurseryCollectionCallback setNurseryCollectionCallback( + JS::GCNurseryCollectionCallback callback); void setValidate(bool enable); void setFullCompartmentChecks(bool enable); diff --git a/js/src/gc/Statistics.cpp b/js/src/gc/Statistics.cpp index beea52cfc76..b52eaaeec8a 100644 --- a/js/src/gc/Statistics.cpp +++ b/js/src/gc/Statistics.cpp @@ -751,6 +751,7 @@ Statistics::Statistics(JSRuntime* rt) activeDagSlot(PHASE_DAG_NONE), suspendedPhaseNestingDepth(0), sliceCallback(nullptr), + nurseryCollectionCallback(nullptr), aborted(false) { PodArrayZero(phaseTotals); @@ -842,6 +843,14 @@ Statistics::setSliceCallback(JS::GCSliceCallback newCallback) return oldCallback; } +JS::GCNurseryCollectionCallback +Statistics::setNurseryCollectionCallback(JS::GCNurseryCollectionCallback newCallback) +{ + auto oldCallback = nurseryCollectionCallback; + nurseryCollectionCallback = newCallback; + return oldCallback; +} + int64_t Statistics::clearMaxGCPauseAccumulator() { diff --git a/js/src/gc/Statistics.h b/js/src/gc/Statistics.h index bd9f6991ae8..8a3ef580558 100644 --- a/js/src/gc/Statistics.h +++ b/js/src/gc/Statistics.h @@ -200,6 +200,8 @@ struct Statistics UniqueChars formatDetailedMessage(); JS::GCSliceCallback setSliceCallback(JS::GCSliceCallback callback); + JS::GCNurseryCollectionCallback setNurseryCollectionCallback( + JS::GCNurseryCollectionCallback callback); int64_t clearMaxGCPauseAccumulator(); int64_t getMaxGCPauseSinceClear(); @@ -306,6 +308,7 @@ struct Statistics Vector sccTimes; JS::GCSliceCallback sliceCallback; + JS::GCNurseryCollectionCallback nurseryCollectionCallback; /* * True if we saw an OOM while allocating slices. The statistics for this diff --git a/js/src/jsgc.cpp b/js/src/jsgc.cpp index 82c5b915c56..987ecb504bc 100644 --- a/js/src/jsgc.cpp +++ b/js/src/jsgc.cpp @@ -1757,6 +1757,11 @@ GCRuntime::setSliceCallback(JS::GCSliceCallback callback) { return stats.setSliceCallback(callback); } +JS::GCNurseryCollectionCallback +GCRuntime::setNurseryCollectionCallback(JS::GCNurseryCollectionCallback callback) { + return stats.setNurseryCollectionCallback(callback); +} + bool GCRuntime::addRoot(Value* vp, const char* name) { @@ -7488,6 +7493,12 @@ JS::SetGCSliceCallback(JSRuntime* rt, GCSliceCallback callback) return rt->gc.setSliceCallback(callback); } +JS_PUBLIC_API(JS::GCNurseryCollectionCallback) +JS::SetGCNurseryCollectionCallback(JSRuntime* rt, GCNurseryCollectionCallback callback) +{ + return rt->gc.setNurseryCollectionCallback(callback); +} + JS_PUBLIC_API(void) JS::DisableIncrementalGC(JSRuntime* rt) { From 3891408128c580d8107ac38e2b0044c8f9fbcbaa Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Tue, 19 Jan 2016 12:48:22 -0800 Subject: [PATCH 058/119] Bug 1233831 - Part 1: Call the callback on nursery collections; r=terrence This commit adds the `js::gcstats::Statistics::{begin,end}NurseryCollection` methods which calls the nursery collection callback, if present, and additionally handles counting minor GCs (which used to be inline in js::Nursery::collect). --- js/src/gc/Nursery.cpp | 4 ++-- js/src/gc/Statistics.h | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/js/src/gc/Nursery.cpp b/js/src/gc/Nursery.cpp index 520246d832b..e55d895f19b 100644 --- a/js/src/gc/Nursery.cpp +++ b/js/src/gc/Nursery.cpp @@ -418,8 +418,7 @@ js::Nursery::collect(JSRuntime* rt, JS::gcreason::Reason reason, ObjectGroupList rt->gc.incMinorGcNumber(); - rt->gc.stats.count(gcstats::STAT_MINOR_GC); - + rt->gc.stats.beginNurseryCollection(reason); TraceMinorGCStart(); int64_t timestampStart_total = PRMJ_Now(); @@ -563,6 +562,7 @@ js::Nursery::collect(JSRuntime* rt, JS::gcreason::Reason reason, ObjectGroupList if (totalTime > 1000) rt->addTelemetry(JS_TELEMETRY_GC_MINOR_REASON_LONG, reason); + rt->gc.stats.endNurseryCollection(reason); TraceMinorGCEnd(); if (enableProfiling_ && totalTime >= profileThreshold_) { diff --git a/js/src/gc/Statistics.h b/js/src/gc/Statistics.h index 8a3ef580558..db35ed79949 100644 --- a/js/src/gc/Statistics.h +++ b/js/src/gc/Statistics.h @@ -191,6 +191,23 @@ struct Statistics counts[s]++; } + void beginNurseryCollection(JS::gcreason::Reason reason) { + count(STAT_MINOR_GC); + if (nurseryCollectionCallback) { + (*nurseryCollectionCallback)(runtime, + JS::GCNurseryProgress::GC_NURSERY_COLLECTION_START, + reason); + } + } + + void endNurseryCollection(JS::gcreason::Reason reason) { + if (nurseryCollectionCallback) { + (*nurseryCollectionCallback)(runtime, + JS::GCNurseryProgress::GC_NURSERY_COLLECTION_END, + reason); + } + } + int64_t beginSCC(); void endSCC(unsigned scc, int64_t start); From 823546e03f8f0be258d5af1cf954f11546495e87 Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Tue, 19 Jan 2016 12:48:22 -0800 Subject: [PATCH 059/119] Bug 1233831 - Part 2: Expose JS::gcreason::ExplainReason to embedders; r=terrence This renames the internal function `js::gcstats::ExplainReason` to `JS::gcreason::ExplainReason` and publicly exposes it to embedders. --- js/public/GCAPI.h | 6 ++++++ js/src/gc/Nursery.cpp | 2 +- js/src/gc/Statistics.cpp | 4 ++-- js/src/gc/Statistics.h | 1 - js/src/vm/Debugger.cpp | 2 +- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/js/public/GCAPI.h b/js/public/GCAPI.h index ff31654b17e..f3453827e79 100644 --- a/js/public/GCAPI.h +++ b/js/public/GCAPI.h @@ -128,6 +128,12 @@ enum Reason { NUM_TELEMETRY_REASONS = 100 }; +/** + * Get a statically allocated C string explaining the given GC reason. + */ +extern JS_PUBLIC_API(const char*) +ExplainReason(JS::gcreason::Reason reason); + } /* namespace gcreason */ /* diff --git a/js/src/gc/Nursery.cpp b/js/src/gc/Nursery.cpp index e55d895f19b..cfc8b0b32f2 100644 --- a/js/src/gc/Nursery.cpp +++ b/js/src/gc/Nursery.cpp @@ -600,7 +600,7 @@ js::Nursery::collect(JSRuntime* rt, JS::gcreason::Reason reason, ObjectGroupList } #define FMT " %6" PRIu64 - fprintf(stderr, "MinorGC: %20s %5.1f%% %4d " FMT, js::gcstats::ExplainReason(reason), + fprintf(stderr, "MinorGC: %20s %5.1f%% %4d " FMT, JS::gcreason::ExplainReason(reason), promotionRate * 100, numActiveChunks_, totalTime); for (auto &entry : PrintList) { fprintf(stderr, FMT, entry.time); diff --git a/js/src/gc/Statistics.cpp b/js/src/gc/Statistics.cpp index b52eaaeec8a..2962c45cd7c 100644 --- a/js/src/gc/Statistics.cpp +++ b/js/src/gc/Statistics.cpp @@ -48,8 +48,8 @@ js::gcstats::ExplainInvocationKind(JSGCInvocationKind gckind) return "Shrinking"; } -const char* -js::gcstats::ExplainReason(JS::gcreason::Reason reason) +JS_PUBLIC_API(const char*) +JS::gcreason::ExplainReason(JS::gcreason::Reason reason) { switch (reason) { #define SWITCH_REASON(name) \ diff --git a/js/src/gc/Statistics.h b/js/src/gc/Statistics.h index db35ed79949..ff1f1dcb034 100644 --- a/js/src/gc/Statistics.h +++ b/js/src/gc/Statistics.h @@ -423,7 +423,6 @@ struct MOZ_RAII AutoSCC }; const char* ExplainInvocationKind(JSGCInvocationKind gckind); -const char* ExplainReason(JS::gcreason::Reason reason); } /* namespace gcstats */ } /* namespace js */ diff --git a/js/src/vm/Debugger.cpp b/js/src/vm/Debugger.cpp index 9e3d5ad31de..2391925aca7 100644 --- a/js/src/vm/Debugger.cpp +++ b/js/src/vm/Debugger.cpp @@ -8519,7 +8519,7 @@ GarbageCollectionEvent::Create(JSRuntime* rt, ::js::gcstats::Statistics& stats, // reasons this data is stored and replicated on each slice. Each // slice used to have its own GCReason, but now they are all the // same. - data->reason = gcstats::ExplainReason(range.front().reason); + data->reason = gcreason::ExplainReason(range.front().reason); MOZ_ASSERT(data->reason); } From 1aab9201645e8acfbfc18df39a7c50f762df88df Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Tue, 19 Jan 2016 12:48:22 -0800 Subject: [PATCH 060/119] Bug 1233831 - Part 3: Install a callback to trace nursery collections; r=mccr8 This commit makes CycleCollectedJSRuntime install a nursery collection callback which traces nursery collections with a new `mozilla::TimelineMarker` subclass. --- xpcom/base/CycleCollectedJSRuntime.cpp | 89 +++++++++++++++++++++++++- xpcom/base/CycleCollectedJSRuntime.h | 4 ++ 2 files changed, 92 insertions(+), 1 deletion(-) diff --git a/xpcom/base/CycleCollectedJSRuntime.cpp b/xpcom/base/CycleCollectedJSRuntime.cpp index d65b9e8081d..069c2e138fd 100644 --- a/xpcom/base/CycleCollectedJSRuntime.cpp +++ b/xpcom/base/CycleCollectedJSRuntime.cpp @@ -58,11 +58,15 @@ #include #include "mozilla/ArrayUtils.h" #include "mozilla/AutoRestore.h" +#include "mozilla/Move.h" #include "mozilla/MemoryReporting.h" #include "mozilla/Snprintf.h" #include "mozilla/Telemetry.h" +#include "mozilla/TimelineConsumers.h" +#include "mozilla/TimelineMarker.h" #include "mozilla/DebuggerOnGCRunnable.h" #include "mozilla/dom/DOMJSClass.h" +#include "mozilla/dom/ProfileTimelineMarkerBinding.h" #include "mozilla/dom/Promise.h" #include "mozilla/dom/ScriptSettings.h" #include "jsprf.h" @@ -411,6 +415,7 @@ CycleCollectedJSRuntime::CycleCollectedJSRuntime(JSRuntime* aParentRuntime, , mJSZoneCycleCollectorGlobal(sJSZoneCycleCollectorGlobal) , mJSRuntime(nullptr) , mPrevGCSliceCallback(nullptr) + , mPrevGCNurseryCollectionCallback(nullptr) , mJSHolders(256) , mDoingStableStates(false) , mOutOfMemoryState(OOMState::OK) @@ -437,6 +442,19 @@ CycleCollectedJSRuntime::CycleCollectedJSRuntime(JSRuntime* aParentRuntime, JS_SetGrayGCRootsTracer(mJSRuntime, TraceGrayJS, this); JS_SetGCCallback(mJSRuntime, GCCallback, this); mPrevGCSliceCallback = JS::SetGCSliceCallback(mJSRuntime, GCSliceCallback); + + if (NS_IsMainThread()) { + // We would like to support all threads here, but the way timeline consumers + // are set up currently, you can either add a marker for one specific + // docshell, or for every consumer globally. We would like to add a marker + // for every consumer observing anything on this thread, but that is not + // currently possible. For now, add global markers only when we are on the + // main thread, since the UI for this tracing data only displays data + // relevant to the main-thread. + mPrevGCNurseryCollectionCallback = JS::SetGCNurseryCollectionCallback( + mJSRuntime, GCNurseryCollectionCallback); + } + JS_SetObjectsTenuredCallback(mJSRuntime, JSObjectsTenuredCb, this); JS::SetOutOfMemoryCallback(mJSRuntime, OutOfMemoryCallback, this); JS::SetLargeAllocationFailureCallback(mJSRuntime, @@ -745,6 +763,76 @@ CycleCollectedJSRuntime::GCSliceCallback(JSRuntime* aRuntime, } } +class MinorGCMarker : public TimelineMarker +{ +private: + JS::gcreason::Reason mReason; + +public: + MinorGCMarker(MarkerTracingType aTracingType, + JS::gcreason::Reason aReason) + : TimelineMarker("MinorGC", + aTracingType, + MarkerStackRequest::NO_STACK) + , mReason(aReason) + { + MOZ_ASSERT(aTracingType == MarkerTracingType::START || + aTracingType == MarkerTracingType::END); + } + + MinorGCMarker(JS::GCNurseryProgress aProgress, + JS::gcreason::Reason aReason) + : TimelineMarker("MinorGC", + aProgress == JS::GCNurseryProgress::GC_NURSERY_COLLECTION_START + ? MarkerTracingType::START + : MarkerTracingType::END, + MarkerStackRequest::NO_STACK) + , mReason(aReason) + { } + + virtual void + AddDetails(JSContext* aCx, + dom::ProfileTimelineMarker& aMarker) override + { + TimelineMarker::AddDetails(aCx, aMarker); + + if (GetTracingType() == MarkerTracingType::START) { + auto reason = JS::gcreason::ExplainReason(mReason); + aMarker.mCauseName.Construct(NS_ConvertUTF8toUTF16(reason)); + } + } + + virtual UniquePtr + Clone() override + { + auto clone = MakeUnique(GetTracingType(), mReason); + clone->SetCustomTime(GetTime()); + return UniquePtr(Move(clone)); + } +}; + +/* static */ void +CycleCollectedJSRuntime::GCNurseryCollectionCallback(JSRuntime* aRuntime, + JS::GCNurseryProgress aProgress, + JS::gcreason::Reason aReason) +{ + CycleCollectedJSRuntime* self = CycleCollectedJSRuntime::Get(); + MOZ_ASSERT(self->Runtime() == aRuntime); + MOZ_ASSERT(NS_IsMainThread()); + + RefPtr timelines = TimelineConsumers::Get(); + if (timelines && !timelines->IsEmpty()) { + UniquePtr abstractMarker( + MakeUnique(aProgress, aReason)); + timelines->AddMarkerForAllObservedDocShells(abstractMarker); + } + + if (self->mPrevGCNurseryCollectionCallback) { + self->mPrevGCNurseryCollectionCallback(aRuntime, aProgress, aReason); + } +} + + /* static */ void CycleCollectedJSRuntime::OutOfMemoryCallback(JSContext* aContext, void* aData) @@ -1403,4 +1491,3 @@ CycleCollectedJSRuntime::OnLargeAllocationFailure() CustomLargeAllocationFailureCallback(); AnnotateAndSetOutOfMemory(&mLargeAllocationFailureState, OOMState::Reported); } - diff --git a/xpcom/base/CycleCollectedJSRuntime.h b/xpcom/base/CycleCollectedJSRuntime.h index 19271e34f57..7937d935cff 100644 --- a/xpcom/base/CycleCollectedJSRuntime.h +++ b/xpcom/base/CycleCollectedJSRuntime.h @@ -203,6 +203,9 @@ private: static void GCCallback(JSRuntime* aRuntime, JSGCStatus aStatus, void* aData); static void GCSliceCallback(JSRuntime* aRuntime, JS::GCProgress aProgress, const JS::GCDescription& aDesc); + static void GCNurseryCollectionCallback(JSRuntime* aRuntime, + JS::GCNurseryProgress aProgress, + JS::gcreason::Reason aReason); static void OutOfMemoryCallback(JSContext* aContext, void* aData); static void LargeAllocationFailureCallback(void* aData); static bool ContextCallback(JSContext* aCx, unsigned aOperation, @@ -341,6 +344,7 @@ private: JSRuntime* mJSRuntime; JS::GCSliceCallback mPrevGCSliceCallback; + JS::GCNurseryCollectionCallback mPrevGCNurseryCollectionCallback; nsDataHashtable, nsScriptObjectTracer*> mJSHolders; From 40ec1758e1a9d6be0b26646df5fac1dabf4bee33 Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Tue, 19 Jan 2016 12:48:22 -0800 Subject: [PATCH 061/119] Bug 1233831 - Part 4: Add metadata for the minor GC markers; r=vporof This commit adds the necessary metadata for the performance tool to render the new minor gc markers. --- devtools/client/locales/en-US/markers.properties | 4 ++++ .../client/performance/modules/logic/marker-utils.js | 9 +++++++++ devtools/client/performance/modules/markers.js | 6 ++++++ 3 files changed, 19 insertions(+) diff --git a/devtools/client/locales/en-US/markers.properties b/devtools/client/locales/en-US/markers.properties index 35deb2375c7..c463cb03e49 100644 --- a/devtools/client/locales/en-US/markers.properties +++ b/devtools/client/locales/en-US/markers.properties @@ -27,6 +27,7 @@ marker.label.consoleTime=Console marker.label.garbageCollection2=Garbage Collection marker.label.garbageCollection.incremental=Incremental GC marker.label.garbageCollection.nonIncremental=Non-incremental GC +marker.label.minorGC=Minor GC marker.label.cycleCollection=Cycle Collection marker.label.cycleCollection.forgetSkippable=CC Graph Reduction marker.label.timestamp=Timestamp @@ -125,6 +126,9 @@ marker.gcreason.label.FINISH_LARGE_EVALUATE=Large Eval marker.gcreason.label.DOM_WINDOW_UTILS=User Inactive marker.gcreason.label.USER_INACTIVE=User Inactive +# The name of a nursery collection. +marker.nurseryCollection=Nursery Collection + # LOCALIZATION NOTE (marker.gcreason.description.*): # These strings are used to give an expanded description of why a GC occurred. marker.gcreason.description.API=There was an API call to force garbage collection. diff --git a/devtools/client/performance/modules/logic/marker-utils.js b/devtools/client/performance/modules/logic/marker-utils.js index 195331e67e4..8a6552f7eac 100644 --- a/devtools/client/performance/modules/logic/marker-utils.js +++ b/devtools/client/performance/modules/logic/marker-utils.js @@ -407,6 +407,15 @@ const Formatters = { return fields; }, + MinorGCFields: function (marker) { + const cause = marker.causeName; + const label = L10N.getStr(`marker.gcreason.label.${cause}`) || cause; + return { + [L10N.getStr("marker.field.type")]: L10N.getStr("marker.nurseryCollection"), + [L10N.getStr("marker.field.causeName")]: label, + }; + }, + DOMEventFields: function (marker) { let fields = Object.create(null); if ("type" in marker) { diff --git a/devtools/client/performance/modules/markers.js b/devtools/client/performance/modules/markers.js index 0352d6be4c6..f22e01777f5 100644 --- a/devtools/client/performance/modules/markers.js +++ b/devtools/client/performance/modules/markers.js @@ -123,6 +123,12 @@ const TIMELINE_BLUEPRINT = { label: Formatters.GCLabel, fields: Formatters.GCFields, }, + "MinorGC": { + group: 1, + colorName: "graphs-red", + label: L10N.getStr("marker.label.minorGC"), + fields: Formatters.MinorGCFields, + }, "nsCycleCollector::Collect": { group: 1, colorName: "graphs-red", From 01fc9259ecdebef6d1dcf110caeecbe5e27d8f1c Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Tue, 19 Jan 2016 12:48:23 -0800 Subject: [PATCH 062/119] Bug 1233831 - Part 5: Test the minor GC markers; r=vporof --- devtools/server/tests/browser/browser.ini | 1 + .../tests/browser/browser_markers-minor-gc.js | 32 +++++++++++++++++++ .../server/tests/browser/doc_allocations.html | 6 ++-- 3 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 devtools/server/tests/browser/browser_markers-minor-gc.js diff --git a/devtools/server/tests/browser/browser.ini b/devtools/server/tests/browser/browser.ini index 61ff42217ce..eedbb99131a 100644 --- a/devtools/server/tests/browser/browser.ini +++ b/devtools/server/tests/browser/browser.ini @@ -54,6 +54,7 @@ skip-if = e10s # Bug 1183605 - devtools/server/tests/browser/ tests are still di [browser_markers-docloading-02.js] [browser_markers-docloading-03.js] [browser_markers-gc.js] +[browser_markers-minor-gc.js] [browser_markers-parse-html.js] [browser_markers-styles.js] [browser_markers-timestamp.js] diff --git a/devtools/server/tests/browser/browser_markers-minor-gc.js b/devtools/server/tests/browser/browser_markers-minor-gc.js new file mode 100644 index 00000000000..3c3a1b2e412 --- /dev/null +++ b/devtools/server/tests/browser/browser_markers-minor-gc.js @@ -0,0 +1,32 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +/** + * Test that we get "MinorGC" markers when we continue to steadily allocate + * objects. + */ + +const { PerformanceFront } = require("devtools/server/actors/performance"); + +add_task(function*() { + // This test runs very slowly on linux32 debug EC2 instances. + requestLongerTimeout(2); + + let doc = yield addTab(MAIN_DOMAIN + "doc_allocations.html"); + + initDebuggerServer(); + let client = new DebuggerClient(DebuggerServer.connectPipe()); + let form = yield connectDebuggerClient(client); + let front = PerformanceFront(client, form); + yield front.connect(); + let rec = yield front.startRecording({ withMarkers: true }); + + let markers = yield waitForMarkerType(front, ["MinorGC"]); + yield front.stopRecording(rec); + + ok(markers.some(m => m.name === "MinorGC" && m.causeName), + "got some MinorGC markers"); + + yield closeDebuggerClient(client); + gBrowser.removeCurrentTab(); +}); diff --git a/devtools/server/tests/browser/doc_allocations.html b/devtools/server/tests/browser/doc_allocations.html index 9d26df4a7f6..314c40cac25 100644 --- a/devtools/server/tests/browser/doc_allocations.html +++ b/devtools/server/tests/browser/doc_allocations.html @@ -5,10 +5,12 @@ diff --git a/dom/tests/mochitest/fetch/sw_reroute.js b/dom/tests/mochitest/fetch/sw_reroute.js index 0525258c6ce..c22fd62fd9d 100644 --- a/dom/tests/mochitest/fetch/sw_reroute.js +++ b/dom/tests/mochitest/fetch/sw_reroute.js @@ -17,7 +17,9 @@ function testScript(script) { ["dom.serviceWorkers.exemptFromPerDomainMax", true]] }, function() { navigator.serviceWorker.ready.then(setupSW); - navigator.serviceWorker.register("reroute.js", {scope: "/"}); + var scriptURL = location.href.includes("sw_empty_reroute.html") + ? "empty.js" : "reroute.js"; + navigator.serviceWorker.register(scriptURL, {scope: "/"}); }); } diff --git a/dom/tests/mochitest/fetch/test_fetch_basic_http_sw_empty_reroute.html b/dom/tests/mochitest/fetch/test_fetch_basic_http_sw_empty_reroute.html new file mode 100644 index 00000000000..0f5052edac9 --- /dev/null +++ b/dom/tests/mochitest/fetch/test_fetch_basic_http_sw_empty_reroute.html @@ -0,0 +1,22 @@ + + + + + Bug 1039846 - Test fetch() http fetching in worker + + + + +

+ +

+
+
+
+
+
diff --git a/dom/tests/mochitest/fetch/test_fetch_basic_sw_empty_reroute.html b/dom/tests/mochitest/fetch/test_fetch_basic_sw_empty_reroute.html
new file mode 100644
index 00000000000..bcf959addb5
--- /dev/null
+++ b/dom/tests/mochitest/fetch/test_fetch_basic_sw_empty_reroute.html
@@ -0,0 +1,22 @@
+
+
+
+
+  Bug 1039846 - Test fetch() function in worker
+  
+  
+
+
+

+ +

+
+
+
+
+
diff --git a/dom/tests/mochitest/fetch/test_fetch_cors_sw_empty_reroute.html b/dom/tests/mochitest/fetch/test_fetch_cors_sw_empty_reroute.html
new file mode 100644
index 00000000000..7ad368cfd6c
--- /dev/null
+++ b/dom/tests/mochitest/fetch/test_fetch_cors_sw_empty_reroute.html
@@ -0,0 +1,22 @@
+
+
+
+
+  Bug 1039846 - Test fetch() CORS mode
+  
+  
+
+
+

+ +

+
+
+
+
+

From bfb7d127baa524e88a7f83cc66a6ce6650bcfa5a Mon Sep 17 00:00:00 2001
From: Ben Kelly 
Date: Tue, 19 Jan 2016 13:54:15 -0800
Subject: [PATCH 068/119] Bug 1237455 P4 Create helper method to set fetch
 request headers. r=ehsan

---
 dom/fetch/FetchDriver.cpp | 65 ++++++++++++++++++++++-----------------
 dom/fetch/FetchDriver.h   |  2 ++
 2 files changed, 38 insertions(+), 29 deletions(-)

diff --git a/dom/fetch/FetchDriver.cpp b/dom/fetch/FetchDriver.cpp
index f7564054a44..76fa43fd571 100644
--- a/dom/fetch/FetchDriver.cpp
+++ b/dom/fetch/FetchDriver.cpp
@@ -249,25 +249,7 @@ FetchDriver::HttpFetch()
     NS_ENSURE_SUCCESS(rv, rv);
 
     // Set the same headers.
-    nsAutoTArray headers;
-    mRequest->Headers()->GetEntries(headers);
-    bool hasAccept = false;
-    for (uint32_t i = 0; i < headers.Length(); ++i) {
-      if (!hasAccept && headers[i].mName.EqualsLiteral("accept")) {
-        hasAccept = true;
-      }
-      if (headers[i].mValue.IsEmpty()) {
-        httpChan->SetEmptyRequestHeader(headers[i].mName);
-      } else {
-        httpChan->SetRequestHeader(headers[i].mName, headers[i].mValue, false /* merge */);
-      }
-    }
-
-    if (!hasAccept) {
-      httpChan->SetRequestHeader(NS_LITERAL_CSTRING("accept"),
-                                 NS_LITERAL_CSTRING("*/*"),
-                                 false /* merge */);
-    }
+    SetRequestHeaders(httpChan);
 
     // Step 2. Set the referrer.
     nsAutoString referrer;
@@ -300,16 +282,6 @@ FetchDriver::HttpFetch()
       NS_ENSURE_SUCCESS(rv, rv);
     }
 
-    // Step 3 "If HTTPRequest's force Origin header flag is set..."
-    if (mRequest->ForceOriginHeader()) {
-      nsAutoString origin;
-      rv = nsContentUtils::GetUTFOrigin(mPrincipal, origin);
-      NS_ENSURE_SUCCESS(rv, rv);
-
-      httpChan->SetRequestHeader(NS_LITERAL_CSTRING("origin"),
-                                 NS_ConvertUTF16toUTF8(origin),
-                                 false /* merge */);
-    }
     // Bug 1120722 - Authorization will be handled later.
     // Auth may require prompting, we don't support it yet.
     // The next patch in this same bug prevents this from aborting the request.
@@ -714,5 +686,40 @@ FetchDriver::SetDocument(nsIDocument* aDocument)
   mDocument = aDocument;
 }
 
+void
+FetchDriver::SetRequestHeaders(nsIHttpChannel* aChannel) const
+{
+  MOZ_ASSERT(aChannel);
+
+  nsAutoTArray headers;
+  mRequest->Headers()->GetEntries(headers);
+  bool hasAccept = false;
+  for (uint32_t i = 0; i < headers.Length(); ++i) {
+    if (!hasAccept && headers[i].mName.EqualsLiteral("accept")) {
+      hasAccept = true;
+    }
+    if (headers[i].mValue.IsEmpty()) {
+      aChannel->SetEmptyRequestHeader(headers[i].mName);
+    } else {
+      aChannel->SetRequestHeader(headers[i].mName, headers[i].mValue, false /* merge */);
+    }
+  }
+
+  if (!hasAccept) {
+    aChannel->SetRequestHeader(NS_LITERAL_CSTRING("accept"),
+                               NS_LITERAL_CSTRING("*/*"),
+                               false /* merge */);
+  }
+
+  if (mRequest->ForceOriginHeader()) {
+    nsAutoString origin;
+    if (NS_SUCCEEDED(nsContentUtils::GetUTFOrigin(mPrincipal, origin))) {
+      aChannel->SetRequestHeader(NS_LITERAL_CSTRING("origin"),
+                                 NS_ConvertUTF16toUTF8(origin),
+                                 false /* merge */);
+    }
+  }
+}
+
 } // namespace dom
 } // namespace mozilla
diff --git a/dom/fetch/FetchDriver.h b/dom/fetch/FetchDriver.h
index 1652192c250..4b3bef51998 100644
--- a/dom/fetch/FetchDriver.h
+++ b/dom/fetch/FetchDriver.h
@@ -99,6 +99,8 @@ private:
   // Utility since not all cases need to do any post processing of the filtered
   // response.
   nsresult FailWithNetworkError();
+
+  void SetRequestHeaders(nsIHttpChannel* aChannel) const;
 };
 
 } // namespace dom

From b3ce613a30e2844a2630f22c241ea4cfc83e37c0 Mon Sep 17 00:00:00 2001
From: Ben Kelly 
Date: Tue, 19 Jan 2016 13:54:15 -0800
Subject: [PATCH 069/119] Bug 1237455 P5 Set headers on fetch() redirects.
 r=ehsan

---
 dom/fetch/FetchDriver.cpp | 33 ++++++++++++++++++++++++++++++++-
 dom/fetch/FetchDriver.h   |  2 ++
 2 files changed, 34 insertions(+), 1 deletion(-)

diff --git a/dom/fetch/FetchDriver.cpp b/dom/fetch/FetchDriver.cpp
index 76fa43fd571..ae2ae2c0b3e 100644
--- a/dom/fetch/FetchDriver.cpp
+++ b/dom/fetch/FetchDriver.cpp
@@ -43,7 +43,7 @@ namespace mozilla {
 namespace dom {
 
 NS_IMPL_ISUPPORTS(FetchDriver,
-                  nsIStreamListener, nsIInterfaceRequestor,
+                  nsIStreamListener, nsIChannelEventSink, nsIInterfaceRequestor,
                   nsIThreadRetargetableStreamListener)
 
 FetchDriver::FetchDriver(InternalRequest* aRequest, nsIPrincipal* aPrincipal,
@@ -230,6 +230,17 @@ FetchDriver::HttpFetch()
 
   mLoadGroup = nullptr;
 
+  // Insert ourselves into the notification callbacks chain so we can set
+  // headers on redirects.
+#ifdef DEBUG
+  {
+    nsCOMPtr notificationCallbacks;
+    chan->GetNotificationCallbacks(getter_AddRefs(notificationCallbacks));
+    MOZ_ASSERT(!notificationCallbacks);
+  }
+#endif
+  chan->SetNotificationCallbacks(this);
+
   // FIXME(nsm): Bug 1120715.
   // Step 3.4 "If request's cache mode is default and request's header list
   // contains a header named `If-Modified-Since`, `If-None-Match`,
@@ -655,6 +666,21 @@ FetchDriver::OnStopRequest(nsIRequest* aRequest,
   return NS_OK;
 }
 
+NS_IMETHODIMP
+FetchDriver::AsyncOnChannelRedirect(nsIChannel* aOldChannel,
+                                    nsIChannel* aNewChannel,
+                                    uint32_t aFlags,
+                                    nsIAsyncVerifyRedirectCallback *aCallback)
+{
+  nsCOMPtr httpChannel = do_QueryInterface(aNewChannel);
+  if (httpChannel) {
+    SetRequestHeaders(httpChannel);
+  }
+
+  aCallback->OnRedirectVerifyCallback(NS_OK);
+  return NS_OK;
+}
+
 NS_IMETHODIMP
 FetchDriver::CheckListenerChain()
 {
@@ -664,6 +690,11 @@ FetchDriver::CheckListenerChain()
 NS_IMETHODIMP
 FetchDriver::GetInterface(const nsIID& aIID, void **aResult)
 {
+  if (aIID.Equals(NS_GET_IID(nsIChannelEventSink))) {
+    *aResult = static_cast(this);
+    NS_ADDREF_THIS();
+    return NS_OK;
+  }
   if (aIID.Equals(NS_GET_IID(nsIStreamListener))) {
     *aResult = static_cast(this);
     NS_ADDREF_THIS();
diff --git a/dom/fetch/FetchDriver.h b/dom/fetch/FetchDriver.h
index 4b3bef51998..4651f094705 100644
--- a/dom/fetch/FetchDriver.h
+++ b/dom/fetch/FetchDriver.h
@@ -55,6 +55,7 @@ private:
 };
 
 class FetchDriver final : public nsIStreamListener,
+                          public nsIChannelEventSink,
                           public nsIInterfaceRequestor,
                           public nsIThreadRetargetableStreamListener
 {
@@ -62,6 +63,7 @@ public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIREQUESTOBSERVER
   NS_DECL_NSISTREAMLISTENER
+  NS_DECL_NSICHANNELEVENTSINK
   NS_DECL_NSIINTERFACEREQUESTOR
   NS_DECL_NSITHREADRETARGETABLESTREAMLISTENER
 

From c3a47b5727c89bcf69a6659c11db7c84e866d3e5 Mon Sep 17 00:00:00 2001
From: Jan de Mooij 
Date: Tue, 19 Jan 2016 22:50:22 +0100
Subject: [PATCH 070/119] Bug 1236316 - Suppress GC in ActivationEntryMonitor
 constructors; should fix a ton of dt oranges. r=fitzgen

---
 js/src/jit/BaselineJIT.cpp | 12 ++++++++++++
 js/src/jit/Ion.cpp         | 18 ++++++++++++++++++
 js/src/vm/Stack.cpp        |  6 ++++++
 3 files changed, 36 insertions(+)

diff --git a/js/src/jit/BaselineJIT.cpp b/js/src/jit/BaselineJIT.cpp
index 849a512598c..8e0e4eb4af5 100644
--- a/js/src/jit/BaselineJIT.cpp
+++ b/js/src/jit/BaselineJIT.cpp
@@ -106,6 +106,15 @@ EnterBaseline(JSContext* cx, EnterJitData& data)
         JS_CHECK_RECURSION(cx, return JitExec_Aborted);
     }
 
+#ifdef DEBUG
+    // Assert we don't GC before entering JIT code. A GC could discard JIT code
+    // or move the function stored in the CalleeToken (it won't be traced at
+    // this point). We use Maybe<> here so we can call reset() to call the
+    // AutoAssertOnGC destructor before we enter JIT code.
+    mozilla::Maybe nogc;
+    nogc.emplace(cx->runtime());
+#endif
+
     MOZ_ASSERT(jit::IsBaselineEnabled(cx));
     MOZ_ASSERT_IF(data.osrFrame, CheckFrame(data.osrFrame));
 
@@ -130,6 +139,9 @@ EnterBaseline(JSContext* cx, EnterJitData& data)
         if (data.osrFrame)
             data.osrFrame->setRunningInJit();
 
+#ifdef DEBUG
+        nogc.reset();
+#endif
         // Single transition point from Interpreter to Baseline.
         CALL_GENERATED_CODE(enter, data.jitcode, data.maxArgc, data.maxArgv, data.osrFrame, data.calleeToken,
                             data.scopeChain.get(), data.osrNumStackValues, data.result.address());
diff --git a/js/src/jit/Ion.cpp b/js/src/jit/Ion.cpp
index d0eb991176f..ae90f2e64b3 100644
--- a/js/src/jit/Ion.cpp
+++ b/js/src/jit/Ion.cpp
@@ -2705,6 +2705,12 @@ EnterIon(JSContext* cx, EnterJitData& data)
     MOZ_ASSERT(jit::IsIonEnabled(cx));
     MOZ_ASSERT(!data.osrFrame);
 
+#ifdef DEBUG
+    // See comment in EnterBaseline.
+    mozilla::Maybe nogc;
+    nogc.emplace(cx->runtime());
+#endif
+
     EnterJitCode enter = cx->runtime()->jitRuntime()->enterIon();
 
     // Caller must construct |this| before invoking the Ion function.
@@ -2717,6 +2723,9 @@ EnterIon(JSContext* cx, EnterJitData& data)
         ActivationEntryMonitor entryMonitor(cx, data.calleeToken);
         JitActivation activation(cx);
 
+#ifdef DEBUG
+        nogc.reset();
+#endif
         CALL_GENERATED_CODE(enter, data.jitcode, data.maxArgc, data.maxArgv, /* osrFrame = */nullptr, data.calleeToken,
                             /* scopeChain = */ nullptr, 0, data.result.address());
     }
@@ -2826,6 +2835,12 @@ jit::FastInvoke(JSContext* cx, HandleFunction fun, CallArgs& args)
 {
     JS_CHECK_RECURSION(cx, return JitExec_Error);
 
+#ifdef DEBUG
+    // See comment in EnterBaseline.
+    mozilla::Maybe nogc;
+    nogc.emplace(cx->runtime());
+#endif
+
     RootedScript script(cx, fun->nonLazyScript());
     IonScript* ion = script->ionScript();
     JitCode* code = ion->method();
@@ -2843,6 +2858,9 @@ jit::FastInvoke(JSContext* cx, HandleFunction fun, CallArgs& args)
     RootedValue result(cx, Int32Value(args.length()));
     MOZ_ASSERT(args.length() >= fun->nargs());
 
+#ifdef DEBUG
+    nogc.reset();
+#endif
     CALL_GENERATED_CODE(enter, jitcode, args.length() + 1, args.array() - 1, /* osrFrame = */nullptr,
                         calleeToken, /* scopeChain = */ nullptr, 0, result.address());
 
diff --git a/js/src/vm/Stack.cpp b/js/src/vm/Stack.cpp
index fe2f65aa9a2..d8b881710b7 100644
--- a/js/src/vm/Stack.cpp
+++ b/js/src/vm/Stack.cpp
@@ -1396,6 +1396,9 @@ ActivationEntryMonitor::ActivationEntryMonitor(JSContext* cx, InterpreterFrame*
   : ActivationEntryMonitor(cx)
 {
     if (entryMonitor_) {
+        // The InterpreterFrame is not yet part of an Activation, so it won't
+        // be traced if we trigger GC here. Suppress GC to avoid this.
+        gc::AutoSuppressGC suppressGC(cx);
         RootedValue stack(cx, asyncStack(cx));
         RootedString asyncCause(cx, cx->runtime()->asyncCauseForNewActivations);
         if (entryFrame->isFunctionFrame())
@@ -1409,6 +1412,9 @@ ActivationEntryMonitor::ActivationEntryMonitor(JSContext* cx, jit::CalleeToken e
   : ActivationEntryMonitor(cx)
 {
     if (entryMonitor_) {
+        // The CalleeToken is not traced at this point and we also don't want
+        // a GC to discard the code we're about to enter, so we suppress GC.
+        gc::AutoSuppressGC suppressGC(cx);
         RootedValue stack(cx, asyncStack(cx));
         RootedString asyncCause(cx, cx->runtime()->asyncCauseForNewActivations);
         if (jit::CalleeTokenIsFunction(entryToken))

From 568b94f3c0e94fadb04aa1668d3d5b1ea26c675c Mon Sep 17 00:00:00 2001
From: Francois Marier 
Date: Tue, 19 Jan 2016 13:56:49 -0800
Subject: [PATCH 071/119] Bug 1239587 - Rename the
 browser.safebrowsing.appRepURL pref. r=gcp

---
 b2g/app/b2g.js                                                  | 2 +-
 browser/app/profile/firefox.js                                  | 2 +-
 mobile/android/app/mobile.js                                    | 2 +-
 mobile/android/b2gdroid/app/b2gdroid.js                         | 2 +-
 testing/profiles/prefs_general.js                               | 2 +-
 toolkit/components/downloads/ApplicationReputation.cpp          | 2 +-
 toolkit/components/downloads/test/unit/test_app_rep.js          | 2 +-
 toolkit/components/downloads/test/unit/test_app_rep_maclinux.js | 2 +-
 toolkit/components/downloads/test/unit/test_app_rep_windows.js  | 2 +-
 9 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/b2g/app/b2g.js b/b2g/app/b2g.js
index 8addabb8364..f1712b2f64f 100644
--- a/b2g/app/b2g.js
+++ b/b2g/app/b2g.js
@@ -354,6 +354,7 @@ pref("browser.safebrowsing.malware.enabled", true);
 pref("browser.safebrowsing.downloads.enabled", true);
 pref("browser.safebrowsing.downloads.remote.enabled", true);
 pref("browser.safebrowsing.downloads.remote.timeout_ms", 10000);
+pref("browser.safebrowsing.downloads.remote.url", "https://sb-ssl.google.com/safebrowsing/clientreport/download?key=%GOOGLE_API_KEY%");
 pref("browser.safebrowsing.debug", false);
 
 pref("browser.safebrowsing.provider.google.lists", "goog-badbinurl-shavar,goog-downloadwhite-digest256,goog-phish-shavar,goog-malware-shavar,goog-unwanted-shavar");
@@ -364,7 +365,6 @@ pref("browser.safebrowsing.provider.google.reportURL", "https://safebrowsing.goo
 pref("browser.safebrowsing.reportPhishMistakeURL", "https://%LOCALE%.phish-error.mozilla.com/?hl=%LOCALE%&url=");
 pref("browser.safebrowsing.reportPhishURL", "https://%LOCALE%.phish-report.mozilla.com/?hl=%LOCALE%&url=");
 pref("browser.safebrowsing.reportMalwareMistakeURL", "https://%LOCALE%.malware-error.mozilla.com/?hl=%LOCALE%&url=");
-pref("browser.safebrowsing.appRepURL", "https://sb-ssl.google.com/safebrowsing/clientreport/download?key=%GOOGLE_API_KEY%");
 
 pref("browser.safebrowsing.id", "Firefox");
 
diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js
index b95b5c3fd6f..8c3105f0cb8 100644
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -952,6 +952,7 @@ pref("browser.safebrowsing.malware.enabled", true);
 pref("browser.safebrowsing.downloads.enabled", true);
 pref("browser.safebrowsing.downloads.remote.enabled", true);
 pref("browser.safebrowsing.downloads.remote.timeout_ms", 10000);
+pref("browser.safebrowsing.downloads.remote.url", "https://sb-ssl.google.com/safebrowsing/clientreport/download?key=%GOOGLE_API_KEY%");
 pref("browser.safebrowsing.debug", false);
 
 pref("browser.safebrowsing.provider.google.lists", "goog-badbinurl-shavar,goog-downloadwhite-digest256,goog-phish-shavar,goog-malware-shavar,goog-unwanted-shavar");
@@ -962,7 +963,6 @@ pref("browser.safebrowsing.provider.google.reportURL", "https://safebrowsing.goo
 pref("browser.safebrowsing.reportPhishMistakeURL", "https://%LOCALE%.phish-error.mozilla.com/?hl=%LOCALE%&url=");
 pref("browser.safebrowsing.reportPhishURL", "https://%LOCALE%.phish-report.mozilla.com/?hl=%LOCALE%&url=");
 pref("browser.safebrowsing.reportMalwareMistakeURL", "https://%LOCALE%.malware-error.mozilla.com/?hl=%LOCALE%&url=");
-pref("browser.safebrowsing.appRepURL", "https://sb-ssl.google.com/safebrowsing/clientreport/download?key=%GOOGLE_API_KEY%");
 
 #ifdef MOZILLA_OFFICIAL
 // Normally the "client ID" sent in updates is appinfo.name, but for
diff --git a/mobile/android/app/mobile.js b/mobile/android/app/mobile.js
index 724af62474a..e7b99e0891b 100644
--- a/mobile/android/app/mobile.js
+++ b/mobile/android/app/mobile.js
@@ -635,6 +635,7 @@ pref("browser.safebrowsing.malware.enabled", true);
 pref("browser.safebrowsing.downloads.enabled", true);
 pref("browser.safebrowsing.downloads.remote.enabled", true);
 pref("browser.safebrowsing.downloads.remote.timeout_ms", 10000);
+pref("browser.safebrowsing.downloads.remote.url", "https://sb-ssl.google.com/safebrowsing/clientreport/download?key=%GOOGLE_API_KEY%");
 pref("browser.safebrowsing.debug", false);
 
 pref("browser.safebrowsing.provider.google.lists", "goog-badbinurl-shavar,goog-downloadwhite-digest256,goog-phish-shavar,goog-malware-shavar,goog-unwanted-shavar");
@@ -645,7 +646,6 @@ pref("browser.safebrowsing.provider.google.reportURL", "https://safebrowsing.goo
 pref("browser.safebrowsing.reportPhishMistakeURL", "https://%LOCALE%.phish-error.mozilla.com/?hl=%LOCALE%&url=");
 pref("browser.safebrowsing.reportPhishURL", "https://%LOCALE%.phish-report.mozilla.com/?hl=%LOCALE%&url=");
 pref("browser.safebrowsing.reportMalwareMistakeURL", "https://%LOCALE%.malware-error.mozilla.com/?hl=%LOCALE%&url=");
-pref("browser.safebrowsing.appRepURL", "https://sb-ssl.google.com/safebrowsing/clientreport/download?key=%GOOGLE_API_KEY%");
 
 pref("browser.safebrowsing.id", @MOZ_APP_UA_NAME@);
 
diff --git a/mobile/android/b2gdroid/app/b2gdroid.js b/mobile/android/b2gdroid/app/b2gdroid.js
index cbbb92785c3..d7a9b894294 100644
--- a/mobile/android/b2gdroid/app/b2gdroid.js
+++ b/mobile/android/b2gdroid/app/b2gdroid.js
@@ -604,6 +604,7 @@ pref("browser.safebrowsing.malware.enabled", true);
 pref("browser.safebrowsing.downloads.enabled", false);
 pref("browser.safebrowsing.downloads.remote.enabled", false);
 pref("browser.safebrowsing.downloads.remote.timeout_ms", 10000);
+pref("browser.safebrowsing.downloads.remote.url", "https://sb-ssl.google.com/safebrowsing/clientreport/download?key=%GOOGLE_API_KEY%");
 pref("browser.safebrowsing.debug", false);
 
 pref("browser.safebrowsing.provider.google.lists", "goog-badbinurl-shavar,goog-downloadwhite-digest256,goog-phish-shavar,goog-malware-shavar,goog-unwanted-shavar");
@@ -614,7 +615,6 @@ pref("browser.safebrowsing.provider.google.reportURL", "https://safebrowsing.goo
 pref("browser.safebrowsing.reportPhishMistakeURL", "https://%LOCALE%.phish-error.mozilla.com/?hl=%LOCALE%&url=");
 pref("browser.safebrowsing.reportPhishURL", "https://%LOCALE%.phish-report.mozilla.com/?hl=%LOCALE%&url=");
 pref("browser.safebrowsing.reportMalwareMistakeURL", "https://%LOCALE%.malware-error.mozilla.com/?hl=%LOCALE%&url=");
-pref("browser.safebrowsing.appRepURL", "https://sb-ssl.google.com/safebrowsing/clientreport/download?key=%GOOGLE_API_KEY%");
 
 pref("browser.safebrowsing.id", @MOZ_APP_UA_NAME@);
 
diff --git a/testing/profiles/prefs_general.js b/testing/profiles/prefs_general.js
index 24793582c5c..c0f816db506 100644
--- a/testing/profiles/prefs_general.js
+++ b/testing/profiles/prefs_general.js
@@ -83,7 +83,7 @@ user_pref("geo.wifi.logging.enabled", true);
 // Make url-classifier updates so rare that they won't affect tests
 user_pref("urlclassifier.updateinterval", 172800);
 // Point the url-classifier to the local testing server for fast failures
-user_pref("browser.safebrowsing.appRepURL", "http://%(server)s/safebrowsing-dummy/update");
+user_pref("browser.safebrowsing.downloads.remote.url", "http://%(server)s/safebrowsing-dummy/update");
 user_pref("browser.safebrowsing.provider.google.gethashURL", "http://%(server)s/safebrowsing-dummy/gethash");
 user_pref("browser.safebrowsing.provider.google.updateURL", "http://%(server)s/safebrowsing-dummy/update");
 user_pref("browser.safebrowsing.provider.mozilla.gethashURL", "http://%(server)s/safebrowsing-dummy/gethash");
diff --git a/toolkit/components/downloads/ApplicationReputation.cpp b/toolkit/components/downloads/ApplicationReputation.cpp
index 780dc02229e..0e037550c96 100644
--- a/toolkit/components/downloads/ApplicationReputation.cpp
+++ b/toolkit/components/downloads/ApplicationReputation.cpp
@@ -62,7 +62,7 @@ using safe_browsing::ClientDownloadRequest_Resource;
 using safe_browsing::ClientDownloadRequest_SignatureInfo;
 
 // Preferences that we need to initialize the query.
-#define PREF_SB_APP_REP_URL "browser.safebrowsing.appRepURL"
+#define PREF_SB_APP_REP_URL "browser.safebrowsing.downloads.remote.url"
 #define PREF_SB_MALWARE_ENABLED "browser.safebrowsing.malware.enabled"
 #define PREF_SB_DOWNLOADS_ENABLED "browser.safebrowsing.downloads.enabled"
 #define PREF_SB_DOWNLOADS_REMOTE_ENABLED "browser.safebrowsing.downloads.remote.enabled"
diff --git a/toolkit/components/downloads/test/unit/test_app_rep.js b/toolkit/components/downloads/test/unit/test_app_rep.js
index 44bd38f128f..b9468b8ff5e 100644
--- a/toolkit/components/downloads/test/unit/test_app_rep.js
+++ b/toolkit/components/downloads/test/unit/test_app_rep.js
@@ -20,7 +20,7 @@ var whitelistedURI = createURI("http://foo:bar@whitelisted.com/index.htm#junk");
 var exampleURI = createURI("http://user:password@example.com/i.html?foo=bar");
 var blocklistedURI = createURI("http://baz:qux@blocklisted.com?xyzzy");
 
-const appRepURLPref = "browser.safebrowsing.appRepURL";
+const appRepURLPref = "browser.safebrowsing.downloads.remote.url";
 
 function readFileToString(aFilename) {
   let f = do_get_file(aFilename);
diff --git a/toolkit/components/downloads/test/unit/test_app_rep_maclinux.js b/toolkit/components/downloads/test/unit/test_app_rep_maclinux.js
index 596e24e7881..d4ac9e192d8 100644
--- a/toolkit/components/downloads/test/unit/test_app_rep_maclinux.js
+++ b/toolkit/components/downloads/test/unit/test_app_rep_maclinux.js
@@ -26,7 +26,7 @@ var gStillRunning = true;
 var gTables = {};
 var gHttpServer = null;
 
-const appRepURLPref = "browser.safebrowsing.appRepURL";
+const appRepURLPref = "browser.safebrowsing.downloads.remote.url";
 const remoteEnabledPref = "browser.safebrowsing.downloads.remote.enabled";
 
 function readFileToString(aFilename) {
diff --git a/toolkit/components/downloads/test/unit/test_app_rep_windows.js b/toolkit/components/downloads/test/unit/test_app_rep_windows.js
index 5dd5bbd3c64..3b71e710664 100644
--- a/toolkit/components/downloads/test/unit/test_app_rep_windows.js
+++ b/toolkit/components/downloads/test/unit/test_app_rep_windows.js
@@ -39,7 +39,7 @@ var gStillRunning = true;
 var gTables = {};
 var gHttpServer = null;
 
-const appRepURLPref = "browser.safebrowsing.appRepURL";
+const appRepURLPref = "browser.safebrowsing.downloads.remote.url";
 const remoteEnabledPref = "browser.safebrowsing.downloads.remote.enabled";
 
 /**

From 1f53f5d0948d93a43899e3c9f0af08e4e6ab2285 Mon Sep 17 00:00:00 2001
From: Chris Manchester 
Date: Tue, 19 Jan 2016 14:21:30 -0800
Subject: [PATCH 072/119] Bug 1240239 - Install test plugins in artifact based
 builds. r=nalexander

---
 python/mozbuild/mozbuild/artifacts.py     | 89 +++++++++++++----------
 python/mozbuild/mozbuild/mach_commands.py |  7 +-
 2 files changed, 58 insertions(+), 38 deletions(-)

diff --git a/python/mozbuild/mozbuild/artifacts.py b/python/mozbuild/mozbuild/artifacts.py
index c779393c9fb..5ada42f1ee1 100644
--- a/python/mozbuild/mozbuild/artifacts.py
+++ b/python/mozbuild/mozbuild/artifacts.py
@@ -93,16 +93,22 @@ PROCESSED_SUFFIX = '.processed.jar'
 
 class ArtifactJob(object):
     # These are a subset of TEST_HARNESS_BINS in testing/mochitest/Makefile.in.
+    # Each item is a pair of (pattern, (src_prefix, dest_prefix), where src_prefix
+    # is the prefix of the pattern relevant to its location in the archive, and
+    # dest_prefix is the prefix to be added that will yield the final path relative
+    # to dist/.
     test_artifact_patterns = {
-        'bin/BadCertServer',
-        'bin/GenerateOCSPResponse',
-        'bin/OCSPStaplingServer',
-        'bin/certutil',
-        'bin/fileid',
-        'bin/pk12util',
-        'bin/ssltunnel',
-        'bin/xpcshell',
+        ('bin/BadCertServer', ('bin', 'bin')),
+        ('bin/GenerateOCSPResponse', ('bin', 'bin')),
+        ('bin/OCSPStaplingServer', ('bin', 'bin')),
+        ('bin/certutil', ('bin', 'bin')),
+        ('bin/fileid', ('bin', 'bin')),
+        ('bin/pk12util', ('bin', 'bin')),
+        ('bin/ssltunnel', ('bin', 'bin')),
+        ('bin/xpcshell', ('bin', 'bin')),
+        ('bin/plugins/*', ('bin/plugins', 'plugins'))
     }
+
     # We can tell our input is a test archive by this suffix, which happens to
     # be the same across platforms.
     _test_archive_suffix = '.common.tests.zip'
@@ -150,13 +156,16 @@ class ArtifactJob(object):
         with JarWriter(file=processed_filename, optimize=False, compress_level=5) as writer:
             reader = JarReader(filename)
             for filename, entry in reader.entries.iteritems():
-                if filename in self.test_artifact_patterns:
-                    basename = mozpath.basename(filename)
+                for pattern, (src_prefix, dest_prefix) in self.test_artifact_patterns:
+                    if not mozpath.match(filename, pattern):
+                        continue
+                    destpath = mozpath.relpath(filename, src_prefix)
+                    destpath = mozpath.join(dest_prefix, destpath)
                     self.log(logging.INFO, 'artifact',
-                             {'basename': basename},
-                             'Adding {basename} to processed archive')
+                             {'destpath': destpath},
+                             'Adding {destpath} to processed archive')
                     mode = entry['external_attr'] >> 16
-                    writer.add(basename.encode('utf-8'), reader[filename], mode=mode)
+                    writer.add(destpath.encode('utf-8'), reader[filename], mode=mode)
                     added_entry = True
 
         if not added_entry:
@@ -178,6 +187,7 @@ class AndroidArtifactJob(ArtifactJob):
                     {'basename': basename},
                    'Adding {basename} to processed archive')
 
+                basename = mozpath.join('bin', basename)
                 writer.add(basename.encode('utf-8'), f)
 
 
@@ -210,7 +220,8 @@ class LinuxArtifactJob(ArtifactJob):
 
                     # We strip off the relative "firefox/" bit from the path,
                     # but otherwise preserve it.
-                    destpath = mozpath.relpath(f.name, "firefox")
+                    destpath = mozpath.join('bin',
+                                            mozpath.relpath(f.name, "firefox"))
                     self.log(logging.INFO, 'artifact',
                              {'destpath': destpath},
                              'Adding {destpath} to processed archive')
@@ -295,7 +306,8 @@ class MacArtifactJob(ArtifactJob):
                         self.log(logging.INFO, 'artifact',
                             {'path': path},
                             'Adding {path} to processed archive')
-                        writer.add(os.path.basename(p).encode('utf-8'), f, mode=os.stat(mozpath.join(finder.base, p)).st_mode)
+                        destpath = mozpath.join('bin', os.path.basename(p))
+                        writer.add(destpath.encode('utf-8'), f, mode=os.stat(mozpath.join(finder.base, p)).st_mode)
 
                 root, paths = paths_keep_path
                 finder = FileFinder(mozpath.join(source, root))
@@ -304,7 +316,8 @@ class MacArtifactJob(ArtifactJob):
                         self.log(logging.INFO, 'artifact',
                             {'path': path},
                             'Adding {path} to processed archive')
-                        writer.add(p.encode('utf-8'), f, mode=os.stat(mozpath.join(finder.base, p)).st_mode)
+                        destpath = mozpath.join('bin', p)
+                        writer.add(destpath.encode('utf-8'), f, mode=os.stat(mozpath.join(finder.base, p)).st_mode)
 
         finally:
             try:
@@ -326,14 +339,15 @@ class WinArtifactJob(ArtifactJob):
     }
     # These are a subset of TEST_HARNESS_BINS in testing/mochitest/Makefile.in.
     test_artifact_patterns = {
-        'bin/BadCertServer.exe',
-        'bin/GenerateOCSPResponse.exe',
-        'bin/OCSPStaplingServer.exe',
-        'bin/certutil.exe',
-        'bin/fileid.exe',
-        'bin/pk12util.exe',
-        'bin/ssltunnel.exe',
-        'bin/xpcshell.exe',
+        ('bin/BadCertServer.exe', ('bin', 'bin')),
+        ('bin/GenerateOCSPResponse.exe', ('bin', 'bin')),
+        ('bin/OCSPStaplingServer.exe', ('bin', 'bin')),
+        ('bin/certutil.exe', ('bin', 'bin')),
+        ('bin/fileid.exe', ('bin', 'bin')),
+        ('bin/pk12util.exe', ('bin', 'bin')),
+        ('bin/ssltunnel.exe', ('bin', 'bin')),
+        ('bin/xpcshell.exe', ('bin', 'bin')),
+        ('bin/plugins/*', ('bin/plugins', 'plugins'))
     }
 
     def process_package_artifact(self, filename, processed_filename):
@@ -345,6 +359,7 @@ class WinArtifactJob(ArtifactJob):
 
                 # strip off the relative "firefox/" bit from the path:
                 basename = mozpath.relpath(f.filename, "firefox")
+                basename = mozpath.join('bin', basename)
                 self.log(logging.INFO, 'artifact',
                     {'basename': basename},
                     'Adding {basename} to processed archive')
@@ -664,7 +679,7 @@ class Artifacts(object):
         if self._log:
             self._log(*args, **kwargs)
 
-    def install_from_file(self, filename, bindir, install_callback=None):
+    def install_from_file(self, filename, distdir, install_callback=None):
         self.log(logging.INFO, 'artifact',
             {'filename': filename},
             'Installing from {filename}')
@@ -685,13 +700,13 @@ class Artifacts(object):
             'Installing from processed {processed_filename}')
 
         # Copy all .so files, avoiding modification where possible.
-        ensureParentDir(mozpath.join(bindir, '.dummy'))
+        ensureParentDir(mozpath.join(distdir, '.dummy'))
 
         with zipfile.ZipFile(processed_filename) as zf:
             for info in zf.infolist():
                 if info.filename.endswith('.ini'):
                     continue
-                n = mozpath.join(bindir, info.filename)
+                n = mozpath.join(distdir, info.filename)
                 fh = FileAvoidWrite(n, mode='rb')
                 shutil.copyfileobj(zf.open(info), fh)
                 file_existed, file_updated = fh.close()
@@ -708,15 +723,15 @@ class Artifacts(object):
                     install_callback(info.filename, file_existed, file_updated)
         return 0
 
-    def install_from_url(self, url, bindir, install_callback=None):
+    def install_from_url(self, url, distdir, install_callback=None):
         self.log(logging.INFO, 'artifact',
             {'url': url},
             'Installing from {url}')
         with self._artifact_cache as artifact_cache:  # The with block handles persistence.
             filename = artifact_cache.fetch(url)
-        return self.install_from_file(filename, bindir, install_callback=install_callback)
+        return self.install_from_file(filename, distdir, install_callback=install_callback)
 
-    def install_from_hg(self, revset, bindir, install_callback=None):
+    def install_from_hg(self, revset, distdir, install_callback=None):
         if not revset:
             revset = '.'
         if len(revset) != 40:
@@ -745,7 +760,7 @@ class Artifacts(object):
                     pass
         if urls:
             for url in urls:
-                if self.install_from_url(url, bindir, install_callback=install_callback):
+                if self.install_from_url(url, distdir, install_callback=install_callback):
                     return 1
             return 0
         self.log(logging.ERROR, 'artifact',
@@ -753,21 +768,21 @@ class Artifacts(object):
                  'No built artifacts for {revset} found.')
         return 1
 
-    def install_from(self, source, bindir, install_callback=None):
-        """Install artifacts from a ``source`` into the given ``bindir``.
+    def install_from(self, source, distdir, install_callback=None):
+        """Install artifacts from a ``source`` into the given ``distdir``.
 
         If ``callback`` is given, it is called once with arguments ``(path,
         existed, updated)``, where ``path`` is the file path written relative
-        to ``bindir``; ``existed`` is a boolean indicating whether the file
+        to ``distdir``; ``existed`` is a boolean indicating whether the file
         existed; and ``updated`` is a boolean indicating whether the file was
         updated.
         """
         if source and os.path.isfile(source):
-            return self.install_from_file(source, bindir, install_callback=install_callback)
+            return self.install_from_file(source, distdir, install_callback=install_callback)
         elif source and urlparse.urlparse(source).scheme:
-            return self.install_from_url(source, bindir, install_callback=install_callback)
+            return self.install_from_url(source, distdir, install_callback=install_callback)
         else:
-            return self.install_from_hg(source, bindir, install_callback=install_callback)
+            return self.install_from_hg(source, distdir, install_callback=install_callback)
 
     def print_last(self):
         self.log(logging.INFO, 'artifact',
diff --git a/python/mozbuild/mozbuild/mach_commands.py b/python/mozbuild/mozbuild/mach_commands.py
index 184be79e3e0..7354b7570fd 100644
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.py
@@ -1499,10 +1499,15 @@ class PackageFrontend(MachCommandBase):
         manifest = InstallManifest(manifest_path)
 
         def install_callback(path, file_existed, file_updated):
+            # Our paths are either under dist/bin or dist/plugins (for test
+            # plugins). dist/plugins. does not have an install manifest.
+            if not path.startswith('bin/'):
+                return
+            path = path[len('bin/'):]
             if path not in manifest:
                 manifest.add_optional_exists(path)
 
-        retcode = artifacts.install_from(source, self.bindir, install_callback=install_callback)
+        retcode = artifacts.install_from(source, self.distdir, install_callback=install_callback)
 
         if retcode == 0:
             manifest.write(manifest_path)

From cfbd89d80b473d93bed6a5070b6ea8cf2d81a372 Mon Sep 17 00:00:00 2001
From: Chris Manchester 
Date: Thu, 1 Oct 2015 18:56:53 -0500
Subject: [PATCH 073/119] Bug 1214885 - Add a "ChromeUrl" build backend to
 write out information useful for resolving chrome urls. r=glandium

The result of running this backend is a json file containing an array with 3 elements:
a map from resource:// and chrome:// url prefixes to corresponding objdir directories,
a map of overrides, and a map from objdir files to srcdir files (with a flag for whether
the file was preprocessed) for js file in FinalTargetFiles. A subsequent commit implements
the procedure to find an replace based on the url mapping, subsistute based on overrides,
and find sourcedir files based on objdir files.
---
 build/autoconf/config.status.m4               |   2 +-
 .../mozbuild/codecoverage/chrome_map.py       | 105 ++++++++++++++++++
 python/mozbuild/mozbuild/config_status.py     |   6 +-
 python/mozbuild/mozbuild/mach_commands.py     |   2 +-
 4 files changed, 112 insertions(+), 3 deletions(-)
 create mode 100644 python/mozbuild/mozbuild/codecoverage/chrome_map.py

diff --git a/build/autoconf/config.status.m4 b/build/autoconf/config.status.m4
index a4df5c3947a..15f06d99f73 100644
--- a/build/autoconf/config.status.m4
+++ b/build/autoconf/config.status.m4
@@ -231,7 +231,7 @@ define([MOZ_BUILD_BACKEND],
 BUILD_BACKENDS="RecursiveMake"
 
 MOZ_ARG_ENABLE_STRING(build-backend,
-[  --enable-build-backend={AndroidEclipse,CppEclipse,VisualStudio,FasterMake,CompileDB}
+[  --enable-build-backend={AndroidEclipse,CppEclipse,VisualStudio,FasterMake,CompileDB,ChromeMap}
                          Enable additional build backends],
 [ BUILD_BACKENDS="RecursiveMake `echo $enableval | sed 's/,/ /g'`"])
 
diff --git a/python/mozbuild/mozbuild/codecoverage/chrome_map.py b/python/mozbuild/mozbuild/codecoverage/chrome_map.py
new file mode 100644
index 00000000000..81c3c9a071c
--- /dev/null
+++ b/python/mozbuild/mozbuild/codecoverage/chrome_map.py
@@ -0,0 +1,105 @@
+# 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/.
+
+from collections import defaultdict
+import json
+import os
+import urlparse
+
+from mach.config import ConfigSettings
+from mach.logging import LoggingManager
+from mozbuild.backend.common import CommonBackend
+from mozbuild.base import MozbuildObject
+from mozbuild.frontend.data import (
+    FinalTargetFiles,
+    FinalTargetPreprocessedFiles,
+)
+from mozbuild.frontend.data import JARManifest, ChromeManifestEntry
+from mozpack.chrome.manifest import (
+    Manifest,
+    ManifestChrome,
+    ManifestOverride,
+    ManifestResource,
+    parse_manifest,
+)
+import mozpack.path as mozpath
+
+
+class ChromeManifestHandler(object):
+    def __init__(self):
+        self.overrides = {}
+        self.chrome_mapping = defaultdict(set)
+
+    def handle_manifest_entry(self, entry):
+        format_strings = {
+            "content": "chrome://%s/content/",
+            "resource": "resource://%s/",
+            "locale": "chrome://%s/locale/",
+            "skin": "chrome://%s/skin/",
+        }
+
+        if isinstance(entry, (ManifestChrome, ManifestResource)):
+            if isinstance(entry, ManifestResource):
+                dest = entry.target
+                url = urlparse.urlparse(dest)
+                if not url.scheme:
+                    dest = mozpath.normpath(mozpath.join(entry.base, dest))
+                if url.scheme == 'file':
+                    dest = mozpath.normpath(url.path)
+            else:
+                dest = mozpath.normpath(entry.path)
+
+            base_uri = format_strings[entry.type] % entry.name
+            self.chrome_mapping[base_uri].add(dest)
+        if isinstance(entry, ManifestOverride):
+            self.overrides[entry.overloaded] = entry.overload
+        if isinstance(entry, Manifest):
+            for e in parse_manifest(None, entry.path):
+                self.handle_manifest_entry(e)
+
+class ChromeMapBackend(CommonBackend):
+    def _init(self):
+        CommonBackend._init(self)
+
+        log_manager = LoggingManager()
+        self._cmd = MozbuildObject(self.environment.topsrcdir, ConfigSettings(),
+                                   log_manager, self.environment.topobjdir)
+        self._install_mapping = {}
+        self.manifest_handler = ChromeManifestHandler()
+
+    def consume_object(self, obj):
+        if isinstance(obj, JARManifest):
+            self._consume_jar_manifest(obj)
+        if isinstance(obj, ChromeManifestEntry):
+            self.manifest_handler.handle_manifest_entry(obj.entry)
+        if isinstance(obj, (FinalTargetFiles,
+                            FinalTargetPreprocessedFiles)):
+            self._handle_final_target_files(obj)
+        return True
+
+    def _handle_final_target_files(self, obj):
+        for path, files in obj.files.walk():
+            for f in files:
+                dest = mozpath.join(obj.install_target, path, f.target_basename)
+                is_pp = isinstance(obj,
+                                   FinalTargetPreprocessedFiles)
+                self._install_mapping[dest] = f.full_path, is_pp
+
+    def consume_finished(self):
+        # Our result has three parts:
+        #  A map from url prefixes to objdir directories:
+        #  { "chrome://mozapps/content/": [ "dist/bin/chrome/toolkit/content/mozapps" ], ... }
+        #  A map of overrides.
+        #  A map from objdir paths to sourcedir paths, and a flag for whether the source was preprocessed:
+        #  { "dist/bin/browser/chrome/browser/content/browser/aboutSessionRestore.js":
+        #    [ "$topsrcdir/browser/components/sessionstore/content/aboutSessionRestore.js", false ], ... }
+        outputfile = os.path.join(self.environment.topobjdir, 'chrome-map.json')
+        with self._write_file(outputfile) as fh:
+            chrome_mapping = self.manifest_handler.chrome_mapping
+            overrides = self.manifest_handler.overrides
+            json.dump([
+                {k: list(v) for k, v in chrome_mapping.iteritems()},
+                overrides,
+                self._install_mapping,
+            ], fh, sort_keys=True, indent=2)
diff --git a/python/mozbuild/mozbuild/config_status.py b/python/mozbuild/mozbuild/config_status.py
index 174faa3b1fb..e427a1d0de1 100644
--- a/python/mozbuild/mozbuild/config_status.py
+++ b/python/mozbuild/mozbuild/config_status.py
@@ -110,7 +110,8 @@ def config_status(topobjdir='.', topsrcdir='.',
                         help='print diffs of changed files.')
     parser.add_argument('-b', '--backend', nargs='+',
                         choices=['RecursiveMake', 'AndroidEclipse', 'CppEclipse',
-                                 'VisualStudio', 'FasterMake', 'CompileDB'],
+                                 'VisualStudio', 'FasterMake', 'CompileDB',
+                                 'ChromeMap'],
                         default=default_backends,
                         help='what backend to build (default: %s).' %
                         ' '.join(default_backends))
@@ -150,6 +151,9 @@ def config_status(topobjdir='.', topsrcdir='.',
         elif backend == 'CompileDB':
             from mozbuild.compilation.database import CompileDBBackend
             backends_cls.append(CompileDBBackend)
+        elif backend == 'ChromeMap':
+            from mozbuild.codecoverage.chrome_map import ChromeMapBackend
+            backends_cls.append(ChromeMapBackend)
         else:
             backends_cls.append(RecursiveMakeBackend)
 
diff --git a/python/mozbuild/mozbuild/mach_commands.py b/python/mozbuild/mozbuild/mach_commands.py
index 7354b7570fd..2d9d53cdc72 100644
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.py
@@ -603,7 +603,7 @@ class Build(MachCommandBase):
     # conditions, but that is for another day.
     @CommandArgument('-b', '--backend', nargs='+',
         choices=['RecursiveMake', 'AndroidEclipse', 'CppEclipse',
-                 'VisualStudio', 'FasterMake', 'CompileDB'],
+                 'VisualStudio', 'FasterMake', 'CompileDB', 'ChromeMap'],
         help='Which backend to build.')
     def build_backend(self, backend, diff=False):
         python = self.virtualenv_manager.python_path

From 86b16127f96787a4ab4d22c7d8c01d1864669017 Mon Sep 17 00:00:00 2001
From: Mike Hommey 
Date: Tue, 19 Jan 2016 10:31:15 +0900
Subject: [PATCH 074/119] Bug 1237140 - Move DefinesAction from
 mozbuild.action.process_install_manifest to mozbuild.util. r=gps

---
 .../action/process_install_manifest.py         | 17 +----------------
 python/mozbuild/mozbuild/util.py               | 18 ++++++++++++++++++
 2 files changed, 19 insertions(+), 16 deletions(-)

diff --git a/python/mozbuild/mozbuild/action/process_install_manifest.py b/python/mozbuild/mozbuild/action/process_install_manifest.py
index 1ce8c50c6da..99ea2a3a6ac 100644
--- a/python/mozbuild/mozbuild/action/process_install_manifest.py
+++ b/python/mozbuild/mozbuild/action/process_install_manifest.py
@@ -16,6 +16,7 @@ from mozpack.files import (
     FileFinder,
 )
 from mozpack.manifests import InstallManifest
+from mozbuild.util import DefinesAction
 
 
 COMPLETE = 'From {dest}: Kept {existing} existing; Added/updated {updated}; ' \
@@ -66,22 +67,6 @@ def process_manifest(destdir, paths, track=None,
     return result
 
 
-class DefinesAction(argparse.Action):
-    def __call__(self, parser, namespace, values, option_string):
-        defines = getattr(namespace, self.dest)
-        if defines is None:
-            defines = {}
-        values = values.split('=', 1)
-        if len(values) == 1:
-            name, value = values[0], 1
-        else:
-            name, value = values
-            if value.isdigit():
-                value = int(value)
-        defines[name] = value
-        setattr(namespace, self.dest, defines)
-
-
 def main(argv):
     parser = argparse.ArgumentParser(
         description='Process install manifest files.')
diff --git a/python/mozbuild/mozbuild/util.py b/python/mozbuild/mozbuild/util.py
index 7c092f4b2f8..c0fd62944ff 100644
--- a/python/mozbuild/mozbuild/util.py
+++ b/python/mozbuild/mozbuild/util.py
@@ -7,6 +7,7 @@
 
 from __future__ import absolute_import, unicode_literals
 
+import argparse
 import collections
 import difflib
 import errno
@@ -974,3 +975,20 @@ def expand_variables(s, variables):
             value = ' '.join(value)
         result += value
     return result
+
+
+class DefinesAction(argparse.Action):
+    '''An ArgumentParser action to handle -Dvar[=value] type of arguments.'''
+    def __call__(self, parser, namespace, values, option_string):
+        defines = getattr(namespace, self.dest)
+        if defines is None:
+            defines = {}
+        values = values.split('=', 1)
+        if len(values) == 1:
+            name, value = values[0], 1
+        else:
+            name, value = values
+            if value.isdigit():
+                value = int(value)
+        defines[name] = value
+        setattr(namespace, self.dest, defines)

From 7e5616ea66885101d4ac96fe34d15ec16a11cf00 Mon Sep 17 00:00:00 2001
From: Mike Hommey 
Date: Tue, 19 Jan 2016 10:38:52 +0900
Subject: [PATCH 075/119] Bug 1237140 - Allow file_generate scripts to take
 additional flags. r=gps

Currently, file_generate scripts can only accept input and output file
name, but sometimes, one would like for them to take additional flags.
---
 python/mozbuild/mozbuild/action/file_generate.py  | 3 ++-
 python/mozbuild/mozbuild/backend/recursivemake.py | 6 ++++--
 python/mozbuild/mozbuild/frontend/data.py         | 4 +++-
 3 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/python/mozbuild/mozbuild/action/file_generate.py b/python/mozbuild/mozbuild/action/file_generate.py
index 51414450caa..552dcd9d157 100644
--- a/python/mozbuild/mozbuild/action/file_generate.py
+++ b/python/mozbuild/mozbuild/action/file_generate.py
@@ -31,7 +31,8 @@ def main(argv):
                         help='The file to generate')
     parser.add_argument('dep_file', metavar='dep-file', type=str,
                         help='File to write any additional make dependencies to')
-    parser.add_argument('additional_arguments', metavar='arg', nargs='*',
+    parser.add_argument('additional_arguments', metavar='arg',
+                        nargs=argparse.REMAINDER,
                         help="Additional arguments to the script's main() method")
 
     args = parser.parse_args(argv)
diff --git a/python/mozbuild/mozbuild/backend/recursivemake.py b/python/mozbuild/mozbuild/backend/recursivemake.py
index 84116dec24a..05f7c1d9820 100644
--- a/python/mozbuild/mozbuild/backend/recursivemake.py
+++ b/python/mozbuild/mozbuild/backend/recursivemake.py
@@ -518,13 +518,15 @@ class RecursiveMakeBackend(CommonBackend):
             backend_file.write('GENERATED_FILES += %s\n' % obj.output)
             backend_file.write('EXTRA_MDDEPEND_FILES += %s\n' % dep_file)
             if obj.script:
-                backend_file.write("""{output}: {script}{inputs}
+                backend_file.write("""{output}: {script}{inputs}{backend}
 \t$(REPORT_BUILD)
-\t$(call py_action,file_generate,{script} {method} {output} $(MDDEPDIR)/{dep_file}{inputs})
+\t$(call py_action,file_generate,{script} {method} {output} $(MDDEPDIR)/{dep_file}{inputs}{flags})
 
 """.format(output=obj.output,
            dep_file=dep_file,
            inputs=' ' + ' '.join(obj.inputs) if obj.inputs else '',
+           flags=' ' + ' '.join(obj.flags) if obj.flags else '',
+           backend=' backend.mk' if obj.flags else '',
            script=obj.script,
            method=obj.method))
 
diff --git a/python/mozbuild/mozbuild/frontend/data.py b/python/mozbuild/mozbuild/frontend/data.py
index cdd3fec2e77..a5bd9594e45 100644
--- a/python/mozbuild/mozbuild/frontend/data.py
+++ b/python/mozbuild/mozbuild/frontend/data.py
@@ -848,14 +848,16 @@ class GeneratedFile(ContextDerived):
         'method',
         'output',
         'inputs',
+        'flags',
     )
 
-    def __init__(self, context, script, method, output, inputs):
+    def __init__(self, context, script, method, output, inputs, flags=()):
         ContextDerived.__init__(self, context)
         self.script = script
         self.method = method
         self.output = output
         self.inputs = inputs
+        self.flags = flags
 
 
 class ClassPathEntry(object):

From e82de99d204550a006adec4f9d73bfe303ba4d25 Mon Sep 17 00:00:00 2001
From: Mike Hommey 
Date: Tue, 19 Jan 2016 10:38:52 +0900
Subject: [PATCH 076/119] Bug 1237140 - Add support for local defines in
 generate_symbols_file. r=gps

generate_symbols_file only supports the global defines, and completely
ignores DEFINES from the same moz.build the SYMBOLS_FILE is defined.
This fixes this misfeature.
---
 .../mozbuild/action/generate_symbols_file.py     | 16 ++++++++++++++--
 python/mozbuild/mozbuild/frontend/emitter.py     |  2 +-
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/python/mozbuild/mozbuild/action/generate_symbols_file.py b/python/mozbuild/mozbuild/action/generate_symbols_file.py
index 9f76f9823e3..ba1d562a9bc 100644
--- a/python/mozbuild/mozbuild/action/generate_symbols_file.py
+++ b/python/mozbuild/mozbuild/action/generate_symbols_file.py
@@ -4,18 +4,30 @@
 
 from __future__ import absolute_import, print_function, unicode_literals
 
+import argparse
 import buildconfig
 import os
 from StringIO import StringIO
 from mozbuild.preprocessor import Preprocessor
+from mozbuild.util import DefinesAction
 
 
-def generate_symbols_file(output, input):
+def generate_symbols_file(output, *args):
     ''' '''
-    input = os.path.abspath(input)
+    parser = argparse.ArgumentParser()
+    parser.add_argument('input')
+    parser.add_argument('-D', action=DefinesAction)
+    parser.add_argument('-U', action='append', default=[])
+    args = parser.parse_args(args)
+    input = os.path.abspath(args.input)
 
     pp = Preprocessor()
     pp.context.update(buildconfig.defines)
+    if args.D:
+        pp.context.update(args.D)
+    for undefine in args.U:
+        if undefine in pp.context:
+            del pp.context[undefine]
     # Hack until MOZ_DEBUG_FLAGS are simply part of buildconfig.defines
     if buildconfig.substs['MOZ_DEBUG']:
         pp.context['DEBUG'] = '1'
diff --git a/python/mozbuild/mozbuild/frontend/emitter.py b/python/mozbuild/mozbuild/frontend/emitter.py
index ac364b3ed39..0c1e9956242 100644
--- a/python/mozbuild/mozbuild/frontend/emitter.py
+++ b/python/mozbuild/mozbuild/frontend/emitter.py
@@ -538,7 +538,7 @@ class TreeMetadataEmitter(LoggingMixin):
                         'action', 'generate_symbols_file.py')
                     yield GeneratedFile(context, script,
                         'generate_symbols_file', lib.symbols_file,
-                        [symbols_file.full_path])
+                        [symbols_file.full_path], lib.defines.get_defines())
             if static_lib:
                 lib = StaticLibrary(context, libname, **static_args)
                 self._libs[libname].append(lib)

From 7f5341dfb410711dcb1942e40864913105ea11ff Mon Sep 17 00:00:00 2001
From: Mike Hommey 
Date: Tue, 19 Jan 2016 11:01:06 +0900
Subject: [PATCH 077/119] Bug 1237140 - Pass NSS_EXTRA_SYMBOLS_FILE down to
 nss.symbols processing. r=gps

---
 config/external/nss/moz.build | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/config/external/nss/moz.build b/config/external/nss/moz.build
index 10a12ea592e..35642fbf188 100644
--- a/config/external/nss/moz.build
+++ b/config/external/nss/moz.build
@@ -44,3 +44,6 @@ else:
 
 # XXX: We should fix these warnings.
 ALLOW_COMPILER_WARNINGS = True
+
+if CONFIG['NSS_EXTRA_SYMBOLS_FILE']:
+    DEFINES['NSS_EXTRA_SYMBOLS_FILE'] = CONFIG['NSS_EXTRA_SYMBOLS_FILE']

From c1c742660a5e7fad2fea9df8fa900422576c5b19 Mon Sep 17 00:00:00 2001
From: Mike Hommey 
Date: Tue, 19 Jan 2016 14:50:54 +0900
Subject: [PATCH 078/119] Bug 1240657 - Fix FasterMake race condition leading
 to missing "manifest interfaces.manifest" entries. r=gps

Turns out the claim in bug 1234439 that the FasterMake backend knows
about all the chrome manifest entries is wrong, and there's still one
that is added "manually" with buildlist.py, and during mach build
faster, that can happen before or after the corresponding chrome
manifests are written out by install manifest processing.

While the real fix here would be to make the build system totally
aware of those "manifest interfaces.manifest" entries, for now, it's
simpler to add dependencies to work around the race condition.
---
 config/faster/rules.mk | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/config/faster/rules.mk b/config/faster/rules.mk
index 3784b861b39..68035b64931 100644
--- a/config/faster/rules.mk
+++ b/config/faster/rules.mk
@@ -123,3 +123,6 @@ $(TOPOBJDIR)/toolkit/xre/platform.ini: $(TOPOBJDIR)/config/buildid
 # The xpidl target in config/makefiles/xpidl requires the install manifest for
 # dist/idl to have been processed.
 $(TOPOBJDIR)/config/makefiles/xpidl/xpidl: $(TOPOBJDIR)/install-dist_idl
+# It also requires all the install manifests for dist/bin to have been processed
+# because it adds interfaces.manifest references with buildlist.py.
+$(TOPOBJDIR)/config/makefiles/xpidl/xpidl: $(addprefix install-,$(filter dist/bin%,$(INSTALL_MANIFESTS)))

From fd7cb7f1777e5d665cadaeac703c8442afe4bde1 Mon Sep 17 00:00:00 2001
From: Mike Hommey 
Date: Tue, 19 Jan 2016 15:26:39 +0900
Subject: [PATCH 079/119] Bug 1240660 - Remove "+" prefixes in jar manifests.
 r=gps

Now that the faster make backend is enabled by default avoiding
cross-jar.mn file conflicts, and now that individual files can't
overlap with wildcards in the same jar.mn files, which were two
main things that the "+" prefix was used for (apart from
cargo-culting), the "+" prefixes in the tree are not necessary
anymore.
---
 toolkit/components/aboutcache/jar.mn          |  2 +-
 toolkit/components/aboutmemory/jar.mn         |  6 +-
 toolkit/components/aboutperformance/jar.mn    |  4 +-
 toolkit/components/prompts/jar.mn             |  4 +-
 toolkit/components/thumbnails/jar.mn          |  2 +-
 .../components/url-classifier/tests/jar.mn    |  2 +-
 toolkit/content/jar.mn                        | 30 +++++-----
 toolkit/obsolete/jar.mn                       | 10 ++--
 toolkit/themes/faststripe/global/jar.mn       | 22 +++----
 toolkit/themes/mobile/jar.mn                  | 58 +++++++++----------
 10 files changed, 70 insertions(+), 70 deletions(-)

diff --git a/toolkit/components/aboutcache/jar.mn b/toolkit/components/aboutcache/jar.mn
index a9ed4125eb4..b414a8f6d5b 100644
--- a/toolkit/components/aboutcache/jar.mn
+++ b/toolkit/components/aboutcache/jar.mn
@@ -3,4 +3,4 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 toolkit.jar:
-+ content/global/aboutCache.js                         (content/aboutCache.js)
+  content/global/aboutCache.js                         (content/aboutCache.js)
diff --git a/toolkit/components/aboutmemory/jar.mn b/toolkit/components/aboutmemory/jar.mn
index 82af6a5333d..0a6b01ed78d 100644
--- a/toolkit/components/aboutmemory/jar.mn
+++ b/toolkit/components/aboutmemory/jar.mn
@@ -3,6 +3,6 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 toolkit.jar:
-+ content/global/aboutMemory.js                        (content/aboutMemory.js)
-+ content/global/aboutMemory.xhtml                     (content/aboutMemory.xhtml)
-+ content/global/aboutMemory.css                       (content/aboutMemory.css)
+  content/global/aboutMemory.js                        (content/aboutMemory.js)
+  content/global/aboutMemory.xhtml                     (content/aboutMemory.xhtml)
+  content/global/aboutMemory.css                       (content/aboutMemory.css)
diff --git a/toolkit/components/aboutperformance/jar.mn b/toolkit/components/aboutperformance/jar.mn
index 26d594b0471..96e046d8ee6 100644
--- a/toolkit/components/aboutperformance/jar.mn
+++ b/toolkit/components/aboutperformance/jar.mn
@@ -3,5 +3,5 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 toolkit.jar:
-+ content/global/aboutPerformance.xhtml               (content/aboutPerformance.xhtml)
-+ content/global/aboutPerformance.js                  (content/aboutPerformance.js)
+  content/global/aboutPerformance.xhtml               (content/aboutPerformance.xhtml)
+  content/global/aboutPerformance.js                  (content/aboutPerformance.js)
diff --git a/toolkit/components/prompts/jar.mn b/toolkit/components/prompts/jar.mn
index f90006a47e2..60ecbdcbc41 100644
--- a/toolkit/components/prompts/jar.mn
+++ b/toolkit/components/prompts/jar.mn
@@ -4,9 +4,9 @@
 
 toolkit.jar:
    content/global/commonDialog.js             (content/commonDialog.js)
-*+ content/global/commonDialog.xul            (content/commonDialog.xul)
+*  content/global/commonDialog.xul            (content/commonDialog.xul)
    content/global/commonDialog.css            (content/commonDialog.css)
    content/global/selectDialog.js             (content/selectDialog.js)
    content/global/selectDialog.xul            (content/selectDialog.xul)
    content/global/tabprompts.css              (content/tabprompts.css)
-*+ content/global/tabprompts.xml              (content/tabprompts.xml)
+*  content/global/tabprompts.xml              (content/tabprompts.xml)
diff --git a/toolkit/components/thumbnails/jar.mn b/toolkit/components/thumbnails/jar.mn
index 68d728095b0..c83c64e48c3 100644
--- a/toolkit/components/thumbnails/jar.mn
+++ b/toolkit/components/thumbnails/jar.mn
@@ -3,4 +3,4 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 toolkit.jar:
-+ content/global/backgroundPageThumbsContent.js (content/backgroundPageThumbsContent.js)
+  content/global/backgroundPageThumbsContent.js (content/backgroundPageThumbsContent.js)
diff --git a/toolkit/components/url-classifier/tests/jar.mn b/toolkit/components/url-classifier/tests/jar.mn
index 749c0890ba8..2264c289654 100644
--- a/toolkit/components/url-classifier/tests/jar.mn
+++ b/toolkit/components/url-classifier/tests/jar.mn
@@ -1,2 +1,2 @@
 toolkit.jar:
-+ content/global/url-classifier/unittests.xul         (unittests.xul)
+  content/global/url-classifier/unittests.xul         (unittests.xul)
diff --git a/toolkit/content/jar.mn b/toolkit/content/jar.mn
index 3682627e55d..05d9aa3a395 100644
--- a/toolkit/content/jar.mn
+++ b/toolkit/content/jar.mn
@@ -42,7 +42,7 @@ toolkit.jar:
    content/global/plugins.css
    content/global/browser-child.js
    content/global/browser-content.js
-*+  content/global/buildconfig.html
+*   content/global/buildconfig.html
 *  content/global/contentAreaUtils.js
 #ifndef MOZ_FENNEC
    content/global/customizeToolbar.css
@@ -52,14 +52,14 @@ toolkit.jar:
    content/global/devicestorage.properties
 #ifndef MOZ_FENNEC
    content/global/editMenuOverlay.js
-*+ content/global/editMenuOverlay.xul
+*  content/global/editMenuOverlay.xul
    content/global/finddialog.js
-*+ content/global/finddialog.xul
+*  content/global/finddialog.xul
    content/global/findUtils.js
 #endif
    content/global/filepicker.properties
-+  content/global/globalOverlay.js
-+  content/global/mozilla.xhtml
+   content/global/globalOverlay.js
+   content/global/mozilla.xhtml
    content/global/nsDragAndDrop.js
    content/global/process-content.js
    content/global/resetProfile.css
@@ -70,26 +70,26 @@ toolkit.jar:
    content/global/TopLevelVideoDocument.js
    content/global/treeUtils.js
    content/global/viewZoomOverlay.js
-+  content/global/bindings/autocomplete.xml    (widgets/autocomplete.xml)
+   content/global/bindings/autocomplete.xml    (widgets/autocomplete.xml)
    content/global/bindings/browser.xml         (widgets/browser.xml)
    content/global/bindings/button.xml          (widgets/button.xml)
    content/global/bindings/checkbox.xml        (widgets/checkbox.xml)
    content/global/bindings/colorpicker.xml     (widgets/colorpicker.xml)
    content/global/bindings/datetimepicker.xml  (widgets/datetimepicker.xml)
-*+ content/global/bindings/dialog.xml          (widgets/dialog.xml)
+*  content/global/bindings/dialog.xml          (widgets/dialog.xml)
    content/global/bindings/editor.xml          (widgets/editor.xml)
    content/global/bindings/expander.xml        (widgets/expander.xml)
    content/global/bindings/filefield.xml       (widgets/filefield.xml)
-*+ content/global/bindings/findbar.xml         (widgets/findbar.xml)
+*  content/global/bindings/findbar.xml         (widgets/findbar.xml)
    content/global/bindings/general.xml         (widgets/general.xml)
    content/global/bindings/groupbox.xml        (widgets/groupbox.xml)
-+  content/global/bindings/listbox.xml         (widgets/listbox.xml)
+   content/global/bindings/listbox.xml         (widgets/listbox.xml)
    content/global/bindings/menu.xml            (widgets/menu.xml)
    content/global/bindings/menulist.xml        (widgets/menulist.xml)
    content/global/bindings/notification.xml    (widgets/notification.xml)
    content/global/bindings/numberbox.xml       (widgets/numberbox.xml)
    content/global/bindings/popup.xml           (widgets/popup.xml)
-*+ content/global/bindings/preferences.xml     (widgets/preferences.xml)
+*  content/global/bindings/preferences.xml     (widgets/preferences.xml)
    content/global/bindings/progressmeter.xml   (widgets/progressmeter.xml)
    content/global/bindings/radio.xml           (widgets/radio.xml)
    content/global/bindings/remote-browser.xml  (widgets/remote-browser.xml)
@@ -101,15 +101,15 @@ toolkit.jar:
    content/global/bindings/splitter.xml        (widgets/splitter.xml)
    content/global/bindings/spinbuttons.xml     (widgets/spinbuttons.xml)
    content/global/bindings/stringbundle.xml    (widgets/stringbundle.xml)
-*+ content/global/bindings/tabbox.xml          (widgets/tabbox.xml)
+*  content/global/bindings/tabbox.xml          (widgets/tabbox.xml)
    content/global/bindings/text.xml            (widgets/text.xml)
-*+ content/global/bindings/textbox.xml         (widgets/textbox.xml)
+*  content/global/bindings/textbox.xml         (widgets/textbox.xml)
    content/global/bindings/toolbar.xml         (widgets/toolbar.xml)
    content/global/bindings/toolbarbutton.xml   (widgets/toolbarbutton.xml)
-*+ content/global/bindings/tree.xml            (widgets/tree.xml)
-*+ content/global/bindings/videocontrols.xml   (widgets/videocontrols.xml)
+*  content/global/bindings/tree.xml            (widgets/tree.xml)
+*  content/global/bindings/videocontrols.xml   (widgets/videocontrols.xml)
    content/global/bindings/videocontrols.css   (widgets/videocontrols.css)
-*+ content/global/bindings/wizard.xml          (widgets/wizard.xml)
+*  content/global/bindings/wizard.xml          (widgets/wizard.xml)
 #ifdef XP_MACOSX
    content/global/macWindowMenu.js
 #endif
diff --git a/toolkit/obsolete/jar.mn b/toolkit/obsolete/jar.mn
index 6e8a1a8c279..95d86da2f1d 100644
--- a/toolkit/obsolete/jar.mn
+++ b/toolkit/obsolete/jar.mn
@@ -3,10 +3,10 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 toolkit.jar:
-+  content/global/globalOverlay.xul             (content/globalOverlay.xul)
-*+ content/global/dialogOverlay.xul             (content/dialogOverlay.xul)
+   content/global/globalOverlay.xul             (content/globalOverlay.xul)
+*  content/global/dialogOverlay.xul             (content/dialogOverlay.xul)
    content/global/dialogOverlay.js              (content/dialogOverlay.js)
    content/global/inlineSpellCheckUI.js         (content/inlineSpellCheckUI.js)
-+  content/global/nsClipboard.js                (content/nsClipboard.js)
-+  content/global/nsUserSettings.js             (content/nsUserSettings.js)
-+  content/global/strres.js                     (content/strres.js)
+   content/global/nsClipboard.js                (content/nsClipboard.js)
+   content/global/nsUserSettings.js             (content/nsUserSettings.js)
+   content/global/strres.js                     (content/strres.js)
diff --git a/toolkit/themes/faststripe/global/jar.mn b/toolkit/themes/faststripe/global/jar.mn
index 572b8c14ab6..84cc90cd3f9 100644
--- a/toolkit/themes/faststripe/global/jar.mn
+++ b/toolkit/themes/faststripe/global/jar.mn
@@ -5,14 +5,14 @@
 toolkit.jar:
 % skin global classic/1.0 %skin/classic/global/
 # These are the CSS files that have been changed from windows
-+  skin/classic/global/button.css
-+  skin/classic/global/checkbox.css
-+  skin/classic/global/dropmarker.css
-+  skin/classic/global/groupbox.css
-+  skin/classic/global/menu.css
-+  skin/classic/global/menulist.css
-+  skin/classic/global/popup.css
-+  skin/classic/global/radio.css
-+  skin/classic/global/tabbox.css
-+  skin/classic/global/textbox.css
-+  skin/classic/global/scrollbars.css                       (xulscrollbars.css)
+   skin/classic/global/button.css
+   skin/classic/global/checkbox.css
+   skin/classic/global/dropmarker.css
+   skin/classic/global/groupbox.css
+   skin/classic/global/menu.css
+   skin/classic/global/menulist.css
+   skin/classic/global/popup.css
+   skin/classic/global/radio.css
+   skin/classic/global/tabbox.css
+   skin/classic/global/textbox.css
+   skin/classic/global/scrollbars.css                       (xulscrollbars.css)
diff --git a/toolkit/themes/mobile/jar.mn b/toolkit/themes/mobile/jar.mn
index 9d81faeb870..09e05750c72 100644
--- a/toolkit/themes/mobile/jar.mn
+++ b/toolkit/themes/mobile/jar.mn
@@ -5,34 +5,34 @@
 toolkit.jar:
 % skin global classic/1.0 %skin/classic/global/
 # These are the CSS files that must exist
-+  skin/classic/global/autocomplete.css                    (global/empty.css)
-+  skin/classic/global/button.css                          (global/empty.css)
-+  skin/classic/global/checkbox.css                        (global/empty.css)
-+  skin/classic/global/dialog.css                          (global/empty.css)
-+  skin/classic/global/dropmarker.css                      (global/empty.css)
-+  skin/classic/global/global.css                          (global/empty.css)
-+  skin/classic/global/groupbox.css                        (global/empty.css)
-+  skin/classic/global/listbox.css                         (global/empty.css)
-+  skin/classic/global/menu.css                            (global/empty.css)
-+  skin/classic/global/menulist.css                        (global/empty.css)
-+  skin/classic/global/numberbox.css                       (global/empty.css)
-+  skin/classic/global/popup.css                           (global/empty.css)
-+  skin/classic/global/preferences.css                     (global/empty.css)
-+  skin/classic/global/progressmeter.css                   (global/empty.css)
-+  skin/classic/global/radio.css                           (global/empty.css)
-+  skin/classic/global/resizer.css                         (global/empty.css)
-+  skin/classic/global/richlistbox.css                     (global/empty.css)
-+  skin/classic/global/scale.css                           (global/empty.css)
-+  skin/classic/global/scrollbox.css                       (global/empty.css)
-+  skin/classic/global/spinbuttons.css                     (global/empty.css)
-+  skin/classic/global/splitter.css                        (global/empty.css)
-+  skin/classic/global/tabbox.css                          (global/empty.css)
-+  skin/classic/global/textbox.css                         (global/empty.css)
-+  skin/classic/global/toolbar.css                         (global/empty.css)
-+  skin/classic/global/toolbarbutton.css                   (global/empty.css)
-+  skin/classic/global/tree.css                            (global/empty.css)
-+  skin/classic/global/wizard.css                          (global/empty.css)
-+  skin/classic/global/scrollbars.css                      (global/empty.css)
+   skin/classic/global/autocomplete.css                    (global/empty.css)
+   skin/classic/global/button.css                          (global/empty.css)
+   skin/classic/global/checkbox.css                        (global/empty.css)
+   skin/classic/global/dialog.css                          (global/empty.css)
+   skin/classic/global/dropmarker.css                      (global/empty.css)
+   skin/classic/global/global.css                          (global/empty.css)
+   skin/classic/global/groupbox.css                        (global/empty.css)
+   skin/classic/global/listbox.css                         (global/empty.css)
+   skin/classic/global/menu.css                            (global/empty.css)
+   skin/classic/global/menulist.css                        (global/empty.css)
+   skin/classic/global/numberbox.css                       (global/empty.css)
+   skin/classic/global/popup.css                           (global/empty.css)
+   skin/classic/global/preferences.css                     (global/empty.css)
+   skin/classic/global/progressmeter.css                   (global/empty.css)
+   skin/classic/global/radio.css                           (global/empty.css)
+   skin/classic/global/resizer.css                         (global/empty.css)
+   skin/classic/global/richlistbox.css                     (global/empty.css)
+   skin/classic/global/scale.css                           (global/empty.css)
+   skin/classic/global/scrollbox.css                       (global/empty.css)
+   skin/classic/global/spinbuttons.css                     (global/empty.css)
+   skin/classic/global/splitter.css                        (global/empty.css)
+   skin/classic/global/tabbox.css                          (global/empty.css)
+   skin/classic/global/textbox.css                         (global/empty.css)
+   skin/classic/global/toolbar.css                         (global/empty.css)
+   skin/classic/global/toolbarbutton.css                   (global/empty.css)
+   skin/classic/global/tree.css                            (global/empty.css)
+   skin/classic/global/wizard.css                          (global/empty.css)
+   skin/classic/global/scrollbars.css                      (global/empty.css)
 
    skin/classic/global/media/clicktoplay-bgtexture.png     (global/media/clicktoplay-bgtexture.png)
    skin/classic/global/media/error.png                     (global/media/error.png)
@@ -42,7 +42,7 @@ toolkit.jar:
    skin/classic/global/icons/Error.png                     (global/icons/Error.png)
 
 % skin mozapps classic/1.0 %skin/classic/mozapps/
-+  skin/classic/mozapps/plugins/pluginProblem.css          (mozapps/plugins/pluginProblem.css)
+   skin/classic/mozapps/plugins/pluginProblem.css          (mozapps/plugins/pluginProblem.css)
 
    skin/classic/mozapps/plugins/contentPluginActivate.png  (mozapps/plugins/contentPluginActivate.png)
    skin/classic/mozapps/plugins/contentPluginBlocked.png   (mozapps/plugins/contentPluginBlocked.png)

From 9fc2271352f5c20f9414302a66a2da6f3ba1b955 Mon Sep 17 00:00:00 2001
From: Mike Hommey 
Date: Tue, 19 Jan 2016 15:26:24 +0900
Subject: [PATCH 080/119] Bug 1240660 - Remove support for the "+" prefix in
 jar manifests. r=gps

---
 build/docs/jar-manifests.rst               |  9 +--------
 python/mozbuild/mozbuild/backend/common.py | 11 +++++++++--
 python/mozbuild/mozbuild/jar.py            | 21 ++++++++++-----------
 3 files changed, 20 insertions(+), 21 deletions(-)

diff --git a/build/docs/jar-manifests.rst b/build/docs/jar-manifests.rst
index 5ee656ac638..89776a1014b 100644
--- a/build/docs/jar-manifests.rst
+++ b/build/docs/jar-manifests.rst
@@ -55,15 +55,8 @@ file should be processed by the :ref:`preprocessor` before being packaged::
 
    * path/in/jar/preprocessed.xul  (source/tree/location/file_name.xul)
 
-A plus marker (``+``) at the beginning of the line indicates that the file
-should replace an existing file, even if the source file's timestamp isn't
-newer than the existing file::
-
-   + path/in/jar/file_name.xul     (source/tree/location/my_file_name.xul)
-
 Preprocessed files always replace existing files, to ensure that changes in
-``#expand`` or ``#include`` directives are picked up, so ``+`` and ``*`` are
-equivalent.
+``#expand`` or ``#include`` directives are picked up.
 
 There is a special source-directory format for localized files (note the
 percent sign in the source file location): this format reads ``localized.dtd``
diff --git a/python/mozbuild/mozbuild/backend/common.py b/python/mozbuild/mozbuild/backend/common.py
index c242f0502f1..e756f6e877c 100644
--- a/python/mozbuild/mozbuild/backend/common.py
+++ b/python/mozbuild/mozbuild/backend/common.py
@@ -37,7 +37,10 @@ from mozbuild.frontend.data import (
     XPIDLFile,
     WebIDLFile,
 )
-from mozbuild.jar import JarManifestParser
+from mozbuild.jar import (
+    DeprecatedJarManifest,
+    JarManifestParser,
+)
 from mozbuild.preprocessor import Preprocessor
 from mozpack.chrome.manifest import parse_manifest_line
 
@@ -397,7 +400,11 @@ class CommonBackend(BuildBackend):
             BUILD_FASTER=1,
         )
         pp.out = JarManifestParser()
-        pp.do_include(obj.path.full_path)
+        try:
+            pp.do_include(obj.path.full_path)
+        except DeprecatedJarManifest as e:
+            raise DeprecatedJarManifest('Parsing error while processing %s: %s'
+                                        % (obj.path.full_path, e.message))
         self.backend_input_files |= pp.includes
 
         for jarinfo in pp.out:
diff --git a/python/mozbuild/mozbuild/jar.py b/python/mozbuild/mozbuild/jar.py
index 8e208311f99..d40751b69bd 100644
--- a/python/mozbuild/mozbuild/jar.py
+++ b/python/mozbuild/mozbuild/jar.py
@@ -64,13 +64,11 @@ def getModTime(aPath):
 
 
 class JarManifestEntry(object):
-    def __init__(self, output, source, is_locale=False, preprocess=False,
-                 overwrite=False):
+    def __init__(self, output, source, is_locale=False, preprocess=False):
         self.output = output
         self.source = source
         self.is_locale = is_locale
         self.preprocess = preprocess
-        self.overwrite = overwrite
 
 
 class JarInfo(object):
@@ -92,6 +90,9 @@ class JarInfo(object):
         self.entries = []
 
 
+class DeprecatedJarManifest(Exception): pass
+
+
 class JarManifestParser(object):
 
     ignore = re.compile('\s*(\#.*)?$')
@@ -169,17 +170,17 @@ class JarManifestParser(object):
         # directory. The  may start with a "%" for files part
         # of a localization directory, in which case the "%" counts as the
         # locale.
-        # Each entry can be prefixed with "*" for preprocessing and "+" to
-        # always overwrite the destination independently of file timestamps
-        # (the usefulness of the latter is dubious in the modern days).
+        # Each entry can be prefixed with "*" for preprocessing.
         m = self.entryline.match(line)
         if m:
+            if m.group('optOverwrite'):
+                raise DeprecatedJarManifest(
+                    'The "+" prefix is not supported anymore')
             self._current_jar.entries.append(JarManifestEntry(
                 m.group('output'),
                 m.group('source') or mozpath.basename(m.group('output')),
                 is_locale=bool(m.group('locale')),
                 preprocess=bool(m.group('optPreprocess')),
-                overwrite=bool(m.group('optOverwrite')),
             ))
             return
 
@@ -431,7 +432,6 @@ class JarMaker(object):
                         path,
                         is_locale=e.is_locale,
                         preprocess=e.preprocess,
-                        overwrite=e.overwrite
                     )
                     self._processEntryLine(e, outHelper, jf)
             return
@@ -465,10 +465,9 @@ class JarMaker(object):
             inf.close()
             return
 
-        # copy or symlink if newer or overwrite
+        # copy or symlink if newer
 
-        if e.overwrite or getModTime(realsrc) \
-            > outHelper.getDestModTime(e.output):
+        if getModTime(realsrc) > outHelper.getDestModTime(e.output):
             if self.outputFormat == 'symlink':
                 outHelper.symlink(realsrc, out)
                 return

From 5c61f233914f517c850f22e86da67d98b4a7cbd3 Mon Sep 17 00:00:00 2001
From: Mike Hommey 
Date: Tue, 19 Jan 2016 15:38:51 +0900
Subject: [PATCH 081/119] Bug 1240660 - Move jar_maker to the misc tier, now
 that ordering does't matter. r=gps

---
 browser/locales/Makefile.in                  | 2 +-
 config/rules.mk                              | 2 +-
 python/mozbuild/mozbuild/frontend/context.py | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/browser/locales/Makefile.in b/browser/locales/Makefile.in
index 6f75776caf6..31c2d290f01 100644
--- a/browser/locales/Makefile.in
+++ b/browser/locales/Makefile.in
@@ -74,7 +74,7 @@ PP_TARGETS += SEARCHPLUGINS
 list-txt = $(SEARCHPLUGINS_PATH)/list.txt
 GARBAGE += $(list-txt)
 
-libs:: searchplugins
+misc:: searchplugins
 
 # Required for l10n.mk - defines a list of app sub dirs that should
 # be included in langpack xpis.
diff --git a/config/rules.mk b/config/rules.mk
index 5fb2a9065d2..6a4120cb786 100644
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -1216,7 +1216,7 @@ endif
 endif
 endif
 
-libs realchrome:: $(FINAL_TARGET)/chrome
+misc realchrome:: $(FINAL_TARGET)/chrome
 	$(call py_action,jar_maker,\
 	  $(QUIET) -d $(FINAL_TARGET) \
 	  $(MAKE_JARS_FLAGS) $(DEFINES) $(ACDEFINES) \
diff --git a/python/mozbuild/mozbuild/frontend/context.py b/python/mozbuild/mozbuild/frontend/context.py
index 40888ab8a5f..1ce7e3f8593 100644
--- a/python/mozbuild/mozbuild/frontend/context.py
+++ b/python/mozbuild/mozbuild/frontend/context.py
@@ -1354,7 +1354,7 @@ VARIABLES = {
         JAR manifests are files in the tree that define how to package files
         into JARs and how chrome registration is performed. For more info,
         see :ref:`jar_manifests`.
-        """, 'libs'),
+        """, 'misc'),
 
     # IDL Generation.
     'XPIDL_SOURCES': (StrictOrderingOnAppendList, list,

From b3ffbcf672ec70d19f7ca8e1d61b94293efd348d Mon Sep 17 00:00:00 2001
From: Mike Hommey 
Date: Tue, 19 Jan 2016 16:43:14 +0900
Subject: [PATCH 082/119] Bug 1240671 - Move FINAL_TARGET_PP_FILES and
 TEST_HARNESS_FILES to the misc tier. r=gps

---
 python/mozbuild/mozbuild/backend/recursivemake.py           | 2 ++
 python/mozbuild/mozbuild/frontend/context.py                | 4 ++--
 python/mozbuild/mozbuild/test/backend/test_recursivemake.py | 1 +
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/python/mozbuild/mozbuild/backend/recursivemake.py b/python/mozbuild/mozbuild/backend/recursivemake.py
index 05f7c1d9820..42b8ad541d8 100644
--- a/python/mozbuild/mozbuild/backend/recursivemake.py
+++ b/python/mozbuild/mozbuild/backend/recursivemake.py
@@ -950,6 +950,7 @@ class RecursiveMakeBackend(CommonBackend):
             backend_file.write("""
 %(prefix)s_FILES := %(files)s
 %(prefix)s_DEST := %(dest)s
+%(prefix)s_TARGET := misc
 INSTALL_TARGETS += %(prefix)s
 """ % { 'prefix': prefix,
         'dest': '$(DEPTH)/_tests/%s' % path,
@@ -1316,6 +1317,7 @@ INSTALL_TARGETS += %(prefix)s
                     i, self._pretty_path(f, backend_file)))
             backend_file.write('DIST_FILES_%d_PATH := $(DEPTH)/%s\n'
                                % (i, mozpath.join(obj.install_target, path)))
+            backend_file.write('DIST_FILES_%d_TARGET := misc\n' % i)
             backend_file.write('PP_TARGETS += DIST_FILES_%d\n' % i)
 
     def _process_chrome_manifest_entry(self, obj, backend_file):
diff --git a/python/mozbuild/mozbuild/frontend/context.py b/python/mozbuild/mozbuild/frontend/context.py
index 1ce7e3f8593..a909465f67c 100644
--- a/python/mozbuild/mozbuild/frontend/context.py
+++ b/python/mozbuild/mozbuild/frontend/context.py
@@ -1053,7 +1053,7 @@ VARIABLES = {
 
     'FINAL_TARGET_PP_FILES': (ContextDerivedTypedHierarchicalStringList(Path), list,
         """Like ``FINAL_TARGET_FILES``, with preprocessing.
-        """, 'libs'),
+        """, 'misc'),
 
     'TESTING_FILES': (ContextDerivedTypedHierarchicalStringList(Path), list,
         """List of files to be installed in the _tests directory.
@@ -1698,7 +1698,7 @@ VARIABLES = {
         Files from topsrcdir and the objdir can also be installed by prefixing
         the path(s) with a '/' character and a '!' character, respectively::
            TEST_HARNESS_FILES.path += ['/build/bar.py', '!quux.py']
-        """, 'libs'),
+        """, 'misc'),
 
     'NO_EXPAND_LIBS': (bool, bool,
         """Forces to build a real static library, and no corresponding fake
diff --git a/python/mozbuild/mozbuild/test/backend/test_recursivemake.py b/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
index 9a82f50de2a..c03e5dd2641 100644
--- a/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
+++ b/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
@@ -706,6 +706,7 @@ class TestRecursiveMakeBackend(BackendTester):
             'DIST_FILES_0 += $(srcdir)/install.rdf',
             'DIST_FILES_0 += $(srcdir)/main.js',
             'DIST_FILES_0_PATH := $(DEPTH)/dist/bin/',
+            'DIST_FILES_0_TARGET := misc',
             'PP_TARGETS += DIST_FILES_0',
         ]
 

From 74567ab8038a20299b1eebfef5a17a896166607f Mon Sep 17 00:00:00 2001
From: Blake Kaplan 
Date: Tue, 19 Jan 2016 14:37:47 -0800
Subject: [PATCH 083/119] Bug 1240909 - Use pushPermissions to be e10s
 compatible. r=mccr8

---
 dom/tests/mochitest/general/mochitest.ini             |  2 +-
 .../mochitest/general/test_idleapi_permissions.html   | 11 +++++------
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/dom/tests/mochitest/general/mochitest.ini b/dom/tests/mochitest/general/mochitest.ini
index 201651f0f77..0d8e7da789c 100644
--- a/dom/tests/mochitest/general/mochitest.ini
+++ b/dom/tests/mochitest/general/mochitest.ini
@@ -74,7 +74,7 @@ skip-if = e10s || buildapp == 'mulet' || buildapp == 'b2g' || toolkit == 'androi
 [test_pointerPreserves3D.html]
 [test_framedhistoryframes.html]
 [test_idleapi_permissions.html]
-skip-if = e10s || buildapp == 'b2g' || buildapp == 'mulet'
+skip-if = buildapp == 'b2g' || buildapp == 'mulet'
 [test_img_mutations.html]
 [test_interfaces.html]
 skip-if = ((buildapp == 'mulet' || buildapp == 'b2g') && toolkit != 'gonk') #Bug 931116, b2g desktop specific, initial triage
diff --git a/dom/tests/mochitest/general/test_idleapi_permissions.html b/dom/tests/mochitest/general/test_idleapi_permissions.html
index fac100b55de..ccd4c8ca83c 100644
--- a/dom/tests/mochitest/general/test_idleapi_permissions.html
+++ b/dom/tests/mochitest/general/test_idleapi_permissions.html
@@ -35,13 +35,12 @@ function run_test() {
 
   var added = doAddIdleObserver(this.idleObserver, false);
   ok(!added, "Should not be able to add idle observer without permission");
-  
-  SpecialPowers.addPermission("idle", true, document);
 
-  added = doAddIdleObserver(this.idleObserver, true);
-  ok(added, "Should be able to add idle observer with permission.");
-  
-  SimpleTest.finish();
+  SpecialPowers.pushPermissions([{type: "idle", allow: true, context: document}], () => {
+    added = doAddIdleObserver(this.idleObserver, true);
+    ok(added, "Should be able to add idle observer with permission.");
+    SimpleTest.finish();
+  });
 }
 
 SimpleTest.waitForExplicitFinish();

From 98a69d988ded4efe063170eb2490ab5f2411f7fd Mon Sep 17 00:00:00 2001
From: Ehsan Akhgari 
Date: Wed, 13 Jan 2016 18:15:37 -0500
Subject: [PATCH 084/119] Bug 1209081 - Part 1: Implement the "navigate" value
 for RequestMode; r=bkelly

---
 dom/bindings/Errors.msg                            |  1 +
 dom/cache/DBSchema.cpp                             |  3 ++-
 dom/fetch/FetchDriver.cpp                          |  3 ++-
 dom/fetch/InternalRequest.cpp                      | 14 +++++++-------
 dom/fetch/Request.cpp                              |  5 +++++
 dom/tests/mochitest/fetch/reroute.js               |  3 ++-
 dom/tests/mochitest/fetch/test_request.js          | 10 ++++++++++
 dom/webidl/Request.webidl                          |  2 +-
 dom/workers/ServiceWorkerEvents.cpp                |  3 ++-
 dom/workers/ServiceWorkerManager.cpp               |  2 ++
 netwerk/protocol/http/nsIHttpChannelInternal.idl   |  3 ++-
 .../fetch-request-fallback.https.html              |  4 ++--
 .../service-worker/request-end-to-end.https.html   |  2 ++
 .../resources/fetch-rewrite-worker.js              |  3 +++
 .../resources/request-end-to-end-worker.js         |  1 +
 15 files changed, 44 insertions(+), 15 deletions(-)

diff --git a/dom/bindings/Errors.msg b/dom/bindings/Errors.msg
index 917c227a779..92c725dc629 100644
--- a/dom/bindings/Errors.msg
+++ b/dom/bindings/Errors.msg
@@ -60,6 +60,7 @@ MSG_DEF(MSG_INVALID_HEADER_SEQUENCE, 0, JSEXN_TYPEERR, "Headers require name/val
 MSG_DEF(MSG_PERMISSION_DENIED_TO_PASS_ARG, 1, JSEXN_TYPEERR, "Permission denied to pass cross-origin object as {0}.")
 MSG_DEF(MSG_MISSING_REQUIRED_DICTIONARY_MEMBER, 1, JSEXN_TYPEERR, "Missing required {0}.")
 MSG_DEF(MSG_INVALID_REQUEST_METHOD, 1, JSEXN_TYPEERR, "Invalid request method {0}.")
+MSG_DEF(MSG_INVALID_REQUEST_MODE, 1, JSEXN_TYPEERR, "Invalid request mode {0}.")
 MSG_DEF(MSG_FETCH_BODY_CONSUMED_ERROR, 0, JSEXN_TYPEERR, "Body has already been consumed.")
 MSG_DEF(MSG_RESPONSE_INVALID_STATUSTEXT_ERROR, 0, JSEXN_TYPEERR, "Response statusText may not contain newline or carriage return.")
 MSG_DEF(MSG_FETCH_FAILED, 0, JSEXN_TYPEERR, "NetworkError when attempting to fetch resource.")
diff --git a/dom/cache/DBSchema.cpp b/dom/cache/DBSchema.cpp
index c1e83c95ad1..4558f11272c 100644
--- a/dom/cache/DBSchema.cpp
+++ b/dom/cache/DBSchema.cpp
@@ -192,7 +192,8 @@ static_assert(int(HeadersGuardEnum::None) == 0 &&
 static_assert(int(RequestMode::Same_origin) == 0 &&
               int(RequestMode::No_cors) == 1 &&
               int(RequestMode::Cors) == 2 &&
-              int(RequestMode::EndGuard_) == 3,
+              int(RequestMode::Navigate) == 3 &&
+              int(RequestMode::EndGuard_) == 4,
               "RequestMode values are as expected");
 static_assert(int(RequestCredentials::Omit) == 0 &&
               int(RequestCredentials::Same_origin) == 1 &&
diff --git a/dom/fetch/FetchDriver.cpp b/dom/fetch/FetchDriver.cpp
index ae2ae2c0b3e..a9b340f8e4d 100644
--- a/dom/fetch/FetchDriver.cpp
+++ b/dom/fetch/FetchDriver.cpp
@@ -170,7 +170,8 @@ FetchDriver::HttpFetch()
   nsSecurityFlags secFlags = nsILoadInfo::SEC_ABOUT_BLANK_INHERITS;
   if (mRequest->Mode() == RequestMode::Cors) {
     secFlags |= nsILoadInfo::SEC_REQUIRE_CORS_DATA_INHERITS;
-  } else if (mRequest->Mode() == RequestMode::Same_origin) {
+  } else if (mRequest->Mode() == RequestMode::Same_origin ||
+             mRequest->Mode() == RequestMode::Navigate) {
     secFlags |= nsILoadInfo::SEC_REQUIRE_SAME_ORIGIN_DATA_INHERITS;
   } else if (mRequest->Mode() == RequestMode::No_cors) {
     secFlags |= nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_INHERITS;
diff --git a/dom/fetch/InternalRequest.cpp b/dom/fetch/InternalRequest.cpp
index 2579402eaff..07c9fc0b13e 100644
--- a/dom/fetch/InternalRequest.cpp
+++ b/dom/fetch/InternalRequest.cpp
@@ -275,14 +275,13 @@ InternalRequest::MapChannelToRequestMode(nsIChannel* aChannel)
   nsCOMPtr loadInfo;
   MOZ_ALWAYS_TRUE(NS_SUCCEEDED(aChannel->GetLoadInfo(getter_AddRefs(loadInfo))));
 
-  // RequestMode deviates from our internal security mode for navigations.
-  // While navigations normally allow cross origin we must set a same-origin
-  // RequestMode to get the correct service worker interception restrictions
-  // in place.
-  // TODO: remove the worker override once securityMode is fully implemented (bug 1189945)
   nsContentPolicyType contentPolicy = loadInfo->InternalContentPolicyType();
-  if (IsNavigationContentPolicy(contentPolicy) ||
-      IsWorkerContentPolicy(contentPolicy)) {
+  if (IsNavigationContentPolicy(contentPolicy)) {
+    return RequestMode::Navigate;
+  }
+
+  // TODO: remove the worker override once securityMode is fully implemented (bug 1189945)
+  if (IsWorkerContentPolicy(contentPolicy)) {
     return RequestMode::Same_origin;
   }
 
@@ -319,6 +318,7 @@ InternalRequest::MapChannelToRequestMode(nsIChannel* aChannel)
 
   uint32_t corsMode;
   MOZ_ALWAYS_TRUE(NS_SUCCEEDED(httpChannel->GetCorsMode(&corsMode)));
+  MOZ_ASSERT(corsMode != nsIHttpChannelInternal::CORS_MODE_NAVIGATE);
 
   // This cast is valid due to static asserts in ServiceWorkerManager.cpp.
   return static_cast(corsMode);
diff --git a/dom/fetch/Request.cpp b/dom/fetch/Request.cpp
index a6e874fdf00..9a690393523 100644
--- a/dom/fetch/Request.cpp
+++ b/dom/fetch/Request.cpp
@@ -284,6 +284,11 @@ Request::Constructor(const GlobalObject& aGlobal,
     aInit.mCredentials.WasPassed() ? aInit.mCredentials.Value()
                                    : fallbackCredentials;
 
+  if (mode == RequestMode::Navigate) {
+    aRv.ThrowTypeError(NS_LITERAL_STRING("navigate"));
+    return nullptr;
+  }
+
   if (mode != RequestMode::EndGuard_) {
     request->ClearCreatedByFetchEvent();
     request->SetMode(mode);
diff --git a/dom/tests/mochitest/fetch/reroute.js b/dom/tests/mochitest/fetch/reroute.js
index c2bd08402d5..2c9bcd35f18 100644
--- a/dom/tests/mochitest/fetch/reroute.js
+++ b/dom/tests/mochitest/fetch/reroute.js
@@ -7,11 +7,12 @@ onfetch = function(e) {
 
     e.respondWith(e.request.text().then(function(text) {
       var body = text === '' ? undefined : text;
+      var mode = e.request.mode == 'navigate' ? 'same-origin' : e.request.mode;
       return fetch(url, {
         method: e.request.method,
         headers: e.request.headers,
         body: body,
-        mode: e.request.mode,
+        mode: mode,
         credentials: e.request.credentials,
         redirect: e.request.redirect,
         cache: e.request.cache,
diff --git a/dom/tests/mochitest/fetch/test_request.js b/dom/tests/mochitest/fetch/test_request.js
index e7202caefec..33c56e1a1e6 100644
--- a/dom/tests/mochitest/fetch/test_request.js
+++ b/dom/tests/mochitest/fetch/test_request.js
@@ -151,6 +151,15 @@ function testHeaderGuard() {
   ok(!r2.headers.has("Non-Simple-Header"), "no-cors Request header should have guard request-no-cors and prevent setting non-simple header.");
 }
 
+function testMode() {
+  try {
+    var req = new Request("http://example.com", {mode: "navigate"});
+    ok(false, "Creating a Request with navigate RequestMode should throw a TypeError");
+  } catch(e) {
+    is(e.name, "TypeError", "Creating a Request with navigate RequestMode should throw a TypeError");
+  }
+}
+
 function testMethod() {
   // These get normalized.
   var allowed = ["delete", "get", "head", "options", "post", "put" ];
@@ -511,6 +520,7 @@ function runTest() {
   testUrlFragment();
   testUrlCredentials();
   testUrlMalformed();
+  testMode();
   testMethod();
   testBug1109574();
   testBug1184550();
diff --git a/dom/webidl/Request.webidl b/dom/webidl/Request.webidl
index 09a19ebc7da..bfe2a1b36b8 100644
--- a/dom/webidl/Request.webidl
+++ b/dom/webidl/Request.webidl
@@ -55,7 +55,7 @@ enum RequestContext {
   "xslt"
 };
 
-enum RequestMode { "same-origin", "no-cors", "cors" };
+enum RequestMode { "same-origin", "no-cors", "cors", "navigate" };
 enum RequestCredentials { "omit", "same-origin", "include" };
 enum RequestCache { "default", "no-store", "reload", "no-cache", "force-cache" };
 enum RequestRedirect { "follow", "error", "manual" };
diff --git a/dom/workers/ServiceWorkerEvents.cpp b/dom/workers/ServiceWorkerEvents.cpp
index 6f474484456..c1508ee841e 100644
--- a/dom/workers/ServiceWorkerEvents.cpp
+++ b/dom/workers/ServiceWorkerEvents.cpp
@@ -568,7 +568,8 @@ RespondWithHandler::ResolvedCallback(JSContext* aCx, JS::Handle aValu
     return;
   }
 
-  MOZ_ASSERT_IF(mIsClientRequest, mRequestMode == RequestMode::Same_origin);
+  MOZ_ASSERT_IF(mIsClientRequest, mRequestMode == RequestMode::Same_origin ||
+                                  mRequestMode == RequestMode::Navigate);
 
   if (response->Type() == ResponseType::Opaque && mRequestMode != RequestMode::No_cors) {
     uint32_t mode = static_cast(mRequestMode);
diff --git a/dom/workers/ServiceWorkerManager.cpp b/dom/workers/ServiceWorkerManager.cpp
index 726d7fde567..85ee793b351 100644
--- a/dom/workers/ServiceWorkerManager.cpp
+++ b/dom/workers/ServiceWorkerManager.cpp
@@ -103,6 +103,8 @@ static_assert(nsIHttpChannelInternal::CORS_MODE_NO_CORS == static_cast
               "RequestMode enumeration value should match Necko CORS mode value.");
 static_assert(nsIHttpChannelInternal::CORS_MODE_CORS == static_cast(RequestMode::Cors),
               "RequestMode enumeration value should match Necko CORS mode value.");
+static_assert(nsIHttpChannelInternal::CORS_MODE_NAVIGATE == static_cast(RequestMode::Navigate),
+              "RequestMode enumeration value should match Necko CORS mode value.");
 
 static_assert(nsIHttpChannelInternal::REDIRECT_MODE_FOLLOW == static_cast(RequestRedirect::Follow),
               "RequestRedirect enumeration value should make Necko Redirect mode value.");
diff --git a/netwerk/protocol/http/nsIHttpChannelInternal.idl b/netwerk/protocol/http/nsIHttpChannelInternal.idl
index 48b06cf6ca9..b7d4132543e 100644
--- a/netwerk/protocol/http/nsIHttpChannelInternal.idl
+++ b/netwerk/protocol/http/nsIHttpChannelInternal.idl
@@ -39,7 +39,7 @@ interface nsIHttpUpgradeListener : nsISupports
  * using any feature exposed by this interface, be aware that this interface
  * will change and you will be broken.  You have been warned.
  */
-[scriptable, uuid(332d5f9c-991c-45e3-922f-99e6fe0deb60)]
+[scriptable, uuid(f292a080-f2f6-41d6-8aa4-71337e477360)]
 interface nsIHttpChannelInternal : nsISupports
 {
     /**
@@ -226,6 +226,7 @@ interface nsIHttpChannelInternal : nsISupports
     const unsigned long CORS_MODE_SAME_ORIGIN = 0;
     const unsigned long CORS_MODE_NO_CORS = 1;
     const unsigned long CORS_MODE_CORS = 2;
+    const unsigned long CORS_MODE_NAVIGATE = 3;
     /**
      * Set by nsCORSListenerProxy to indicate CORS load type. Defaults to CORS_MODE_NO_CORS.
      */
diff --git a/testing/web-platform/mozilla/tests/service-workers/service-worker/fetch-request-fallback.https.html b/testing/web-platform/mozilla/tests/service-workers/service-worker/fetch-request-fallback.https.html
index 7420b831434..8290e21dd3e 100644
--- a/testing/web-platform/mozilla/tests/service-workers/service-worker/fetch-request-fallback.https.html
+++ b/testing/web-platform/mozilla/tests/service-workers/service-worker/fetch-request-fallback.https.html
@@ -95,9 +95,9 @@ async_test(function(t) {
           assert_equals(requests[0].url, new URL(SCOPE, location).toString(),
                         'The first request to the SW must be the request for ' +
                         'the page.');
-          assert_equals(requests[0].mode, 'same-origin',
+          assert_equals(requests[0].mode, 'navigate',
                         'The mode of the first request to the SW must be ' +
-                        'same-origin');
+                        'navigate');
           for (var i = 0; i < expected_urls.length; ++i) {
             assert_equals(requests[i + 1].url, expected_urls[i],
                           'The URL of the request which was passed from XHR ' +
diff --git a/testing/web-platform/mozilla/tests/service-workers/service-worker/request-end-to-end.https.html b/testing/web-platform/mozilla/tests/service-workers/service-worker/request-end-to-end.https.html
index 20eebe68eec..c9c3b30464b 100644
--- a/testing/web-platform/mozilla/tests/service-workers/service-worker/request-end-to-end.https.html
+++ b/testing/web-platform/mozilla/tests/service-workers/service-worker/request-end-to-end.https.html
@@ -43,6 +43,8 @@ t.step(function() {
             location.href.substring(0, location.href.lastIndexOf('/') + 1) +
             scope,
             'request.url should be passed to onfetch event.');
+        assert_equals(event.data.mode, 'navigate',
+                      'request.mode should be passed to onfetch event.');
         assert_equals(event.data.method, 'GET',
                       'request.method should be passed to onfetch event.');
         assert_equals(event.data.referrer, location.href,
diff --git a/testing/web-platform/mozilla/tests/service-workers/service-worker/resources/fetch-rewrite-worker.js b/testing/web-platform/mozilla/tests/service-workers/service-worker/resources/fetch-rewrite-worker.js
index 0370e17e5ec..3929f2cccf1 100644
--- a/testing/web-platform/mozilla/tests/service-workers/service-worker/resources/fetch-rewrite-worker.js
+++ b/testing/web-platform/mozilla/tests/service-workers/service-worker/resources/fetch-rewrite-worker.js
@@ -16,6 +16,9 @@ function get_request_init(base, params) {
   var init = {};
   init['method'] = params['method'] || base['method'];
   init['mode'] = params['mode'] || base['mode'];
+  if (init['mode'] == 'navigate') {
+    init['mode'] = 'same-origin';
+  }
   init['credentials'] = params['credentials'] || base['credentials'];
   init['redirect'] = params['redirect-mode'] || base['redirect'];
   return init;
diff --git a/testing/web-platform/mozilla/tests/service-workers/service-worker/resources/request-end-to-end-worker.js b/testing/web-platform/mozilla/tests/service-workers/service-worker/resources/request-end-to-end-worker.js
index 065df374668..323c7f24367 100644
--- a/testing/web-platform/mozilla/tests/service-workers/service-worker/resources/request-end-to-end-worker.js
+++ b/testing/web-platform/mozilla/tests/service-workers/service-worker/resources/request-end-to-end-worker.js
@@ -22,6 +22,7 @@ onfetch = function(e) {
   }
   port.postMessage({
       url: e.request.url,
+      mode: e.request.mode,
       method: e.request.method,
       referrer: e.request.referrer,
       headers: headers,

From df877e4c27902f82d6a92753c37c90414719ca18 Mon Sep 17 00:00:00 2001
From: Ehsan Akhgari 
Date: Tue, 19 Jan 2016 16:01:31 -0500
Subject: [PATCH 085/119] Bug 1209081 - Part 2: Upgrade the saved Requests in
 the DOM Cache to reflect the "navigate" RequestMode if they represent
 navigation content policy types; r=bkelly

---
 dom/cache/DBSchema.cpp                        |  36 +++++++++++++++++-
 dom/cache/test/xpcshell/schema_15_profile.zip | Bin 3111 -> 3111 bytes
 dom/cache/test/xpcshell/test_migration.js     |   1 +
 3 files changed, 36 insertions(+), 1 deletion(-)

diff --git a/dom/cache/DBSchema.cpp b/dom/cache/DBSchema.cpp
index 4558f11272c..5edf0933fe8 100644
--- a/dom/cache/DBSchema.cpp
+++ b/dom/cache/DBSchema.cpp
@@ -37,7 +37,7 @@ const int32_t kFirstShippedSchemaVersion = 15;
 namespace {
 
 // Update this whenever the DB schema is changed.
-const int32_t kLatestSchemaVersion = 18;
+const int32_t kLatestSchemaVersion = 19;
 
 // ---------
 // The following constants define the SQL schema.  These are defined in the
@@ -2412,12 +2412,14 @@ struct Migration
 nsresult MigrateFrom15To16(mozIStorageConnection* aConn);
 nsresult MigrateFrom16To17(mozIStorageConnection* aConn);
 nsresult MigrateFrom17To18(mozIStorageConnection* aConn);
+nsresult MigrateFrom18To19(mozIStorageConnection* aConn);
 
 // Configure migration functions to run for the given starting version.
 Migration sMigrationList[] = {
   Migration(15, MigrateFrom15To16),
   Migration(16, MigrateFrom16To17),
   Migration(17, MigrateFrom17To18),
+  Migration(18, MigrateFrom18To19),
 };
 
 uint32_t sMigrationListLength = sizeof(sMigrationList) / sizeof(Migration);
@@ -2685,6 +2687,38 @@ MigrateFrom17To18(mozIStorageConnection* aConn)
   return rv;
 }
 
+nsresult
+MigrateFrom18To19(mozIStorageConnection* aConn)
+{
+  MOZ_ASSERT(!NS_IsMainThread());
+  MOZ_ASSERT(aConn);
+
+  mozStorageTransaction trans(aConn, true,
+                              mozIStorageConnection::TRANSACTION_IMMEDIATE);
+
+  // This migration is needed in order to update the RequestMode values for
+  // Request objects corresponding to a navigation content policy type to
+  // "navigate".
+
+  static_assert(int(nsIContentPolicy::TYPE_DOCUMENT) == 6 &&
+                int(nsIContentPolicy::TYPE_SUBDOCUMENT) == 7 &&
+                int(nsIContentPolicy::TYPE_INTERNAL_FRAME) == 28 &&
+                int(nsIContentPolicy::TYPE_INTERNAL_IFRAME) == 29 &&
+                int(nsIContentPolicy::TYPE_REFRESH) == 8 &&
+                int(RequestMode::Navigate) == 3,
+                "This is where the numbers below come from!");
+  nsresult rv = aConn->ExecuteSimpleSQL(NS_LITERAL_CSTRING(
+    "UPDATE entries SET request_mode = 3 "
+      "WHERE request_contentpolicytype IN (6, 7, 28, 29, 8);"
+  ));
+  if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
+
+  rv = aConn->SetSchemaVersion(19);
+  if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
+
+  return rv;
+}
+
 
 } // anonymous namespace
 
diff --git a/dom/cache/test/xpcshell/schema_15_profile.zip b/dom/cache/test/xpcshell/schema_15_profile.zip
index 246d01e07e3f2103645513c2ebe5b6995aa67c8d..32cc8f2eeb144a881f345e1468a155a0f959a5db 100644
GIT binary patch
delta 1554
zcmZ{kdpOg39LIk%wOA#iHh0g{k&epLTne>V9CA4(mt$_HhYd}xF_*Tf<2XmUX`#u;
zWz?Fjkiv006emL@muAN;VRK1hx$cbTsnem^%!>%H~>0W?Ft;R19)??H=CMlh
z3IY}Nt_1a$8QN;yb$)ry)5?}{qtZDNAeL(OxM^^!%&g^hLdGsOUXUb!Er%5bxr15>
zU>NLZ-39RQpI5*mf>uAJrd*f|jEwe169UZ5=J*T-m8~Vr7iX|e;_&Uhq?=K$S-bAt
zd~(*q@^?+L+ODe3rEWEJDA(k}+3zUk_Sc$M4;cp6C}RjYh{Xv1#jc(r!e*1s0cQI)
zHXVJN{MJMUNRU{I7#1j$F(KI7r48q>`S~29h_AqH<@QEy;_LAQ9wo&wOd~9*8~-BA
zD~NjF4RnDV|MWQ$&R!W|GHpfl{<7))2L_U9oDnzwhd5KGPTa$pzJ1Y@zbVQ)<@d0d
zlLhl(_@Vm#=d4G8-02WqwlNVOiCLvr9K^VYbSf0hxf2srP~)J5cDzOcvaJTK4+V&(PZiC_e
z`{`Cyo5?Z#QNCJAX>sz@NL)nGV~1KdcDxnih41V-AX9
zpp@I+=TmfRQbn(dkIP^Ur!7FrPwkdC(jU~%#!Ub8t~v86=UE1RV!0E|PM=Z~mrZG0?Aw!f7MyDm~gn157uGF5$wg(0j~>mF5p)A5WIBd)S04_iCTjQGpF8TWwpLb~>S0|XFdDd)j?-75(IRVYL7}g!X|2x!3``ohh==Zd)AuVKL5b<=qw4C9@IA!t
zR~LjO3a3`5O}g99Py<smCgr>|+_A8jwEKM~8q%^c;_PCe`aIW31tXiZ_jknKa>@3Hu)Yx0!w*W@!01)v7OEN*;i&D!hbh{xikp6ouMl;JB~*Bv
z6lT(;+i26i*tjgyF(yIFeToro%O?#+$6*W;_sL)tox48NW;rc++?mO5m-v2u%kt*q
zVi9#?$d~d?B8EHJrCvqQV332~LNQr`76vhb{|^RfWGI5x1qqRY6SE~)st>lfN;OMf
zi>4!YRDM0j$qpo=2~HhC&=TcNDE;efTmtK;<;z*aVV5YR3w_IAGb9u>mo03o7rZ_OITwz{vrFcmqGH=to|HMi$
zH!l%VBHl<-pvSbD<|R!hNTe-^NXO=g&1R8mt3YgN+m#axDQ27_m=FKIzkGAP~scOF>Zw
zvfj?P9UNX(^`9OFMMOMKHnF{B@70qySuMV;i@sR`DQ-f&#!IuyE0}Qi
z^ov=M=JpYehtWxUm<^G;xwJbxRoWxW*tjnd8`G=xBpDf_*dLX=Y-xAsMYW
zMB*!F2!-Dw=J!{{n|$+Jyxg9==3&YPi@F-#;;
zRwG1Z;~T%&veN3cB<-GzjtX13eQjKHYKX2Y4)rs|L3erkBC*qT{pVvFt+vNj?9TW-
zSDXXybu&wB88tV-XZ$hKGE!5URI{2gJ^X;}ZxVgl;hOzchlcA_w7C=LWtK#fb^?FT
z@s!t=n(#~^qlJ~+!EYNtbR)6-Xb5l~B5u$%-Q
zEDWottYm0k;?L5z(S7Bu4vvUBQ+*}$N9P=1p)%P{$)*jXypBeKXl_oj#)K@cI&Da%
zMXQ&{;2WJL4#Mbr8q
zK3yh9;>V986IA$m73RT!Ey{a8hhmlia9Y_0`ac*12sJs|KZfH$|K}Uy?+24>$AB4

diff --git a/dom/cache/test/xpcshell/test_migration.js b/dom/cache/test/xpcshell/test_migration.js
index 5739ce25c9a..31acc4cb7b5 100644
--- a/dom/cache/test/xpcshell/test_migration.js
+++ b/dom/cache/test/xpcshell/test_migration.js
@@ -21,6 +21,7 @@ function run_test() {
       ok(request, 'each request in list should be non-null');
       ok(request.redirect === 'follow', 'request.redirect should default to "follow"');
       ok(request.cache === 'default', 'request.cache should have been updated to "default"' + request.cache);
+      ok(request.mode === 'navigate', 'request.mode should have been updated to "navigate"');
     });
     return Promise.all(requestList.map(function(request) {
       return cache.match(request);

From 7e95055d1aaf9fcf36a767accac8c0d05aed1f7d Mon Sep 17 00:00:00 2001
From: Jean-Yves Avenard 
Date: Mon, 18 Jan 2016 10:21:59 +1100
Subject: [PATCH 086/119] Bug 1236703: P1. Add debugging information for MSE to
 about:media plugin. r=kentuckyfriedtakahe

Add : number of frames decoded and number of frames skipped during skip to next key frame and if hardware acceleration is currently in use.
---
 dom/media/MediaFormatReader.cpp              | 16 ++++++++++++++++
 dom/media/MediaFormatReader.h                |  6 ++++++
 dom/media/mediasource/MediaSourceDecoder.cpp |  7 +++----
 dom/media/mediasource/MediaSourceDecoder.h   |  2 ++
 4 files changed, 27 insertions(+), 4 deletions(-)

diff --git a/dom/media/MediaFormatReader.cpp b/dom/media/MediaFormatReader.cpp
index fb0a2887c55..6c65699e638 100644
--- a/dom/media/MediaFormatReader.cpp
+++ b/dom/media/MediaFormatReader.cpp
@@ -1363,6 +1363,7 @@ MediaFormatReader::OnVideoSkipCompleted(uint32_t aSkipped)
   if (mDecoder) {
     mDecoder->NotifyDecodedFrames(aSkipped, 0, aSkipped);
   }
+  mVideo.mNumSamplesSkippedTotal += aSkipped;
   MOZ_ASSERT(!mVideo.mError); // We have flushed the decoder, no frame could
                               // have been decoded (and as such errored)
   NotifyDecodingRequested(TrackInfo::kVideoTrack);
@@ -1661,4 +1662,19 @@ MediaFormatReader::GetImageContainer()
     ? mVideoFrameContainer->GetImageContainer() : nullptr;
 }
 
+void
+MediaFormatReader::GetMozDebugReaderData(nsAString& aString)
+{
+  nsAutoCString result;
+  result += nsPrintfCString("hardware video decoding: %s\n",
+                            VideoIsHardwareAccelerated() ? "enabled" : "disabled");
+  result += nsPrintfCString("audio frames decoded: %lld (skipped:%lld)\n"
+                            "video frames decoded: %lld (skipped:%lld)\n",
+                            mAudio.mNumSamplesOutputTotal,
+                            mAudio.mNumSamplesSkippedTotal,
+                            mVideo.mNumSamplesOutputTotal,
+                            mVideo.mNumSamplesSkippedTotal);
+  aString += NS_ConvertUTF8toUTF16(result);
+}
+
 } // namespace mozilla
diff --git a/dom/media/MediaFormatReader.h b/dom/media/MediaFormatReader.h
index 5a49f8bafa9..30207b59fc4 100644
--- a/dom/media/MediaFormatReader.h
+++ b/dom/media/MediaFormatReader.h
@@ -96,6 +96,10 @@ public:
   void SetCDMProxy(CDMProxy* aProxy) override;
 #endif
 
+  // Returns a string describing the state of the decoder data.
+  // Used for debugging purposes.
+  void GetMozDebugReaderData(nsAString& aString);
+
 private:
   bool HasVideo() { return mVideo.mTrackDemuxer; }
   bool HasAudio() { return mAudio.mTrackDemuxer; }
@@ -226,6 +230,7 @@ private:
       , mNumSamplesInput(0)
       , mNumSamplesOutput(0)
       , mNumSamplesOutputTotal(0)
+      , mNumSamplesSkippedTotal(0)
       , mSizeOfQueue(0)
       , mIsHardwareAccelerated(false)
       , mLastStreamSourceID(UINT32_MAX)
@@ -289,6 +294,7 @@ private:
     uint64_t mNumSamplesInput;
     uint64_t mNumSamplesOutput;
     uint64_t mNumSamplesOutputTotal;
+    uint64_t mNumSamplesSkippedTotal;
 
     // These get overriden in the templated concrete class.
     // Indicate if we have a pending promise for decoded frame.
diff --git a/dom/media/mediasource/MediaSourceDecoder.cpp b/dom/media/mediasource/MediaSourceDecoder.cpp
index 34f20cd986f..7d962a8ea56 100644
--- a/dom/media/mediasource/MediaSourceDecoder.cpp
+++ b/dom/media/mediasource/MediaSourceDecoder.cpp
@@ -13,7 +13,6 @@
 #include "MediaSourceResource.h"
 #include "MediaSourceUtils.h"
 #include "VideoUtils.h"
-#include "MediaFormatReader.h"
 #include "MediaSourceDemuxer.h"
 #include "SourceBufferList.h"
 #include 
@@ -47,9 +46,8 @@ MediaSourceDecoder::CreateStateMachine()
 {
   MOZ_ASSERT(NS_IsMainThread());
   mDemuxer = new MediaSourceDemuxer();
-  RefPtr reader =
-    new MediaFormatReader(this, mDemuxer, GetVideoFrameContainer());
-  return new MediaDecoderStateMachine(this, reader);
+  mReader = new MediaFormatReader(this, mDemuxer, GetVideoFrameContainer());
+  return new MediaDecoderStateMachine(this, mReader);
 }
 
 nsresult
@@ -241,6 +239,7 @@ MediaSourceDecoder::GetMediaSourceDuration()
 void
 MediaSourceDecoder::GetMozDebugReaderData(nsAString& aString)
 {
+  mReader->GetMozDebugReaderData(aString);
   mDemuxer->GetMozDebugReaderData(aString);
 }
 
diff --git a/dom/media/mediasource/MediaSourceDecoder.h b/dom/media/mediasource/MediaSourceDecoder.h
index eabfe9957b9..704e78eade9 100644
--- a/dom/media/mediasource/MediaSourceDecoder.h
+++ b/dom/media/mediasource/MediaSourceDecoder.h
@@ -12,6 +12,7 @@
 #include "nsCOMPtr.h"
 #include "nsError.h"
 #include "MediaDecoder.h"
+#include "MediaFormatReader.h"
 
 class nsIStreamListener;
 
@@ -88,6 +89,7 @@ private:
   // mMediaSource.
   dom::MediaSource* mMediaSource;
   RefPtr mDemuxer;
+  RefPtr mReader;
 
   Atomic mEnded;
 };

From 97b90a26b780487d01de2e25ac3d1fac1abe9886 Mon Sep 17 00:00:00 2001
From: Jean-Yves Avenard 
Date: Mon, 18 Jan 2016 15:34:07 +1100
Subject: [PATCH 087/119] Bug 1236703: P2. Add methods to retrieve debugging
 data on plain readers. r=jwwang

---
 dom/media/MediaDecoder.h                     |  4 ++++
 dom/media/fmp4/MP4Decoder.cpp                | 13 ++++++++++---
 dom/media/fmp4/MP4Decoder.h                  |  6 ++++++
 dom/media/mediasource/MediaSourceDecoder.cpp |  6 ++++--
 dom/media/mediasource/MediaSourceDecoder.h   |  2 +-
 dom/media/webm/WebMDecoder.cpp               | 13 ++++++++++---
 dom/media/webm/WebMDecoder.h                 |  6 ++++++
 7 files changed, 41 insertions(+), 9 deletions(-)

diff --git a/dom/media/MediaDecoder.h b/dom/media/MediaDecoder.h
index e731d2455d1..7a1672d6076 100644
--- a/dom/media/MediaDecoder.h
+++ b/dom/media/MediaDecoder.h
@@ -530,6 +530,10 @@ private:
   virtual MediaDecoderOwner::NextFrameStatus NextFrameStatus() { return mNextFrameStatus; }
   virtual MediaDecoderOwner::NextFrameStatus NextFrameBufferedStatus();
 
+  // Returns a string describing the state of the media player internal
+  // data. Used for debugging purposes.
+  virtual void GetMozDebugReaderData(nsAString& aString) {}
+
 protected:
   virtual ~MediaDecoder();
 
diff --git a/dom/media/fmp4/MP4Decoder.cpp b/dom/media/fmp4/MP4Decoder.cpp
index eaba46b151e..25ad3adb21b 100644
--- a/dom/media/fmp4/MP4Decoder.cpp
+++ b/dom/media/fmp4/MP4Decoder.cpp
@@ -6,7 +6,6 @@
 
 #include "MP4Decoder.h"
 #include "MediaDecoderStateMachine.h"
-#include "MediaFormatReader.h"
 #include "MP4Demuxer.h"
 #include "mozilla/Preferences.h"
 #include "nsCharSeparatedTokenizer.h"
@@ -47,12 +46,12 @@ MP4Decoder::MP4Decoder(MediaDecoderOwner* aOwner)
 
 MediaDecoderStateMachine* MP4Decoder::CreateStateMachine()
 {
-  MediaDecoderReader* reader =
+  mReader =
     new MediaFormatReader(this,
                           new MP4Demuxer(GetResource()),
                           GetVideoFrameContainer());
 
-  return new MediaDecoderStateMachine(this, reader);
+  return new MediaDecoderStateMachine(this, mReader);
 }
 
 static bool
@@ -227,4 +226,12 @@ MP4Decoder::IsVideoAccelerated(layers::LayersBackend aBackend, nsACString& aFail
   return result;
 }
 
+void
+MP4Decoder::GetMozDebugReaderData(nsAString& aString)
+{
+  if (mReader) {
+    mReader->GetMozDebugReaderData(aString);
+  }
+}
+
 } // namespace mozilla
diff --git a/dom/media/fmp4/MP4Decoder.h b/dom/media/fmp4/MP4Decoder.h
index b509cb69e54..62578ed2348 100644
--- a/dom/media/fmp4/MP4Decoder.h
+++ b/dom/media/fmp4/MP4Decoder.h
@@ -7,6 +7,7 @@
 #define MP4Decoder_h_
 
 #include "MediaDecoder.h"
+#include "MediaFormatReader.h"
 
 namespace mozilla {
 
@@ -38,6 +39,11 @@ public:
   static bool IsEnabled();
 
   static bool IsVideoAccelerated(layers::LayersBackend aBackend, nsACString& aReason);
+
+  void GetMozDebugReaderData(nsAString& aString) override;
+
+private:
+  RefPtr mReader;
 };
 
 } // namespace mozilla
diff --git a/dom/media/mediasource/MediaSourceDecoder.cpp b/dom/media/mediasource/MediaSourceDecoder.cpp
index 7d962a8ea56..9e2e7fdf64a 100644
--- a/dom/media/mediasource/MediaSourceDecoder.cpp
+++ b/dom/media/mediasource/MediaSourceDecoder.cpp
@@ -239,8 +239,10 @@ MediaSourceDecoder::GetMediaSourceDuration()
 void
 MediaSourceDecoder::GetMozDebugReaderData(nsAString& aString)
 {
-  mReader->GetMozDebugReaderData(aString);
-  mDemuxer->GetMozDebugReaderData(aString);
+  if (mReader && mDemuxer) {
+    mReader->GetMozDebugReaderData(aString);
+    mDemuxer->GetMozDebugReaderData(aString);
+  }
 }
 
 double
diff --git a/dom/media/mediasource/MediaSourceDecoder.h b/dom/media/mediasource/MediaSourceDecoder.h
index 704e78eade9..ff3110eda36 100644
--- a/dom/media/mediasource/MediaSourceDecoder.h
+++ b/dom/media/mediasource/MediaSourceDecoder.h
@@ -74,7 +74,7 @@ public:
 
   // Returns a string describing the state of the MediaSource internal
   // buffered data. Used for debugging purposes.
-  void GetMozDebugReaderData(nsAString& aString);
+  void GetMozDebugReaderData(nsAString& aString) override;
 
   void AddSizeOfResources(ResourceSizes* aSizes) override;
 
diff --git a/dom/media/webm/WebMDecoder.cpp b/dom/media/webm/WebMDecoder.cpp
index fdc4f429c4b..65eb83d01f1 100644
--- a/dom/media/webm/WebMDecoder.cpp
+++ b/dom/media/webm/WebMDecoder.cpp
@@ -6,7 +6,6 @@
 
 #include "mozilla/Preferences.h"
 #include "MediaDecoderStateMachine.h"
-#include "MediaFormatReader.h"
 #include "WebMDemuxer.h"
 #include "WebMDecoder.h"
 #include "VideoUtils.h"
@@ -15,9 +14,9 @@ namespace mozilla {
 
 MediaDecoderStateMachine* WebMDecoder::CreateStateMachine()
 {
-  RefPtr reader =
+  mReader =
     new MediaFormatReader(this, new WebMDemuxer(GetResource()), GetVideoFrameContainer());
-  return new MediaDecoderStateMachine(this, reader);
+  return new MediaDecoderStateMachine(this, mReader);
 }
 
 /* static */
@@ -71,5 +70,13 @@ WebMDecoder::CanHandleMediaType(const nsACString& aMIMETypeExcludingCodecs,
   return true;
 }
 
+void
+WebMDecoder::GetMozDebugReaderData(nsAString& aString)
+{
+  if (mReader) {
+    mReader->GetMozDebugReaderData(aString);
+  }
+}
+
 } // namespace mozilla
 
diff --git a/dom/media/webm/WebMDecoder.h b/dom/media/webm/WebMDecoder.h
index 03c049c48f8..744620ff6b0 100644
--- a/dom/media/webm/WebMDecoder.h
+++ b/dom/media/webm/WebMDecoder.h
@@ -7,6 +7,7 @@
 #define WebMDecoder_h_
 
 #include "MediaDecoder.h"
+#include "MediaFormatReader.h"
 
 namespace mozilla {
 
@@ -31,6 +32,11 @@ public:
   // out params whether the codecs string contains Opus/Vorbis or VP8/VP9.
   static bool CanHandleMediaType(const nsACString& aMIMETypeExcludingCodecs,
                                  const nsAString& aCodecs);
+
+  void GetMozDebugReaderData(nsAString& aString) override;
+
+private:
+  RefPtr mReader;
 };
 
 } // namespace mozilla

From f01248696075a86c4e676f9ece2e90339327533f Mon Sep 17 00:00:00 2001
From: Jean-Yves Avenard 
Date: Mon, 18 Jan 2016 15:34:48 +1100
Subject: [PATCH 088/119] Bug 1236703: P3. Add moz specific method to retrieve
 debug data to media object IDL. r=bz

---
 dom/html/HTMLMediaElement.cpp      | 8 ++++++++
 dom/html/HTMLMediaElement.h        | 4 ++++
 dom/webidl/HTMLMediaElement.webidl | 3 +++
 3 files changed, 15 insertions(+)

diff --git a/dom/html/HTMLMediaElement.cpp b/dom/html/HTMLMediaElement.cpp
index fe7a428a553..aa072cc6098 100644
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -551,6 +551,14 @@ HTMLMediaElement::GetMozMediaSourceObject() const
   return source.forget();
 }
 
+void
+HTMLMediaElement::GetMozDebugReaderData(nsAString& aString)
+{
+  if (mDecoder && !mSrcStream) {
+    mDecoder->GetMozDebugReaderData(aString);
+  }
+}
+
 already_AddRefed
 HTMLMediaElement::GetSrcObject() const
 {
diff --git a/dom/html/HTMLMediaElement.h b/dom/html/HTMLMediaElement.h
index cd4da2bb08e..6fd44a94913 100644
--- a/dom/html/HTMLMediaElement.h
+++ b/dom/html/HTMLMediaElement.h
@@ -553,6 +553,10 @@ public:
   }
 
   already_AddRefed GetMozMediaSourceObject() const;
+  // Returns a string describing the state of the media player internal
+  // data. Used for debugging purposes.
+  void GetMozDebugReaderData(nsAString& aString);
+
   already_AddRefed GetSrcObject() const;
   void SetSrcObject(DOMMediaStream& aValue);
   void SetSrcObject(DOMMediaStream* aValue);
diff --git a/dom/webidl/HTMLMediaElement.webidl b/dom/webidl/HTMLMediaElement.webidl
index cc7451382d5..82c3446ab00 100644
--- a/dom/webidl/HTMLMediaElement.webidl
+++ b/dom/webidl/HTMLMediaElement.webidl
@@ -104,6 +104,9 @@ interface HTMLMediaElement : HTMLElement {
 partial interface HTMLMediaElement {
   [ChromeOnly]
   readonly attribute MediaSource? mozMediaSourceObject;
+  [ChromeOnly]
+  readonly attribute DOMString mozDebugReaderData;
+
   attribute MediaStream? srcObject;
   // TODO: remove prefixed version soon (1183495).
   attribute MediaStream? mozSrcObject;

From 6bc8a4310400c6506ad62abef92dcb86b93f62e3 Mon Sep 17 00:00:00 2001
From: Jean-Yves Avenard 
Date: Mon, 18 Jan 2016 21:01:51 +1100
Subject: [PATCH 089/119] Bug 1237629: [webm] Parse into BlockGroup element.
 r=kinetik

---
 dom/media/webm/WebMBufferedParser.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/dom/media/webm/WebMBufferedParser.cpp b/dom/media/webm/WebMBufferedParser.cpp
index 5fe7d825a38..2d355c83ad0 100644
--- a/dom/media/webm/WebMBufferedParser.cpp
+++ b/dom/media/webm/WebMBufferedParser.cpp
@@ -45,6 +45,7 @@ void WebMBufferedParser::Append(const unsigned char* aBuffer, uint32_t aLength,
   static const uint32_t CLUSTER_ID = 0x1f43b675;
   static const uint32_t TIMECODESCALE_ID = 0x2ad7b1;
   static const unsigned char TIMECODE_ID = 0xe7;
+  static const unsigned char BLOCKGROUP_ID = 0xa0;
   static const unsigned char BLOCK_ID = 0xa1;
   static const unsigned char SIMPLEBLOCK_ID = 0xa3;
   static const uint32_t BLOCK_TIMECODE_LENGTH = 2;
@@ -115,6 +116,9 @@ void WebMBufferedParser::Append(const unsigned char* aBuffer, uint32_t aLength,
         }
         mState = READ_ELEMENT_ID;
         break;
+      case BLOCKGROUP_ID:
+        mState = READ_ELEMENT_ID;
+        break;
       case SIMPLEBLOCK_ID:
         /* FALLTHROUGH */
       case BLOCK_ID:

From bc74bff4ff61863af820ca8d539e901d1b7bcd8c Mon Sep 17 00:00:00 2001
From: Jean-Yves Avenard 
Date: Tue, 19 Jan 2016 10:03:07 +1100
Subject: [PATCH 090/119] Bug 1240627: [ffvpx] Enable AVX2 on mac. r=rillian

---
 media/ffvpx/config_darwin64.asm | 6 +++---
 media/ffvpx/config_darwin64.h   | 8 ++++----
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/media/ffvpx/config_darwin64.asm b/media/ffvpx/config_darwin64.asm
index 31b5b738d39..6dbca31a9f3 100644
--- a/media/ffvpx/config_darwin64.asm
+++ b/media/ffvpx/config_darwin64.asm
@@ -40,7 +40,7 @@
 %define HAVE_AMD3DNOW 1
 %define HAVE_AMD3DNOWEXT 1
 %define HAVE_AVX 1
-%define HAVE_AVX2 0
+%define HAVE_AVX2 1
 %define HAVE_FMA3 1
 %define HAVE_FMA4 1
 %define HAVE_MMX 1
@@ -83,7 +83,7 @@
 %define HAVE_AMD3DNOW_EXTERNAL 1
 %define HAVE_AMD3DNOWEXT_EXTERNAL 1
 %define HAVE_AVX_EXTERNAL 1
-%define HAVE_AVX2_EXTERNAL 0
+%define HAVE_AVX2_EXTERNAL 1
 %define HAVE_FMA3_EXTERNAL 1
 %define HAVE_FMA4_EXTERNAL 1
 %define HAVE_MMX_EXTERNAL 1
@@ -126,7 +126,7 @@
 %define HAVE_AMD3DNOW_INLINE 1
 %define HAVE_AMD3DNOWEXT_INLINE 1
 %define HAVE_AVX_INLINE 1
-%define HAVE_AVX2_INLINE 0
+%define HAVE_AVX2_INLINE 1
 %define HAVE_FMA3_INLINE 1
 %define HAVE_FMA4_INLINE 1
 %define HAVE_MMX_INLINE 1
diff --git a/media/ffvpx/config_darwin64.h b/media/ffvpx/config_darwin64.h
index ab5102ac61c..ef084dfe467 100644
--- a/media/ffvpx/config_darwin64.h
+++ b/media/ffvpx/config_darwin64.h
@@ -1,7 +1,7 @@
 /* Automatically generated by configure - do not modify! */
 #ifndef FFMPEG_CONFIG_H
 #define FFMPEG_CONFIG_H
-#define FFMPEG_CONFIGURATION "--disable-everything --disable-protocols --disable-demuxers --disable-muxers --disable-filters --disable-programs --disable-doc --disable-parsers --enable-parser=vp8 --enable-parser=vp9 --enable-decoder=vp8 --enable-decoder=vp9 --disable-static --enable-shared --disable-debug --disable-sdl --disable-libxcb --disable-securetransport --disable-iconv --disable-swresample --disable-swscale --disable-avdevice --disable-avfilter --disable-avformat --disable-d3d11va --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --disable-videotoolbox --enable-asm --enable-yasm --disable-avx2"
+#define FFMPEG_CONFIGURATION "--disable-everything --disable-protocols --disable-demuxers --disable-muxers --disable-filters --disable-programs --disable-doc --disable-parsers --enable-parser=vp8 --enable-parser=vp9 --enable-decoder=vp8 --enable-decoder=vp9 --disable-static --enable-shared --disable-debug --disable-sdl --disable-libxcb --disable-securetransport --disable-iconv --disable-swresample --disable-swscale --disable-avdevice --disable-avfilter --disable-avformat --disable-d3d11va --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --disable-videotoolbox --enable-asm --enable-yasm"
 #define FFMPEG_LICENSE "LGPL version 2.1 or later"
 #define CONFIG_THIS_YEAR 2016
 #define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
@@ -56,7 +56,7 @@
 #define HAVE_AMD3DNOW 1
 #define HAVE_AMD3DNOWEXT 1
 #define HAVE_AVX 1
-#define HAVE_AVX2 0
+#define HAVE_AVX2 1
 #define HAVE_FMA3 1
 #define HAVE_FMA4 1
 #define HAVE_MMX 1
@@ -99,7 +99,7 @@
 #define HAVE_AMD3DNOW_EXTERNAL 1
 #define HAVE_AMD3DNOWEXT_EXTERNAL 1
 #define HAVE_AVX_EXTERNAL 1
-#define HAVE_AVX2_EXTERNAL 0
+#define HAVE_AVX2_EXTERNAL 1
 #define HAVE_FMA3_EXTERNAL 1
 #define HAVE_FMA4_EXTERNAL 1
 #define HAVE_MMX_EXTERNAL 1
@@ -142,7 +142,7 @@
 #define HAVE_AMD3DNOW_INLINE 1
 #define HAVE_AMD3DNOWEXT_INLINE 1
 #define HAVE_AVX_INLINE 1
-#define HAVE_AVX2_INLINE 0
+#define HAVE_AVX2_INLINE 1
 #define HAVE_FMA3_INLINE 1
 #define HAVE_FMA4_INLINE 1
 #define HAVE_MMX_INLINE 1

From 105fd3595f4326931037cdc85bd986cf2213a5a8 Mon Sep 17 00:00:00 2001
From: Robert Helmer 
Date: Tue, 19 Jan 2016 11:01:19 -0800
Subject: [PATCH 091/119] Bug 1239484 - remove use of Object.values() r=mossop

---
 toolkit/mozapps/extensions/content/selectAddons.js              | 2 +-
 .../extensions/internal/AddonRepository_SQLiteMigrator.jsm      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/toolkit/mozapps/extensions/content/selectAddons.js b/toolkit/mozapps/extensions/content/selectAddons.js
index 2aac119fcc7..a15cbd747b2 100644
--- a/toolkit/mozapps/extensions/content/selectAddons.js
+++ b/toolkit/mozapps/extensions/content/selectAddons.js
@@ -126,7 +126,7 @@ var gChecking = {
     if (this._completeCount < this._addonCount)
       return;
 
-    let addons = Object.values(gAddons);
+    let addons = Object.keys(gAddons).map(k => gAddons[k]);
 
     addons.sort(function(a, b) {
       let orderA = orderForScope(a.addon.scope);
diff --git a/toolkit/mozapps/extensions/internal/AddonRepository_SQLiteMigrator.jsm b/toolkit/mozapps/extensions/internal/AddonRepository_SQLiteMigrator.jsm
index bffcd357ca1..b2204fe9526 100644
--- a/toolkit/mozapps/extensions/internal/AddonRepository_SQLiteMigrator.jsm
+++ b/toolkit/mozapps/extensions/internal/AddonRepository_SQLiteMigrator.jsm
@@ -60,7 +60,7 @@ this.AddonRepository_SQLiteMigrator = {
 
     this._retrieveStoredData((results) => {
       this._closeConnection();
-      let resultArray = Object.values(results);
+      let resultArray = Object.keys(results).map(k => results[k]);
       logger.debug(resultArray.length + " addons imported.")
       aCallback(resultArray);
     });

From 4bb090819a7693628b7e4af33783be2c75acd781 Mon Sep 17 00:00:00 2001
From: Dave Townsend 
Date: Thu, 14 Jan 2016 15:19:44 -0800
Subject: [PATCH 092/119] Bug 1239810: UpdateUtils.jsm requires the
 update.locale file to be shipped regardless of whether the application update
 is included. r=nalexander,rstrong

---
 mobile/android/installer/package-manifest.in | 2 +-
 toolkit/locales/Makefile.in                  | 2 --
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/mobile/android/installer/package-manifest.in b/mobile/android/installer/package-manifest.in
index 66b65d70241..0030384e96b 100644
--- a/mobile/android/installer/package-manifest.in
+++ b/mobile/android/installer/package-manifest.in
@@ -18,8 +18,8 @@
 @BINPATH@/chrome/@AB_CD@@JAREXT@
 @BINPATH@/chrome/@AB_CD@.manifest
 @BINPATH@/@PREF_DIR@/mobile-l10n.js
-#ifdef MOZ_UPDATER
 @BINPATH@/update.locale
+#ifdef MOZ_UPDATER
 @BINPATH@/updater.ini
 #endif
 @BINPATH@/dictionaries/*
diff --git a/toolkit/locales/Makefile.in b/toolkit/locales/Makefile.in
index 781437fb695..e2012861107 100644
--- a/toolkit/locales/Makefile.in
+++ b/toolkit/locales/Makefile.in
@@ -27,10 +27,8 @@ chrome-%:
 	@$(MAKE) -C $(DEPTH)/security/manager/locales/ chrome AB_CD=$*
 	@$(MAKE) chrome AB_CD=$*
 
-ifdef MOZ_UPDATER
 libs:: update.locale
 	sed -e 's/%AB_CD%/$(AB_CD)/' $< > $(FINAL_TARGET)/update.locale
-endif
 
 ifdef MOZ_CRASHREPORTER
 libs:: crashreporter.ini

From 2f087d81b45becc625eb8f303e7d295c6281be17 Mon Sep 17 00:00:00 2001
From: Xidorn Quan 
Date: Wed, 20 Jan 2016 09:56:52 +1100
Subject: [PATCH 093/119] Bug 1238536 part 1 - Do not automatically exit
 fullscreen if restored from minimized state. r=jimm

---
 widget/windows/nsWindow.cpp | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/widget/windows/nsWindow.cpp b/widget/windows/nsWindow.cpp
index 88c022475df..da29b037637 100644
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -1753,6 +1753,15 @@ NS_METHOD nsWindow::PlaceBehind(nsTopLevelWidgetZPlacement aPlacement,
   return NS_OK;
 }
 
+static UINT
+GetCurrentShowCmd(HWND aWnd)
+{
+  WINDOWPLACEMENT pl;
+  pl.length = sizeof(pl);
+  ::GetWindowPlacement(aWnd, &pl);
+  return pl.showCmd;
+}
+
 // Maximize, minimize or restore the window.
 NS_IMETHODIMP
 nsWindow::SetSizeMode(nsSizeMode aMode) {
@@ -1794,14 +1803,11 @@ nsWindow::SetSizeMode(nsSizeMode aMode) {
         mode = SW_RESTORE;
     }
 
-    WINDOWPLACEMENT pl;
-    pl.length = sizeof(pl);
-    ::GetWindowPlacement(mWnd, &pl);
     // Don't call ::ShowWindow if we're trying to "restore" a window that is
     // already in a normal state.  Prevents a bug where snapping to one side
     // of the screen and then minimizing would cause Windows to forget our
     // window's correct restored position/size.
-    if( !(pl.showCmd == SW_SHOWNORMAL && mode == SW_RESTORE) ) {
+    if(!(GetCurrentShowCmd(mWnd) == SW_SHOWNORMAL && mode == SW_RESTORE)) {
       ::ShowWindow(mWnd, mode);
     }
     // we activate here to ensure that the right child window is focused
@@ -5639,8 +5645,10 @@ nsWindow::ProcessMessage(UINT msg, WPARAM& wParam, LPARAM& lParam,
         ::ShowWindow(mWnd, SW_SHOWMINIMIZED);
         result = true;
       }
-	  
-      if (mSizeMode == nsSizeMode_Fullscreen && filteredWParam == SC_RESTORE) {
+
+      if (mSizeMode == nsSizeMode_Fullscreen &&
+          filteredWParam == SC_RESTORE &&
+          GetCurrentShowCmd(mWnd) != SW_SHOWMINIMIZED) {
         MakeFullScreen(false);
         result = true;
       }

From 33d0496f6c31da5f89c1d9683d798ba27b6ded15 Mon Sep 17 00:00:00 2001
From: Xidorn Quan 
Date: Wed, 20 Jan 2016 09:56:52 +1100
Subject: [PATCH 094/119] Bug 1238536 part 2 - Do not trigger fullscreen
 changed when switching between fullscreen and minimized. r=karlt

---
 widget/gtk/nsWindow.cpp | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp
index 99018412ffe..e77b4a2d015 100644
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -3296,7 +3296,6 @@ nsWindow::OnWindowStateEvent(GtkWidget *aWidget, GdkEventWindowState *aEvent)
         return;
     }
 
-    bool wasInFullscreen = mSizeState == nsSizeMode_Fullscreen;
     if (aEvent->new_window_state & GDK_WINDOW_STATE_ICONIFIED) {
         LOG(("\tIconified\n"));
         mSizeState = nsSizeMode_Minimized;
@@ -3325,10 +3324,9 @@ nsWindow::OnWindowStateEvent(GtkWidget *aWidget, GdkEventWindowState *aEvent)
 
     if (mWidgetListener) {
       mWidgetListener->SizeModeChanged(mSizeState);
-
-      bool isInFullscreen = mSizeState == nsSizeMode_Fullscreen;
-      if (isInFullscreen != wasInFullscreen) {
-        mWidgetListener->FullscreenChanged(isInFullscreen);
+      if (aEvent->changed_mask & GDK_WINDOW_STATE_FULLSCREEN) {
+        mWidgetListener->FullscreenChanged(
+          aEvent->new_window_state & GDK_WINDOW_STATE_FULLSCREEN);
       }
     }
 }

From f68189d332aaa4c8d6fd60988150ba5b0e99c59b Mon Sep 17 00:00:00 2001
From: Xidorn Quan 
Date: Wed, 20 Jan 2016 09:56:52 +1100
Subject: [PATCH 095/119] Bug 1238536 part 3 - Properly handle restoring to
 normal state from fullscreen. r=smaug

---
 xpfe/appshell/nsWebShellWindow.cpp | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/xpfe/appshell/nsWebShellWindow.cpp b/xpfe/appshell/nsWebShellWindow.cpp
index d51fe95eada..3cb21075960 100644
--- a/xpfe/appshell/nsWebShellWindow.cpp
+++ b/xpfe/appshell/nsWebShellWindow.cpp
@@ -349,7 +349,17 @@ nsWebShellWindow::SizeModeChanged(nsSizeMode sizeMode)
       ourWindow->SetFullScreen(true);
     }
     else if (sizeMode != nsSizeMode_Minimized) {
-      ourWindow->SetFullScreen(false);
+      if (ourWindow->GetFullScreen()) {
+        // The first SetFullscreenInternal call below ensures that we do
+        // not trigger any fullscreen transition even if the window was
+        // put in fullscreen only for the Fullscreen API. The second
+        // SetFullScreen call ensures that the window really exit from
+        // fullscreen even if it entered fullscreen for both Fullscreen
+        // Mode and Fullscreen API.
+        ourWindow->SetFullscreenInternal(
+          nsPIDOMWindow::eForForceExitFullscreen, false);
+        ourWindow->SetFullScreen(false);
+      }
     }
 
     // And always fire a user-defined sizemodechange event on the window

From 27c01110a7ec3fa5ba35939faca0982cabf555e8 Mon Sep 17 00:00:00 2001
From: Nick Fitzgerald 
Date: Tue, 19 Jan 2016 14:57:28 -0800
Subject: [PATCH 096/119] Bug 1233831 - Follow up: Expand sanitizeMarkers to
 filter out minor GC markers; r=jsantell

Minor gc markers can show up at any time, and these tests aren't expecting them,
so we have to filter them out before testing various properties of the expected
markers.
---
 docshell/test/browser/browser_timelineMarkers-frame-02.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/docshell/test/browser/browser_timelineMarkers-frame-02.js b/docshell/test/browser/browser_timelineMarkers-frame-02.js
index 14528cf6e11..83750395d83 100644
--- a/docshell/test/browser/browser_timelineMarkers-frame-02.js
+++ b/docshell/test/browser/browser_timelineMarkers-frame-02.js
@@ -12,9 +12,9 @@ function rectangleContains(rect, x, y, width, height) {
 }
 
 function sanitizeMarkers(list) {
-  // Worker markers are currently gathered from all docshells, which may
+  // These markers are currently gathered from all docshells, which may
   // interfere with this test.
-  return list.filter(e => e.name != "Worker")
+  return list.filter(e => e.name != "Worker" && e.name != "MinorGC");
 }
 
 var TESTS = [{

From fdaae52ad91a5b0a40059da5c1abf0f6a4e65d0f Mon Sep 17 00:00:00 2001
From: Mike Hommey 
Date: Wed, 20 Jan 2016 08:01:42 +0900
Subject: [PATCH 097/119] Backout changeset de0a7a1cdc4a from bug 1240660 for
 make package bustage on a CLOSED TREE

---
 browser/locales/Makefile.in                  | 2 +-
 config/rules.mk                              | 2 +-
 python/mozbuild/mozbuild/frontend/context.py | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/browser/locales/Makefile.in b/browser/locales/Makefile.in
index 31c2d290f01..6f75776caf6 100644
--- a/browser/locales/Makefile.in
+++ b/browser/locales/Makefile.in
@@ -74,7 +74,7 @@ PP_TARGETS += SEARCHPLUGINS
 list-txt = $(SEARCHPLUGINS_PATH)/list.txt
 GARBAGE += $(list-txt)
 
-misc:: searchplugins
+libs:: searchplugins
 
 # Required for l10n.mk - defines a list of app sub dirs that should
 # be included in langpack xpis.
diff --git a/config/rules.mk b/config/rules.mk
index 6a4120cb786..5fb2a9065d2 100644
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -1216,7 +1216,7 @@ endif
 endif
 endif
 
-misc realchrome:: $(FINAL_TARGET)/chrome
+libs realchrome:: $(FINAL_TARGET)/chrome
 	$(call py_action,jar_maker,\
 	  $(QUIET) -d $(FINAL_TARGET) \
 	  $(MAKE_JARS_FLAGS) $(DEFINES) $(ACDEFINES) \
diff --git a/python/mozbuild/mozbuild/frontend/context.py b/python/mozbuild/mozbuild/frontend/context.py
index a909465f67c..c8d9a1dba2b 100644
--- a/python/mozbuild/mozbuild/frontend/context.py
+++ b/python/mozbuild/mozbuild/frontend/context.py
@@ -1354,7 +1354,7 @@ VARIABLES = {
         JAR manifests are files in the tree that define how to package files
         into JARs and how chrome registration is performed. For more info,
         see :ref:`jar_manifests`.
-        """, 'misc'),
+        """, 'libs'),
 
     # IDL Generation.
     'XPIDL_SOURCES': (StrictOrderingOnAppendList, list,

From 7573d31ee2db7ce865a6626321caa5b64215cbaa Mon Sep 17 00:00:00 2001
From: Jean-Yves Avenard 
Date: Wed, 20 Jan 2016 10:34:22 +1100
Subject: [PATCH 098/119] Bug 1240627 - Touch CLOBBER to force a rebuild

CLOSED TREE
---
 CLOBBER | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/CLOBBER b/CLOBBER
index d8d25883836..d8162056e88 100644
--- a/CLOBBER
+++ b/CLOBBER
@@ -22,4 +22,5 @@
 # changes to stick? As of bug 928195, this shouldn't be necessary! Please
 # don't change CLOBBER for WebIDL changes any more.
 
-Bug 1228641 - Remove initializer_list from config/stl-headers
+Bug 1240627 - Enable AVX2 optimizations in ffvpx on Mac
+

From fee45f3e02ac3a3b6f6a47808cbf2e39ac80f0b8 Mon Sep 17 00:00:00 2001
From: Andreas Tolfsen 
Date: Mon, 18 Jan 2016 22:05:30 +0000
Subject: [PATCH 099/119] Bug 1240576 - Use Preferences.jsm throughout
 Marionette; r=automatedtester

A distinct advantage is that try...catch statements are no longer used
to control the flow of code.
---
 testing/marionette/actions.js                 | 18 +++--
 .../client/marionette/marionette_test.py      |  4 +-
 .../marionette/runner/mixins/browsermob.py    | 11 +--
 .../tests/unit/test_getactiveframe_oop.py     | 59 ++++++---------
 .../marionette/tests/unit/test_proxy.py       |  2 +-
 .../tests/unit/test_switch_remote_frame.py    | 72 ++++++++-----------
 .../components/marionettecomponent.js         | 17 ++---
 testing/marionette/dispatcher.js              |  1 +
 testing/marionette/driver.js                  | 50 ++++++-------
 .../driver/marionette_driver/marionette.py    | 47 +++---------
 testing/marionette/server.js                  | 13 ++--
 11 files changed, 119 insertions(+), 175 deletions(-)

diff --git a/testing/marionette/actions.js b/testing/marionette/actions.js
index f96c4f60469..a93594d5906 100644
--- a/testing/marionette/actions.js
+++ b/testing/marionette/actions.js
@@ -2,6 +2,13 @@
  * 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/. */
 
+var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
+
+Cu.import("resource://gre/modules/Preferences.jsm");
+
+var CONTEXT_MENU_DELAY_PREF = "ui.click_hold_context_menus.delay";
+var DEFAULT_CONTEXT_MENU_DELAY = 750;  // ms
+
 this.EXPORTED_SYMBOLS = ["ActionChain"];
 
 /**
@@ -18,8 +25,7 @@ this.ActionChain = function(utils, checkForInterrupted) {
   this.scrolling = false;
   // whether to send mouse event
   this.mouseEventsOnly = false;
-  this.checkTimer = Components.classes["@mozilla.org/timer;1"]
-      .createInstance(Components.interfaces.nsITimer);
+  this.checkTimer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
 
   // callbacks for command completion
   this.onSuccess = null;
@@ -258,10 +264,9 @@ ActionChain.prototype.actions = function(chain, touchId, i, keyModifiers) {
         let time = pack[1] * 1000;
 
         // standard waiting time to fire contextmenu
-        let standard = 750;
-        try {
-          standard = Services.prefs.getIntPref("ui.click_hold_context_menus.delay");
-        } catch (e) {}
+        let standard = Preferences.get(
+            CONTEXT_MENU_DELAY_PREF,
+            DEFAULT_CONTEXT_MENU_DELAY);
 
         if (time >= standard && this.isTap) {
           chain.splice(i, 0, ["longPress"], ["wait", (time - standard) / 1000]);
@@ -297,7 +302,6 @@ ActionChain.prototype.actions = function(chain, touchId, i, keyModifiers) {
           keyModifiers);
       this.actions(chain, touchId, i, keyModifiers);
       break;
-
   }
 };
 
diff --git a/testing/marionette/client/marionette/marionette_test.py b/testing/marionette/client/marionette/marionette_test.py
index 92c026bef7f..85b17ae279f 100644
--- a/testing/marionette/client/marionette/marionette_test.py
+++ b/testing/marionette/client/marionette/marionette_test.py
@@ -552,8 +552,8 @@ setReq.onerror = function() {
         self.marionette.set_context("chrome")
         self.marionette.execute_script("""
             let SECURITY_PREF = "security.turn_off_all_security_so_that_viruses_can_take_over_this_computer";
-            Components.utils.import("resource://gre/modules/Services.jsm");
-            Services.prefs.setBoolPref(SECURITY_PREF, true);
+            Components.utils.import("resource://gre/modules/Preferences.jsm");
+            Preferences.set(SECURITY_PREF, true);
 
             if (!testUtils.hasOwnProperty("specialPowersObserver")) {
               let loader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
diff --git a/testing/marionette/client/marionette/runner/mixins/browsermob.py b/testing/marionette/client/marionette/runner/mixins/browsermob.py
index ea10ab4403a..c45b2878a3e 100644
--- a/testing/marionette/client/marionette/runner/mixins/browsermob.py
+++ b/testing/marionette/client/marionette/runner/mixins/browsermob.py
@@ -48,11 +48,12 @@ class BrowserMobProxyTestCaseMixin(object):
         client = self.browsermob_server.create_proxy()
         with self.marionette.using_context('chrome'):
             self.marionette.execute_script("""
-                Services.prefs.setIntPref('network.proxy.type', 1);
-                Services.prefs.setCharPref('network.proxy.http', 'localhost');
-                Services.prefs.setIntPref('network.proxy.http_port', %(port)s);
-                Services.prefs.setCharPref('network.proxy.ssl', 'localhost');
-                Services.prefs.setIntPref('network.proxy.ssl_port', %(port)s);
+                Components.utils.import("resource://gre/modules/Preferences.jsm");
+                Preferences.set("network.proxy.type", 1);
+                Preferences.set("network.proxy.http", "localhost");
+                Preferences.set("network.proxy.http_port", %(port)s);
+                Preferences.set("network.proxy.ssl", "localhost");
+                Preferences.set("network.proxy.ssl_port", %(port)s);
             """ % {"port": client.port})
         return client
 
diff --git a/testing/marionette/client/marionette/tests/unit/test_getactiveframe_oop.py b/testing/marionette/client/marionette/tests/unit/test_getactiveframe_oop.py
index ae0c97367eb..25762b3f6c1 100644
--- a/testing/marionette/client/marionette/tests/unit/test_getactiveframe_oop.py
+++ b/testing/marionette/client/marionette/tests/unit/test_getactiveframe_oop.py
@@ -6,28 +6,30 @@ from marionette import MarionetteTestCase
 from marionette_driver.by import By
 
 
+OOP_BY_DEFAULT = "dom.ipc.browser_frames.oop_by_default"
+BROWSER_FRAMES_ENABLED = "dom.mozBrowserFramesEnabeld"
+
+
 class TestGetActiveFrameOOP(MarionetteTestCase):
     def setUp(self):
         super(TestGetActiveFrameOOP, self).setUp()
-        with self.marionette.using_context('chrome'):
-            self.oop_by_default = self.marionette.execute_script("""
-                try {
-                  return Services.prefs.getBoolPref('dom.ipc.browser_frames.oop_by_default');
-                }
-                catch(e) {}
-                """)
-            self.mozBrowserFramesEnabled = self.marionette.execute_script("""
-                try {
-                  return Services.prefs.getBoolPref('dom.mozBrowserFramesEnabled');
-                }
-                catch(e) {}
-                """)
-            self.marionette.execute_script("""
-                Services.prefs.setBoolPref('dom.ipc.browser_frames.oop_by_default', true);
-                """)
-            self.marionette.execute_script("""
-                Services.prefs.setBoolPref('dom.mozBrowserFramesEnabled', true);
-                """)
+        with self.marionette.using_context("chrome"):
+            self.oop_by_default = self.marionette.get_pref(OOP_BY_DEFAULT)
+            self.mozBrowserFramesEnabled = self.marionette.get_pref(BROWSER_FRAMES_ENABLED)
+            self.marionette.set_pref(OOP_BY_DEFAULT, True)
+            self.marionette.set_pref(BROWSER_FRAMES_ENABLED, True)
+
+    def tearDown(self):
+        with self.marionette.using_context("chrome"):
+            if self.oop_by_default is None:
+                self.marionette.clear_pref(OOP_BY_DEFAULT)
+            else:
+                self.marionette.set_pref(OOP_BY_DEFAULT, self.oop_by_default)
+
+            if self.mozBrowserFramesEnabled is None:
+                self.marionette.clear_pref(BROWSER_FRAMES_ENABLED)
+            else:
+                self.marionette.set_pref(BROWSER_FRAMES_ENABLED, self.mozBrowserFramesEnabled)
 
     def test_active_frame_oop(self):
         self.marionette.navigate(self.marionette.absolute_url("test.html"))
@@ -94,22 +96,3 @@ class TestGetActiveFrameOOP(MarionetteTestCase):
         # on a b2g device, the contents do appear
         # print self.marionette.get_url()
         # print self.marionette.page_source
-
-    def tearDown(self):
-        with self.marionette.using_context('chrome'):
-            if self.oop_by_default is None:
-                self.marionette.execute_script("""
-                    Services.prefs.clearUserPref('dom.ipc.browser_frames.oop_by_default');
-                    """)
-            else:
-                self.marionette.execute_script("""
-                    Services.prefs.setBoolPref('dom.ipc.browser_frames.oop_by_default', %s);
-                    """ % 'true' if self.oop_by_default else 'false')
-            if self.mozBrowserFramesEnabled is None:
-                self.marionette.execute_script("""
-                    Services.prefs.clearUserPref('dom.mozBrowserFramesEnabled');
-                    """)
-            else:
-                self.marionette.execute_script("""
-                    Services.prefs.setBoolPref('dom.mozBrowserFramesEnabled', %s);
-                    """ % 'true' if self.mozBrowserFramesEnabled else 'false')
diff --git a/testing/marionette/client/marionette/tests/unit/test_proxy.py b/testing/marionette/client/marionette/tests/unit/test_proxy.py
index ee4b0ea51ad..e23ea8fd4fa 100644
--- a/testing/marionette/client/marionette/tests/unit/test_proxy.py
+++ b/testing/marionette/client/marionette/tests/unit/test_proxy.py
@@ -225,7 +225,7 @@ class TestProxy(MarionetteTestCase):
             self.marionette.start_session(capabilities)
             self.fail("We should have started a session because proxy should be a dict")
         except InvalidArgumentException as e:
-            assert e.msg == "the value of 'proxy' should be an object"
+            assert e.msg == "Value of 'proxy' should be an object"
 
     def test_proxy_is_passed_in_with_no_proxy_doesnt_set_it(self):
         capabilities = {"requiredCapabilities":
diff --git a/testing/marionette/client/marionette/tests/unit/test_switch_remote_frame.py b/testing/marionette/client/marionette/tests/unit/test_switch_remote_frame.py
index 4481a3f56d5..45e1f86b6e0 100644
--- a/testing/marionette/client/marionette/tests/unit/test_switch_remote_frame.py
+++ b/testing/marionette/client/marionette/tests/unit/test_switch_remote_frame.py
@@ -5,26 +5,18 @@
 from marionette import MarionetteTestCase
 
 
+OOP_BY_DEFAULT = "dom.ipc.browser_frames.oop_by_default"
+BROWSER_FRAMES_ENABLED = "dom.mozBrowserFramesEnabled"
+
+
 class TestSwitchRemoteFrame(MarionetteTestCase):
     def setUp(self):
         super(TestSwitchRemoteFrame, self).setUp()
         with self.marionette.using_context('chrome'):
-            self.oop_by_default = self.marionette.execute_script("""
-                try {
-                  return Services.prefs.getBoolPref('dom.ipc.browser_frames.oop_by_default');
-                }
-                catch(e) {}
-                """)
-            self.mozBrowserFramesEnabled = self.marionette.execute_script("""
-                try {
-                  return Services.prefs.getBoolPref('dom.mozBrowserFramesEnabled');
-                }
-                catch(e) {}
-                """)
-            self.marionette.execute_script("""
-                Services.prefs.setBoolPref("dom.ipc.browser_frames.oop_by_default", true);
-                Services.prefs.setBoolPref("dom.mozBrowserFramesEnabled", true);
-                """)
+            self.oop_by_default = self.marionette.get_pref(OOP_BY_DEFAULT)
+            self.mozBrowserFramesEnabled = self.marionette.get_pref(BROWSER_FRAMES_ENABLED)
+            self.marionette.set_pref(OOP_BY_DEFAULT, True)
+            self.marionette.set_pref(BROWSER_FRAMES_ENABLED, True)
 
             self.multi_process_browser = self.marionette.execute_script("""
                 try {
@@ -33,12 +25,25 @@ class TestSwitchRemoteFrame(MarionetteTestCase):
                   return false;
                 }""")
 
+    def tearDown(self):
+        with self.marionette.using_context("chrome"):
+            if self.oop_by_default is None:
+                self.marionette.clear_pref(OOP_BY_DEFAULT)
+            else:
+                self.marionette.set_pref(OOP_BY_DEFAULT, self.oop_by_default)
+
+            if self.mozBrowserFramesEnabled is None:
+                self.marionette.clear_pref(BROWSER_FRAMES_ENABLED)
+            else:
+                self.marionette.set_pref(BROWSER_FRAMES_ENABLED, self.mozBrowserFramesEnabled)
+
+    @property
     def is_main_process(self):
         return self.marionette.execute_script("""
             return Components.classes["@mozilla.org/xre/app-info;1"].
                 getService(Components.interfaces.nsIXULRuntime).
                 processType == Components.interfaces.nsIXULRuntime.PROCESS_TYPE_DEFAULT;
-        """, sandbox='system')
+        """, sandbox="system")
 
     def test_remote_frame(self):
         self.marionette.navigate(self.marionette.absolute_url("test.html"))
@@ -55,7 +60,7 @@ class TestSwitchRemoteFrame(MarionetteTestCase):
             """ % self.marionette.absolute_url("test.html"))
         remote_iframe = self.marionette.find_element("id", "remote_iframe")
         self.marionette.switch_to_frame(remote_iframe)
-        main_process = self.is_main_process()
+        main_process = self.is_main_process
         self.assertFalse(main_process)
 
     def test_remote_frame_revisit(self):
@@ -74,15 +79,15 @@ class TestSwitchRemoteFrame(MarionetteTestCase):
             """ % self.marionette.absolute_url("test.html"))
         self.marionette.switch_to_frame(self.marionette.find_element("id",
                                                                      "remote_iframe"))
-        main_process = self.is_main_process()
+        main_process = self.is_main_process
         self.assertFalse(main_process)
         self.marionette.switch_to_frame()
-        main_process = self.is_main_process()
+        main_process = self.is_main_process
         should_be_main_process = not self.multi_process_browser
         self.assertEqual(main_process, should_be_main_process)
         self.marionette.switch_to_frame(self.marionette.find_element("id",
                                                                      "remote_iframe"))
-        main_process = self.is_main_process()
+        main_process = self.is_main_process
         self.assertFalse(main_process)
 
     def test_we_can_switch_to_a_remote_frame_by_index(self):
@@ -100,31 +105,12 @@ class TestSwitchRemoteFrame(MarionetteTestCase):
             document.body.appendChild(iframe);
             """ % self.marionette.absolute_url("test.html"))
         self.marionette.switch_to_frame(0)
-        main_process = self.is_main_process()
+        main_process = self.is_main_process
         self.assertFalse(main_process)
         self.marionette.switch_to_frame()
-        main_process = self.is_main_process()
+        main_process = self.is_main_process
         should_be_main_process = not self.multi_process_browser
         self.assertEqual(main_process, should_be_main_process)
         self.marionette.switch_to_frame(0)
-        main_process = self.is_main_process()
+        main_process = self.is_main_process
         self.assertFalse(main_process)
-
-    def tearDown(self):
-        with self.marionette.using_context('chrome'):
-            if self.oop_by_default is None:
-                self.marionette.execute_script("""
-                    Services.prefs.clearUserPref('dom.ipc.browser_frames.oop_by_default');
-                    """)
-            else:
-                self.marionette.execute_async_script(
-                    "Services.prefs.setBoolPref('dom.ipc.browser_frames.oop_by_default', %s);" %
-                    ('true' if self.oop_by_default else 'false'))
-            if self.mozBrowserFramesEnabled is None:
-                self.marionette.execute_script("""
-                    Services.prefs.clearUserPref('dom.mozBrowserFramesEnabled');
-                    """)
-            else:
-                self.marionette.execute_async_script(
-                    "Services.prefs.setBoolPref('dom.mozBrowserFramesEnabled', %s);" %
-                    ('true' if self.mozBrowserFramesEnabled else 'false'))
diff --git a/testing/marionette/components/marionettecomponent.js b/testing/marionette/components/marionettecomponent.js
index 2d91d3989e2..0932fb1dd10 100644
--- a/testing/marionette/components/marionettecomponent.js
+++ b/testing/marionette/components/marionettecomponent.js
@@ -110,9 +110,7 @@ MarionetteComponent.prototype.observe = function(subj, topic, data) {
       // so we wait for that by adding an observer here.
       this.observerService.addObserver(this, "final-ui-startup", false);
 #ifdef ENABLE_MARIONETTE
-      try {
-        this.enabled = Services.prefs.getBoolPref(ENABLED_PREF);
-      } catch(e) {}
+      this.enabled = Preferences.get(ENABLED_PREF, false);
       if (this.enabled) {
         this.logger.debug("Marionette enabled via build flag and pref");
 
@@ -165,11 +163,9 @@ MarionetteComponent.prototype.init = function() {
 
   this.loaded_ = true;
 
-  let forceLocal = Services.appinfo.name == "B2G" ? false : true;
-  try {
-    forceLocal = Services.prefs.getBoolPref(FORCELOCAL_PREF);
-  } catch (e) {}
-  Services.prefs.setBoolPref(FORCELOCAL_PREF, forceLocal);
+  let forceLocal = Preferences.get(FORCELOCAL_PREF,
+      Services.appinfo.name == "B2G" ? false : true);
+  Preferences.set(FORCELOCAL_PREF, forceLocal);
 
   if (!forceLocal) {
     // See bug 800138.  Because the first socket that opens with
@@ -182,10 +178,7 @@ MarionetteComponent.prototype.init = function() {
     insaneSacrificialGoat.asyncListen(this);
   }
 
-  let port = DEFAULT_PORT;
-  try {
-    port = Services.prefs.getIntPref(PORT_PREF);
-  } catch (e) {}
+  let port = Preferences.get(PORT_PREF, DEFAULT_PORT);
 
   let s;
   try {
diff --git a/testing/marionette/dispatcher.js b/testing/marionette/dispatcher.js
index 495b0e84ad8..26c3726724b 100644
--- a/testing/marionette/dispatcher.js
+++ b/testing/marionette/dispatcher.js
@@ -7,6 +7,7 @@
 const {interfaces: Ci, utils: Cu} = Components;
 
 Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://gre/modules/Preferences.jsm");
 Cu.import("resource://gre/modules/Task.jsm");
 
 Cu.import("chrome://marionette/content/driver.js");
diff --git a/testing/marionette/driver.js b/testing/marionette/driver.js
index 589cf7fb742..3054c0f5c00 100644
--- a/testing/marionette/driver.js
+++ b/testing/marionette/driver.js
@@ -12,6 +12,7 @@ var loader = Cc["@mozilla.org/moz/jssubscript-loader;1"]
 Cu.import("resource://gre/modules/FileUtils.jsm");
 Cu.import("resource://gre/modules/Log.jsm");
 Cu.import("resource://gre/modules/NetUtil.jsm");
+Cu.import("resource://gre/modules/Preferences.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/Task.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
@@ -365,9 +366,9 @@ GeckoDriver.prototype.whenBrowserStarted = function(win, isNewSession) {
       }
     }
 
-    if (!Services.prefs.getBoolPref("marionette.contentListener") || !isNewSession) {
+    if (!Preferences.get(CONTENT_LISTENER_PREF) || !isNewSession) {
       mm.loadFrameScript(FRAME_SCRIPT, true, true);
-      Services.prefs.setBoolPref("marionette.contentListener", true);
+      Preferences.set(CONTENT_LISTENER_PREF, true);
     }
   } catch (e) {
     // there may not always be a content process
@@ -543,10 +544,7 @@ GeckoDriver.prototype.newSession = function(cmd, resp) {
       };
       win.addEventListener("load", listener, true);
     } else {
-      let clickToStart;
-      try {
-        clickToStart = Services.prefs.getBoolPref(CLICK_TO_START_PREF);
-      } catch (e) {}
+      let clickToStart = Preferences.get(CLICK_TO_START_PREF);
       if (clickToStart && (this.appName != "B2G")) {
         let pService = Cc["@mozilla.org/embedcomp/prompt-service;1"]
             .getService(Ci.nsIPromptService);
@@ -557,7 +555,7 @@ GeckoDriver.prototype.newSession = function(cmd, resp) {
   };
 
   let runSessionStart = function() {
-    if (!Services.prefs.getBoolPref(CONTENT_LISTENER_PREF)) {
+    if (!Preferences.get(CONTENT_LISTENER_PREF)) {
       waitForWindow.call(this);
     } else if (this.appName != "Firefox" && this.curBrowser === null) {
       // if there is a content listener, then we just wake it up
@@ -672,45 +670,49 @@ GeckoDriver.prototype.setSessionCapabilities = function(newCaps) {
 };
 
 GeckoDriver.prototype.setUpProxy = function(proxy) {
-  logger.debug("User-provided proxy settings: " + JSON.stringify(proxy));
+  logger.config("User-provided proxy settings: " + JSON.stringify(proxy));
 
   if (typeof proxy == "object" && proxy.hasOwnProperty("proxyType")) {
     switch (proxy.proxyType.toUpperCase()) {
       case "MANUAL":
-        Services.prefs.setIntPref("network.proxy.type", 1);
+        Preferences.set("network.proxy.type", 1);
         if (proxy.httpProxy && proxy.httpProxyPort){
-          Services.prefs.setCharPref("network.proxy.http", proxy.httpProxy);
-          Services.prefs.setIntPref("network.proxy.http_port", proxy.httpProxyPort);
+          Preferences.set("network.proxy.http", proxy.httpProxy);
+          Preferences.set("network.proxy.http_port", proxy.httpProxyPort);
         }
         if (proxy.sslProxy && proxy.sslProxyPort){
-          Services.prefs.setCharPref("network.proxy.ssl", proxy.sslProxy);
-          Services.prefs.setIntPref("network.proxy.ssl_port", proxy.sslProxyPort);
+          Preferences.set("network.proxy.ssl", proxy.sslProxy);
+          Preferences.set("network.proxy.ssl_port", proxy.sslProxyPort);
         }
         if (proxy.ftpProxy && proxy.ftpProxyPort) {
-          Services.prefs.setCharPref("network.proxy.ftp", proxy.ftpProxy);
-          Services.prefs.setIntPref("network.proxy.ftp_port", proxy.ftpProxyPort);
+          Preferences.set("network.proxy.ftp", proxy.ftpProxy);
+          Preferences.set("network.proxy.ftp_port", proxy.ftpProxyPort);
         }
         if (proxy.socksProxy) {
-          Services.prefs.setCharPref("network.proxy.socks", proxy.socksProxy);
-          Services.prefs.setIntPref("network.proxy.socks_port", proxy.socksProxyPort);
+          Preferences.set("network.proxy.socks", proxy.socksProxy);
+          Preferences.set("network.proxy.socks_port", proxy.socksProxyPort);
           if (proxy.socksVersion) {
-            Services.prefs.setIntPref("network.proxy.socks_version", proxy.socksVersion);
+            Preferences.set("network.proxy.socks_version", proxy.socksVersion);
           }
         }
         break;
+
       case "PAC":
-        Services.prefs.setIntPref("network.proxy.type", 2);
-        Services.prefs.setCharPref("network.proxy.autoconfig_url", proxy.pacUrl);
+        Preferences.set("network.proxy.type", 2);
+        Preferences.set("network.proxy.autoconfig_url", proxy.pacUrl);
         break;
+
       case "AUTODETECT":
-        Services.prefs.setIntPref("network.proxy.type", 4);
+        Preferences.set("network.proxy.type", 4);
         break;
+
       case "SYSTEM":
-        Services.prefs.setIntPref("network.proxy.type", 5);
+        Preferences.set("network.proxy.type", 5);
         break;
+
       case "NOPROXY":
       default:
-        Services.prefs.setIntPref("network.proxy.type", 0);
+        Preferences.set("network.proxy.type", 0);
     }
   } else {
     throw new InvalidArgumentError("Value of 'proxy' should be an object");
@@ -2450,7 +2452,7 @@ GeckoDriver.prototype.sessionTearDown = function(cmd, resp) {
           this.curBrowser.knownFrames.indexOf(this.curBrowser.mainContentId), 1);
     } else {
       // don't set this pref for B2G since the framescript can be safely reused
-      Services.prefs.setBoolPref("marionette.contentListener", false);
+      Preferences.set(CONTENT_LISTENER_PREF, false);
     }
 
     // delete session in each frame in each browser
diff --git a/testing/marionette/driver/marionette_driver/marionette.py b/testing/marionette/driver/marionette_driver/marionette.py
index e935da32d88..6ad1a707c57 100644
--- a/testing/marionette/driver/marionette_driver/marionette.py
+++ b/testing/marionette/driver/marionette_driver/marionette.py
@@ -967,39 +967,26 @@ class Marionette(object):
                 self.push_permission(perm, original_perms[perm])
 
     def get_pref(self, pref):
-        '''Gets the preference value.
+        """Gets the preference value.
 
         :param pref: Name of the preference.
 
         Usage example::
 
-          marionette.get_pref('browser.tabs.warnOnClose')
-
-        '''
+            marionette.get_pref("browser.tabs.warnOnClose")
+        """
         with self.using_context(self.CONTEXT_CONTENT):
             pref_value = self.execute_script("""
-                Components.utils.import("resource://gre/modules/Services.jsm");
-                let pref = arguments[0];
-                let type = Services.prefs.getPrefType(pref);
-                switch (type) {
-                    case Services.prefs.PREF_STRING:
-                        return Services.prefs.getCharPref(pref);
-                    case Services.prefs.PREF_INT:
-                        return Services.prefs.getIntPref(pref);
-                    case Services.prefs.PREF_BOOL:
-                        return Services.prefs.getBoolPref(pref);
-                    case Services.prefs.PREF_INVALID:
-                        return null;
-                }
-                """, script_args=[pref], sandbox='system')
+                Components.utils.import("resource://gre/modules/Preferences.jsm");
+                return Preferences.get(arguments[0], null);
+                """, script_args=[pref], sandbox="system")
             return pref_value
 
     def clear_pref(self, pref):
         with self.using_context(self.CONTEXT_CHROME):
             self.execute_script("""
-               Components.utils.import("resource://gre/modules/Services.jsm");
-               let pref = arguments[0];
-               Services.prefs.clearUserPref(pref);
+               Components.utils.import("resource://gre/modules/Preferences.jsm");
+               Preferences.reset(arguments[0]);
                """, script_args=[pref])
 
     def set_pref(self, pref, value):
@@ -1008,22 +995,10 @@ class Marionette(object):
                 self.clear_pref(pref)
                 return
 
-            if isinstance(value, bool):
-                func = 'setBoolPref'
-            elif isinstance(value, (int, long)):
-                func = 'setIntPref'
-            elif isinstance(value, basestring):
-                func = 'setCharPref'
-            else:
-                raise errors.MarionetteException(
-                    "Unsupported preference type: %s" % type(value))
-
             self.execute_script("""
-                Components.utils.import("resource://gre/modules/Services.jsm");
-                let pref = arguments[0];
-                let value = arguments[1];
-                Services.prefs.%s(pref, value);
-                """ % func, script_args=[pref, value])
+                Components.utils.import("resource://gre/modules/Preferences.jsm");
+                Preferences.set(arguments[0], arguments[1]);
+                """, script_args=[pref, value])
 
     def set_prefs(self, prefs):
         '''Sets preferences.
diff --git a/testing/marionette/server.js b/testing/marionette/server.js
index 44c4e80cb32..492291d2bb3 100644
--- a/testing/marionette/server.js
+++ b/testing/marionette/server.js
@@ -10,6 +10,7 @@ var loader = Cc["@mozilla.org/moz/jssubscript-loader;1"].getService(Ci.mozIJSSub
 const ServerSocket = CC("@mozilla.org/network/server-socket;1", "nsIServerSocket", "initSpecialConnection");
 
 Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://gre/modules/Preferences.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 
 Cu.import("chrome://marionette/content/dispatcher.js");
@@ -29,7 +30,9 @@ loader.loadSubScript("chrome://marionette/content/frame-manager.js");
 const logger = Log.repository.getLogger("Marionette");
 
 this.EXPORTED_SYMBOLS = ["MarionetteServer"];
+
 const CONTENT_LISTENER_PREF = "marionette.contentListener";
+const MANAGE_OFFLINE_STATUS_PREF = "network.gonk.manage-offline-status";
 
 /**
  * Bootstraps Marionette and handles incoming client connections.
@@ -84,11 +87,11 @@ MarionetteServer.prototype.driverFactory = function(emulator) {
     device = "desktop";
   }
 
-  Services.prefs.setBoolPref(CONTENT_LISTENER_PREF, false);
+  Preferences.set(CONTENT_LISTENER_PREF, false);
 
   if (bypassOffline) {
     logger.debug("Bypassing offline status");
-    Services.prefs.setBoolPref("network.gonk.manage-offline-status", false);
+    Preferences.set(MANAGE_OFFLINE_STATUS_PREF, false);
     Services.io.manageOfflineStatus = false;
     Services.io.offline = false;
   }
@@ -146,9 +149,5 @@ MarionetteServer.prototype.onConnectionClosed = function(conn) {
 };
 
 function isMulet() {
-  try {
-    return Services.prefs.getBoolPref("b2g.is_mulet");
-  } catch (e) {
-    return false;
-  }
+  return Preferences.get("b2g.is_mulet", false);
 }

From 270ff9c1d741953bf9ff72e9ad445ed971dc60b6 Mon Sep 17 00:00:00 2001
From: Andreas Tolfsen 
Date: Tue, 19 Jan 2016 16:05:43 +0000
Subject: [PATCH 100/119] Bug 1240751 - Annotate bug component in
 testing/marionette; r=automatedtester

---
 testing/marionette/moz.build | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/testing/marionette/moz.build b/testing/marionette/moz.build
index 0c87f1e9ac6..fc7eb048f2a 100644
--- a/testing/marionette/moz.build
+++ b/testing/marionette/moz.build
@@ -1,9 +1,10 @@
-# -*- 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/.
 
-DIRS += ['components', 'atoms']
+DIRS += ["components", "atoms"]
 
-JAR_MANIFESTS += ['jar.mn']
+JAR_MANIFESTS += ["jar.mn"]
+
+with Files("**"):
+    BUG_COMPONENT = ("Testing", "Marionette")

From cb10a0d7bcab4a6c82a76cee96dccf63b04e1101 Mon Sep 17 00:00:00 2001
From: Andreas Tolfsen 
Date: Tue, 19 Jan 2016 14:44:54 +0000
Subject: [PATCH 101/119] Bug 1240610 - Align socket_timeout with Python's
 socket interface; r=automatedtester

When socket.settimeout(None) is set in Python's standard library this
is meant to be equivalent to disabling timeouts on socket operations.
marionette.transport should respect this.

This change set unbreaks the use of the --jdebugger flag to `./mach
marionette-test'.
---
 .../marionette/transport/marionette_transport/transport.py  | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/testing/marionette/transport/marionette_transport/transport.py b/testing/marionette/transport/marionette_transport/transport.py
index 5b8bf5aca42..28ab714cd6e 100644
--- a/testing/marionette/transport/marionette_transport/transport.py
+++ b/testing/marionette/transport/marionette_transport/transport.py
@@ -116,6 +116,10 @@ class TcpTransport(object):
     connection_lost_msg = "Connection to Marionette server is lost. Check gecko.log (desktop firefox) or logcat (b2g) for errors."
 
     def __init__(self, addr, port, socket_timeout=360.0):
+        """If `socket_timeout` is `0` or `0.0`, non-blocking socket mode
+        will be used.  Setting it to `1` or `None` disables timeouts on
+        socket operations altogether.
+        """
         self.addr = addr
         self.port = port
         self.socket_timeout = socket_timeout
@@ -164,7 +168,7 @@ class TcpTransport(object):
         data = ""
         bytes_to_recv = 10
 
-        while time.time() - now < self.socket_timeout:
+        while self.socket_timeout is None or (time.time() - now < self.socket_timeout):
             try:
                 chunk = self.sock.recv(bytes_to_recv)
                 data += chunk

From 908abf6e28ed79d7315a09017b691a7acf26ae57 Mon Sep 17 00:00:00 2001
From: Andreas Tolfsen 
Date: Mon, 18 Jan 2016 22:12:55 +0000
Subject: [PATCH 102/119] Bug 1240601 - Set timeout on socket in
 transport.wait_for_port; r=automatedtester

If the client is able to connect but the server never sends any data,
the socket should time out in order for the function not to hang forever.

That said, polling for ports like this is inherently racy and we should
instead specify and bind what port we wish Marionette to start on in
the future.
---
 .../marionette/transport/marionette_transport/transport.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/testing/marionette/transport/marionette_transport/transport.py b/testing/marionette/transport/marionette_transport/transport.py
index 28ab714cd6e..455760a5787 100644
--- a/testing/marionette/transport/marionette_transport/transport.py
+++ b/testing/marionette/transport/marionette_transport/transport.py
@@ -289,22 +289,23 @@ class TcpTransport(object):
 
 
 def wait_for_port(host, port, timeout=60):
-    """ Wait for the specified host/port to be available."""
+    """Wait for the specified host/port to become available."""
     starttime = datetime.datetime.now()
     poll_interval = 0.1
     while datetime.datetime.now() - starttime < datetime.timedelta(seconds=timeout):
         sock = None
         try:
             sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+            sock.settimeout(0.5)
             sock.connect((host, port))
             data = sock.recv(16)
             sock.close()
-            if ':' in data:
+            if ":" in data:
                 return True
         except socket.error:
             pass
         finally:
-            if sock:
+            if sock is not None:
                 sock.close()
         time.sleep(poll_interval)
     return False

From 1676006de9f2878ed7d61cdad4b0791365af8c53 Mon Sep 17 00:00:00 2001
From: "Dustin J. Mitchell" 
Date: Tue, 19 Jan 2016 19:41:00 +0000
Subject: [PATCH 103/119] Bug 1240856: update cache whitelist for new cache
 names; r=garndt

---
 testing/taskcluster/mach_commands.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/testing/taskcluster/mach_commands.py b/testing/taskcluster/mach_commands.py
index 62161a747cf..52fc7718f2a 100644
--- a/testing/taskcluster/mach_commands.py
+++ b/testing/taskcluster/mach_commands.py
@@ -10,6 +10,7 @@ from collections import defaultdict
 import os
 import json
 import copy
+import re
 import sys
 import time
 from collections import namedtuple
@@ -132,14 +133,13 @@ def remove_caches_from_task(task):
     :param task: task definition.
     """
     whitelist = [
-        "tc-vcs",
-        "tc-vcs-public-sources",
-        "tooltool-cache",
+        re.compile("^level-[123]-.*-tc-vcs(-public-sources)?$"),
+        re.compile("^tooltool-cache$"),
     ]
     try:
         caches = task["task"]["payload"]["cache"]
         for cache in caches.keys():
-            if cache not in whitelist:
+            if not any(pat.match(cache) for pat in whitelist):
                 caches.pop(cache)
     except KeyError:
         pass

From c8f694bf4327554a73867e6b45982923d63fac0e Mon Sep 17 00:00:00 2001
From: Dave Townsend 
Date: Thu, 14 Jan 2016 15:21:01 -0800
Subject: [PATCH 104/119] Bug 1232274: Make installing or enabling an add-on
 require a restart if e10s is on and a pref is set. r=rhelmer

---
 .../extensions/internal/XPIProvider.jsm       |  67 ++++++++++
 .../extensions/test/xpcshell/head_addons.js   |   1 +
 .../test/xpcshell/test_e10s_restartless.js    | 125 ++++++++++++++++++
 .../test/xpcshell/xpcshell-shared.ini         |   1 +
 4 files changed, 194 insertions(+)
 create mode 100644 toolkit/mozapps/extensions/test/xpcshell/test_e10s_restartless.js

diff --git a/toolkit/mozapps/extensions/internal/XPIProvider.jsm b/toolkit/mozapps/extensions/internal/XPIProvider.jsm
index 923d3d07213..64bdb20d29e 100644
--- a/toolkit/mozapps/extensions/internal/XPIProvider.jsm
+++ b/toolkit/mozapps/extensions/internal/XPIProvider.jsm
@@ -112,6 +112,7 @@ const PREF_SHOWN_SELECTION_UI         = "extensions.shownSelectionUI";
 const PREF_INTERPOSITION_ENABLED      = "extensions.interposition.enabled";
 const PREF_SYSTEM_ADDON_SET           = "extensions.systemAddonSet";
 const PREF_SYSTEM_ADDON_UPDATE_URL    = "extensions.systemAddon.update.url";
+const PREF_E10S_BLOCK_ENABLE          = "extensions.e10sBlocksEnabling";
 
 const PREF_EM_MIN_COMPAT_APP_VERSION      = "extensions.minCompatibleAppVersion";
 const PREF_EM_MIN_COMPAT_PLATFORM_VERSION = "extensions.minCompatiblePlatformVersion";
@@ -2744,11 +2745,19 @@ this.XPIProvider = {
         observe: function(aSubject, aTopic, aData) {
           XPIProvider._closing = true;
           for (let id in XPIProvider.bootstrappedAddons) {
+            // If no scope has been loaded for this add-on then there is no need
+            // to shut it down (should only happen when a bootstrapped add-on is
+            // pending enable)
+            if (!(id in XPIProvider.bootstrapScopes))
+              continue;
+
             let file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
             file.persistentDescriptor = XPIProvider.bootstrappedAddons[id].descriptor;
             let addon = createAddonDetails(id, XPIProvider.bootstrappedAddons[id]);
             XPIProvider.callBootstrapMethod(addon, file, "shutdown",
                                             BOOTSTRAP_REASONS.APP_SHUTDOWN);
+            if (XPIProvider.bootstrappedAddons[id].disable)
+              delete XPIProvider.bootstrappedAddons[aId];
           }
           Services.obs.removeObserver(this, "quit-application-granted");
         }
@@ -4229,6 +4238,41 @@ this.XPIProvider = {
     }
   },
 
+  /**
+   * In some cases having add-ons active blocks e10s but turning off e10s
+   * requires a restart so some add-ons that are normally restartless will
+   * require a restart to install or enable.
+   *
+   * @param  aAddon
+   *         The add-on to test
+   * @return true if enabling the add-on requires a restart
+   */
+  e10sBlocksEnabling: function(aAddon) {
+    // If the preference isn't set then don't block anything
+    if (!Preferences.get(PREF_E10S_BLOCK_ENABLE, false))
+      return false;
+
+    // If e10s isn't active then don't block anything
+    if (!Services.appinfo.browserTabsRemoteAutostart)
+      return false;
+
+    // Only extensions change behaviour
+    if (aAddon.type != "extension")
+      return false;
+
+    // The hotfix is exempt
+    let hotfixID = Preferences.get(PREF_EM_HOTFIX_ID, undefined);
+    if (hotfixID && hotfixID == aAddon.id)
+      return false;
+
+    // System add-ons are exempt
+    if (aAddon._installLocation.name == KEY_APP_SYSTEM_DEFAULTS ||
+        aAddon._installLocation.name == KEY_APP_SYSTEM_ADDONS)
+      return false;
+
+    return true;
+  },
+
   /**
    * Tests whether enabling an add-on will require a restart.
    *
@@ -4263,6 +4307,9 @@ this.XPIProvider = {
       return aAddon.internalName != this.currentSkin;
     }
 
+    if (this.e10sBlocksEnabling(aAddon))
+      return true;
+
     return !aAddon.bootstrap;
   },
 
@@ -4353,6 +4400,9 @@ this.XPIProvider = {
     if (aAddon.disabled)
       return false;
 
+    if (this.e10sBlocksEnabling(aAddon))
+      return true;
+
     // Themes will require a restart (even if dynamic switching is enabled due
     // to some caching issues) and non-bootstrapped add-ons will require a
     // restart
@@ -4724,6 +4774,23 @@ this.XPIProvider = {
           AddonManagerPrivate.callAddonListeners("onEnabled", wrapper);
         }
       }
+      else if (aAddon.bootstrap) {
+        // Something blocked the restartless add-on from enabling or disabling
+        // make sure it happens on the next startup
+        if (isDisabled) {
+          this.bootstrappedAddons[aAddon.id].disable = true;
+        }
+        else {
+          this.bootstrappedAddons[aAddon.id] = {
+            version: aAddon.version,
+            type: aAddon.type,
+            descriptor: aAddon._sourceBundle.persistentDescriptor,
+            multiprocessCompatible: aAddon.multiprocessCompatible,
+            runInSafeMode: canRunInSafeMode(aAddon),
+          };
+          this.persistBootstrappedAddons();
+        }
+      }
     }
 
     // Sync with XPIStates.
diff --git a/toolkit/mozapps/extensions/test/xpcshell/head_addons.js b/toolkit/mozapps/extensions/test/xpcshell/head_addons.js
index d0051b240fe..476afab5591 100644
--- a/toolkit/mozapps/extensions/test/xpcshell/head_addons.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/head_addons.js
@@ -262,6 +262,7 @@ function createAppInfo(id, name, version, platformVersion) {
     platformBuildID: "2007010101",
 
     // nsIXULRuntime
+    browserTabsRemoteAutostart: false,
     inSafeMode: false,
     logConsoleErrors: true,
     OS: "XPCShell",
diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_e10s_restartless.js b/toolkit/mozapps/extensions/test/xpcshell/test_e10s_restartless.js
new file mode 100644
index 00000000000..b68676901a4
--- /dev/null
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_e10s_restartless.js
@@ -0,0 +1,125 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/
+ */
+
+const ID = "bootstrap1@tests.mozilla.org";
+
+BootstrapMonitor.init();
+
+createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
+
+startupManager();
+
+function* check_normal() {
+  let install = yield new Promise(resolve => AddonManager.getInstallForFile(do_get_addon("test_bootstrap1_1"), resolve));
+  yield promiseCompleteAllInstalls([install]);
+  do_check_eq(install.state, AddonManager.STATE_INSTALLED);
+  do_check_false(hasFlag(install.addon.pendingOperations, AddonManager.PENDING_INSTALL));
+
+  BootstrapMonitor.checkAddonInstalled(ID);
+  BootstrapMonitor.checkAddonStarted(ID);
+
+  let addon = yield promiseAddonByID(ID);
+  do_check_eq(addon, install.addon);
+
+  do_check_false(hasFlag(addon.operationsRequiringRestart, AddonManager.OP_NEEDS_RESTART_DISABLE));
+  addon.userDisabled = true;
+  BootstrapMonitor.checkAddonNotStarted(ID);
+  do_check_false(addon.isActive);
+  do_check_false(hasFlag(addon.pendingOperations, AddonManager.PENDING_DISABLE));
+
+  do_check_false(hasFlag(addon.operationsRequiringRestart, AddonManager.OP_NEEDS_RESTART_ENABLE));
+  addon.userDisabled = false;
+  BootstrapMonitor.checkAddonStarted(ID);
+  do_check_true(addon.isActive);
+  do_check_false(hasFlag(addon.pendingOperations, AddonManager.PENDING_ENABLE));
+
+  do_check_false(hasFlag(addon.operationsRequiringRestart, AddonManager.OP_NEEDS_RESTART_UNINSTALL));
+  addon.uninstall();
+  BootstrapMonitor.checkAddonNotStarted(ID);
+  BootstrapMonitor.checkAddonNotInstalled(ID);
+
+  restartManager();
+}
+
+// Installing the add-on normally doesn't require a restart
+add_task(function*() {
+  gAppInfo.browserTabsRemoteAutostart = false;
+  Services.prefs.setBoolPref("extensions.e10sBlocksEnabling", false);
+
+  yield check_normal();
+});
+
+// Enabling the pref doesn't change anything
+add_task(function*() {
+  gAppInfo.browserTabsRemoteAutostart = false;
+  Services.prefs.setBoolPref("extensions.e10sBlocksEnabling", true);
+
+  yield check_normal();
+});
+
+// Default e10s doesn't change anything
+add_task(function*() {
+  gAppInfo.browserTabsRemoteAutostart = true;
+  Services.prefs.setBoolPref("extensions.e10sBlocksEnabling", false);
+
+  yield check_normal();
+});
+
+// Pref and e10s blocks install
+add_task(function*() {
+  gAppInfo.browserTabsRemoteAutostart = true;
+  Services.prefs.setBoolPref("extensions.e10sBlocksEnabling", true);
+
+  let install = yield new Promise(resolve => AddonManager.getInstallForFile(do_get_addon("test_bootstrap1_1"), resolve));
+  yield promiseCompleteAllInstalls([install]);
+  do_check_eq(install.state, AddonManager.STATE_INSTALLED);
+  do_check_true(hasFlag(install.addon.pendingOperations, AddonManager.PENDING_INSTALL));
+
+  let addon = yield promiseAddonByID(ID);
+  do_check_eq(addon, null);
+
+  yield promiseRestartManager();
+
+  BootstrapMonitor.checkAddonInstalled(ID);
+  BootstrapMonitor.checkAddonStarted(ID);
+
+  addon = yield promiseAddonByID(ID);
+  do_check_neq(addon, null);
+
+  do_check_false(hasFlag(addon.operationsRequiringRestart, AddonManager.OP_NEEDS_RESTART_DISABLE));
+  addon.userDisabled = true;
+  BootstrapMonitor.checkAddonNotStarted(ID);
+  do_check_false(addon.isActive);
+  do_check_false(hasFlag(addon.pendingOperations, AddonManager.PENDING_DISABLE));
+
+  do_check_true(hasFlag(addon.operationsRequiringRestart, AddonManager.OP_NEEDS_RESTART_ENABLE));
+  addon.userDisabled = false;
+  BootstrapMonitor.checkAddonNotStarted(ID);
+  do_check_false(addon.isActive);
+  do_check_true(hasFlag(addon.pendingOperations, AddonManager.PENDING_ENABLE));
+
+  yield promiseRestartManager();
+
+  addon = yield promiseAddonByID(ID);
+  do_check_neq(addon, null);
+
+  do_check_true(addon.isActive);
+  BootstrapMonitor.checkAddonStarted(ID);
+
+  do_check_false(hasFlag(addon.operationsRequiringRestart, AddonManager.OP_NEEDS_RESTART_UNINSTALL));
+  addon.uninstall();
+  BootstrapMonitor.checkAddonNotStarted(ID);
+  BootstrapMonitor.checkAddonNotInstalled(ID);
+
+  restartManager();
+});
+
+// The hotfix is unaffected
+add_task(function*() {
+  gAppInfo.browserTabsRemoteAutostart = true;
+  Services.prefs.setBoolPref("extensions.e10sBlocksEnabling", true);
+  Services.prefs.setCharPref("extensions.hotfix.id", ID);
+
+  yield check_normal();
+});
diff --git a/toolkit/mozapps/extensions/test/xpcshell/xpcshell-shared.ini b/toolkit/mozapps/extensions/test/xpcshell/xpcshell-shared.ini
index 1e4ef8d2256..97bf8c84ff7 100644
--- a/toolkit/mozapps/extensions/test/xpcshell/xpcshell-shared.ini
+++ b/toolkit/mozapps/extensions/test/xpcshell/xpcshell-shared.ini
@@ -303,3 +303,4 @@ run-sequentially = Uses global XCurProcD dir.
 skip-if = os != "win"
 [test_bug1180901.js]
 skip-if = os != "win"
+[test_e10s_restartless.js]

From b5cff69632c745a6e64688a546cc9b4588b11ad8 Mon Sep 17 00:00:00 2001
From: Aaron Klotz 
Date: Tue, 19 Jan 2016 15:14:24 -0700
Subject: [PATCH 105/119] Bug 1240848: Adds additional instructions to x64
 detour patcher; r=ehsan

---
 toolkit/xre/test/win/TestDllInterceptor.cpp |  3 +++
 xpcom/build/nsWindowsDllInterceptor.h       | 28 +++++++++++++++++++++
 2 files changed, 31 insertions(+)

diff --git a/toolkit/xre/test/win/TestDllInterceptor.cpp b/toolkit/xre/test/win/TestDllInterceptor.cpp
index ea85e8ca7f1..6abb90d1577 100644
--- a/toolkit/xre/test/win/TestDllInterceptor.cpp
+++ b/toolkit/xre/test/win/TestDllInterceptor.cpp
@@ -162,6 +162,9 @@ int main()
       TestHook("imm32.dll", "ImmGetContext") &&
       TestHook("imm32.dll", "ImmGetCompositionStringW") &&
       TestHook("imm32.dll", "ImmSetCandidateWindow") &&
+#ifdef _M_X64
+      TestHook("user32.dll", "CreateWindowExW") &&
+#endif
       TestDetour("ntdll.dll", "LdrLoadDll")) {
     printf("TEST-PASS | WindowsDllInterceptor | all checks passed\n");
     return 0;
diff --git a/xpcom/build/nsWindowsDllInterceptor.h b/xpcom/build/nsWindowsDllInterceptor.h
index 9239582f182..0e399264e62 100644
--- a/xpcom/build/nsWindowsDllInterceptor.h
+++ b/xpcom/build/nsWindowsDllInterceptor.h
@@ -738,6 +738,31 @@ protected:
           // not support yet!
           return;
         }
+      } else if (origBytes[nBytes] == 0x66) {
+        // operand override prefix
+        nBytes += 1;
+        // This is the same as the x86 version
+        if (origBytes[nBytes] >= 0x88 && origBytes[nBytes] <= 0x8B) {
+          // various MOVs
+          unsigned char b = origBytes[nBytes + 1];
+          if (((b & 0xc0) == 0xc0) ||
+              (((b & 0xc0) == 0x00) &&
+               ((b & 0x07) != 0x04) && ((b & 0x07) != 0x05))) {
+            // REG=r, R/M=r or REG=r, R/M=[r]
+            nBytes += 2;
+          } else if ((b & 0xc0) == 0x40) {
+            if ((b & 0x07) == 0x04) {
+              // REG=r, R/M=[SIB + disp8]
+              nBytes += 4;
+            } else {
+              // REG=r, R/M=[r + disp8]
+              nBytes += 3;
+            }
+          } else {
+            // complex MOV, bail
+            return;
+          }
+        }
       } else if ((origBytes[nBytes] & 0xf0) == 0x50) {
         // 1-byte push/pop
         nBytes++;
@@ -747,6 +772,9 @@ protected:
       } else if (origBytes[nBytes] == 0xb8) {
         // MOV 0xB8: http://ref.x86asm.net/coder32.html#xB8
         nBytes += 5;
+      } else if (origBytes[nBytes] == 0x33) {
+        // xor r32, r/m32
+        nBytes += 2;
       } else if (origBytes[nBytes] == 0xc3) {
         // ret
         nBytes++;

From d94f7a2949291c6161450ad9c012a082409d05e9 Mon Sep 17 00:00:00 2001
From: Rail Aliiev 
Date: Tue, 19 Jan 2016 20:02:06 -0500
Subject: [PATCH 106/119] Bug 1166464 - Bump version after shipping release
 builds, r=jlund DONTBUILD

---
 .../configs/merge_day/aurora_to_beta.py       |  7 +-
 .../configs/merge_day/beta_to_release.py      |  7 +-
 .../mozharness/configs/merge_day/bump_esr.py  | 21 +++++
 .../configs/merge_day/central_to_aurora.py    |  7 +-
 .../configs/merge_day/release_to_esr.py       |  7 +-
 .../scripts/merge_day/gecko_migration.py      | 79 +++++++++++++------
 6 files changed, 87 insertions(+), 41 deletions(-)
 create mode 100644 testing/mozharness/configs/merge_day/bump_esr.py

diff --git a/testing/mozharness/configs/merge_day/aurora_to_beta.py b/testing/mozharness/configs/merge_day/aurora_to_beta.py
index a60ef4d91d7..c0800ea2ff5 100644
--- a/testing/mozharness/configs/merge_day/aurora_to_beta.py
+++ b/testing/mozharness/configs/merge_day/aurora_to_beta.py
@@ -1,10 +1,9 @@
 config = {
     "log_name": "aurora_to_beta",
     "version_files": [
-        "browser/config/version.txt",
-        "browser/config/version_display.txt",
-        "config/milestone.txt",
-        "b2g/confvars.sh",
+        {"file": "browser/config/version.txt", "suffix": ""},
+        {"file": "browser/config/version_display.txt", "suffix": "b1"},
+        {"file": "config/milestone.txt", "suffix": ""},
     ],
     "replacements": [
         # File, from, to
diff --git a/testing/mozharness/configs/merge_day/beta_to_release.py b/testing/mozharness/configs/merge_day/beta_to_release.py
index f4e45ad3caa..cbc45cf4e11 100644
--- a/testing/mozharness/configs/merge_day/beta_to_release.py
+++ b/testing/mozharness/configs/merge_day/beta_to_release.py
@@ -1,10 +1,9 @@
 config = {
     "log_name": "beta_to_release",
     "version_files": [
-        "browser/config/version.txt",
-        "browser/config/version_display.txt",
-        "config/milestone.txt",
-        "b2g/confvars.sh",
+        {"file": "browser/config/version.txt", "suffix": ""},
+        {"file": "browser/config/version_display.txt", "suffix": ""},
+        {"file": "config/milestone.txt", "suffix": ""},
     ],
     "replacements": [
         # File, from, to
diff --git a/testing/mozharness/configs/merge_day/bump_esr.py b/testing/mozharness/configs/merge_day/bump_esr.py
new file mode 100644
index 00000000000..be51ca78ad3
--- /dev/null
+++ b/testing/mozharness/configs/merge_day/bump_esr.py
@@ -0,0 +1,21 @@
+config = {
+    "log_name": "bump_esr",
+    "version_files": [
+        {"file": "browser/config/version.txt", "suffix": ""},
+        # TODO: add the following line when ESR is 45
+        # {"file": "browser/config/version_display.txt", "suffix": ""},
+        {"file": "config/milestone.txt", "suffix": ""},
+    ],
+    "tools_repo_url": "https://hg.mozilla.org/build/tools",
+    "tools_repo_revision": "default",
+    "to_repo_url": "ssh://hg.mozilla.org/releases/mozilla-esr38",
+
+    "migration_behavior": "bump_second_digit",
+    "require_remove_locales": False,
+    "requires_head_merge": False,
+    "default_actions": [
+        "clean-repos",
+        "pull",
+        "bump_second_digit"
+    ],
+}
diff --git a/testing/mozharness/configs/merge_day/central_to_aurora.py b/testing/mozharness/configs/merge_day/central_to_aurora.py
index ea5a8102ec0..4e99037f9cf 100644
--- a/testing/mozharness/configs/merge_day/central_to_aurora.py
+++ b/testing/mozharness/configs/merge_day/central_to_aurora.py
@@ -1,10 +1,9 @@
 config = {
     "log_name": "central_to_aurora",
     "version_files": [
-        "browser/config/version.txt",
-        "browser/config/version_display.txt",
-        "config/milestone.txt",
-        "b2g/confvars.sh",
+        {"file": "browser/config/version.txt", "suffix": ""},
+        {"file": "browser/config/version_display.txt", "suffix": ""},
+        {"file": "config/milestone.txt", "suffix": ""},
     ],
     "replacements": [
         # File, from, to
diff --git a/testing/mozharness/configs/merge_day/release_to_esr.py b/testing/mozharness/configs/merge_day/release_to_esr.py
index e303c74c53b..0b6a6df819f 100644
--- a/testing/mozharness/configs/merge_day/release_to_esr.py
+++ b/testing/mozharness/configs/merge_day/release_to_esr.py
@@ -5,10 +5,9 @@ OLD_ESR_CHANGESET = "16351963d75c"
 config = {
     "log_name": "relese_to_esr",
     "version_files": [
-        "browser/config/version.txt",
-        "browser/config/version_display.txt",
-        "config/milestone.txt",
-        "b2g/confvars.sh",
+        {"file": "browser/config/version.txt", "suffix": ""},
+        {"file": "browser/config/version_display.txt", "suffix": ""},
+        {"file": "config/milestone.txt", "suffix": ""},
     ],
     "replacements": [
         # File, from, to
diff --git a/testing/mozharness/scripts/merge_day/gecko_migration.py b/testing/mozharness/scripts/merge_day/gecko_migration.py
index aa884ef289a..be592014450 100755
--- a/testing/mozharness/scripts/merge_day/gecko_migration.py
+++ b/testing/mozharness/scripts/merge_day/gecko_migration.py
@@ -33,7 +33,8 @@ from mozharness.mozilla.selfserve import SelfServeMixin
 from mozharness.mozilla.updates.balrog import BalrogMixin
 
 VALID_MIGRATION_BEHAVIORS = (
-    "beta_to_release", "aurora_to_beta", "central_to_aurora", "release_to_esr"
+    "beta_to_release", "aurora_to_beta", "central_to_aurora", "release_to_esr",
+    "bump_second_digit",
 )
 
 
@@ -84,6 +85,7 @@ class GeckoMigration(MercurialScript, BalrogMixin, VirtualenvMixin, SelfServeMix
                 'pull',
                 'lock-update-paths',
                 'migrate',
+                'bump_second_digit',
                 'commit-changes',
                 'push',
                 'trigger-builders',
@@ -126,13 +128,13 @@ class GeckoMigration(MercurialScript, BalrogMixin, VirtualenvMixin, SelfServeMix
             dirs['abs_work_dir'], 'tools', 'lib', 'python'
         )
         for k in ('from', 'to'):
-            dir_name = self.config.get(
-                "%s_repo_dir",
-                self.get_filename_from_url(self.config["%s_repo_url" % k])
-            )
-            self.abs_dirs['abs_%s_dir' % k] = os.path.join(
-                dirs['abs_work_dir'], dir_name
-            )
+            url = self.config.get("%s_repo_url" % k)
+            if url:
+                dir_name = self.get_filename_from_url(url)
+                self.info("adding %s" % dir_name)
+                self.abs_dirs['abs_%s_dir' % k] = os.path.join(
+                    dirs['abs_work_dir'], dir_name
+                )
         return self.abs_dirs
 
     def query_gecko_repos(self):
@@ -144,13 +146,17 @@ class GeckoMigration(MercurialScript, BalrogMixin, VirtualenvMixin, SelfServeMix
         dirs = self.query_abs_dirs()
         self.gecko_repos = []
         for k in ('from', 'to'):
-            url = self.config["%s_repo_url" % k]
-            self.gecko_repos.append({
-                "repo": url,
-                "revision": self.config.get("%s_repo_revision", "default"),
-                "dest": dirs['abs_%s_dir' % k],
-                "vcs": "hg",
-            })
+            repo_key = "%s_repo_url" % k
+            url = self.config.get(repo_key)
+            if url:
+                self.gecko_repos.append({
+                    "repo": url,
+                    "revision": self.config.get("%s_repo_revision", "default"),
+                    "dest": dirs['abs_%s_dir' % k],
+                    "vcs": "hg",
+                })
+            else:
+                self.warning("Skipping %s" % repo_key)
         self.info(pprint.pformat(self.gecko_repos))
         return self.gecko_repos
 
@@ -174,10 +180,10 @@ class GeckoMigration(MercurialScript, BalrogMixin, VirtualenvMixin, SelfServeMix
         dirs = self.query_abs_dirs()
         return self.query_hg_revision(dirs['abs_to_dir'])
 
-    def get_fx_major_version(self, path):
+    def get_fx_version(self, path):
         version_path = os.path.join(path, "browser", "config", "version.txt")
         contents = self.read_from_file(version_path, error_level=FATAL)
-        return contents.split(".")[0]
+        return contents.split(".")
 
     def hg_tag(self, cwd, tags, user=None, message=None, revision=None,
                force=None, halt_on_failure=True):
@@ -327,8 +333,9 @@ class GeckoMigration(MercurialScript, BalrogMixin, VirtualenvMixin, SelfServeMix
         curr_weave_version = str(int(curr_version) + 2)
         next_weave_version = str(int(curr_weave_version) + 1)
         for f in self.config["version_files"]:
-            self.replace(os.path.join(cwd, f), "%s.0%s" % (curr_version, curr_suffix),
-                         "%s.0%s" % (next_version, next_suffix))
+            from_ = "%s.0%s" % (curr_version, curr_suffix)
+            to = "%s.0%s%s" % (next_version, next_suffix, f["suffix"])
+            self.replace(os.path.join(cwd, f["file"]), from_, to)
 
         # only applicable for m-c
         if bump_major:
@@ -362,11 +369,11 @@ class GeckoMigration(MercurialScript, BalrogMixin, VirtualenvMixin, SelfServeMix
                 error_list=HgErrorList,
                 halt_on_failure=True,
             )
-        next_ma_version = self.get_fx_major_version(dirs['abs_to_dir'])
+        next_ma_version = self.get_fx_version(dirs['abs_to_dir'])[0]
         self.bump_version(dirs['abs_to_dir'], next_ma_version, next_ma_version, "a1", "a2")
         self.apply_replacements()
         # bump m-c version
-        curr_mc_version = self.get_fx_major_version(dirs['abs_from_dir'])
+        curr_mc_version = self.get_fx_version(dirs['abs_from_dir'])[0]
         next_mc_version = str(int(curr_mc_version) + 1)
         self.bump_version(
             dirs['abs_from_dir'], curr_mc_version, next_mc_version, "a1", "a1",
@@ -385,7 +392,7 @@ class GeckoMigration(MercurialScript, BalrogMixin, VirtualenvMixin, SelfServeMix
             staging beta user repo migrations.
             """
         dirs = self.query_abs_dirs()
-        mb_version = self.get_fx_major_version(dirs['abs_to_dir'])
+        mb_version = self.get_fx_version(dirs['abs_to_dir'])[0]
         self.bump_version(dirs['abs_to_dir'], mb_version, mb_version, "a2", "")
         self.apply_replacements()
         self.touch_clobber_file(dirs['abs_to_dir'])
@@ -466,6 +473,25 @@ class GeckoMigration(MercurialScript, BalrogMixin, VirtualenvMixin, SelfServeMix
             halt_on_failure=True,
         )
 
+    def bump_second_digit(self, *args, **kwargs):
+        """Bump second digit.
+
+         ESR need only the second digit bumped as a part of merge day."""
+        dirs = self.query_abs_dirs()
+        version = self.get_fx_version(dirs['abs_to_dir'])
+        curr_version = ".".join(version)
+        next_version = list(version)
+        # bump the second digit
+        next_version[1] = str(int(next_version[1]) + 1)
+        # in case we have third digit, reset it to 0
+        if len(next_version) > 2:
+            next_version[2] = '0'
+        next_version = ".".join(next_version)
+        for f in self.config["version_files"]:
+            self.replace(os.path.join(dirs['abs_to_dir'], f["file"]),
+                         curr_version, next_version + f["suffix"])
+        self.touch_clobber_file(dirs['abs_to_dir'])
+
 # Actions {{{1
     def clean_repos(self):
         """ We may end up with contaminated local repos at some point, but
@@ -534,8 +560,8 @@ class GeckoMigration(MercurialScript, BalrogMixin, VirtualenvMixin, SelfServeMix
         """ Perform the migration.
             """
         dirs = self.query_abs_dirs()
-        from_fx_major_version = self.get_fx_major_version(dirs['abs_from_dir'])
-        to_fx_major_version = self.get_fx_major_version(dirs['abs_to_dir'])
+        from_fx_major_version = self.get_fx_version(dirs['abs_from_dir'])[0]
+        to_fx_major_version = self.get_fx_version(dirs['abs_to_dir'])[0]
         base_from_rev = self.query_from_revision()
         base_to_rev = self.query_to_revision()
         base_tag = self.config['base_tag'] % {'major_version': from_fx_major_version}
@@ -596,7 +622,10 @@ class GeckoMigration(MercurialScript, BalrogMixin, VirtualenvMixin, SelfServeMix
 the script (--clean-repos --pull --migrate).  The second run will be faster."""
         dirs = self.query_abs_dirs()
         hg = self.query_exe("hg", return_type="list")
-        for cwd in (dirs['abs_from_dir'], dirs['abs_to_dir']):
+        for cwd in (dirs.get('abs_from_dir'), dirs.get('abs_to_dir')):
+            if not cwd:
+                self.warning("Skipping %s" % cwd)
+                continue
             push_cmd = hg + ['push']
             if cwd == dirs['abs_to_dir'] and self.config['migration_behavior'] == 'beta_to_release':
                 push_cmd.append('--new-branch')

From 6289535f91d9cf7ae2b55e16f413cf6e1e0b8f1a Mon Sep 17 00:00:00 2001
From: Jean-Yves Avenard 
Date: Tue, 19 Jan 2016 23:06:15 +1100
Subject: [PATCH 107/119] Bug 1237140: don't export unecessary symbol using
 VS2015. r=glandium

---
 media/ffvpx/ffvpxcommon.mozbuild     | 1 +
 media/ffvpx/libavutil/avutil.symbols | 2 ++
 media/ffvpx/libavutil/dummy_funcs.c  | 6 ------
 3 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/media/ffvpx/ffvpxcommon.mozbuild b/media/ffvpx/ffvpxcommon.mozbuild
index 820c395a5a5..cd622557d6a 100644
--- a/media/ffvpx/ffvpxcommon.mozbuild
+++ b/media/ffvpx/ffvpxcommon.mozbuild
@@ -78,6 +78,7 @@ elif CONFIG['_MSC_VER']:
         '-we4013', '-wd4100', '-wd4214', '-wd4307', '-wd4273', '-wd4554',
     ]
     if CONFIG['_MSC_VER'] < '1900':
+        DEFINES['MSVC_2013_OR_LOWER'] = True
         DEFINES['snprintf'] = "avpriv_snprintf"
         DEFINES['_snprintf'] = "avpriv_snprintf"
         DEFINES['vsnprintf'] = "avpriv_vsnprintf"
diff --git a/media/ffvpx/libavutil/avutil.symbols b/media/ffvpx/libavutil/avutil.symbols
index cc32e150286..7a5b9122442 100644
--- a/media/ffvpx/libavutil/avutil.symbols
+++ b/media/ffvpx/libavutil/avutil.symbols
@@ -332,6 +332,8 @@ avutil_license
 avutil_version
 #ifdef XP_WIN
 avpriv_emms_yasm
+#ifdef MSVC_2013_OR_LOWER
 avpriv_snprintf
+#endif
 avpriv_strtod
 #endif
diff --git a/media/ffvpx/libavutil/dummy_funcs.c b/media/ffvpx/libavutil/dummy_funcs.c
index 3b5c480a850..c937098c667 100644
--- a/media/ffvpx/libavutil/dummy_funcs.c
+++ b/media/ffvpx/libavutil/dummy_funcs.c
@@ -17,9 +17,3 @@ void ff_float_dsp_init_aarch64(AVFloatDSPContext *fdsp) {}
 void ff_float_dsp_init_arm(AVFloatDSPContext *fdsp) {}
 void ff_float_dsp_init_ppc(AVFloatDSPContext *fdsp, int strict) {}
 void ff_float_dsp_init_mips(AVFloatDSPContext *fdsp) {}
-
-// VS2015 (and later) now provides snprintf. As we have a global symbols
-// file that do not allow conditional export, we create a dummy entry instead.
-#if defined(_MSC_VER) && _MSC_VER >= 1900
-int avpriv_snprintf(char *s, size_t n, const char *fmt, ...) { return 0; }
-#endif

From 6fe97a5309d4c456c9e75eb5debd53b57072c1cd Mon Sep 17 00:00:00 2001
From: Mason Chang 
Date: Tue, 19 Jan 2016 17:10:07 -0800
Subject: [PATCH 108/119] Bug 1239861. Normalize composite timestamps to now if
 timestamp is in the past. r=kats,vlad

---
 gfx/layers/ipc/CompositorParent.cpp | 23 ++++++++++++++++-------
 gfx/layers/ipc/CompositorParent.h   |  4 +++-
 2 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/gfx/layers/ipc/CompositorParent.cpp b/gfx/layers/ipc/CompositorParent.cpp
index 1a1d9b06432..fdf89ba1de8 100644
--- a/gfx/layers/ipc/CompositorParent.cpp
+++ b/gfx/layers/ipc/CompositorParent.cpp
@@ -336,7 +336,7 @@ CompositorVsyncScheduler::PostCompositeTask(TimeStamp aCompositeTimestamp)
   if (mCurrentCompositeTask == nullptr) {
     mCurrentCompositeTask = NewRunnableMethod(this,
                                               &CompositorVsyncScheduler::Composite,
-                                              aCompositeTimestamp);
+                                              aCompositeTimestamp, nullptr, nullptr);
     ScheduleTask(mCurrentCompositeTask, 0);
   }
 }
@@ -424,7 +424,7 @@ CompositorVsyncScheduler::CancelCurrentCompositeTask()
 }
 
 void
-CompositorVsyncScheduler::Composite(TimeStamp aVsyncTimestamp)
+CompositorVsyncScheduler::Composite(TimeStamp aVsyncTimestamp, gfx::DrawTarget* aTarget, const IntRect* aRect)
 {
   MOZ_ASSERT(CompositorParent::IsInCompositorThread());
   {
@@ -432,13 +432,20 @@ CompositorVsyncScheduler::Composite(TimeStamp aVsyncTimestamp)
     mCurrentCompositeTask = nullptr;
   }
 
+  if (aVsyncTimestamp < mLastCompose) {
+    // We can sometimes get vsync timestamps that are in the past
+    // compared to the last compose with force composites.
+    // In those cases, normalize to now.
+    aVsyncTimestamp = TimeStamp::Now();
+  }
+
   DispatchTouchEvents(aVsyncTimestamp);
   DispatchVREvents(aVsyncTimestamp);
 
   if (mNeedsComposite || mAsapScheduling) {
     mNeedsComposite = 0;
     mLastCompose = aVsyncTimestamp;
-    ComposeToTarget(nullptr);
+    ComposeToTarget(aTarget, aRect);
     mVsyncNotificationsSkipped = 0;
 
     TimeDuration compositeFrameTotal = TimeStamp::Now() - aVsyncTimestamp;
@@ -469,9 +476,10 @@ CompositorVsyncScheduler::OnForceComposeToTarget()
 void
 CompositorVsyncScheduler::ForceComposeToTarget(gfx::DrawTarget* aTarget, const IntRect* aRect)
 {
+  MOZ_ASSERT(CompositorParent::IsInCompositorThread());
   OnForceComposeToTarget();
-  mLastCompose = TimeStamp::Now();
-  ComposeToTarget(aTarget, aRect);
+  SetNeedsComposite();
+  Composite(TimeStamp::Now(), aTarget, aRect);
 }
 
 bool
@@ -556,8 +564,9 @@ CompositorVsyncScheduler::ScheduleTask(CancelableTask* aTask, int aTime)
 void
 CompositorVsyncScheduler::ResumeComposition()
 {
-  mLastCompose = TimeStamp::Now();
-  ComposeToTarget(nullptr);
+  MOZ_ASSERT(CompositorParent::IsInCompositorThread());
+  SetNeedsComposite();
+  Composite(TimeStamp::Now());
 }
 
 void
diff --git a/gfx/layers/ipc/CompositorParent.h b/gfx/layers/ipc/CompositorParent.h
index 5bb56b7cff8..aaece5141a5 100644
--- a/gfx/layers/ipc/CompositorParent.h
+++ b/gfx/layers/ipc/CompositorParent.h
@@ -112,7 +112,9 @@ public:
   void ScheduleComposition();
   void CancelCurrentCompositeTask();
   bool NeedsComposite();
-  void Composite(TimeStamp aVsyncTimestamp);
+  void Composite(TimeStamp aVsyncTimestamp,
+                 gfx::DrawTarget* aTarget = nullptr,
+                 const gfx::IntRect* aRect = nullptr);
   void ForceComposeToTarget(gfx::DrawTarget* aTarget, const gfx::IntRect* aRect);
 
   const TimeStamp& GetLastComposeTime()

From c584212d994aa513d400bc1893d52dff342d44b8 Mon Sep 17 00:00:00 2001
From: Wes Kocher 
Date: Tue, 19 Jan 2016 18:26:42 -0800
Subject: [PATCH 109/119] Backed out changeset 2ee5142ae164 (bug 1240601) for
 b2g xpcshell failures CLOSED TREE

---
 .../marionette/transport/marionette_transport/transport.py | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/testing/marionette/transport/marionette_transport/transport.py b/testing/marionette/transport/marionette_transport/transport.py
index 455760a5787..28ab714cd6e 100644
--- a/testing/marionette/transport/marionette_transport/transport.py
+++ b/testing/marionette/transport/marionette_transport/transport.py
@@ -289,23 +289,22 @@ class TcpTransport(object):
 
 
 def wait_for_port(host, port, timeout=60):
-    """Wait for the specified host/port to become available."""
+    """ Wait for the specified host/port to be available."""
     starttime = datetime.datetime.now()
     poll_interval = 0.1
     while datetime.datetime.now() - starttime < datetime.timedelta(seconds=timeout):
         sock = None
         try:
             sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-            sock.settimeout(0.5)
             sock.connect((host, port))
             data = sock.recv(16)
             sock.close()
-            if ":" in data:
+            if ':' in data:
                 return True
         except socket.error:
             pass
         finally:
-            if sock is not None:
+            if sock:
                 sock.close()
         time.sleep(poll_interval)
     return False

From 211db0c698fff511a79be5b4175dd718432607ac Mon Sep 17 00:00:00 2001
From: Wes Kocher 
Date: Tue, 19 Jan 2016 18:26:45 -0800
Subject: [PATCH 110/119] Backed out changeset 481a3c76e313 (bug 1240610) for
 b2g xpcshell failures CLOSED TREE

---
 .../marionette/transport/marionette_transport/transport.py  | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/testing/marionette/transport/marionette_transport/transport.py b/testing/marionette/transport/marionette_transport/transport.py
index 28ab714cd6e..5b8bf5aca42 100644
--- a/testing/marionette/transport/marionette_transport/transport.py
+++ b/testing/marionette/transport/marionette_transport/transport.py
@@ -116,10 +116,6 @@ class TcpTransport(object):
     connection_lost_msg = "Connection to Marionette server is lost. Check gecko.log (desktop firefox) or logcat (b2g) for errors."
 
     def __init__(self, addr, port, socket_timeout=360.0):
-        """If `socket_timeout` is `0` or `0.0`, non-blocking socket mode
-        will be used.  Setting it to `1` or `None` disables timeouts on
-        socket operations altogether.
-        """
         self.addr = addr
         self.port = port
         self.socket_timeout = socket_timeout
@@ -168,7 +164,7 @@ class TcpTransport(object):
         data = ""
         bytes_to_recv = 10
 
-        while self.socket_timeout is None or (time.time() - now < self.socket_timeout):
+        while time.time() - now < self.socket_timeout:
             try:
                 chunk = self.sock.recv(bytes_to_recv)
                 data += chunk

From a885a7ea868a2dddfe2312af881ce815e1fdf268 Mon Sep 17 00:00:00 2001
From: Wes Kocher 
Date: Tue, 19 Jan 2016 18:26:50 -0800
Subject: [PATCH 111/119] Backed out changeset da8006976f16 (bug 1240751) for
 b2g xpcshell failures CLOSED TREE

---
 testing/marionette/moz.build | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/testing/marionette/moz.build b/testing/marionette/moz.build
index fc7eb048f2a..0c87f1e9ac6 100644
--- a/testing/marionette/moz.build
+++ b/testing/marionette/moz.build
@@ -1,10 +1,9 @@
+# -*- 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/.
 
-DIRS += ["components", "atoms"]
+DIRS += ['components', 'atoms']
 
-JAR_MANIFESTS += ["jar.mn"]
-
-with Files("**"):
-    BUG_COMPONENT = ("Testing", "Marionette")
+JAR_MANIFESTS += ['jar.mn']

From 153a7ce5de2bd88e0085d979c695690ff516148e Mon Sep 17 00:00:00 2001
From: Wes Kocher 
Date: Tue, 19 Jan 2016 18:26:54 -0800
Subject: [PATCH 112/119] Backed out changeset f3011bfcf124 (bug 1240576) for
 b2g xpcshell failures CLOSED TREE

---
 testing/marionette/actions.js                 | 18 ++---
 .../client/marionette/marionette_test.py      |  4 +-
 .../marionette/runner/mixins/browsermob.py    | 11 ++-
 .../tests/unit/test_getactiveframe_oop.py     | 59 +++++++++------
 .../marionette/tests/unit/test_proxy.py       |  2 +-
 .../tests/unit/test_switch_remote_frame.py    | 72 +++++++++++--------
 .../components/marionettecomponent.js         | 17 +++--
 testing/marionette/dispatcher.js              |  1 -
 testing/marionette/driver.js                  | 50 +++++++------
 .../driver/marionette_driver/marionette.py    | 47 +++++++++---
 testing/marionette/server.js                  | 13 ++--
 11 files changed, 175 insertions(+), 119 deletions(-)

diff --git a/testing/marionette/actions.js b/testing/marionette/actions.js
index a93594d5906..f96c4f60469 100644
--- a/testing/marionette/actions.js
+++ b/testing/marionette/actions.js
@@ -2,13 +2,6 @@
  * 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/. */
 
-var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-
-Cu.import("resource://gre/modules/Preferences.jsm");
-
-var CONTEXT_MENU_DELAY_PREF = "ui.click_hold_context_menus.delay";
-var DEFAULT_CONTEXT_MENU_DELAY = 750;  // ms
-
 this.EXPORTED_SYMBOLS = ["ActionChain"];
 
 /**
@@ -25,7 +18,8 @@ this.ActionChain = function(utils, checkForInterrupted) {
   this.scrolling = false;
   // whether to send mouse event
   this.mouseEventsOnly = false;
-  this.checkTimer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
+  this.checkTimer = Components.classes["@mozilla.org/timer;1"]
+      .createInstance(Components.interfaces.nsITimer);
 
   // callbacks for command completion
   this.onSuccess = null;
@@ -264,9 +258,10 @@ ActionChain.prototype.actions = function(chain, touchId, i, keyModifiers) {
         let time = pack[1] * 1000;
 
         // standard waiting time to fire contextmenu
-        let standard = Preferences.get(
-            CONTEXT_MENU_DELAY_PREF,
-            DEFAULT_CONTEXT_MENU_DELAY);
+        let standard = 750;
+        try {
+          standard = Services.prefs.getIntPref("ui.click_hold_context_menus.delay");
+        } catch (e) {}
 
         if (time >= standard && this.isTap) {
           chain.splice(i, 0, ["longPress"], ["wait", (time - standard) / 1000]);
@@ -302,6 +297,7 @@ ActionChain.prototype.actions = function(chain, touchId, i, keyModifiers) {
           keyModifiers);
       this.actions(chain, touchId, i, keyModifiers);
       break;
+
   }
 };
 
diff --git a/testing/marionette/client/marionette/marionette_test.py b/testing/marionette/client/marionette/marionette_test.py
index 85b17ae279f..92c026bef7f 100644
--- a/testing/marionette/client/marionette/marionette_test.py
+++ b/testing/marionette/client/marionette/marionette_test.py
@@ -552,8 +552,8 @@ setReq.onerror = function() {
         self.marionette.set_context("chrome")
         self.marionette.execute_script("""
             let SECURITY_PREF = "security.turn_off_all_security_so_that_viruses_can_take_over_this_computer";
-            Components.utils.import("resource://gre/modules/Preferences.jsm");
-            Preferences.set(SECURITY_PREF, true);
+            Components.utils.import("resource://gre/modules/Services.jsm");
+            Services.prefs.setBoolPref(SECURITY_PREF, true);
 
             if (!testUtils.hasOwnProperty("specialPowersObserver")) {
               let loader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
diff --git a/testing/marionette/client/marionette/runner/mixins/browsermob.py b/testing/marionette/client/marionette/runner/mixins/browsermob.py
index c45b2878a3e..ea10ab4403a 100644
--- a/testing/marionette/client/marionette/runner/mixins/browsermob.py
+++ b/testing/marionette/client/marionette/runner/mixins/browsermob.py
@@ -48,12 +48,11 @@ class BrowserMobProxyTestCaseMixin(object):
         client = self.browsermob_server.create_proxy()
         with self.marionette.using_context('chrome'):
             self.marionette.execute_script("""
-                Components.utils.import("resource://gre/modules/Preferences.jsm");
-                Preferences.set("network.proxy.type", 1);
-                Preferences.set("network.proxy.http", "localhost");
-                Preferences.set("network.proxy.http_port", %(port)s);
-                Preferences.set("network.proxy.ssl", "localhost");
-                Preferences.set("network.proxy.ssl_port", %(port)s);
+                Services.prefs.setIntPref('network.proxy.type', 1);
+                Services.prefs.setCharPref('network.proxy.http', 'localhost');
+                Services.prefs.setIntPref('network.proxy.http_port', %(port)s);
+                Services.prefs.setCharPref('network.proxy.ssl', 'localhost');
+                Services.prefs.setIntPref('network.proxy.ssl_port', %(port)s);
             """ % {"port": client.port})
         return client
 
diff --git a/testing/marionette/client/marionette/tests/unit/test_getactiveframe_oop.py b/testing/marionette/client/marionette/tests/unit/test_getactiveframe_oop.py
index 25762b3f6c1..ae0c97367eb 100644
--- a/testing/marionette/client/marionette/tests/unit/test_getactiveframe_oop.py
+++ b/testing/marionette/client/marionette/tests/unit/test_getactiveframe_oop.py
@@ -6,30 +6,28 @@ from marionette import MarionetteTestCase
 from marionette_driver.by import By
 
 
-OOP_BY_DEFAULT = "dom.ipc.browser_frames.oop_by_default"
-BROWSER_FRAMES_ENABLED = "dom.mozBrowserFramesEnabeld"
-
-
 class TestGetActiveFrameOOP(MarionetteTestCase):
     def setUp(self):
         super(TestGetActiveFrameOOP, self).setUp()
-        with self.marionette.using_context("chrome"):
-            self.oop_by_default = self.marionette.get_pref(OOP_BY_DEFAULT)
-            self.mozBrowserFramesEnabled = self.marionette.get_pref(BROWSER_FRAMES_ENABLED)
-            self.marionette.set_pref(OOP_BY_DEFAULT, True)
-            self.marionette.set_pref(BROWSER_FRAMES_ENABLED, True)
-
-    def tearDown(self):
-        with self.marionette.using_context("chrome"):
-            if self.oop_by_default is None:
-                self.marionette.clear_pref(OOP_BY_DEFAULT)
-            else:
-                self.marionette.set_pref(OOP_BY_DEFAULT, self.oop_by_default)
-
-            if self.mozBrowserFramesEnabled is None:
-                self.marionette.clear_pref(BROWSER_FRAMES_ENABLED)
-            else:
-                self.marionette.set_pref(BROWSER_FRAMES_ENABLED, self.mozBrowserFramesEnabled)
+        with self.marionette.using_context('chrome'):
+            self.oop_by_default = self.marionette.execute_script("""
+                try {
+                  return Services.prefs.getBoolPref('dom.ipc.browser_frames.oop_by_default');
+                }
+                catch(e) {}
+                """)
+            self.mozBrowserFramesEnabled = self.marionette.execute_script("""
+                try {
+                  return Services.prefs.getBoolPref('dom.mozBrowserFramesEnabled');
+                }
+                catch(e) {}
+                """)
+            self.marionette.execute_script("""
+                Services.prefs.setBoolPref('dom.ipc.browser_frames.oop_by_default', true);
+                """)
+            self.marionette.execute_script("""
+                Services.prefs.setBoolPref('dom.mozBrowserFramesEnabled', true);
+                """)
 
     def test_active_frame_oop(self):
         self.marionette.navigate(self.marionette.absolute_url("test.html"))
@@ -96,3 +94,22 @@ class TestGetActiveFrameOOP(MarionetteTestCase):
         # on a b2g device, the contents do appear
         # print self.marionette.get_url()
         # print self.marionette.page_source
+
+    def tearDown(self):
+        with self.marionette.using_context('chrome'):
+            if self.oop_by_default is None:
+                self.marionette.execute_script("""
+                    Services.prefs.clearUserPref('dom.ipc.browser_frames.oop_by_default');
+                    """)
+            else:
+                self.marionette.execute_script("""
+                    Services.prefs.setBoolPref('dom.ipc.browser_frames.oop_by_default', %s);
+                    """ % 'true' if self.oop_by_default else 'false')
+            if self.mozBrowserFramesEnabled is None:
+                self.marionette.execute_script("""
+                    Services.prefs.clearUserPref('dom.mozBrowserFramesEnabled');
+                    """)
+            else:
+                self.marionette.execute_script("""
+                    Services.prefs.setBoolPref('dom.mozBrowserFramesEnabled', %s);
+                    """ % 'true' if self.mozBrowserFramesEnabled else 'false')
diff --git a/testing/marionette/client/marionette/tests/unit/test_proxy.py b/testing/marionette/client/marionette/tests/unit/test_proxy.py
index e23ea8fd4fa..ee4b0ea51ad 100644
--- a/testing/marionette/client/marionette/tests/unit/test_proxy.py
+++ b/testing/marionette/client/marionette/tests/unit/test_proxy.py
@@ -225,7 +225,7 @@ class TestProxy(MarionetteTestCase):
             self.marionette.start_session(capabilities)
             self.fail("We should have started a session because proxy should be a dict")
         except InvalidArgumentException as e:
-            assert e.msg == "Value of 'proxy' should be an object"
+            assert e.msg == "the value of 'proxy' should be an object"
 
     def test_proxy_is_passed_in_with_no_proxy_doesnt_set_it(self):
         capabilities = {"requiredCapabilities":
diff --git a/testing/marionette/client/marionette/tests/unit/test_switch_remote_frame.py b/testing/marionette/client/marionette/tests/unit/test_switch_remote_frame.py
index 45e1f86b6e0..4481a3f56d5 100644
--- a/testing/marionette/client/marionette/tests/unit/test_switch_remote_frame.py
+++ b/testing/marionette/client/marionette/tests/unit/test_switch_remote_frame.py
@@ -5,18 +5,26 @@
 from marionette import MarionetteTestCase
 
 
-OOP_BY_DEFAULT = "dom.ipc.browser_frames.oop_by_default"
-BROWSER_FRAMES_ENABLED = "dom.mozBrowserFramesEnabled"
-
-
 class TestSwitchRemoteFrame(MarionetteTestCase):
     def setUp(self):
         super(TestSwitchRemoteFrame, self).setUp()
         with self.marionette.using_context('chrome'):
-            self.oop_by_default = self.marionette.get_pref(OOP_BY_DEFAULT)
-            self.mozBrowserFramesEnabled = self.marionette.get_pref(BROWSER_FRAMES_ENABLED)
-            self.marionette.set_pref(OOP_BY_DEFAULT, True)
-            self.marionette.set_pref(BROWSER_FRAMES_ENABLED, True)
+            self.oop_by_default = self.marionette.execute_script("""
+                try {
+                  return Services.prefs.getBoolPref('dom.ipc.browser_frames.oop_by_default');
+                }
+                catch(e) {}
+                """)
+            self.mozBrowserFramesEnabled = self.marionette.execute_script("""
+                try {
+                  return Services.prefs.getBoolPref('dom.mozBrowserFramesEnabled');
+                }
+                catch(e) {}
+                """)
+            self.marionette.execute_script("""
+                Services.prefs.setBoolPref("dom.ipc.browser_frames.oop_by_default", true);
+                Services.prefs.setBoolPref("dom.mozBrowserFramesEnabled", true);
+                """)
 
             self.multi_process_browser = self.marionette.execute_script("""
                 try {
@@ -25,25 +33,12 @@ class TestSwitchRemoteFrame(MarionetteTestCase):
                   return false;
                 }""")
 
-    def tearDown(self):
-        with self.marionette.using_context("chrome"):
-            if self.oop_by_default is None:
-                self.marionette.clear_pref(OOP_BY_DEFAULT)
-            else:
-                self.marionette.set_pref(OOP_BY_DEFAULT, self.oop_by_default)
-
-            if self.mozBrowserFramesEnabled is None:
-                self.marionette.clear_pref(BROWSER_FRAMES_ENABLED)
-            else:
-                self.marionette.set_pref(BROWSER_FRAMES_ENABLED, self.mozBrowserFramesEnabled)
-
-    @property
     def is_main_process(self):
         return self.marionette.execute_script("""
             return Components.classes["@mozilla.org/xre/app-info;1"].
                 getService(Components.interfaces.nsIXULRuntime).
                 processType == Components.interfaces.nsIXULRuntime.PROCESS_TYPE_DEFAULT;
-        """, sandbox="system")
+        """, sandbox='system')
 
     def test_remote_frame(self):
         self.marionette.navigate(self.marionette.absolute_url("test.html"))
@@ -60,7 +55,7 @@ class TestSwitchRemoteFrame(MarionetteTestCase):
             """ % self.marionette.absolute_url("test.html"))
         remote_iframe = self.marionette.find_element("id", "remote_iframe")
         self.marionette.switch_to_frame(remote_iframe)
-        main_process = self.is_main_process
+        main_process = self.is_main_process()
         self.assertFalse(main_process)
 
     def test_remote_frame_revisit(self):
@@ -79,15 +74,15 @@ class TestSwitchRemoteFrame(MarionetteTestCase):
             """ % self.marionette.absolute_url("test.html"))
         self.marionette.switch_to_frame(self.marionette.find_element("id",
                                                                      "remote_iframe"))
-        main_process = self.is_main_process
+        main_process = self.is_main_process()
         self.assertFalse(main_process)
         self.marionette.switch_to_frame()
-        main_process = self.is_main_process
+        main_process = self.is_main_process()
         should_be_main_process = not self.multi_process_browser
         self.assertEqual(main_process, should_be_main_process)
         self.marionette.switch_to_frame(self.marionette.find_element("id",
                                                                      "remote_iframe"))
-        main_process = self.is_main_process
+        main_process = self.is_main_process()
         self.assertFalse(main_process)
 
     def test_we_can_switch_to_a_remote_frame_by_index(self):
@@ -105,12 +100,31 @@ class TestSwitchRemoteFrame(MarionetteTestCase):
             document.body.appendChild(iframe);
             """ % self.marionette.absolute_url("test.html"))
         self.marionette.switch_to_frame(0)
-        main_process = self.is_main_process
+        main_process = self.is_main_process()
         self.assertFalse(main_process)
         self.marionette.switch_to_frame()
-        main_process = self.is_main_process
+        main_process = self.is_main_process()
         should_be_main_process = not self.multi_process_browser
         self.assertEqual(main_process, should_be_main_process)
         self.marionette.switch_to_frame(0)
-        main_process = self.is_main_process
+        main_process = self.is_main_process()
         self.assertFalse(main_process)
+
+    def tearDown(self):
+        with self.marionette.using_context('chrome'):
+            if self.oop_by_default is None:
+                self.marionette.execute_script("""
+                    Services.prefs.clearUserPref('dom.ipc.browser_frames.oop_by_default');
+                    """)
+            else:
+                self.marionette.execute_async_script(
+                    "Services.prefs.setBoolPref('dom.ipc.browser_frames.oop_by_default', %s);" %
+                    ('true' if self.oop_by_default else 'false'))
+            if self.mozBrowserFramesEnabled is None:
+                self.marionette.execute_script("""
+                    Services.prefs.clearUserPref('dom.mozBrowserFramesEnabled');
+                    """)
+            else:
+                self.marionette.execute_async_script(
+                    "Services.prefs.setBoolPref('dom.mozBrowserFramesEnabled', %s);" %
+                    ('true' if self.mozBrowserFramesEnabled else 'false'))
diff --git a/testing/marionette/components/marionettecomponent.js b/testing/marionette/components/marionettecomponent.js
index 0932fb1dd10..2d91d3989e2 100644
--- a/testing/marionette/components/marionettecomponent.js
+++ b/testing/marionette/components/marionettecomponent.js
@@ -110,7 +110,9 @@ MarionetteComponent.prototype.observe = function(subj, topic, data) {
       // so we wait for that by adding an observer here.
       this.observerService.addObserver(this, "final-ui-startup", false);
 #ifdef ENABLE_MARIONETTE
-      this.enabled = Preferences.get(ENABLED_PREF, false);
+      try {
+        this.enabled = Services.prefs.getBoolPref(ENABLED_PREF);
+      } catch(e) {}
       if (this.enabled) {
         this.logger.debug("Marionette enabled via build flag and pref");
 
@@ -163,9 +165,11 @@ MarionetteComponent.prototype.init = function() {
 
   this.loaded_ = true;
 
-  let forceLocal = Preferences.get(FORCELOCAL_PREF,
-      Services.appinfo.name == "B2G" ? false : true);
-  Preferences.set(FORCELOCAL_PREF, forceLocal);
+  let forceLocal = Services.appinfo.name == "B2G" ? false : true;
+  try {
+    forceLocal = Services.prefs.getBoolPref(FORCELOCAL_PREF);
+  } catch (e) {}
+  Services.prefs.setBoolPref(FORCELOCAL_PREF, forceLocal);
 
   if (!forceLocal) {
     // See bug 800138.  Because the first socket that opens with
@@ -178,7 +182,10 @@ MarionetteComponent.prototype.init = function() {
     insaneSacrificialGoat.asyncListen(this);
   }
 
-  let port = Preferences.get(PORT_PREF, DEFAULT_PORT);
+  let port = DEFAULT_PORT;
+  try {
+    port = Services.prefs.getIntPref(PORT_PREF);
+  } catch (e) {}
 
   let s;
   try {
diff --git a/testing/marionette/dispatcher.js b/testing/marionette/dispatcher.js
index 26c3726724b..495b0e84ad8 100644
--- a/testing/marionette/dispatcher.js
+++ b/testing/marionette/dispatcher.js
@@ -7,7 +7,6 @@
 const {interfaces: Ci, utils: Cu} = Components;
 
 Cu.import("resource://gre/modules/Log.jsm");
-Cu.import("resource://gre/modules/Preferences.jsm");
 Cu.import("resource://gre/modules/Task.jsm");
 
 Cu.import("chrome://marionette/content/driver.js");
diff --git a/testing/marionette/driver.js b/testing/marionette/driver.js
index 3054c0f5c00..589cf7fb742 100644
--- a/testing/marionette/driver.js
+++ b/testing/marionette/driver.js
@@ -12,7 +12,6 @@ var loader = Cc["@mozilla.org/moz/jssubscript-loader;1"]
 Cu.import("resource://gre/modules/FileUtils.jsm");
 Cu.import("resource://gre/modules/Log.jsm");
 Cu.import("resource://gre/modules/NetUtil.jsm");
-Cu.import("resource://gre/modules/Preferences.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/Task.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
@@ -366,9 +365,9 @@ GeckoDriver.prototype.whenBrowserStarted = function(win, isNewSession) {
       }
     }
 
-    if (!Preferences.get(CONTENT_LISTENER_PREF) || !isNewSession) {
+    if (!Services.prefs.getBoolPref("marionette.contentListener") || !isNewSession) {
       mm.loadFrameScript(FRAME_SCRIPT, true, true);
-      Preferences.set(CONTENT_LISTENER_PREF, true);
+      Services.prefs.setBoolPref("marionette.contentListener", true);
     }
   } catch (e) {
     // there may not always be a content process
@@ -544,7 +543,10 @@ GeckoDriver.prototype.newSession = function(cmd, resp) {
       };
       win.addEventListener("load", listener, true);
     } else {
-      let clickToStart = Preferences.get(CLICK_TO_START_PREF);
+      let clickToStart;
+      try {
+        clickToStart = Services.prefs.getBoolPref(CLICK_TO_START_PREF);
+      } catch (e) {}
       if (clickToStart && (this.appName != "B2G")) {
         let pService = Cc["@mozilla.org/embedcomp/prompt-service;1"]
             .getService(Ci.nsIPromptService);
@@ -555,7 +557,7 @@ GeckoDriver.prototype.newSession = function(cmd, resp) {
   };
 
   let runSessionStart = function() {
-    if (!Preferences.get(CONTENT_LISTENER_PREF)) {
+    if (!Services.prefs.getBoolPref(CONTENT_LISTENER_PREF)) {
       waitForWindow.call(this);
     } else if (this.appName != "Firefox" && this.curBrowser === null) {
       // if there is a content listener, then we just wake it up
@@ -670,49 +672,45 @@ GeckoDriver.prototype.setSessionCapabilities = function(newCaps) {
 };
 
 GeckoDriver.prototype.setUpProxy = function(proxy) {
-  logger.config("User-provided proxy settings: " + JSON.stringify(proxy));
+  logger.debug("User-provided proxy settings: " + JSON.stringify(proxy));
 
   if (typeof proxy == "object" && proxy.hasOwnProperty("proxyType")) {
     switch (proxy.proxyType.toUpperCase()) {
       case "MANUAL":
-        Preferences.set("network.proxy.type", 1);
+        Services.prefs.setIntPref("network.proxy.type", 1);
         if (proxy.httpProxy && proxy.httpProxyPort){
-          Preferences.set("network.proxy.http", proxy.httpProxy);
-          Preferences.set("network.proxy.http_port", proxy.httpProxyPort);
+          Services.prefs.setCharPref("network.proxy.http", proxy.httpProxy);
+          Services.prefs.setIntPref("network.proxy.http_port", proxy.httpProxyPort);
         }
         if (proxy.sslProxy && proxy.sslProxyPort){
-          Preferences.set("network.proxy.ssl", proxy.sslProxy);
-          Preferences.set("network.proxy.ssl_port", proxy.sslProxyPort);
+          Services.prefs.setCharPref("network.proxy.ssl", proxy.sslProxy);
+          Services.prefs.setIntPref("network.proxy.ssl_port", proxy.sslProxyPort);
         }
         if (proxy.ftpProxy && proxy.ftpProxyPort) {
-          Preferences.set("network.proxy.ftp", proxy.ftpProxy);
-          Preferences.set("network.proxy.ftp_port", proxy.ftpProxyPort);
+          Services.prefs.setCharPref("network.proxy.ftp", proxy.ftpProxy);
+          Services.prefs.setIntPref("network.proxy.ftp_port", proxy.ftpProxyPort);
         }
         if (proxy.socksProxy) {
-          Preferences.set("network.proxy.socks", proxy.socksProxy);
-          Preferences.set("network.proxy.socks_port", proxy.socksProxyPort);
+          Services.prefs.setCharPref("network.proxy.socks", proxy.socksProxy);
+          Services.prefs.setIntPref("network.proxy.socks_port", proxy.socksProxyPort);
           if (proxy.socksVersion) {
-            Preferences.set("network.proxy.socks_version", proxy.socksVersion);
+            Services.prefs.setIntPref("network.proxy.socks_version", proxy.socksVersion);
           }
         }
         break;
-
       case "PAC":
-        Preferences.set("network.proxy.type", 2);
-        Preferences.set("network.proxy.autoconfig_url", proxy.pacUrl);
+        Services.prefs.setIntPref("network.proxy.type", 2);
+        Services.prefs.setCharPref("network.proxy.autoconfig_url", proxy.pacUrl);
         break;
-
       case "AUTODETECT":
-        Preferences.set("network.proxy.type", 4);
+        Services.prefs.setIntPref("network.proxy.type", 4);
         break;
-
       case "SYSTEM":
-        Preferences.set("network.proxy.type", 5);
+        Services.prefs.setIntPref("network.proxy.type", 5);
         break;
-
       case "NOPROXY":
       default:
-        Preferences.set("network.proxy.type", 0);
+        Services.prefs.setIntPref("network.proxy.type", 0);
     }
   } else {
     throw new InvalidArgumentError("Value of 'proxy' should be an object");
@@ -2452,7 +2450,7 @@ GeckoDriver.prototype.sessionTearDown = function(cmd, resp) {
           this.curBrowser.knownFrames.indexOf(this.curBrowser.mainContentId), 1);
     } else {
       // don't set this pref for B2G since the framescript can be safely reused
-      Preferences.set(CONTENT_LISTENER_PREF, false);
+      Services.prefs.setBoolPref("marionette.contentListener", false);
     }
 
     // delete session in each frame in each browser
diff --git a/testing/marionette/driver/marionette_driver/marionette.py b/testing/marionette/driver/marionette_driver/marionette.py
index 6ad1a707c57..e935da32d88 100644
--- a/testing/marionette/driver/marionette_driver/marionette.py
+++ b/testing/marionette/driver/marionette_driver/marionette.py
@@ -967,26 +967,39 @@ class Marionette(object):
                 self.push_permission(perm, original_perms[perm])
 
     def get_pref(self, pref):
-        """Gets the preference value.
+        '''Gets the preference value.
 
         :param pref: Name of the preference.
 
         Usage example::
 
-            marionette.get_pref("browser.tabs.warnOnClose")
-        """
+          marionette.get_pref('browser.tabs.warnOnClose')
+
+        '''
         with self.using_context(self.CONTEXT_CONTENT):
             pref_value = self.execute_script("""
-                Components.utils.import("resource://gre/modules/Preferences.jsm");
-                return Preferences.get(arguments[0], null);
-                """, script_args=[pref], sandbox="system")
+                Components.utils.import("resource://gre/modules/Services.jsm");
+                let pref = arguments[0];
+                let type = Services.prefs.getPrefType(pref);
+                switch (type) {
+                    case Services.prefs.PREF_STRING:
+                        return Services.prefs.getCharPref(pref);
+                    case Services.prefs.PREF_INT:
+                        return Services.prefs.getIntPref(pref);
+                    case Services.prefs.PREF_BOOL:
+                        return Services.prefs.getBoolPref(pref);
+                    case Services.prefs.PREF_INVALID:
+                        return null;
+                }
+                """, script_args=[pref], sandbox='system')
             return pref_value
 
     def clear_pref(self, pref):
         with self.using_context(self.CONTEXT_CHROME):
             self.execute_script("""
-               Components.utils.import("resource://gre/modules/Preferences.jsm");
-               Preferences.reset(arguments[0]);
+               Components.utils.import("resource://gre/modules/Services.jsm");
+               let pref = arguments[0];
+               Services.prefs.clearUserPref(pref);
                """, script_args=[pref])
 
     def set_pref(self, pref, value):
@@ -995,10 +1008,22 @@ class Marionette(object):
                 self.clear_pref(pref)
                 return
 
+            if isinstance(value, bool):
+                func = 'setBoolPref'
+            elif isinstance(value, (int, long)):
+                func = 'setIntPref'
+            elif isinstance(value, basestring):
+                func = 'setCharPref'
+            else:
+                raise errors.MarionetteException(
+                    "Unsupported preference type: %s" % type(value))
+
             self.execute_script("""
-                Components.utils.import("resource://gre/modules/Preferences.jsm");
-                Preferences.set(arguments[0], arguments[1]);
-                """, script_args=[pref, value])
+                Components.utils.import("resource://gre/modules/Services.jsm");
+                let pref = arguments[0];
+                let value = arguments[1];
+                Services.prefs.%s(pref, value);
+                """ % func, script_args=[pref, value])
 
     def set_prefs(self, prefs):
         '''Sets preferences.
diff --git a/testing/marionette/server.js b/testing/marionette/server.js
index 492291d2bb3..44c4e80cb32 100644
--- a/testing/marionette/server.js
+++ b/testing/marionette/server.js
@@ -10,7 +10,6 @@ var loader = Cc["@mozilla.org/moz/jssubscript-loader;1"].getService(Ci.mozIJSSub
 const ServerSocket = CC("@mozilla.org/network/server-socket;1", "nsIServerSocket", "initSpecialConnection");
 
 Cu.import("resource://gre/modules/Log.jsm");
-Cu.import("resource://gre/modules/Preferences.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 
 Cu.import("chrome://marionette/content/dispatcher.js");
@@ -30,9 +29,7 @@ loader.loadSubScript("chrome://marionette/content/frame-manager.js");
 const logger = Log.repository.getLogger("Marionette");
 
 this.EXPORTED_SYMBOLS = ["MarionetteServer"];
-
 const CONTENT_LISTENER_PREF = "marionette.contentListener";
-const MANAGE_OFFLINE_STATUS_PREF = "network.gonk.manage-offline-status";
 
 /**
  * Bootstraps Marionette and handles incoming client connections.
@@ -87,11 +84,11 @@ MarionetteServer.prototype.driverFactory = function(emulator) {
     device = "desktop";
   }
 
-  Preferences.set(CONTENT_LISTENER_PREF, false);
+  Services.prefs.setBoolPref(CONTENT_LISTENER_PREF, false);
 
   if (bypassOffline) {
     logger.debug("Bypassing offline status");
-    Preferences.set(MANAGE_OFFLINE_STATUS_PREF, false);
+    Services.prefs.setBoolPref("network.gonk.manage-offline-status", false);
     Services.io.manageOfflineStatus = false;
     Services.io.offline = false;
   }
@@ -149,5 +146,9 @@ MarionetteServer.prototype.onConnectionClosed = function(conn) {
 };
 
 function isMulet() {
-  return Preferences.get("b2g.is_mulet", false);
+  try {
+    return Services.prefs.getBoolPref("b2g.is_mulet");
+  } catch (e) {
+    return false;
+  }
 }

From a5d1502617920c9d4dde9131e2798105799f22cb Mon Sep 17 00:00:00 2001
From: Phil Ringnalda 
Date: Tue, 19 Jan 2016 20:17:20 -0800
Subject: [PATCH 113/119] Back out 604c30246eeb (bug 1180942) for Linux reftest
 OOMs in 632781-verybig.html CLOSED TREE

---
 dom/canvas/test/test_canvas.html                | 17 ++++++++++++++++-
 gfx/thebes/gfxPrefs.h                           |  2 +-
 layout/reftests/border-image/reftest.list       |  2 +-
 layout/reftests/border-radius/reftest.list      |  8 ++++----
 layout/reftests/forms/input/color/reftest.list  |  2 +-
 layout/reftests/svg/reftest.list                |  2 +-
 layout/reftests/text/reftest.list               |  2 +-
 ...nvas_complexshapes_beziercurveto_001.htm.ini |  4 ----
 .../path-objects/2d.path.arc.shape.1.html.ini   |  9 +++++++++
 9 files changed, 34 insertions(+), 14 deletions(-)
 create mode 100644 testing/web-platform/meta/2dcontext/path-objects/2d.path.arc.shape.1.html.ini

diff --git a/dom/canvas/test/test_canvas.html b/dom/canvas/test/test_canvas.html
index 3f64b6f5044..a8b67b3e209 100644
--- a/dom/canvas/test/test_canvas.html
+++ b/dom/canvas/test/test_canvas.html
@@ -11265,7 +11265,22 @@ isPixel(ctx, 50,25, 0,255,0,255, 0);
 isPixel(ctx, 1,1, 0,255,0,255, 0);
 isPixel(ctx, 98,1, 0,255,0,255, 0);
 isPixel(ctx, 1,48, 0,255,0,255, 0);
-isPixel(ctx, 20,48, 0,255,0,255, 0);
+// Fails on Linux with Azure/Cairo only
+// The arc is drawn badly due to Cairo limitations, the error only becomes
+// apparent on Linux because of anti-aliasing, probably due to X.
+// The limitation is that Cairo draws arcs by stroking perpendicular to the arc,
+// and at very large stroke thicknesses, this becomes a fan. Where exactly the
+// 'blades' of the fan appear seems to depend on exactly how the arc is defined
+// and the platform. So if the blades of the fan are where pixels are tested it
+// passes the test, if the testing pixels fall in between the blades, then we fail.
+// With Thebes/Cairo, we were rendering wrong, but got lucky with the test, now
+// we are not so lucky.
+// Bug 764125
+if (IsAzureCairo() && IsLinux()) {
+    todo_isPixel(ctx, 20,48, 0,255,0,255, 0);
+} else {
+    isPixel(ctx, 20,48, 0,255,0,255, 0);
+}
 isPixel(ctx, 98,48, 0,255,0,255, 0);
 
 }
diff --git a/gfx/thebes/gfxPrefs.h b/gfx/thebes/gfxPrefs.h
index e27a4b7db4e..1f603fee7df 100644
--- a/gfx/thebes/gfxPrefs.h
+++ b/gfx/thebes/gfxPrefs.h
@@ -373,7 +373,7 @@ private:
   DECL_GFX_PREF(Once, "layers.tiles.edge-padding",             TileEdgePaddingEnabled, bool, true);
   DECL_GFX_PREF(Live, "layers.transaction.warning-ms",         LayerTransactionWarning, uint32_t, 200);
   DECL_GFX_PREF(Once, "layers.uniformity-info",                UniformityInfo, bool, false);
-  DECL_GFX_PREF(Once, "layers.use-image-offscreen-surfaces",   UseImageOffscreenSurfaces, bool, true);
+  DECL_GFX_PREF(Once, "layers.use-image-offscreen-surfaces",   UseImageOffscreenSurfaces, bool, false);
   DECL_GFX_PREF(Live, "layers.single-tile.enabled",            LayersSingleTileEnabled, bool, true);
 
   DECL_GFX_PREF(Live, "layout.css.scroll-behavior.damping-ratio", ScrollBehaviorDampingRatio, float, 1.0f);
diff --git a/layout/reftests/border-image/reftest.list b/layout/reftests/border-image/reftest.list
index 54453f2fb0e..67a3aedd4e4 100644
--- a/layout/reftests/border-image/reftest.list
+++ b/layout/reftests/border-image/reftest.list
@@ -54,7 +54,7 @@ fuzzy(1,12) == border-image-linear-gradient-repeat-repeat-1.html border-image-li
 fuzzy(1,13) == border-image-linear-gradient-repeat-round-1.html border-image-linear-gradient-repeat-round-1-ref.html
 == border-image-linear-gradient-repeat-repeat-2.html border-image-linear-gradient-repeat-repeat-2-ref.html
 fuzzy(1,576) == border-image-linear-gradient-repeat-round-2.html border-image-linear-gradient-repeat-round-2-ref.html
-fuzzy(1,8533) == border-image-linear-gradient-repeat-repeat-3.html border-image-linear-gradient-repeat-repeat-3-ref.html
+fuzzy(1,6440) == border-image-linear-gradient-repeat-repeat-3.html border-image-linear-gradient-repeat-repeat-3-ref.html
 fuzzy(1,7161) == border-image-linear-gradient-repeat-round-3.html border-image-linear-gradient-repeat-round-3-ref.html
 
 == border-image-radial-gradient.html border-image-radial-gradient-ref.html
diff --git a/layout/reftests/border-radius/reftest.list b/layout/reftests/border-radius/reftest.list
index ccff157ca61..7bdb35dca37 100644
--- a/layout/reftests/border-radius/reftest.list
+++ b/layout/reftests/border-radius/reftest.list
@@ -24,12 +24,12 @@
 
 # more serious tests, using SVG reference
 == border-circle-2.html border-circle-2-ref.xhtml
-fuzzy-if(gtkWidget,14,280) fuzzy-if(cocoaWidget,4,582) fuzzy-if(Android||B2G,36,264) fuzzy-if(d2d,51,323) fuzzy-if(winWidget&&!d2d,16,377) == curved-stripe-border.html curved-stripe-border-ref.svg # bug 459945
+fuzzy-if(gtkWidget,7,437) fuzzy-if(cocoaWidget,4,582) fuzzy-if(Android||B2G,36,264) fuzzy-if(d2d,51,323) fuzzy-if(winWidget&&!d2d,16,377) == curved-stripe-border.html curved-stripe-border-ref.svg # bug 459945
 
 # Corners
 == corner-1.html corner-1-ref.svg # bottom corners different radius than top corners
-fuzzy-if(gtkWidget,23,5) fuzzy-if(winWidget&&!d2d,23,5) fuzzy-if(d2d,32,8) fuzzy-if(Android||B2G,10,8) == corner-2.html corner-2-ref.svg # right corners different radius than left corners; see bug 500804
-fuzzy-if(gtkWidget,3,10) fuzzy-if(winWidget&&!d2d,3,10) fuzzy-if(d2d,15,32) fuzzy-if(Android||B2G,3,15) == corner-3.html corner-3-ref.svg
+fuzzy-if(winWidget&&!d2d,23,5) fuzzy-if(d2d,32,8) fuzzy-if(Android||B2G,10,8) == corner-2.html corner-2-ref.svg # right corners different radius than left corners; see bug 500804
+fuzzy-if(winWidget&&!d2d,3,10) fuzzy-if(d2d,15,32) fuzzy-if(Android||B2G,3,15) == corner-3.html corner-3-ref.svg
 == corner-4.html corner-4-ref.svg
 
 # Test that radii too long are reduced
@@ -87,7 +87,7 @@ skip-if(B2G||Mulet) fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu)||/^Windo
 == iframe-1.html iframe-1-ref.html
 
 # Test for antialiasing gaps between background and border
-fuzzy-if(gtkWidget,1,9) fuzzy-if(winWidget&&!d2d,1,9) fuzzy-if(d2d,5,40) fuzzy-if(Android||B2G,1,5) == curved-border-background-nogap.html curved-border-background-nogap-ref.html
+fuzzy-if(winWidget&&!d2d,1,9) fuzzy-if(d2d,5,40) fuzzy-if(Android||B2G,1,5) == curved-border-background-nogap.html curved-border-background-nogap-ref.html
 
 == color-layer-1a.html color-layer-1-ref.html
 
diff --git a/layout/reftests/forms/input/color/reftest.list b/layout/reftests/forms/input/color/reftest.list
index 0a263064d06..48c8e11edcb 100644
--- a/layout/reftests/forms/input/color/reftest.list
+++ b/layout/reftests/forms/input/color/reftest.list
@@ -9,6 +9,6 @@ default-preferences pref(dom.forms.color,true)
 fails-if(B2G||Mulet||Android) == margin-padding-1.html margin-padding-1-ref.html # Initial mulet triage: parity with B2G/B2G Desktop
 == block-invalidate-1.html block-invalidate-1-ref.html
 == block-invalidate-2.html block-invalidate-2-ref.html
-fuzzy-if(gtkWidget,8,33) fails-if(B2G||Mulet||Android) == transformations-1.html transformations-1-ref.html # Initial mulet triage: parity with B2G/B2G Desktop
+fails-if(B2G||Mulet||Android) == transformations-1.html transformations-1-ref.html # Initial mulet triage: parity with B2G/B2G Desktop
 fails-if(B2G||Mulet||Android) == custom-style-1.html custom-style-1-ref.html # Initial mulet triage: parity with B2G/B2G Desktop
 fails-if(B2G||Mulet||Android) == custom-style-2.html custom-style-2-ref.html # Initial mulet triage: parity with B2G/B2G Desktop
diff --git a/layout/reftests/svg/reftest.list b/layout/reftests/svg/reftest.list
index 212c59c198a..14897338dfa 100644
--- a/layout/reftests/svg/reftest.list
+++ b/layout/reftests/svg/reftest.list
@@ -222,7 +222,7 @@ pref(layout.css.masking.enabled,true) fuzzy-if(d2d,1,6400) == mask-type-04.svg m
 == nested-viewBox-01.svg pass.svg
 == nesting-invalid-01.svg nesting-invalid-01-ref.svg
 fuzzy-if(d2d&&/^Windows\x20NT\x20(6\.1|10\.0)/.test(http.oscpu),63,168) fuzzy-if(cocoaWidget,1,122) == non-scaling-stroke-01.svg non-scaling-stroke-01-ref.svg # bug 1074161 for Win7 and OSX 10.8
-fuzzy-if(gtkWidget,1,99) fuzzy-if(!contentSameGfxBackendAsCanvas,9,99) fuzzy-if(Android||B2G,9,586) == non-scaling-stroke-02.svg non-scaling-stroke-02-ref.svg
+fuzzy-if(!contentSameGfxBackendAsCanvas,9,99) fuzzy-if(Android||B2G,9,586) == non-scaling-stroke-02.svg non-scaling-stroke-02-ref.svg
 == non-scaling-stroke-03.svg non-scaling-stroke-03-ref.svg
 == objectBoundingBox-and-clipPath.svg pass.svg
 # Bug 588684
diff --git a/layout/reftests/text/reftest.list b/layout/reftests/text/reftest.list
index a41999759fb..fab1274ef91 100644
--- a/layout/reftests/text/reftest.list
+++ b/layout/reftests/text/reftest.list
@@ -123,7 +123,7 @@ fails HTTP(..) == wordbreak-7b.html wordbreak-7b-ref.html # bug 479829
 pref(gfx.font_rendering.graphite.enabled,true) HTTP(..) == wordbreak-9.html wordbreak-9-ref.html
 == wordwrap-01.html wordwrap-01-ref.html
 HTTP(..) == wordwrap-02.html wordwrap-02-ref.html
-fuzzy-if(gtkWidget,1,44) skip-if(B2G||Mulet) HTTP(..) == wordwrap-03.html wordwrap-03-ref.html # Initial mulet triage: parity with B2G/B2G Desktop
+skip-if(B2G||Mulet) HTTP(..) == wordwrap-03.html wordwrap-03-ref.html # Initial mulet triage: parity with B2G/B2G Desktop
 == wordwrap-04.html wordwrap-04-ref.html
 == wordwrap-05.html wordwrap-05-ref.html
 == wordwrap-06.html wordwrap-06-ref.html
diff --git a/testing/web-platform/meta/2dcontext/building-paths/canvas_complexshapes_beziercurveto_001.htm.ini b/testing/web-platform/meta/2dcontext/building-paths/canvas_complexshapes_beziercurveto_001.htm.ini
index de46cf635e8..419938ab332 100644
--- a/testing/web-platform/meta/2dcontext/building-paths/canvas_complexshapes_beziercurveto_001.htm.ini
+++ b/testing/web-platform/meta/2dcontext/building-paths/canvas_complexshapes_beziercurveto_001.htm.ini
@@ -1,10 +1,6 @@
 [canvas_complexshapes_beziercurveto_001.htm]
   type: reftest
   expected:
-    if not debug and (os == "linux") and (version == "Ubuntu 12.04") and (processor == "x86") and (bits == 32): FAIL
-    if not debug and (os == "linux") and (version == "Ubuntu 12.04") and (processor == "x86_64") and (bits == 64): FAIL
-    if debug and (os == "linux") and (version == "Ubuntu 12.04") and (processor == "x86_64") and (bits == 64): FAIL
-    if debug and (os == "linux") and (version == "Ubuntu 12.04") and (processor == "x86") and (bits == 32): FAIL
     if not debug and (os == "mac") and (version == "OS X 10.8") and (processor == "x86_64") and (bits == 64): FAIL
     if not debug and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL
     if not debug and (os == "mac") and (version == "OS X 10.10.2") and (processor == "x86") and (bits == 32): FAIL
diff --git a/testing/web-platform/meta/2dcontext/path-objects/2d.path.arc.shape.1.html.ini b/testing/web-platform/meta/2dcontext/path-objects/2d.path.arc.shape.1.html.ini
new file mode 100644
index 00000000000..b27dcaf7fa9
--- /dev/null
+++ b/testing/web-platform/meta/2dcontext/path-objects/2d.path.arc.shape.1.html.ini
@@ -0,0 +1,9 @@
+[2d.path.arc.shape.1.html]
+  type: testharness
+  [arc() from 0 to pi does not draw anything in the wrong half]
+    expected:
+      if not debug and (os == "linux") and (version == "Ubuntu 12.04") and (processor == "x86") and (bits == 32): FAIL
+      if not debug and (os == "linux") and (version == "Ubuntu 12.04") and (processor == "x86_64") and (bits == 64): FAIL
+      if debug and (os == "linux") and (version == "Ubuntu 12.04") and (processor == "x86_64") and (bits == 64): FAIL
+      if debug and (os == "linux") and (version == "Ubuntu 12.04") and (processor == "x86") and (bits == 32): FAIL
+

From 5570ade1759ef340aae1e6c601a6d9d1fbb833d6 Mon Sep 17 00:00:00 2001
From: Jonathan Kew 
Date: Wed, 20 Jan 2016 08:50:32 +0000
Subject: [PATCH 114/119] Bug 1240007 - Update graphite2 library to release
 1.3.5. r=jdaggett

---
 gfx/graphite2/COPYING                  | 26 ++++++++++++++++++++++++++
 gfx/graphite2/README.mozilla           |  9 +++------
 gfx/graphite2/include/graphite2/Font.h |  2 +-
 gfx/graphite2/src/SegCacheEntry.cpp    |  7 +++----
 gfx/graphite2/src/Segment.cpp          | 16 +++++++++-------
 gfx/graphite2/src/inc/Segment.h        |  4 ++--
 6 files changed, 44 insertions(+), 20 deletions(-)
 create mode 100644 gfx/graphite2/COPYING

diff --git a/gfx/graphite2/COPYING b/gfx/graphite2/COPYING
new file mode 100644
index 00000000000..d40f2d84587
--- /dev/null
+++ b/gfx/graphite2/COPYING
@@ -0,0 +1,26 @@
+/*  GRAPHITE2 LICENSING
+
+    Copyright 2010, SIL International
+    All rights reserved.
+
+    This library is free software; you can redistribute it and/or modify
+    it under the terms of the GNU Lesser General Public License as published
+    by the Free Software Foundation; either version 2.1 of License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should also have received a copy of the GNU Lesser General Public
+    License along with this library in the file named "LICENSE".
+    If not, write to the Free Software Foundation, 51 Franklin Street, 
+    Suite 500, Boston, MA 02110-1335, USA or visit their web page on the 
+    internet at http://www.fsf.org/licenses/lgpl.html.
+
+    Alternatively, you may use this library under the terms of the Mozilla
+    Public License (http://mozilla.org/MPL) or under the GNU General Public
+    License, as published by the Free Sofware Foundation; either version
+    2 of the license or (at your option) any later version.
+*/
diff --git a/gfx/graphite2/README.mozilla b/gfx/graphite2/README.mozilla
index 8edf83bcc6e..9630ee7d5b0 100644
--- a/gfx/graphite2/README.mozilla
+++ b/gfx/graphite2/README.mozilla
@@ -1,6 +1,3 @@
-This directory contains the Graphite2 library release 1.3.4 from
-https://github.com/silnrsi/graphite/releases/download/1.3.4/graphite2-minimal-1.3.4.tgz
-See ./gfx/graphite2/moz-gr-update.sh for update procedure.
-
-Bug 1223002: Updated to upstream commit 6106dcbd5bc4df2e6ef6a7c632c69ca71ba2b518
-to fix recently-discovered fuzzbugs.
+This directory contains the Graphite2 library release 1.3.5 from
+https://github.com/silnrsi/graphite/releases/download/1.3.5/graphite2-minimal-1.3.5.tgz
+See gfx/graphite2/moz-gr-update.sh for update procedure.
diff --git a/gfx/graphite2/include/graphite2/Font.h b/gfx/graphite2/include/graphite2/Font.h
index e5b9aec2a6c..8c96ec3cc7b 100644
--- a/gfx/graphite2/include/graphite2/Font.h
+++ b/gfx/graphite2/include/graphite2/Font.h
@@ -30,7 +30,7 @@
 
 #define GR2_VERSION_MAJOR   1
 #define GR2_VERSION_MINOR   3
-#define GR2_VERSION_BUGFIX  4
+#define GR2_VERSION_BUGFIX  5
 
 #ifdef __cplusplus
 extern "C"
diff --git a/gfx/graphite2/src/SegCacheEntry.cpp b/gfx/graphite2/src/SegCacheEntry.cpp
index 9dc4c386b35..d35912d5aed 100644
--- a/gfx/graphite2/src/SegCacheEntry.cpp
+++ b/gfx/graphite2/src/SegCacheEntry.cpp
@@ -61,8 +61,7 @@ SegCacheEntry::SegCacheEntry(const uint16* cmapGlyphs, size_t length, Segment *
     }
     const Slot * slot = seg->first();
     m_glyph = new Slot[glyphCount];
-    int attrSize = seg->numAttrs() + (seg->hasCollisionInfo() ? (sizeof(SlotCollision) + 1) / 2 : 0);
-    m_attr = gralloc(glyphCount * attrSize);
+    m_attr = gralloc(glyphCount * seg->numAttrs());
     if (!m_glyph || (!m_attr && seg->numAttrs())) return;
     m_glyphLength = glyphCount;
     Slot * slotCopy = m_glyph;
@@ -71,9 +70,9 @@ SegCacheEntry::SegCacheEntry(const uint16* cmapGlyphs, size_t length, Segment *
     uint16 pos = 0;
     while (slot)
     {
-        slotCopy->userAttrs(m_attr + pos * attrSize);
+        slotCopy->userAttrs(m_attr + pos * seg->numAttrs());
         slotCopy->m_justs = m_justs ? reinterpret_cast(m_justs + justs_pos++ * sizeof_sjust) : 0;
-        slotCopy->set(*slot, -static_cast(charOffset), attrSize, seg->silf()->numJustLevels(), length);
+        slotCopy->set(*slot, -static_cast(charOffset), seg->numAttrs(), seg->silf()->numJustLevels(), length);
         slotCopy->index(pos);
         if (slot->firstChild())
             slotCopy->m_child = m_glyph + slot->firstChild()->index();
diff --git a/gfx/graphite2/src/Segment.cpp b/gfx/graphite2/src/Segment.cpp
index dd565acb649..980f68c3cbc 100644
--- a/gfx/graphite2/src/Segment.cpp
+++ b/gfx/graphite2/src/Segment.cpp
@@ -46,6 +46,7 @@ Segment::Segment(unsigned int numchars, const Face* face, uint32 script, int tex
 : m_freeSlots(NULL),
   m_freeJustifies(NULL),
   m_charinfo(new CharInfo[numchars]),
+  m_collisions(NULL),
   m_face(face),
   m_silf(face->chooseSilf(script)),
   m_first(NULL),
@@ -71,6 +72,7 @@ Segment::~Segment()
     for (JustifyRope::iterator i = m_justifies.begin(); i != m_justifies.end(); ++i)
         free(*i);
     delete[] m_charinfo;
+    free(m_collisions);
 }
 
 #ifndef GRAPHITE2_NSEGCACHE
@@ -175,8 +177,7 @@ Slot *Segment::newSlot()
         if (m_face->logger()) ++numUser;
 #endif
         Slot *newSlots = grzeroalloc(m_bufSize);
-        int attrSize = numUser + (hasCollisionInfo() ? ((sizeof(SlotCollision) + 1) / 2) : 0);
-        int16 *newAttrs = grzeroalloc(m_bufSize * attrSize);
+        int16 *newAttrs = grzeroalloc(m_bufSize * numUser);
         if (!newSlots || !newAttrs)
         {
             free(newSlots);
@@ -185,7 +186,7 @@ Slot *Segment::newSlot()
         }
         for (size_t i = 0; i < m_bufSize; i++)
         {
-            ::new (newSlots + i) Slot(newAttrs + i * attrSize);
+            ::new (newSlots + i) Slot(newAttrs + i * numUser);
             newSlots[i].next(newSlots + i + 1);
         }
         newSlots[m_bufSize - 1].next(NULL);
@@ -214,8 +215,7 @@ void Segment::freeSlot(Slot *aSlot)
     }
     // reset the slot incase it is reused
     ::new (aSlot) Slot(aSlot->userAttrs());
-    int attrSize = m_silf->numUser() + (hasCollisionInfo() ? ((sizeof(SlotCollision) + 1) / 2) : 0);
-    memset(aSlot->userAttrs(), 0, attrSize * sizeof(int16));
+    memset(aSlot->userAttrs(), 0, m_silf->numUser() * sizeof(int16));
     // Update generation counter for debug
 #if !defined GRAPHITE2_NTRACING
     if (m_face->logger())
@@ -304,14 +304,13 @@ void Segment::splice(size_t offset, size_t length, Slot * const startSlot,
     assert(offset + numChars <= m_numCharinfo);
     Slot * indexmap[eMaxSpliceSize*3];
     assert(numGlyphs < sizeof indexmap/sizeof *indexmap);
-    int attrSize = m_silf->numUser() + (hasCollisionInfo() ? ((sizeof(SlotCollision) + 1) / 2) : 0);
     Slot * slot = startSlot;
     for (uint16 i=0; i < numGlyphs; slot = slot->next(), ++i)
         indexmap[i] = slot;
 
     for (slot = startSlot; slot != endSlot; slot = slot->next(), srcSlot = srcSlot->next())
     {
-        slot->set(*srcSlot, offset, attrSize, m_silf->numJustLevels(), numChars);
+        slot->set(*srcSlot, offset, m_silf->numUser(), m_silf->numJustLevels(), numChars);
         if (srcSlot->attachedTo())  slot->attachTo(indexmap[srcSlot->attachedTo()->index()]);
         if (srcSlot->nextSibling()) slot->m_sibling = indexmap[srcSlot->nextSibling()->index()];
         if (srcSlot->firstChild())  slot->m_child = indexmap[srcSlot->firstChild()->index()];
@@ -523,6 +522,9 @@ void Segment::doMirror(uint16 aMirror)
 
 bool Segment::initCollisions()
 {
+    m_collisions = grzeroalloc(slotCount());
+    if (!m_collisions) return false;
+
     for (Slot *p = m_first; p; p = p->next())
         ::new (collisionInfo(p)) SlotCollision(this, p);
     return true;
diff --git a/gfx/graphite2/src/inc/Segment.h b/gfx/graphite2/src/inc/Segment.h
index bbeecef8bf5..7d72f98eda4 100644
--- a/gfx/graphite2/src/inc/Segment.h
+++ b/gfx/graphite2/src/inc/Segment.h
@@ -160,8 +160,7 @@ public:
 
     bool isWhitespace(const int cid) const;
     bool hasCollisionInfo() const { return (m_flags & SEG_HASCOLLISIONS); }
-    SlotCollision *collisionInfo(const Slot *s) const { return hasCollisionInfo() ? reinterpret_cast(s->userAttrs() + m_silf->numUser()) : 0; }
-
+    SlotCollision *collisionInfo(const Slot *s) const { return m_collisions ? m_collisions + s->index() : 0; }
     CLASS_NEW_DELETE
 
 public:       //only used by: GrSegment* makeAndInitialize(const GrFont *font, const GrFace *face, uint32 script, const FeaturesHandle& pFeats/*must not be IsNull*/, encform enc, const void* pStart, size_t nChars, int dir);
@@ -179,6 +178,7 @@ private:
     Slot          * m_freeSlots;        // linked list of free slots
     SlotJustify   * m_freeJustifies;    // Slot justification blocks free list
     CharInfo      * m_charinfo;         // character info, one per input character
+    SlotCollision * m_collisions;
     const Face    * m_face;             // GrFace
     const Silf    * m_silf;
     Slot          * m_first;            // first slot in segment

From f805628f6a18f49f1170cf2ae499ce67c7bf9eb9 Mon Sep 17 00:00:00 2001
From: Jonathan Kew 
Date: Wed, 20 Jan 2016 08:50:43 +0000
Subject: [PATCH 115/119] Bug 1240739 - Support opacity when rendering color
 fonts (e.g. emoji). r=jdaggett

---
 gfx/thebes/gfxTextRun.cpp | 25 +++++++++++++++++++------
 1 file changed, 19 insertions(+), 6 deletions(-)

diff --git a/gfx/thebes/gfxTextRun.cpp b/gfx/thebes/gfxTextRun.cpp
index a6008b19969..854557e32eb 100644
--- a/gfx/thebes/gfxTextRun.cpp
+++ b/gfx/thebes/gfxTextRun.cpp
@@ -484,18 +484,31 @@ gfxTextRun::DrawPartialLigature(gfxFont *aFont, uint32_t aStart, uint32_t aEnd,
     }
 }
 
-// returns true if a glyph run is using a font with synthetic bolding enabled, false otherwise
+// Returns true if a glyph run is using a font with synthetic bolding enabled,
+// or a color font (COLR/SVG/sbix/CBDT), false otherwise. This is used to
+// check whether the text run needs to be explicitly composited in order to
+// support opacity.
 static bool
-HasSyntheticBold(gfxTextRun *aRun, uint32_t aStart, uint32_t aLength)
+HasSyntheticBoldOrColor(gfxTextRun *aRun, uint32_t aStart, uint32_t aLength)
 {
     gfxTextRun::GlyphRunIterator iter(aRun, aStart, aLength);
     while (iter.NextRun()) {
         gfxFont *font = iter.GetGlyphRun()->mFont;
-        if (font && font->IsSyntheticBold()) {
-            return true;
+        if (font) {
+            if (font->IsSyntheticBold()) {
+                return true;
+            }
+            gfxFontEntry* fe = font->GetFontEntry();
+            if (fe->TryGetSVGData(font) || fe->TryGetColorGlyphs()) {
+                return true;
+            }
+#if defined(XP_MACOSX) // sbix fonts only supported via Core Text
+            if (fe->HasFontTable(TRUETYPE_TAG('s', 'b', 'i', 'x'))) {
+                return true;
+            }
+#endif
         }
     }
-
     return false;
 }
 
@@ -592,7 +605,7 @@ gfxTextRun::Draw(gfxContext *aContext, gfxPoint aPt, DrawMode aDrawMode,
 
     if (aDrawMode == DrawMode::GLYPH_FILL &&
         HasNonOpaqueNonTransparentColor(aContext, currentColor) &&
-        HasSyntheticBold(this, aStart, aLength)) {
+        HasSyntheticBoldOrColor(this, aStart, aLength)) {
         needToRestore = true;
         // measure text, use the bounding box
         gfxTextRun::Metrics metrics = MeasureText(aStart, aLength,

From c0585d2bdaf3632a5190db6d759b22a972cafb8f Mon Sep 17 00:00:00 2001
From: Honza Bambas 
Date: Tue, 19 Jan 2016 15:28:00 +0100
Subject: [PATCH 116/119] Bug 1087320 - On charset reload set LOAD_FROM_CACHE
 only on the default channel, r=bz r=jduell

---
 docshell/base/nsDocShell.cpp                | 10 ++++++++--
 netwerk/base/nsICacheInfoChannel.idl        |  9 ++++++++-
 netwerk/ipc/NeckoChannelParams.ipdlh        |  1 +
 netwerk/protocol/http/HttpBaseChannel.cpp   |  1 +
 netwerk/protocol/http/HttpBaseChannel.h     |  4 ++++
 netwerk/protocol/http/HttpChannelChild.cpp  | 16 +++++++++++++++
 netwerk/protocol/http/HttpChannelParent.cpp |  8 ++++++--
 netwerk/protocol/http/HttpChannelParent.h   |  3 ++-
 netwerk/protocol/http/nsHttpChannel.cpp     | 22 ++++++++++++++++++++-
 9 files changed, 67 insertions(+), 7 deletions(-)

diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp
index 35abc7ea473..de0a0763dea 100644
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -10984,9 +10984,15 @@ nsDocShell::DoChannelLoad(nsIChannel* aChannel,
       break;
     }
 
-    case LOAD_RELOAD_CHARSET_CHANGE:
-      loadFlags |= nsIRequest::LOAD_FROM_CACHE;
+    case LOAD_RELOAD_CHARSET_CHANGE: {
+      // Use SetAllowStaleCacheContent (not LOAD_FROM_CACHE flag) since we only want
+      // to force cache load for this channel, not the whole loadGroup.
+      nsCOMPtr cachingChannel = do_QueryInterface(aChannel);
+      if (cachingChannel) {
+        cachingChannel->SetAllowStaleCacheContent(true);
+      }
       break;
+    }
 
     case LOAD_RELOAD_NORMAL:
     case LOAD_REFRESH:
diff --git a/netwerk/base/nsICacheInfoChannel.idl b/netwerk/base/nsICacheInfoChannel.idl
index b8b7219cea4..9ad97309f13 100644
--- a/netwerk/base/nsICacheInfoChannel.idl
+++ b/netwerk/base/nsICacheInfoChannel.idl
@@ -4,7 +4,7 @@
 
 #include "nsISupports.idl"
 
-[scriptable, uuid (c5f583f0-ae53-4e39-8af9-2c2d0d7af093)]
+[scriptable, uuid(72c34415-c6eb-48af-851f-772fa9ee5972)]
 interface nsICacheInfoChannel : nsISupports
 {
   /**
@@ -45,4 +45,11 @@ interface nsICacheInfoChannel : nsISupports
    * is likewise valid.
    */
   attribute nsISupports cacheKey;
+
+  /**
+   * Tells the channel to behave as if the LOAD_FROM_CACHE flag has been set,
+   * but without affecting the loads for the entire loadGroup in case of this
+   * channel being the default load group's channel.
+   */
+  attribute boolean allowStaleCacheContent;
 };
diff --git a/netwerk/ipc/NeckoChannelParams.ipdlh b/netwerk/ipc/NeckoChannelParams.ipdlh
index 9afdf73d2ee..2d57f609c94 100644
--- a/netwerk/ipc/NeckoChannelParams.ipdlh
+++ b/netwerk/ipc/NeckoChannelParams.ipdlh
@@ -116,6 +116,7 @@ struct HttpChannelOpenArgs
   OptionalCorsPreflightArgs   preflightArgs;
   uint32_t                    initialRwin;
   bool                        suspendAfterSynthesizeResponse;
+  bool                        allowStaleCacheContent;
 };
 
 struct HttpChannelConnectArgs
diff --git a/netwerk/protocol/http/HttpBaseChannel.cpp b/netwerk/protocol/http/HttpBaseChannel.cpp
index d9bfbf90c69..4a353efa7af 100644
--- a/netwerk/protocol/http/HttpBaseChannel.cpp
+++ b/netwerk/protocol/http/HttpBaseChannel.cpp
@@ -87,6 +87,7 @@ HttpBaseChannel::HttpBaseChannel()
   , mAllRedirectsSameOrigin(true)
   , mAllRedirectsPassTimingAllowCheck(true)
   , mResponseCouldBeSynthesized(false)
+  , mAllowStaleCacheContent(false)
   , mSuspendCount(0)
   , mInitialRwin(0)
   , mProxyResolveFlags(0)
diff --git a/netwerk/protocol/http/HttpBaseChannel.h b/netwerk/protocol/http/HttpBaseChannel.h
index d6d792ba71d..5add8a52123 100644
--- a/netwerk/protocol/http/HttpBaseChannel.h
+++ b/netwerk/protocol/http/HttpBaseChannel.h
@@ -431,6 +431,10 @@ protected:
   // True if this channel was intercepted and could receive a synthesized response.
   uint32_t                          mResponseCouldBeSynthesized : 1;
 
+  // If true, we behave as if the LOAD_FROM_CACHE flag has been set.
+  // Used to enforce that flag's behavior but not expose it externally.
+  uint32_t                          mAllowStaleCacheContent : 1;
+
   // Current suspension depth for this channel object
   uint32_t                          mSuspendCount;
 
diff --git a/netwerk/protocol/http/HttpChannelChild.cpp b/netwerk/protocol/http/HttpChannelChild.cpp
index cdb62a123b0..541b9a93555 100644
--- a/netwerk/protocol/http/HttpChannelChild.cpp
+++ b/netwerk/protocol/http/HttpChannelChild.cpp
@@ -1964,6 +1964,8 @@ HttpChannelChild::ContinueAsyncOpen()
   }
   openArgs.cacheKey() = cacheKey;
 
+  openArgs.allowStaleCacheContent() = mAllowStaleCacheContent;
+
   nsresult rv = mozilla::ipc::LoadInfoToLoadInfoArgs(mLoadInfo, &openArgs.loadInfo());
   NS_ENSURE_SUCCESS(rv, rv);
 
@@ -2123,6 +2125,20 @@ HttpChannelChild::SetCacheKey(nsISupports *cacheKey)
   return NS_OK;
 }
 
+NS_IMETHODIMP
+HttpChannelChild::SetAllowStaleCacheContent(bool aAllowStaleCacheContent)
+{
+  mAllowStaleCacheContent = aAllowStaleCacheContent;
+  return NS_OK;
+}
+NS_IMETHODIMP
+HttpChannelChild::GetAllowStaleCacheContent(bool *aAllowStaleCacheContent)
+{
+  NS_ENSURE_ARG(aAllowStaleCacheContent);
+  *aAllowStaleCacheContent = mAllowStaleCacheContent;
+  return NS_OK;
+}
+
 //-----------------------------------------------------------------------------
 // HttpChannelChild::nsIResumableChannel
 //-----------------------------------------------------------------------------
diff --git a/netwerk/protocol/http/HttpChannelParent.cpp b/netwerk/protocol/http/HttpChannelParent.cpp
index 757d0b5a95b..8c18effc85d 100644
--- a/netwerk/protocol/http/HttpChannelParent.cpp
+++ b/netwerk/protocol/http/HttpChannelParent.cpp
@@ -131,7 +131,8 @@ HttpChannelParent::Init(const HttpChannelCreationArgs& aArgs)
                        a.loadInfo(), a.synthesizedResponseHead(),
                        a.synthesizedSecurityInfoSerialization(),
                        a.cacheKey(), a.schedulingContextID(), a.preflightArgs(),
-                       a.initialRwin(), a.suspendAfterSynthesizeResponse());
+                       a.initialRwin(), a.suspendAfterSynthesizeResponse(),
+                       a.allowStaleCacheContent());
   }
   case HttpChannelCreationArgs::THttpChannelConnectArgs:
   {
@@ -264,7 +265,8 @@ HttpChannelParent::DoAsyncOpen(  const URIParams&           aURI,
                                  const nsCString&           aSchedulingContextID,
                                  const OptionalCorsPreflightArgs& aCorsPreflightArgs,
                                  const uint32_t&            aInitialRwin,
-                                 const bool&                aSuspendAfterSynthesizeResponse)
+                                 const bool&                aSuspendAfterSynthesizeResponse,
+                                 const bool&                aAllowStaleCacheContent)
 {
   nsCOMPtr uri = DeserializeURI(aURI);
   if (!uri) {
@@ -413,6 +415,8 @@ HttpChannelParent::DoAsyncOpen(  const URIParams&           aURI,
 
   mChannel->SetCacheKey(cacheKey);
 
+  mChannel->SetAllowStaleCacheContent(aAllowStaleCacheContent);
+
   if (priority != nsISupportsPriority::PRIORITY_NORMAL) {
     mChannel->SetPriority(priority);
   }
diff --git a/netwerk/protocol/http/HttpChannelParent.h b/netwerk/protocol/http/HttpChannelParent.h
index ba4ee4309f0..ccf7fdcf6d2 100644
--- a/netwerk/protocol/http/HttpChannelParent.h
+++ b/netwerk/protocol/http/HttpChannelParent.h
@@ -137,7 +137,8 @@ protected:
                    const nsCString&           aSchedulingContextID,
                    const OptionalCorsPreflightArgs& aCorsPreflightArgs,
                    const uint32_t&            aInitialRwin,
-                   const bool&                aSuspendAfterSynthesizeResponse);
+                   const bool&                aSuspendAfterSynthesizeResponse,
+                   const bool&                aAllowStaleCacheContent);
 
   virtual bool RecvSetPriority(const uint16_t& priority) override;
   virtual bool RecvSetClassOfService(const uint32_t& cos) override;
diff --git a/netwerk/protocol/http/nsHttpChannel.cpp b/netwerk/protocol/http/nsHttpChannel.cpp
index c686e132c6e..59da82654b3 100644
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -481,6 +481,10 @@ nsHttpChannel::SpeculativeConnect()
                       LOAD_NO_NETWORK_IO | LOAD_CHECK_OFFLINE_CACHE))
         return;
 
+    if (mAllowStaleCacheContent) {
+        return;
+    }
+
     nsCOMPtr callbacks;
     NS_NewNotificationCallbacksAggregation(mCallbacks, mLoadGroup,
                                            getter_AddRefs(callbacks));
@@ -3180,7 +3184,7 @@ nsHttpChannel::OnCacheEntryCheck(nsICacheEntry* entry, nsIApplicationCache* appC
         doValidation = false;
     }
     // If the LOAD_FROM_CACHE flag is set, any cached data can simply be used
-    else if (mLoadFlags & nsIRequest::LOAD_FROM_CACHE) {
+    else if (mLoadFlags & nsIRequest::LOAD_FROM_CACHE || mAllowStaleCacheContent) {
         LOG(("NOT validating based on LOAD_FROM_CACHE load flag\n"));
         doValidation = false;
     }
@@ -6283,6 +6287,22 @@ nsHttpChannel::SetCacheTokenCachedCharset(const nsACString &aCharset)
                                            PromiseFlatCString(aCharset).get());
 }
 
+NS_IMETHODIMP
+nsHttpChannel::SetAllowStaleCacheContent(bool aAllowStaleCacheContent)
+{
+    LOG(("nsHttpChannel::SetAllowStaleCacheContent [this=%p, allow=%d]",
+         this, aAllowStaleCacheContent));
+    mAllowStaleCacheContent = aAllowStaleCacheContent;
+    return NS_OK;
+}
+NS_IMETHODIMP
+nsHttpChannel::GetAllowStaleCacheContent(bool *aAllowStaleCacheContent)
+{
+    NS_ENSURE_ARG(aAllowStaleCacheContent);
+    *aAllowStaleCacheContent = mAllowStaleCacheContent;
+    return NS_OK;
+}
+
 //-----------------------------------------------------------------------------
 // nsHttpChannel::nsICachingChannel
 //-----------------------------------------------------------------------------

From db665e161aa21bd0ed5d5ae42e5d8361a83a3c48 Mon Sep 17 00:00:00 2001
From: dimi 
Date: Fri, 15 Jan 2016 10:27:01 +0800
Subject: [PATCH 117/119] Bug 1229795 - P1. Remove scriptSpec from registration
 data. r=baku, bkelly

---
 dom/workers/ServiceWorkerManager.cpp          | 11 ++++-------
 dom/workers/ServiceWorkerManagerParent.cpp    |  1 -
 dom/workers/ServiceWorkerRegistrar.cpp        |  4 ----
 dom/workers/ServiceWorkerRegistrar.h          |  2 +-
 dom/workers/ServiceWorkerRegistrarTypes.ipdlh |  1 -
 dom/workers/test/gtest/TestReadWrite.cpp      | 11 ++---------
 6 files changed, 7 insertions(+), 23 deletions(-)

diff --git a/dom/workers/ServiceWorkerManager.cpp b/dom/workers/ServiceWorkerManager.cpp
index 85ee793b351..fa02c626524 100644
--- a/dom/workers/ServiceWorkerManager.cpp
+++ b/dom/workers/ServiceWorkerManager.cpp
@@ -328,8 +328,6 @@ PopulateRegistrationData(nsIPrincipal* aPrincipal,
     return NS_ERROR_FAILURE;
   }
 
-  aData.scriptSpec() = newest->ScriptSpec();
-
   if (aRegistration->mActiveWorker) {
     aData.currentWorkerURL() = aRegistration->mActiveWorker->ScriptSpec();
     aData.activeCacheName() = aRegistration->mActiveWorker->CacheName();
@@ -2919,11 +2917,10 @@ ServiceWorkerManager::LoadRegistration(
   if (!registration) {
     registration = CreateNewRegistration(aRegistration.scope(), principal);
   } else {
-    RefPtr newest = registration->Newest();
-    // If the script spec matches and our active worker state matches our
-    // expectations for a "current worker", then we are done.
-    if (newest && newest->ScriptSpec() == aRegistration.scriptSpec() &&
-        !registration->mActiveWorker == aRegistration.currentWorkerURL().IsEmpty()) {
+    // If active worker script matches our expectations for a "current worker",
+    // then we are done.
+    if (registration->mActiveWorker &&
+        registration->mActiveWorker->ScriptSpec() == aRegistration.currentWorkerURL()) {
       // No needs for updates.
       return;
     }
diff --git a/dom/workers/ServiceWorkerManagerParent.cpp b/dom/workers/ServiceWorkerManagerParent.cpp
index 67cdc293879..7bada3f34e0 100644
--- a/dom/workers/ServiceWorkerManagerParent.cpp
+++ b/dom/workers/ServiceWorkerManagerParent.cpp
@@ -181,7 +181,6 @@ ServiceWorkerManagerParent::RecvRegister(
 
   // Basic validation.
   if (aData.scope().IsEmpty() ||
-      aData.scriptSpec().IsEmpty() ||
       aData.principal().type() == PrincipalInfo::TNullPrincipalInfo ||
       aData.principal().type() == PrincipalInfo::TSystemPrincipalInfo) {
     return false;
diff --git a/dom/workers/ServiceWorkerRegistrar.cpp b/dom/workers/ServiceWorkerRegistrar.cpp
index b9d06c47d63..3445b149303 100644
--- a/dom/workers/ServiceWorkerRegistrar.cpp
+++ b/dom/workers/ServiceWorkerRegistrar.cpp
@@ -336,7 +336,6 @@ ServiceWorkerRegistrar::ReadData()
       mozilla::ipc::ContentPrincipalInfo(attrs, line);
 
     GET_LINE(entry->scope());
-    GET_LINE(entry->scriptSpec());
     GET_LINE(entry->currentWorkerURL());
 
     nsAutoCString cacheName;
@@ -561,9 +560,6 @@ ServiceWorkerRegistrar::WriteData()
     buffer.Append(data[i].scope());
     buffer.Append('\n');
 
-    buffer.Append(data[i].scriptSpec());
-    buffer.Append('\n');
-
     buffer.Append(data[i].currentWorkerURL());
     buffer.Append('\n');
 
diff --git a/dom/workers/ServiceWorkerRegistrar.h b/dom/workers/ServiceWorkerRegistrar.h
index 13f0e471d7e..539c26970f5 100644
--- a/dom/workers/ServiceWorkerRegistrar.h
+++ b/dom/workers/ServiceWorkerRegistrar.h
@@ -16,7 +16,7 @@
 #include "nsTArray.h"
 
 #define SERVICEWORKERREGISTRAR_FILE "serviceworker.txt"
-#define SERVICEWORKERREGISTRAR_VERSION "2"
+#define SERVICEWORKERREGISTRAR_VERSION "3"
 #define SERVICEWORKERREGISTRAR_TERMINATOR "#"
 #define SERVICEWORKERREGISTRAR_TRUE "true"
 #define SERVICEWORKERREGISTRAR_FALSE "false"
diff --git a/dom/workers/ServiceWorkerRegistrarTypes.ipdlh b/dom/workers/ServiceWorkerRegistrarTypes.ipdlh
index a6ba52b7f1f..57f89c63798 100644
--- a/dom/workers/ServiceWorkerRegistrarTypes.ipdlh
+++ b/dom/workers/ServiceWorkerRegistrarTypes.ipdlh
@@ -12,7 +12,6 @@ namespace dom {
 struct ServiceWorkerRegistrationData
 {
   nsCString scope;
-  nsCString scriptSpec;
   nsCString currentWorkerURL;
 
   nsString activeCacheName;
diff --git a/dom/workers/test/gtest/TestReadWrite.cpp b/dom/workers/test/gtest/TestReadWrite.cpp
index 10b4799c7a5..436bd45e67b 100644
--- a/dom/workers/test/gtest/TestReadWrite.cpp
+++ b/dom/workers/test/gtest/TestReadWrite.cpp
@@ -142,11 +142,11 @@ TEST(ServiceWorkerRegistrar, TestReadData)
   nsAutoCString buffer(SERVICEWORKERREGISTRAR_VERSION "\n");
 
   buffer.Append("^appId=123&inBrowser=1\n");
-  buffer.Append("spec 0\nscope 0\nscriptSpec 0\ncurrentWorkerURL 0\nactiveCache 0\nwaitingCache 0\n");
+  buffer.Append("spec 0\nscope 0\ncurrentWorkerURL 0\nactiveCache 0\nwaitingCache 0\n");
   buffer.Append(SERVICEWORKERREGISTRAR_TERMINATOR "\n");
 
   buffer.Append("\n");
-  buffer.Append("spec 1\nscope 1\nscriptSpec 1\ncurrentWorkerURL 1\nactiveCache 1\nwaitingCache 1\n");
+  buffer.Append("spec 1\nscope 1\ncurrentWorkerURL 1\nactiveCache 1\nwaitingCache 1\n");
   buffer.Append(SERVICEWORKERREGISTRAR_TERMINATOR "\n");
 
   ASSERT_TRUE(CreateFile(buffer)) << "CreateFile should not fail";
@@ -169,7 +169,6 @@ TEST(ServiceWorkerRegistrar, TestReadData)
   ASSERT_STREQ("^appId=123&inBrowser=1", suffix0.get());
   ASSERT_STREQ("spec 0", cInfo0.spec().get());
   ASSERT_STREQ("scope 0", data[0].scope().get());
-  ASSERT_STREQ("scriptSpec 0", data[0].scriptSpec().get());
   ASSERT_STREQ("currentWorkerURL 0", data[0].currentWorkerURL().get());
   ASSERT_STREQ("activeCache 0", NS_ConvertUTF16toUTF8(data[0].activeCacheName()).get());
   ASSERT_STREQ("waitingCache 0", NS_ConvertUTF16toUTF8(data[0].waitingCacheName()).get());
@@ -184,7 +183,6 @@ TEST(ServiceWorkerRegistrar, TestReadData)
   ASSERT_STREQ("", suffix1.get());
   ASSERT_STREQ("spec 1", cInfo1.spec().get());
   ASSERT_STREQ("scope 1", data[1].scope().get());
-  ASSERT_STREQ("scriptSpec 1", data[1].scriptSpec().get());
   ASSERT_STREQ("currentWorkerURL 1", data[1].currentWorkerURL().get());
   ASSERT_STREQ("activeCache 1", NS_ConvertUTF16toUTF8(data[1].activeCacheName()).get());
   ASSERT_STREQ("waitingCache 1", NS_ConvertUTF16toUTF8(data[1].waitingCacheName()).get());
@@ -221,7 +219,6 @@ TEST(ServiceWorkerRegistrar, TestWriteData)
       spec.AppendPrintf("spec write %d", i);
       d->principal() = mozilla::ipc::ContentPrincipalInfo(mozilla::PrincipalOriginAttributes(i, i % 2), spec);
       d->scope().AppendPrintf("scope write %d", i);
-      d->scriptSpec().AppendPrintf("scriptSpec write %d", i);
       d->currentWorkerURL().AppendPrintf("currentWorkerURL write %d", i);
       d->activeCacheName().AppendPrintf("activeCacheName write %d", i);
       d->waitingCacheName().AppendPrintf("waitingCacheName write %d", i);
@@ -259,10 +256,6 @@ TEST(ServiceWorkerRegistrar, TestWriteData)
     test.AppendPrintf("scope write %d", i);
     ASSERT_STREQ(test.get(), data[i].scope().get());
 
-    test.Truncate();
-    test.AppendPrintf("scriptSpec write %d", i);
-    ASSERT_STREQ(test.get(), data[i].scriptSpec().get());
-
     test.Truncate();
     test.AppendPrintf("currentWorkerURL write %d", i);
     ASSERT_STREQ(test.get(), data[i].currentWorkerURL().get());

From 8a66619bce9ae9639c934db191caa60346bd758c Mon Sep 17 00:00:00 2001
From: dimi 
Date: Wed, 13 Jan 2016 09:31:23 +0800
Subject: [PATCH 118/119] Bug 1229795 - P2. Remove waitingCacheName from
 registartion data. r=baku

---
 dom/workers/ServiceWorkerManager.cpp          |  8 ++-----
 dom/workers/ServiceWorkerRegistrar.cpp        |  9 ++------
 dom/workers/ServiceWorkerRegistrarTypes.ipdlh |  3 +--
 dom/workers/test/gtest/TestReadWrite.cpp      | 21 +++++++------------
 4 files changed, 12 insertions(+), 29 deletions(-)

diff --git a/dom/workers/ServiceWorkerManager.cpp b/dom/workers/ServiceWorkerManager.cpp
index fa02c626524..4ac6173b111 100644
--- a/dom/workers/ServiceWorkerManager.cpp
+++ b/dom/workers/ServiceWorkerManager.cpp
@@ -330,11 +330,7 @@ PopulateRegistrationData(nsIPrincipal* aPrincipal,
 
   if (aRegistration->mActiveWorker) {
     aData.currentWorkerURL() = aRegistration->mActiveWorker->ScriptSpec();
-    aData.activeCacheName() = aRegistration->mActiveWorker->CacheName();
-  }
-
-  if (aRegistration->mWaitingWorker) {
-    aData.waitingCacheName() = aRegistration->mWaitingWorker->CacheName();
+    aData.cacheName() = aRegistration->mActiveWorker->CacheName();
   }
 
   return NS_OK;
@@ -2930,7 +2926,7 @@ ServiceWorkerManager::LoadRegistration(
   if (!currentWorkerURL.IsEmpty()) {
     registration->mActiveWorker =
       new ServiceWorkerInfo(registration, currentWorkerURL,
-                            aRegistration.activeCacheName());
+                            aRegistration.cacheName());
     registration->mActiveWorker->SetActivateStateUncheckedWithoutEvent(ServiceWorkerState::Activated);
   }
 }
diff --git a/dom/workers/ServiceWorkerRegistrar.cpp b/dom/workers/ServiceWorkerRegistrar.cpp
index 3445b149303..7f751885bd0 100644
--- a/dom/workers/ServiceWorkerRegistrar.cpp
+++ b/dom/workers/ServiceWorkerRegistrar.cpp
@@ -340,10 +340,8 @@ ServiceWorkerRegistrar::ReadData()
 
     nsAutoCString cacheName;
     GET_LINE(cacheName);
-    CopyUTF8toUTF16(cacheName, entry->activeCacheName());
+    CopyUTF8toUTF16(cacheName, entry->cacheName());
 
-    GET_LINE(cacheName);
-    CopyUTF8toUTF16(cacheName, entry->waitingCacheName());
 
 #undef GET_LINE
 
@@ -563,10 +561,7 @@ ServiceWorkerRegistrar::WriteData()
     buffer.Append(data[i].currentWorkerURL());
     buffer.Append('\n');
 
-    buffer.Append(NS_ConvertUTF16toUTF8(data[i].activeCacheName()));
-    buffer.Append('\n');
-
-    buffer.Append(NS_ConvertUTF16toUTF8(data[i].waitingCacheName()));
+    buffer.Append(NS_ConvertUTF16toUTF8(data[i].cacheName()));
     buffer.Append('\n');
 
     buffer.AppendLiteral(SERVICEWORKERREGISTRAR_TERMINATOR);
diff --git a/dom/workers/ServiceWorkerRegistrarTypes.ipdlh b/dom/workers/ServiceWorkerRegistrarTypes.ipdlh
index 57f89c63798..7754a19e665 100644
--- a/dom/workers/ServiceWorkerRegistrarTypes.ipdlh
+++ b/dom/workers/ServiceWorkerRegistrarTypes.ipdlh
@@ -14,8 +14,7 @@ struct ServiceWorkerRegistrationData
   nsCString scope;
   nsCString currentWorkerURL;
 
-  nsString activeCacheName;
-  nsString waitingCacheName;
+  nsString cacheName;
 
   PrincipalInfo principal;
 };
diff --git a/dom/workers/test/gtest/TestReadWrite.cpp b/dom/workers/test/gtest/TestReadWrite.cpp
index 436bd45e67b..bf35e481e87 100644
--- a/dom/workers/test/gtest/TestReadWrite.cpp
+++ b/dom/workers/test/gtest/TestReadWrite.cpp
@@ -142,11 +142,11 @@ TEST(ServiceWorkerRegistrar, TestReadData)
   nsAutoCString buffer(SERVICEWORKERREGISTRAR_VERSION "\n");
 
   buffer.Append("^appId=123&inBrowser=1\n");
-  buffer.Append("spec 0\nscope 0\ncurrentWorkerURL 0\nactiveCache 0\nwaitingCache 0\n");
+  buffer.Append("spec 0\nscope 0\ncurrentWorkerURL 0\ncacheName 0\n");
   buffer.Append(SERVICEWORKERREGISTRAR_TERMINATOR "\n");
 
   buffer.Append("\n");
-  buffer.Append("spec 1\nscope 1\ncurrentWorkerURL 1\nactiveCache 1\nwaitingCache 1\n");
+  buffer.Append("spec 1\nscope 1\ncurrentWorkerURL 1\ncacheName 1\n");
   buffer.Append(SERVICEWORKERREGISTRAR_TERMINATOR "\n");
 
   ASSERT_TRUE(CreateFile(buffer)) << "CreateFile should not fail";
@@ -170,8 +170,7 @@ TEST(ServiceWorkerRegistrar, TestReadData)
   ASSERT_STREQ("spec 0", cInfo0.spec().get());
   ASSERT_STREQ("scope 0", data[0].scope().get());
   ASSERT_STREQ("currentWorkerURL 0", data[0].currentWorkerURL().get());
-  ASSERT_STREQ("activeCache 0", NS_ConvertUTF16toUTF8(data[0].activeCacheName()).get());
-  ASSERT_STREQ("waitingCache 0", NS_ConvertUTF16toUTF8(data[0].waitingCacheName()).get());
+  ASSERT_STREQ("cacheName 0", NS_ConvertUTF16toUTF8(data[0].cacheName()).get());
 
   const mozilla::ipc::PrincipalInfo& info1 = data[1].principal();
   ASSERT_EQ(info1.type(), mozilla::ipc::PrincipalInfo::TContentPrincipalInfo) << "First principal must be content";
@@ -184,8 +183,7 @@ TEST(ServiceWorkerRegistrar, TestReadData)
   ASSERT_STREQ("spec 1", cInfo1.spec().get());
   ASSERT_STREQ("scope 1", data[1].scope().get());
   ASSERT_STREQ("currentWorkerURL 1", data[1].currentWorkerURL().get());
-  ASSERT_STREQ("activeCache 1", NS_ConvertUTF16toUTF8(data[1].activeCacheName()).get());
-  ASSERT_STREQ("waitingCache 1", NS_ConvertUTF16toUTF8(data[1].waitingCacheName()).get());
+  ASSERT_STREQ("cacheName 1", NS_ConvertUTF16toUTF8(data[1].cacheName()).get());
 }
 
 TEST(ServiceWorkerRegistrar, TestDeleteData)
@@ -220,8 +218,7 @@ TEST(ServiceWorkerRegistrar, TestWriteData)
       d->principal() = mozilla::ipc::ContentPrincipalInfo(mozilla::PrincipalOriginAttributes(i, i % 2), spec);
       d->scope().AppendPrintf("scope write %d", i);
       d->currentWorkerURL().AppendPrintf("currentWorkerURL write %d", i);
-      d->activeCacheName().AppendPrintf("activeCacheName write %d", i);
-      d->waitingCacheName().AppendPrintf("waitingCacheName write %d", i);
+      d->cacheName().AppendPrintf("cacheName write %d", i);
     }
 
     nsresult rv = swr->TestWriteData();
@@ -261,12 +258,8 @@ TEST(ServiceWorkerRegistrar, TestWriteData)
     ASSERT_STREQ(test.get(), data[i].currentWorkerURL().get());
 
     test.Truncate();
-    test.AppendPrintf("activeCacheName write %d", i);
-    ASSERT_STREQ(test.get(), NS_ConvertUTF16toUTF8(data[i].activeCacheName()).get());
-
-    test.Truncate();
-    test.AppendPrintf("waitingCacheName write %d", i);
-    ASSERT_STREQ(test.get(), NS_ConvertUTF16toUTF8(data[i].waitingCacheName()).get());
+    test.AppendPrintf("cacheName write %d", i);
+    ASSERT_STREQ(test.get(), NS_ConvertUTF16toUTF8(data[i].cacheName()).get());
   }
 }
 

From cfd4156755054153184197f1028df14d384535bc Mon Sep 17 00:00:00 2001
From: dimi 
Date: Wed, 20 Jan 2016 09:34:26 +0800
Subject: [PATCH 119/119] Bug 1229795 - P3. Migrate service worker registrar
 data between version 2 and version 3. r=baku

---
 dom/workers/ServiceWorkerRegistrar.cpp   | 105 ++++++++++++++++++-----
 dom/workers/ServiceWorkerRegistrar.h     |   2 +
 dom/workers/test/gtest/TestReadWrite.cpp |  49 +++++++++++
 3 files changed, 133 insertions(+), 23 deletions(-)

diff --git a/dom/workers/ServiceWorkerRegistrar.cpp b/dom/workers/ServiceWorkerRegistrar.cpp
index 7f751885bd0..36270d66b73 100644
--- a/dom/workers/ServiceWorkerRegistrar.cpp
+++ b/dom/workers/ServiceWorkerRegistrar.cpp
@@ -38,6 +38,11 @@ namespace dom {
 
 namespace {
 
+static const char* gSupportedRegistrarVersions[] = {
+  SERVICEWORKERREGISTRAR_VERSION,
+  "2"
+};
+
 StaticRefPtr gServiceWorkerRegistrar;
 
 } // namespace
@@ -297,20 +302,20 @@ ServiceWorkerRegistrar::ReadData()
   nsCOMPtr lineInputStream = do_QueryInterface(stream);
   MOZ_ASSERT(lineInputStream);
 
-  nsAutoCString line;
+  nsAutoCString version;
   bool hasMoreLines;
-  rv = lineInputStream->ReadLine(line, &hasMoreLines);
+  rv = lineInputStream->ReadLine(version, &hasMoreLines);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
-  // The file is corrupted ?
-  // FIXME: in case we implement a version 2, we should inform the user using
-  // the console about this issue.
-  if (!line.EqualsLiteral(SERVICEWORKERREGISTRAR_VERSION)) {
+  if (!IsSupportedVersion(version)) {
+    nsContentUtils::LogMessageToConsole(
+      "Unsupported service worker registrar version: %s", version.get());
     return NS_ERROR_FAILURE;
   }
 
+  bool overwrite = false;
   while (hasMoreLines) {
     ServiceWorkerRegistrationData* entry = mData.AppendElement();
 
@@ -323,26 +328,59 @@ ServiceWorkerRegistrar::ReadData()
       return NS_ERROR_FAILURE;                        \
     }
 
-    nsAutoCString suffix;
-    GET_LINE(suffix);
+    nsAutoCString line;
+    if (version.EqualsLiteral(SERVICEWORKERREGISTRAR_VERSION)) {
+      nsAutoCString suffix;
+      GET_LINE(suffix);
 
-    PrincipalOriginAttributes attrs;
-    if (!attrs.PopulateFromSuffix(suffix)) {
-      return NS_ERROR_INVALID_ARG;
+      PrincipalOriginAttributes attrs;
+      if (!attrs.PopulateFromSuffix(suffix)) {
+        return NS_ERROR_INVALID_ARG;
+      }
+
+      GET_LINE(line);
+      entry->principal() =
+        mozilla::ipc::ContentPrincipalInfo(attrs, line);
+
+      GET_LINE(entry->scope());
+      GET_LINE(entry->currentWorkerURL());
+
+      nsAutoCString cacheName;
+      GET_LINE(cacheName);
+      CopyUTF8toUTF16(cacheName, entry->cacheName());
+    } else if (version.EqualsLiteral("2")) {
+      overwrite = true;
+
+      nsAutoCString suffix;
+      GET_LINE(suffix);
+
+      PrincipalOriginAttributes attrs;
+      if (!attrs.PopulateFromSuffix(suffix)) {
+        return NS_ERROR_INVALID_ARG;
+      }
+
+      GET_LINE(line);
+      entry->principal() =
+        mozilla::ipc::ContentPrincipalInfo(attrs, line);
+
+      GET_LINE(entry->scope());
+
+      // scriptSpec is no more used in latest version.
+      nsAutoCString unused;
+      GET_LINE(unused);
+
+      GET_LINE(entry->currentWorkerURL());
+
+      nsAutoCString cacheName;
+      GET_LINE(cacheName);
+      CopyUTF8toUTF16(cacheName, entry->cacheName());
+
+      // waitingCacheName is no more used in latest version.
+      GET_LINE(unused);
+    } else {
+      MOZ_ASSERT_UNREACHABLE("Should never get here!");
     }
 
-    GET_LINE(line);
-    entry->principal() =
-      mozilla::ipc::ContentPrincipalInfo(attrs, line);
-
-    GET_LINE(entry->scope());
-    GET_LINE(entry->currentWorkerURL());
-
-    nsAutoCString cacheName;
-    GET_LINE(cacheName);
-    CopyUTF8toUTF16(cacheName, entry->cacheName());
-
-
 #undef GET_LINE
 
     rv = lineInputStream->ReadLine(line, &hasMoreLines);
@@ -355,6 +393,15 @@ ServiceWorkerRegistrar::ReadData()
     }
   }
 
+  stream->Close();
+
+  // Overwrite previous version.
+  // Cannot call SaveData directly because gtest uses main-thread.
+  if (overwrite && NS_FAILED(WriteData())) {
+    NS_WARNING("Failed to write data for the ServiceWorker Registations.");
+    DeleteData();
+  }
+
   return NS_OK;
 }
 
@@ -491,6 +538,18 @@ ServiceWorkerRegistrar::MaybeScheduleShutdownCompleted()
   }
 }
 
+bool
+ServiceWorkerRegistrar::IsSupportedVersion(const nsACString& aVersion) const
+{
+  uint32_t numVersions = ArrayLength(gSupportedRegistrarVersions);
+  for (uint32_t i = 0; i < numVersions; i++) {
+    if (aVersion.EqualsASCII(gSupportedRegistrarVersions[i])) {
+      return true;
+    }
+  }
+  return false;
+}
+
 nsresult
 ServiceWorkerRegistrar::WriteData()
 {
diff --git a/dom/workers/ServiceWorkerRegistrar.h b/dom/workers/ServiceWorkerRegistrar.h
index 539c26970f5..82275fb635e 100644
--- a/dom/workers/ServiceWorkerRegistrar.h
+++ b/dom/workers/ServiceWorkerRegistrar.h
@@ -77,6 +77,8 @@ private:
   void ShutdownCompleted();
   void MaybeScheduleShutdownCompleted();
 
+  bool IsSupportedVersion(const nsACString& aVersion) const;
+
   mozilla::Monitor mMonitor;
 
 protected:
diff --git a/dom/workers/test/gtest/TestReadWrite.cpp b/dom/workers/test/gtest/TestReadWrite.cpp
index bf35e481e87..1410a89510b 100644
--- a/dom/workers/test/gtest/TestReadWrite.cpp
+++ b/dom/workers/test/gtest/TestReadWrite.cpp
@@ -263,6 +263,55 @@ TEST(ServiceWorkerRegistrar, TestWriteData)
   }
 }
 
+TEST(ServiceWorkerRegistrar, TestVersion2Migration)
+{
+  nsAutoCString buffer("2" "\n");
+
+  buffer.Append("^appId=123&inBrowser=1\n");
+  buffer.Append("spec 0\nscope 0\nscriptSpec 0\ncurrentWorkerURL 0\nactiveCache 0\nwaitingCache 0\n");
+  buffer.Append(SERVICEWORKERREGISTRAR_TERMINATOR "\n");
+
+  buffer.Append("\n");
+  buffer.Append("spec 1\nscope 1\nscriptSpec 1\ncurrentWorkerURL 1\nactiveCache 1\nwaitingCache 1\n");
+  buffer.Append(SERVICEWORKERREGISTRAR_TERMINATOR "\n");
+
+  ASSERT_TRUE(CreateFile(buffer)) << "CreateFile should not fail";
+
+  RefPtr swr = new ServiceWorkerRegistrarTest;
+
+  nsresult rv = swr->TestReadData();
+  ASSERT_EQ(NS_OK, rv) << "ReadData() should not fail";
+
+  const nsTArray& data = swr->TestGetData();
+  ASSERT_EQ((uint32_t)2, data.Length()) << "4 entries should be found";
+
+  const mozilla::ipc::PrincipalInfo& info0 = data[0].principal();
+  ASSERT_EQ(info0.type(), mozilla::ipc::PrincipalInfo::TContentPrincipalInfo) << "First principal must be content";
+  const mozilla::ipc::ContentPrincipalInfo& cInfo0 = data[0].principal();
+
+  nsAutoCString suffix0;
+  cInfo0.attrs().CreateSuffix(suffix0);
+
+  ASSERT_STREQ("^appId=123&inBrowser=1", suffix0.get());
+  ASSERT_STREQ("spec 0", cInfo0.spec().get());
+  ASSERT_STREQ("scope 0", data[0].scope().get());
+  ASSERT_STREQ("currentWorkerURL 0", data[0].currentWorkerURL().get());
+  ASSERT_STREQ("activeCache 0", NS_ConvertUTF16toUTF8(data[0].cacheName()).get());
+
+  const mozilla::ipc::PrincipalInfo& info1 = data[1].principal();
+  ASSERT_EQ(info1.type(), mozilla::ipc::PrincipalInfo::TContentPrincipalInfo) << "First principal must be content";
+  const mozilla::ipc::ContentPrincipalInfo& cInfo1 = data[1].principal();
+
+  nsAutoCString suffix1;
+  cInfo1.attrs().CreateSuffix(suffix1);
+
+  ASSERT_STREQ("", suffix1.get());
+  ASSERT_STREQ("spec 1", cInfo1.spec().get());
+  ASSERT_STREQ("scope 1", data[1].scope().get());
+  ASSERT_STREQ("currentWorkerURL 1", data[1].currentWorkerURL().get());
+  ASSERT_STREQ("activeCache 1", NS_ConvertUTF16toUTF8(data[1].cacheName()).get());
+}
+
 int main(int argc, char** argv) {
   ::testing::InitGoogleTest(&argc, argv);