Merge m-c to inbound.
authorRyan VanderMeulen <ryanvm@gmail.com>
Fri, 17 Jan 2014 15:17:49 -0500
changeset 164099 b7717200fb18b205e69cd88e8e21ce55458e1c86
parent 164098 f95bc5df7fcfbd8801a8f043a0d9e25148f3bae9 (diff)
parent 164075 298f262f21ff15750346ede893b49345cfa1964a (current diff)
child 164100 d70ddcedc57d43aee995630e822c624c3b7a6ee0
push id26026
push userphilringnalda@gmail.com
push dateSat, 18 Jan 2014 23:17:27 +0000
treeherdermozilla-central@61fd0f987cf2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone29.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge m-c to inbound.
addon-sdk/source/lib/sdk/content/symbiont.js
addon-sdk/source/lib/sdk/deprecated/app-strings.js
addon-sdk/source/lib/sdk/deprecated/observer-service.js
addon-sdk/source/test/test-app-strings.js
addon-sdk/source/test/test-observer-service.js
browser/components/sessionstore/src/DocumentUtils.jsm
browser/components/sessionstore/src/TextAndScrollData.jsm
browser/components/sessionstore/test/browser_346337.js
browser/components/sessionstore/test/browser_346337_sample.html
browser/components/sessionstore/test/browser_463205_helper.html
browser/components/sessionstore/test/browser_916390_form_data_loss.js
browser/components/sessionstore/test/browser_916390_sample.html
browser/components/sessionstore/test/browser_input.js
browser/components/sessionstore/test/browser_input_sample.html
dom/network/interfaces/nsIDOMMobileConnection.idl
dom/network/interfaces/nsIMobileConnectionProvider.idl
dom/network/tests/marionette/manifest.ini
dom/network/tests/marionette/test_call_barring_change_password.js
dom/network/tests/marionette/test_call_barring_get_option.js
dom/network/tests/marionette/test_call_barring_set_error.js
dom/network/tests/marionette/test_mobile_connections_array_uninitialized.js
dom/network/tests/marionette/test_mobile_data_connection.js
dom/network/tests/marionette/test_mobile_data_location.js
dom/network/tests/marionette/test_mobile_data_state.js
dom/network/tests/marionette/test_mobile_last_known_network.js
dom/network/tests/marionette/test_mobile_mmi.js
dom/network/tests/marionette/test_mobile_networks.js
dom/network/tests/marionette/test_mobile_operator_names.js
dom/network/tests/marionette/test_mobile_preferred_network_type.js
dom/network/tests/marionette/test_mobile_preferred_network_type_by_setting.js
dom/network/tests/marionette/test_mobile_roaming_preference.js
dom/network/tests/marionette/test_mobile_set_radio.js
dom/network/tests/marionette/test_mobile_voice_state.js
mobile/android/base/fxa/activities/FxAccountSetupActivity.java
mobile/android/base/fxa/sync/FxAccount.java
mobile/android/base/resources/layout/fxaccount_setup.xml
mobile/android/base/resources/values/fxaccount_styles.xml
--- a/browser/confvars.sh
+++ b/browser/confvars.sh
@@ -59,9 +59,11 @@ if test "$OS_TARGET" = "WINNT" -o "$OS_T
   MOZ_FOLD_LIBS=1
 fi
 MOZ_WEBGL_CONFORMANT=1
 # Enable navigator.mozPay
 MOZ_PAY=1
 # Enable activities. These are used for FxOS developers currently.
 MOZ_ACTIVITIES=1
 MOZ_JSDOWNLOADS=1
+# Enable exact rooting on desktop.
+JSGC_USE_EXACT_ROOTING=1
 
--- a/configure.in
+++ b/configure.in
@@ -1545,60 +1545,16 @@ if test "$MOZ_PROFILING" -a -z "$STRIP_F
     case "$OS_TARGET" in
     Linux|DragonFly|FreeBSD|NetBSD|OpenBSD)
         STRIP_FLAGS="--strip-debug"
         ;;
     esac
 fi
 
 dnl ========================================================
-dnl = Use incremental GC
-dnl ========================================================
-JSGC_INCREMENTAL=1
-MOZ_ARG_DISABLE_BOOL(gcincremental,
-[  --disable-gcincremental Disable incremental GC],
-    JSGC_INCREMENTAL= )
-if test -n "$JSGC_INCREMENTAL"; then
-    AC_DEFINE(JSGC_INCREMENTAL)
-fi
-
-dnl ========================================================
-dnl = Use generational GC
-dnl ========================================================
-MOZ_ARG_ENABLE_BOOL(gcgenerational,
-[  --enable-gcgenerational Enable generational GC],
-    JSGC_GENERATIONAL=1,
-    JSGC_GENERATIONAL= )
-if test -n "$JSGC_GENERATIONAL"; then
-    AC_DEFINE(JSGC_GENERATIONAL)
-fi
-
-dnl ========================================================
-dnl = Perform moving GC stack rooting analysis
-dnl ========================================================
-MOZ_ARG_ENABLE_BOOL(root-analysis,
-[  --enable-root-analysis  Enable moving GC stack root analysis],
-    JSGC_ROOT_ANALYSIS=1,
-    JSGC_ROOT_ANALYSIS= )
-if test -n "$JSGC_ROOT_ANALYSIS"; then
-    AC_DEFINE(JSGC_ROOT_ANALYSIS)
-fi
-
-dnl ========================================================
-dnl = Use exact stack rooting for GC
-dnl ========================================================
-MOZ_ARG_ENABLE_BOOL(exact-rooting,
-[  --enable-exact-rooting  Enable use of exact stack roots for GC],
-    JSGC_USE_EXACT_ROOTING=1,
-    JSGC_USE_EXACT_ROOTING= )
-if test -n "$JSGC_USE_EXACT_ROOTING"; then
-    AC_DEFINE(JSGC_USE_EXACT_ROOTING)
-fi
-
-dnl ========================================================
 dnl = Use Valgrind
 dnl ========================================================
 MOZ_ARG_ENABLE_BOOL(valgrind,
 [  --enable-valgrind       Enable Valgrind integration hooks (default=no)],
     MOZ_VALGRIND=1,
     MOZ_VALGRIND= )
 if test -n "$MOZ_VALGRIND"; then
     MOZ_CHECK_HEADER([valgrind/valgrind.h], [],
@@ -4059,16 +4015,17 @@ MOZ_ANDROID_BEAM=
 MOZ_ANDROID_SYNTHAPKS=
 ACCESSIBILITY=1
 MOZ_TIME_MANAGER=
 MOZ_PAY=
 MOZ_AUDIO_CHANNEL_MANAGER=
 NSS_NO_LIBPKIX=
 MOZ_CONTENT_SANDBOX=
 MOZ_CONTENT_SANDBOX_REPORTER=
+JSGC_USE_EXACT_ROOTING=
 
 case "$target_os" in
     mingw*)
         NS_ENABLE_TSF=1
         AC_DEFINE(NS_ENABLE_TSF)
         ;;
 esac
 
@@ -4203,16 +4160,20 @@ MOZ_ARG_WITH_STRING(app-name,
 [--with-app-name=APPNAME sets MOZ_APP_NAME to APPNAME],
 WITH_APP_NAME=$withval,
 )
 
 if test -n "$WITH_APP_NAME" ; then
     MOZ_APP_NAME="$WITH_APP_NAME"
 fi
 
+if test -z "$MOZ_APP_NAME"; then
+   MOZ_APP_NAME=`echo $MOZ_APP_BASENAME | tr A-Z a-z`
+fi
+
 MOZ_ARG_WITH_STRING(app-basename,
 [--with-app-basename=BASENAME sets MOZ_APP_BASENAME to BASENAME],
 WITH_APP_BASENAME=$withval,
 )
 
 if test -n "$WITH_APP_BASENAME" ; then
     MOZ_APP_BASENAME="$WITH_APP_BASENAME"
 fi
@@ -7069,16 +7030,17 @@ MOZ_ARG_ENABLE_BOOL(wrap-malloc,
     _WRAP_MALLOC=1,
     _WRAP_MALLOC= )
 
 if test -n "$_WRAP_MALLOC"; then
     if test -n "$GNU_CC"; then
         WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=malloc,--wrap=calloc,--wrap=valloc,--wrap=free,--wrap=realloc,--wrap=memalign"
         WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=__builtin_new,--wrap=__builtin_vec_new,--wrap=__builtin_delete,--wrap=__builtin_vec_delete"
         WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=strdup,--wrap=strndup"
+        WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=vasprintf,--wrap=asprintf"
         WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=posix_memalign,--wrap=malloc_usable_size"
         dnl Wrap operator new and operator delete on Android.
         if test "$OS_TARGET" = "Android"; then
             WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=_Znwj,--wrap=_Znaj,--wrap=_ZdlPv,--wrap=_ZdaPv"
             dnl Wrap the nothrow variants too.
             WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=_ZnwjRKSt9nothrow_t,--wrap=_ZnajRKSt9nothrow_t,--wrap=_ZdlPvRKSt9nothrow_t,--wrap=_ZdaPvRKSt9nothrow_t"
         fi
     else
@@ -7100,47 +7062,80 @@ MOZ_ARG_ENABLE_BOOL(trace-jscalls,
 [  --enable-trace-jscalls  Enable JS call enter/exit callback (default=no)],
     MOZ_TRACE_JSCALLS=1,
     MOZ_TRACE_JSCALLS= )
 if test -n "$MOZ_TRACE_JSCALLS"; then
     AC_DEFINE(MOZ_TRACE_JSCALLS)
 fi
 
 dnl ========================================================
+dnl JS opt-mode assertions and minidump instrumentation
+dnl ========================================================
+MOZ_ARG_ENABLE_BOOL(js-diagnostics,
+[  --enable-js-diagnostics
+                          Enable JS diagnostic assertions and breakpad data],
+    JS_CRASH_DIAGNOSTICS=1,
+    JS_CRASH_DIAGNOSTICS= )
+if test -n "$JS_CRASH_DIAGNOSTICS"; then
+    AC_DEFINE(JS_CRASH_DIAGNOSTICS)
+fi
+
+dnl ========================================================
 dnl = Use incremental GC
 dnl ========================================================
 JSGC_INCREMENTAL=1
 MOZ_ARG_DISABLE_BOOL(gcincremental,
 [  --disable-gcincremental Disable incremental GC],
     JSGC_INCREMENTAL= )
 if test -n "$JSGC_INCREMENTAL"; then
     AC_DEFINE(JSGC_INCREMENTAL)
 fi
 
 dnl ========================================================
+dnl = Use exact stack rooting for GC
+dnl ========================================================
+MOZ_ARG_DISABLE_BOOL(exact-rooting,
+[  --disable-exact-rooting  Enable use of conservative stack scanning for GC],
+    JSGC_USE_EXACT_ROOTING= ,
+    JSGC_USE_EXACT_ROOTING=1 )
+if test -n "$JSGC_USE_EXACT_ROOTING"; then
+    AC_DEFINE(JSGC_USE_EXACT_ROOTING)
+fi
+
+dnl ========================================================
+dnl = Use generational GC
+dnl ========================================================
+MOZ_ARG_ENABLE_BOOL(gcgenerational,
+[  --enable-gcgenerational Enable generational GC],
+    JSGC_GENERATIONAL=1,
+    JSGC_GENERATIONAL= )
+if test -n "$JSGC_GENERATIONAL"; then
+    AC_DEFINE(JSGC_GENERATIONAL)
+fi
+
+dnl ========================================================
 dnl Zealous JavaScript GC
 dnl ========================================================
 MOZ_ARG_ENABLE_BOOL(gczeal,
 [  --enable-gczeal         Enable zealous JavaScript GCing],
     JS_GC_ZEAL=1,
     JS_GC_ZEAL= )
 if test -n "$JS_GC_ZEAL" -o -n "$MOZ_DEBUG"; then
     AC_DEFINE(JS_GC_ZEAL)
 fi
 
 dnl ========================================================
-dnl JS opt-mode assertions and minidump instrumentation
-dnl ========================================================
-MOZ_ARG_ENABLE_BOOL(js-diagnostics,
-[  --enable-js-diagnostics
-                          Enable JS diagnostic assertions and breakpad data],
-    JS_CRASH_DIAGNOSTICS=1,
-    JS_CRASH_DIAGNOSTICS= )
-if test -n "$JS_CRASH_DIAGNOSTICS"; then
-    AC_DEFINE(JS_CRASH_DIAGNOSTICS)
+dnl = Perform moving GC stack rooting analysis
+dnl ========================================================
+MOZ_ARG_ENABLE_BOOL(root-analysis,
+[  --enable-root-analysis  Enable moving GC stack root analysis],
+    JSGC_ROOT_ANALYSIS=1,
+    JSGC_ROOT_ANALYSIS= )
+if test -n "$JSGC_ROOT_ANALYSIS"; then
+    AC_DEFINE(JSGC_ROOT_ANALYSIS)
 fi
 
 MOZ_CHECK_CCACHE
 MOZ_CHECK_COMPILER_WRAPPER
 
 dnl ========================================================
 dnl = Enable static checking using gcc-dehydra
 dnl ========================================================
@@ -8457,20 +8452,16 @@ AC_SUBST(MOZ_CHILD_PROCESS_BUNDLE)
 # defaults to a lowercase form of MOZ_APP_BASENAME.
 # - MOZ_APP_PROFILE: When set, used for application.ini's
 # "Profile" field, which controls profile location.
 # - MOZ_APP_ID: When set, used for application.ini's "ID" field, and
 # crash reporter server url.
 # - MOZ_PROFILE_MIGRATOR: When set, enables profile migrator.
 # - MOZ_EXTENSION_MANAGER: When set, enabled extension manager.
 
-if test -z "$MOZ_APP_NAME"; then
-   MOZ_APP_NAME=`echo $MOZ_APP_BASENAME | tr A-Z a-z`
-fi
-
 # For extensions and langpacks, we require a max version that is compatible
 # across security releases. MOZ_APP_MAXVERSION is our method for doing that.
 # 10.0a1 and 10.0a2 aren't affected
 # 10.0 becomes 10.0.*
 # 10.0.1 becomes 10.0.*
 IS_ALPHA=`echo $MOZ_APP_VERSION | grep a`
 if test -z "$IS_ALPHA"; then
   changequote(,)
@@ -9109,16 +9100,19 @@ if test "$BUILD_CTYPES"; then
     ac_configure_args="$ac_configure_args --enable-ctypes"
 fi
 if test -z "$JS_SHARED_LIBRARY" ; then
     ac_configure_args="$ac_configure_args --disable-shared-js"
     if test -n "$MOZ_DISABLE_EXPORT_JS"; then
         ac_configure_args="$ac_configure_args --disable-export-js"
     fi
 fi
+if test -z "$JSGC_USE_EXACT_ROOTING" ; then
+    ac_configure_args="$ac_configure_args --disable-exact-rooting"
+fi
 if test -z "$MOZ_NATIVE_NSPR"; then
     ac_configure_args="$ac_configure_args --with-nspr-cflags='$NSPR_CFLAGS'"
     ac_configure_args="$ac_configure_args --with-nspr-libs='$NSPR_LIBS'"
 fi
 ac_configure_args="$ac_configure_args --with-dist-dir=../../dist"
 ac_configure_args="$ac_configure_args --prefix=$dist"
 if test "$MOZ_MEMORY"; then
    ac_configure_args="$ac_configure_args --enable-jemalloc"
--- a/content/media/webrtc/MediaEngineTabVideoSource.cpp
+++ b/content/media/webrtc/MediaEngineTabVideoSource.cpp
@@ -252,18 +252,19 @@ MediaEngineTabVideoSource::Draw() {
   gfxPoint pt(0, 0);
   context->Translate(pt);
   context->Scale(scale * size.width / srcW, scale * size.height / srcH);
   rv = presShell->RenderDocument(r, renderDocFlags, bgColor, context);
 
   NS_ENSURE_SUCCESS_VOID(rv);
 
   layers::CairoImage::Data cairoData;
-  cairoData.mSurface = surf;
+  cairoData.mDeprecatedSurface = surf;
   cairoData.mSize = size;
+  cairoData.mSourceSurface = gfxPlatform::GetPlatform()->GetSourceSurfaceForSurface(nullptr, surf);
 
   nsRefPtr<layers::CairoImage> image = new layers::CairoImage();
 
   image->SetData(cairoData);
 
   MonitorAutoLock mon(mMonitor);
   mImage = image;
 }
--- a/content/media/webspeech/synth/ipc/SpeechSynthesisChild.cpp
+++ b/content/media/webspeech/synth/ipc/SpeechSynthesisChild.cpp
@@ -107,24 +107,16 @@ bool
 SpeechSynthesisRequestChild::RecvOnResume(const float& aElapsedTime,
                                           const uint32_t& aCharIndex)
 {
   mTask->DispatchResumeImpl(aElapsedTime, aCharIndex);
   return true;
 }
 
 bool
-SpeechSynthesisRequestChild::RecvOnError(const float& aElapsedTime,
-                                         const uint32_t& aCharIndex)
-{
-  mTask->DispatchErrorImpl(aElapsedTime, aCharIndex);
-  return true;
-}
-
-bool
 SpeechSynthesisRequestChild::RecvOnBoundary(const nsString& aName,
                                             const float& aElapsedTime,
                                             const uint32_t& aCharIndex)
 {
   mTask->DispatchBoundaryImpl(aName, aElapsedTime, aCharIndex);
   return true;
 }
 
--- a/content/media/webspeech/synth/ipc/SpeechSynthesisChild.h
+++ b/content/media/webspeech/synth/ipc/SpeechSynthesisChild.h
@@ -17,59 +17,57 @@ class nsSynthVoiceRegistry;
 class SpeechSynthesisRequestChild;
 class SpeechTaskChild;
 
 class SpeechSynthesisChild : public PSpeechSynthesisChild
 {
   friend class nsSynthVoiceRegistry;
 
 public:
-  bool RecvVoiceAdded(const RemoteVoice& aVoice);
+  bool RecvVoiceAdded(const RemoteVoice& aVoice) MOZ_OVERRIDE;
 
-  bool RecvVoiceRemoved(const nsString& aUri);
+  bool RecvVoiceRemoved(const nsString& aUri) MOZ_OVERRIDE;
 
-  bool RecvSetDefaultVoice(const nsString& aUri, const bool& aIsDefault);
+  bool RecvSetDefaultVoice(const nsString& aUri, const bool& aIsDefault) MOZ_OVERRIDE;
 
 protected:
   SpeechSynthesisChild();
   virtual ~SpeechSynthesisChild();
 
   PSpeechSynthesisRequestChild* AllocPSpeechSynthesisRequestChild(const nsString& aLang,
                                                                   const nsString& aUri,
                                                                   const nsString& aText,
                                                                   const float& aVolume,
                                                                   const float& aPitch,
-                                                                  const float& aRate);
-  bool DeallocPSpeechSynthesisRequestChild(PSpeechSynthesisRequestChild* aActor);
+                                                                  const float& aRate) MOZ_OVERRIDE;
+  bool DeallocPSpeechSynthesisRequestChild(PSpeechSynthesisRequestChild* aActor) MOZ_OVERRIDE;
 };
 
 class SpeechSynthesisRequestChild : public PSpeechSynthesisRequestChild
 {
 public:
   SpeechSynthesisRequestChild(SpeechTaskChild* aTask);
   virtual ~SpeechSynthesisRequestChild();
 
 protected:
-  virtual bool RecvOnStart();
+  virtual bool RecvOnStart() MOZ_OVERRIDE;
 
   virtual bool Recv__delete__(const bool& aIsError,
                               const float& aElapsedTime,
-                              const uint32_t& aCharIndex);
-
-  virtual bool RecvOnPause(const float& aElapsedTime, const uint32_t& aCharIndex);
+                              const uint32_t& aCharIndex) MOZ_OVERRIDE;
 
-  virtual bool RecvOnResume(const float& aElapsedTime, const uint32_t& aCharIndex);
+  virtual bool RecvOnPause(const float& aElapsedTime, const uint32_t& aCharIndex) MOZ_OVERRIDE;
 
-  virtual bool RecvOnError(const float& aElapsedTime, const uint32_t& aCharIndex);
+  virtual bool RecvOnResume(const float& aElapsedTime, const uint32_t& aCharIndex) MOZ_OVERRIDE;
 
   virtual bool RecvOnBoundary(const nsString& aName, const float& aElapsedTime,
-                              const uint32_t& aCharIndex);
+                              const uint32_t& aCharIndex) MOZ_OVERRIDE;
 
   virtual bool RecvOnMark(const nsString& aName, const float& aElapsedTime,
-                          const uint32_t& aCharIndex);
+                          const uint32_t& aCharIndex) MOZ_OVERRIDE;
 
   nsRefPtr<SpeechTaskChild> mTask;
 };
 
 class SpeechTaskChild : public nsSpeechTask
 {
   friend class SpeechSynthesisRequestChild;
 public:
--- a/content/media/webspeech/synth/ipc/SpeechSynthesisParent.h
+++ b/content/media/webspeech/synth/ipc/SpeechSynthesisParent.h
@@ -18,54 +18,55 @@ class SpeechSynthesisRequestParent;
 
 class SpeechSynthesisParent : public PSpeechSynthesisParent
 {
   friend class ContentParent;
   friend class SpeechSynthesisRequestParent;
 
 public:
   bool RecvReadVoiceList(InfallibleTArray<RemoteVoice>* aVoices,
-                         InfallibleTArray<nsString>* aDefaults);
+                         InfallibleTArray<nsString>* aDefaults) MOZ_OVERRIDE;
 
 protected:
   SpeechSynthesisParent();
   virtual ~SpeechSynthesisParent();
   PSpeechSynthesisRequestParent* AllocPSpeechSynthesisRequestParent(const nsString& aText,
                                                                     const nsString& aLang,
                                                                     const nsString& aUri,
                                                                     const float& aVolume,
                                                                     const float& aRate,
-                                                                    const float& aPitch);
+                                                                    const float& aPitch)
+                                                                    MOZ_OVERRIDE;
 
-  bool DeallocPSpeechSynthesisRequestParent(PSpeechSynthesisRequestParent* aActor);
+  bool DeallocPSpeechSynthesisRequestParent(PSpeechSynthesisRequestParent* aActor) MOZ_OVERRIDE;
 
   bool RecvPSpeechSynthesisRequestConstructor(PSpeechSynthesisRequestParent* aActor,
                                               const nsString& aText,
                                               const nsString& aLang,
                                               const nsString& aUri,
                                               const float& aVolume,
                                               const float& aRate,
-                                              const float& aPitch);
+                                              const float& aPitch) MOZ_OVERRIDE;
 };
 
 class SpeechSynthesisRequestParent : public PSpeechSynthesisRequestParent
 {
 public:
   SpeechSynthesisRequestParent(SpeechTaskParent* aTask);
   virtual ~SpeechSynthesisRequestParent();
 
   nsRefPtr<SpeechTaskParent> mTask;
 
 protected:
 
-  virtual bool RecvPause();
+  virtual bool RecvPause() MOZ_OVERRIDE;
 
-  virtual bool RecvResume();
+  virtual bool RecvResume() MOZ_OVERRIDE;
 
-  virtual bool RecvCancel();
+  virtual bool RecvCancel() MOZ_OVERRIDE;
 };
 
 class SpeechTaskParent : public nsSpeechTask
 {
   friend class SpeechSynthesisRequestParent;
 public:
   SpeechTaskParent(float aVolume, const nsAString& aUtterance)
     : nsSpeechTask(aVolume, aUtterance) {}
--- a/dom/ipc/ContentChild.h
+++ b/dom/ipc/ContentChild.h
@@ -81,176 +81,179 @@ public:
 
     PCompositorChild*
     AllocPCompositorChild(mozilla::ipc::Transport* aTransport,
                           base::ProcessId aOtherProcess) MOZ_OVERRIDE;
     PImageBridgeChild*
     AllocPImageBridgeChild(mozilla::ipc::Transport* aTransport,
                            base::ProcessId aOtherProcess) MOZ_OVERRIDE;
 
-    virtual bool RecvSetProcessPrivileges(const ChildPrivileges& aPrivs);
+    virtual bool RecvSetProcessPrivileges(const ChildPrivileges& aPrivs) MOZ_OVERRIDE;
 
     virtual PBrowserChild* AllocPBrowserChild(const IPCTabContext &aContext,
                                               const uint32_t &chromeFlags);
     virtual bool DeallocPBrowserChild(PBrowserChild*);
 
     virtual PDeviceStorageRequestChild* AllocPDeviceStorageRequestChild(const DeviceStorageParams&);
     virtual bool DeallocPDeviceStorageRequestChild(PDeviceStorageRequestChild*);
 
     virtual PBlobChild* AllocPBlobChild(const BlobConstructorParams& aParams);
     virtual bool DeallocPBlobChild(PBlobChild*);
 
     virtual PCrashReporterChild*
     AllocPCrashReporterChild(const mozilla::dom::NativeThreadId& id,
-                             const uint32_t& processType);
+                             const uint32_t& processType) MOZ_OVERRIDE;
     virtual bool
-    DeallocPCrashReporterChild(PCrashReporterChild*);
+    DeallocPCrashReporterChild(PCrashReporterChild*) MOZ_OVERRIDE;
 
     virtual PHalChild* AllocPHalChild() MOZ_OVERRIDE;
     virtual bool DeallocPHalChild(PHalChild*) MOZ_OVERRIDE;
 
-    virtual PIndexedDBChild* AllocPIndexedDBChild();
-    virtual bool DeallocPIndexedDBChild(PIndexedDBChild* aActor);
+    virtual PIndexedDBChild* AllocPIndexedDBChild() MOZ_OVERRIDE;
+    virtual bool DeallocPIndexedDBChild(PIndexedDBChild* aActor) MOZ_OVERRIDE;
 
     virtual PMemoryReportRequestChild*
-    AllocPMemoryReportRequestChild(const uint32_t& generation);
+    AllocPMemoryReportRequestChild(const uint32_t& generation) MOZ_OVERRIDE;
 
     virtual bool
-    DeallocPMemoryReportRequestChild(PMemoryReportRequestChild* actor);
+    DeallocPMemoryReportRequestChild(PMemoryReportRequestChild* actor) MOZ_OVERRIDE;
 
     virtual bool
     RecvPMemoryReportRequestConstructor(PMemoryReportRequestChild* child,
-                                        const uint32_t& generation);
+                                        const uint32_t& generation) MOZ_OVERRIDE;
 
     virtual bool
-    RecvAudioChannelNotify();
+    RecvAudioChannelNotify() MOZ_OVERRIDE;
 
     virtual bool
     RecvDumpMemoryInfoToTempDir(const nsString& aIdentifier,
                                 const bool& aMinimizeMemoryUsage,
-                                const bool& aDumpChildProcesses);
+                                const bool& aDumpChildProcesses) MOZ_OVERRIDE;
     virtual bool
     RecvDumpGCAndCCLogsToFile(const nsString& aIdentifier,
                               const bool& aDumpAllTraces,
-                              const bool& aDumpChildProcesses);
+                              const bool& aDumpChildProcesses) MOZ_OVERRIDE;
 
-    virtual PTestShellChild* AllocPTestShellChild();
-    virtual bool DeallocPTestShellChild(PTestShellChild*);
-    virtual bool RecvPTestShellConstructor(PTestShellChild*);
+    virtual PTestShellChild* AllocPTestShellChild() MOZ_OVERRIDE;
+    virtual bool DeallocPTestShellChild(PTestShellChild*) MOZ_OVERRIDE;
+    virtual bool RecvPTestShellConstructor(PTestShellChild*) MOZ_OVERRIDE;
     jsipc::JavaScriptChild *GetCPOWManager();
 
-    virtual PNeckoChild* AllocPNeckoChild();
-    virtual bool DeallocPNeckoChild(PNeckoChild*);
+    virtual PNeckoChild* AllocPNeckoChild() MOZ_OVERRIDE;
+    virtual bool DeallocPNeckoChild(PNeckoChild*) MOZ_OVERRIDE;
 
     virtual PExternalHelperAppChild *AllocPExternalHelperAppChild(
             const OptionalURIParams& uri,
             const nsCString& aMimeContentType,
             const nsCString& aContentDisposition,
             const bool& aForceSave,
             const int64_t& aContentLength,
             const OptionalURIParams& aReferrer,
-            PBrowserChild* aBrowser);
-    virtual bool DeallocPExternalHelperAppChild(PExternalHelperAppChild *aService);
+            PBrowserChild* aBrowser) MOZ_OVERRIDE;
+    virtual bool DeallocPExternalHelperAppChild(PExternalHelperAppChild *aService) MOZ_OVERRIDE;
 
-    virtual PSmsChild* AllocPSmsChild();
-    virtual bool DeallocPSmsChild(PSmsChild*);
+    virtual PSmsChild* AllocPSmsChild() MOZ_OVERRIDE;
+    virtual bool DeallocPSmsChild(PSmsChild*) MOZ_OVERRIDE;
 
-    virtual PTelephonyChild* AllocPTelephonyChild();
-    virtual bool DeallocPTelephonyChild(PTelephonyChild*);
+    virtual PTelephonyChild* AllocPTelephonyChild() MOZ_OVERRIDE;
+    virtual bool DeallocPTelephonyChild(PTelephonyChild*) MOZ_OVERRIDE;
 
-    virtual PStorageChild* AllocPStorageChild();
-    virtual bool DeallocPStorageChild(PStorageChild* aActor);
+    virtual PStorageChild* AllocPStorageChild() MOZ_OVERRIDE;
+    virtual bool DeallocPStorageChild(PStorageChild* aActor) MOZ_OVERRIDE;
 
-    virtual PBluetoothChild* AllocPBluetoothChild();
-    virtual bool DeallocPBluetoothChild(PBluetoothChild* aActor);
+    virtual PBluetoothChild* AllocPBluetoothChild() MOZ_OVERRIDE;
+    virtual bool DeallocPBluetoothChild(PBluetoothChild* aActor) MOZ_OVERRIDE;
 
-    virtual PFMRadioChild* AllocPFMRadioChild();
-    virtual bool DeallocPFMRadioChild(PFMRadioChild* aActor);
+    virtual PFMRadioChild* AllocPFMRadioChild() MOZ_OVERRIDE;
+    virtual bool DeallocPFMRadioChild(PFMRadioChild* aActor) MOZ_OVERRIDE;
 
     virtual PAsmJSCacheEntryChild* AllocPAsmJSCacheEntryChild(
                                  const asmjscache::OpenMode& aOpenMode,
                                  const asmjscache::WriteParams& aWriteParams,
                                  const IPC::Principal& aPrincipal) MOZ_OVERRIDE;
     virtual bool DeallocPAsmJSCacheEntryChild(
                                     PAsmJSCacheEntryChild* aActor) MOZ_OVERRIDE;
 
-    virtual PSpeechSynthesisChild* AllocPSpeechSynthesisChild();
-    virtual bool DeallocPSpeechSynthesisChild(PSpeechSynthesisChild* aActor);
+    virtual PSpeechSynthesisChild* AllocPSpeechSynthesisChild() MOZ_OVERRIDE;
+    virtual bool DeallocPSpeechSynthesisChild(PSpeechSynthesisChild* aActor) MOZ_OVERRIDE;
 
     virtual bool RecvRegisterChrome(const InfallibleTArray<ChromePackage>& packages,
                                     const InfallibleTArray<ResourceMapping>& resources,
                                     const InfallibleTArray<OverrideMapping>& overrides,
-                                    const nsCString& locale);
+                                    const nsCString& locale) MOZ_OVERRIDE;
 
-    virtual mozilla::jsipc::PJavaScriptChild* AllocPJavaScriptChild();
-    virtual bool DeallocPJavaScriptChild(mozilla::jsipc::PJavaScriptChild*);
+    virtual mozilla::jsipc::PJavaScriptChild* AllocPJavaScriptChild() MOZ_OVERRIDE;
+    virtual bool DeallocPJavaScriptChild(mozilla::jsipc::PJavaScriptChild*) MOZ_OVERRIDE;
 
-    virtual bool RecvSetOffline(const bool& offline);
+    virtual bool RecvSetOffline(const bool& offline) MOZ_OVERRIDE;
 
-    virtual bool RecvSpeakerManagerNotify();
+    virtual bool RecvSpeakerManagerNotify() MOZ_OVERRIDE;
 
-    virtual bool RecvNotifyVisited(const URIParams& aURI);
+    virtual bool RecvNotifyVisited(const URIParams& aURI) MOZ_OVERRIDE;
     // auto remove when alertfinished is received.
     nsresult AddRemoteAlertObserver(const nsString& aData, nsIObserver* aObserver);
 
-    virtual bool RecvPreferenceUpdate(const PrefSetting& aPref);
+    virtual bool RecvPreferenceUpdate(const PrefSetting& aPref) MOZ_OVERRIDE;
 
-    virtual bool RecvNotifyAlertsObserver(const nsCString& aType, const nsString& aData);
+    virtual bool RecvNotifyAlertsObserver(const nsCString& aType,
+                                          const nsString& aData) MOZ_OVERRIDE;
 
     virtual bool RecvAsyncMessage(const nsString& aMsg,
                                   const ClonedMessageData& aData,
                                   const InfallibleTArray<CpowEntry>& aCpows,
-                                  const IPC::Principal& aPrincipal);
+                                  const IPC::Principal& aPrincipal) MOZ_OVERRIDE;
 
-    virtual bool RecvGeolocationUpdate(const GeoPosition& somewhere);
+    virtual bool RecvGeolocationUpdate(const GeoPosition& somewhere) MOZ_OVERRIDE;
 
-    virtual bool RecvAddPermission(const IPC::Permission& permission);
+    virtual bool RecvAddPermission(const IPC::Permission& permission) MOZ_OVERRIDE;
 
-    virtual bool RecvScreenSizeChanged(const gfxIntSize &size);
+    virtual bool RecvScreenSizeChanged(const gfxIntSize &size) MOZ_OVERRIDE;
 
-    virtual bool RecvFlushMemory(const nsString& reason);
+    virtual bool RecvFlushMemory(const nsString& reason) MOZ_OVERRIDE;
 
-    virtual bool RecvActivateA11y();
+    virtual bool RecvActivateA11y() MOZ_OVERRIDE;
 
-    virtual bool RecvGarbageCollect();
-    virtual bool RecvCycleCollect();
+    virtual bool RecvGarbageCollect() MOZ_OVERRIDE;
+    virtual bool RecvCycleCollect() MOZ_OVERRIDE;
 
     virtual bool RecvAppInfo(const nsCString& version, const nsCString& buildID,
-                             const nsCString& name, const nsCString& UAName);
+                             const nsCString& name, const nsCString& UAName) MOZ_OVERRIDE;
 
-    virtual bool RecvLastPrivateDocShellDestroyed();
+    virtual bool RecvLastPrivateDocShellDestroyed() MOZ_OVERRIDE;
 
     virtual bool RecvFilePathUpdate(const nsString& aStorageType,
                                     const nsString& aStorageName,
                                     const nsString& aPath,
-                                    const nsCString& aReason);
+                                    const nsCString& aReason) MOZ_OVERRIDE;
     virtual bool RecvFileSystemUpdate(const nsString& aFsName,
                                       const nsString& aVolumeName,
                                       const int32_t& aState,
                                       const int32_t& aMountGeneration,
                                       const bool& aIsMediaPresent,
                                       const bool& aIsSharing,
-                                      const bool& aIsFormatting);
+                                      const bool& aIsFormatting) MOZ_OVERRIDE;
 
     virtual bool RecvNuwaFork() MOZ_OVERRIDE;
 
-    virtual bool RecvNotifyProcessPriorityChanged(const hal::ProcessPriority& aPriority);
-    virtual bool RecvMinimizeMemoryUsage();
-    virtual bool RecvCancelMinimizeMemoryUsage();
+    virtual bool
+    RecvNotifyProcessPriorityChanged(const hal::ProcessPriority& aPriority) MOZ_OVERRIDE;
+    virtual bool RecvMinimizeMemoryUsage() MOZ_OVERRIDE;
+    virtual bool RecvCancelMinimizeMemoryUsage() MOZ_OVERRIDE;
 
-    virtual bool RecvLoadAndRegisterSheet(const URIParams& aURI, const uint32_t& aType);
-    virtual bool RecvUnregisterSheet(const URIParams& aURI, const uint32_t& aType);
+    virtual bool RecvLoadAndRegisterSheet(const URIParams& aURI,
+                                          const uint32_t& aType) MOZ_OVERRIDE;
+    virtual bool RecvUnregisterSheet(const URIParams& aURI, const uint32_t& aType) MOZ_OVERRIDE;
 
-    virtual bool RecvNotifyPhoneStateChange(const nsString& state);
+    virtual bool RecvNotifyPhoneStateChange(const nsString& state) MOZ_OVERRIDE;
 
     void AddIdleObserver(nsIObserver* aObserver, uint32_t aIdleTimeInS);
     void RemoveIdleObserver(nsIObserver* aObserver, uint32_t aIdleTimeInS);
     virtual bool RecvNotifyIdleObserver(const uint64_t& aObserver,
                                         const nsCString& aTopic,
-                                        const nsString& aData);
+                                        const nsString& aData) MOZ_OVERRIDE;
 #ifdef ANDROID
     gfxIntSize GetScreenSize() { return mScreenSize; }
 #endif
 
     // Get the directory for IndexedDB files. We query the parent for this and
     // cache the value
     nsString &GetIndexedDBPath();
 
@@ -259,17 +262,17 @@ public:
     bool IsForApp() { return mIsForApp; }
     bool IsForBrowser() { return mIsForBrowser; }
 
     BlobChild* GetOrCreateActorForBlob(nsIDOMBlob* aBlob);
 
 protected:
     virtual bool RecvPBrowserConstructor(PBrowserChild* actor,
                                          const IPCTabContext& context,
-                                         const uint32_t& chromeFlags);
+                                         const uint32_t& chromeFlags) MOZ_OVERRIDE;
 
 private:
     virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE;
 
     virtual void ProcessingError(Result what) MOZ_OVERRIDE;
 
     /**
      * Exit *now*.  Do not shut down XPCOM, do not pass Go, do not run
--- a/dom/ipc/ContentParent.h
+++ b/dom/ipc/ContentParent.h
@@ -184,17 +184,17 @@ public:
     virtual void OnChannelError() MOZ_OVERRIDE;
 
     virtual PIndexedDBParent* AllocPIndexedDBParent() MOZ_OVERRIDE;
     virtual bool
     RecvPIndexedDBConstructor(PIndexedDBParent* aActor) MOZ_OVERRIDE;
 
     virtual PCrashReporterParent*
     AllocPCrashReporterParent(const NativeThreadId& tid,
-                        const uint32_t& processType) MOZ_OVERRIDE;
+                              const uint32_t& processType) MOZ_OVERRIDE;
     virtual bool
     RecvPCrashReporterConstructor(PCrashReporterParent* actor,
                                   const NativeThreadId& tid,
                                   const uint32_t& processType) MOZ_OVERRIDE;
 
     virtual PNeckoParent* AllocPNeckoParent() MOZ_OVERRIDE;
     virtual bool RecvPNeckoConstructor(PNeckoParent* aActor) MOZ_OVERRIDE {
         return PContentParent::RecvPNeckoConstructor(aActor);
@@ -218,17 +218,17 @@ public:
     }
 
     virtual bool RecvRecordingDeviceEvents(const nsString& aRecordingStatus,
                                            const nsString& aPageURL,
                                            const bool& aIsAudio,
                                            const bool& aIsVideo) MOZ_OVERRIDE;
 protected:
     void OnChannelConnected(int32_t pid) MOZ_OVERRIDE;
-    virtual void ActorDestroy(ActorDestroyReason why);
+    virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE;
     void OnNuwaForkTimeout();
 
     bool ShouldContinueFromReplyTimeout() MOZ_OVERRIDE;
     bool ShouldSandboxContentProcesses();
 
 private:
     static nsDataHashtable<nsStringHashKey, ContentParent*> *sAppContentParents;
     static nsTArray<ContentParent*>* sNonAppContentParents;
@@ -326,209 +326,218 @@ private:
     AllocPImageBridgeParent(mozilla::ipc::Transport* aTransport,
                             base::ProcessId aOtherProcess) MOZ_OVERRIDE;
 
     virtual bool RecvGetProcessAttributes(uint64_t* aId,
                                           bool* aIsForApp,
                                           bool* aIsForBrowser) MOZ_OVERRIDE;
     virtual bool RecvGetXPCOMProcessAttributes(bool* aIsOffline) MOZ_OVERRIDE;
 
-    virtual bool DeallocPJavaScriptParent(mozilla::jsipc::PJavaScriptParent*);
+    virtual bool DeallocPJavaScriptParent(mozilla::jsipc::PJavaScriptParent*) MOZ_OVERRIDE;
 
     virtual PBrowserParent* AllocPBrowserParent(const IPCTabContext& aContext,
-                                                const uint32_t& aChromeFlags);
-    virtual bool DeallocPBrowserParent(PBrowserParent* frame);
+                                                const uint32_t& aChromeFlags) MOZ_OVERRIDE;
+    virtual bool DeallocPBrowserParent(PBrowserParent* frame) MOZ_OVERRIDE;
 
-    virtual PDeviceStorageRequestParent* AllocPDeviceStorageRequestParent(const DeviceStorageParams&);
-    virtual bool DeallocPDeviceStorageRequestParent(PDeviceStorageRequestParent*);
+    virtual PDeviceStorageRequestParent*
+    AllocPDeviceStorageRequestParent(const DeviceStorageParams&) MOZ_OVERRIDE;
+    virtual bool DeallocPDeviceStorageRequestParent(PDeviceStorageRequestParent*) MOZ_OVERRIDE;
 
-    virtual PBlobParent* AllocPBlobParent(const BlobConstructorParams& aParams);
-    virtual bool DeallocPBlobParent(PBlobParent*);
+    virtual PBlobParent* AllocPBlobParent(const BlobConstructorParams& aParams) MOZ_OVERRIDE;
+    virtual bool DeallocPBlobParent(PBlobParent*) MOZ_OVERRIDE;
 
-    virtual bool DeallocPCrashReporterParent(PCrashReporterParent* crashreporter);
+    virtual bool DeallocPCrashReporterParent(PCrashReporterParent* crashreporter) MOZ_OVERRIDE;
 
     virtual bool RecvGetRandomValues(const uint32_t& length,
-                                     InfallibleTArray<uint8_t>* randomValues);
+                                     InfallibleTArray<uint8_t>* randomValues) MOZ_OVERRIDE;
 
     virtual bool DeallocPHalParent(PHalParent*) MOZ_OVERRIDE;
 
-    virtual bool DeallocPIndexedDBParent(PIndexedDBParent* aActor);
-
-    virtual PMemoryReportRequestParent* AllocPMemoryReportRequestParent(const uint32_t& generation);
-    virtual bool DeallocPMemoryReportRequestParent(PMemoryReportRequestParent* actor);
+    virtual bool DeallocPIndexedDBParent(PIndexedDBParent* aActor) MOZ_OVERRIDE;
 
-    virtual PTestShellParent* AllocPTestShellParent();
-    virtual bool DeallocPTestShellParent(PTestShellParent* shell);
+    virtual PMemoryReportRequestParent*
+    AllocPMemoryReportRequestParent(const uint32_t& generation) MOZ_OVERRIDE;
+    virtual bool DeallocPMemoryReportRequestParent(PMemoryReportRequestParent* actor) MOZ_OVERRIDE;
 
-    virtual bool DeallocPNeckoParent(PNeckoParent* necko);
+    virtual PTestShellParent* AllocPTestShellParent() MOZ_OVERRIDE;
+    virtual bool DeallocPTestShellParent(PTestShellParent* shell) MOZ_OVERRIDE;
+
+    virtual bool DeallocPNeckoParent(PNeckoParent* necko) MOZ_OVERRIDE;
 
     virtual PExternalHelperAppParent* AllocPExternalHelperAppParent(
             const OptionalURIParams& aUri,
             const nsCString& aMimeContentType,
             const nsCString& aContentDisposition,
             const bool& aForceSave,
             const int64_t& aContentLength,
             const OptionalURIParams& aReferrer,
-            PBrowserParent* aBrowser);
-    virtual bool DeallocPExternalHelperAppParent(PExternalHelperAppParent* aService);
+            PBrowserParent* aBrowser) MOZ_OVERRIDE;
+    virtual bool DeallocPExternalHelperAppParent(PExternalHelperAppParent* aService) MOZ_OVERRIDE;
 
-    virtual PSmsParent* AllocPSmsParent();
-    virtual bool DeallocPSmsParent(PSmsParent*);
+    virtual PSmsParent* AllocPSmsParent() MOZ_OVERRIDE;
+    virtual bool DeallocPSmsParent(PSmsParent*) MOZ_OVERRIDE;
 
-    virtual PTelephonyParent* AllocPTelephonyParent();
-    virtual bool DeallocPTelephonyParent(PTelephonyParent*);
+    virtual PTelephonyParent* AllocPTelephonyParent() MOZ_OVERRIDE;
+    virtual bool DeallocPTelephonyParent(PTelephonyParent*) MOZ_OVERRIDE;
 
-    virtual bool DeallocPStorageParent(PStorageParent* aActor);
+    virtual bool DeallocPStorageParent(PStorageParent* aActor) MOZ_OVERRIDE;
 
-    virtual PBluetoothParent* AllocPBluetoothParent();
-    virtual bool DeallocPBluetoothParent(PBluetoothParent* aActor);
-    virtual bool RecvPBluetoothConstructor(PBluetoothParent* aActor);
+    virtual PBluetoothParent* AllocPBluetoothParent() MOZ_OVERRIDE;
+    virtual bool DeallocPBluetoothParent(PBluetoothParent* aActor) MOZ_OVERRIDE;
+    virtual bool RecvPBluetoothConstructor(PBluetoothParent* aActor) MOZ_OVERRIDE;
 
-    virtual PFMRadioParent* AllocPFMRadioParent();
-    virtual bool DeallocPFMRadioParent(PFMRadioParent* aActor);
+    virtual PFMRadioParent* AllocPFMRadioParent() MOZ_OVERRIDE;
+    virtual bool DeallocPFMRadioParent(PFMRadioParent* aActor) MOZ_OVERRIDE;
 
     virtual PAsmJSCacheEntryParent* AllocPAsmJSCacheEntryParent(
                                  const asmjscache::OpenMode& aOpenMode,
                                  const asmjscache::WriteParams& aWriteParams,
                                  const IPC::Principal& aPrincipal) MOZ_OVERRIDE;
     virtual bool DeallocPAsmJSCacheEntryParent(
                                    PAsmJSCacheEntryParent* aActor) MOZ_OVERRIDE;
 
-    virtual PSpeechSynthesisParent* AllocPSpeechSynthesisParent();
-    virtual bool DeallocPSpeechSynthesisParent(PSpeechSynthesisParent* aActor);
-    virtual bool RecvPSpeechSynthesisConstructor(PSpeechSynthesisParent* aActor);
+    virtual PSpeechSynthesisParent* AllocPSpeechSynthesisParent() MOZ_OVERRIDE;
+    virtual bool DeallocPSpeechSynthesisParent(PSpeechSynthesisParent* aActor) MOZ_OVERRIDE;
+    virtual bool RecvPSpeechSynthesisConstructor(PSpeechSynthesisParent* aActor) MOZ_OVERRIDE;
 
-    virtual bool RecvReadPrefsArray(InfallibleTArray<PrefSetting>* aPrefs);
-    virtual bool RecvReadFontList(InfallibleTArray<FontListEntry>* retValue);
+    virtual bool RecvReadPrefsArray(InfallibleTArray<PrefSetting>* aPrefs) MOZ_OVERRIDE;
+    virtual bool RecvReadFontList(InfallibleTArray<FontListEntry>* retValue) MOZ_OVERRIDE;
 
-    virtual bool RecvReadPermissions(InfallibleTArray<IPC::Permission>* aPermissions);
+    virtual bool RecvReadPermissions(InfallibleTArray<IPC::Permission>* aPermissions) MOZ_OVERRIDE;
 
-    virtual bool RecvSetClipboardText(const nsString& text, const bool& isPrivateData, const int32_t& whichClipboard);
-    virtual bool RecvGetClipboardText(const int32_t& whichClipboard, nsString* text);
-    virtual bool RecvEmptyClipboard();
-    virtual bool RecvClipboardHasText(bool* hasText);
+    virtual bool RecvSetClipboardText(const nsString& text,
+                                      const bool& isPrivateData,
+                                      const int32_t& whichClipboard) MOZ_OVERRIDE;
+    virtual bool RecvGetClipboardText(const int32_t& whichClipboard, nsString* text) MOZ_OVERRIDE;
+    virtual bool RecvEmptyClipboard() MOZ_OVERRIDE;
+    virtual bool RecvClipboardHasText(bool* hasText) MOZ_OVERRIDE;
 
-    virtual bool RecvGetSystemColors(const uint32_t& colorsCount, InfallibleTArray<uint32_t>* colors);
-    virtual bool RecvGetIconForExtension(const nsCString& aFileExt, const uint32_t& aIconSize, InfallibleTArray<uint8_t>* bits);
-    virtual bool RecvGetShowPasswordSetting(bool* showPassword);
+    virtual bool RecvGetSystemColors(const uint32_t& colorsCount,
+                                     InfallibleTArray<uint32_t>* colors) MOZ_OVERRIDE;
+    virtual bool RecvGetIconForExtension(const nsCString& aFileExt,
+                                         const uint32_t& aIconSize,
+                                         InfallibleTArray<uint8_t>* bits) MOZ_OVERRIDE;
+    virtual bool RecvGetShowPasswordSetting(bool* showPassword) MOZ_OVERRIDE;
 
-    virtual bool RecvStartVisitedQuery(const URIParams& uri);
+    virtual bool RecvStartVisitedQuery(const URIParams& uri) MOZ_OVERRIDE;
 
     virtual bool RecvVisitURI(const URIParams& uri,
                               const OptionalURIParams& referrer,
-                              const uint32_t& flags);
+                              const uint32_t& flags) MOZ_OVERRIDE;
 
     virtual bool RecvSetURITitle(const URIParams& uri,
-                                 const nsString& title);
+                                 const nsString& title) MOZ_OVERRIDE;
 
     virtual bool RecvShowFilePicker(const int16_t& mode,
                                     const int16_t& selectedType,
                                     const bool& addToRecentDocs,
                                     const nsString& title,
                                     const nsString& defaultFile,
                                     const nsString& defaultExtension,
                                     const InfallibleTArray<nsString>& filters,
                                     const InfallibleTArray<nsString>& filterNames,
                                     InfallibleTArray<nsString>* files,
                                     int16_t* retValue,
-                                    nsresult* result);
+                                    nsresult* result) MOZ_OVERRIDE;
 
     virtual bool RecvShowAlertNotification(const nsString& aImageUrl, const nsString& aTitle,
                                            const nsString& aText, const bool& aTextClickable,
                                            const nsString& aCookie, const nsString& aName,
                                            const nsString& aBidi, const nsString& aLang,
-                                           const IPC::Principal& aPrincipal);
+                                           const IPC::Principal& aPrincipal) MOZ_OVERRIDE;
 
     virtual bool RecvCloseAlert(const nsString& aName,
-                                const IPC::Principal& aPrincipal);
+                                const IPC::Principal& aPrincipal) MOZ_OVERRIDE;
 
-    virtual bool RecvLoadURIExternal(const URIParams& uri);
+    virtual bool RecvLoadURIExternal(const URIParams& uri) MOZ_OVERRIDE;
 
     virtual bool RecvSyncMessage(const nsString& aMsg,
                                  const ClonedMessageData& aData,
                                  const InfallibleTArray<CpowEntry>& aCpows,
                                  const IPC::Principal& aPrincipal,
-                                 InfallibleTArray<nsString>* aRetvals);
+                                 InfallibleTArray<nsString>* aRetvals) MOZ_OVERRIDE;
     virtual bool AnswerRpcMessage(const nsString& aMsg,
                                   const ClonedMessageData& aData,
                                   const InfallibleTArray<CpowEntry>& aCpows,
                                   const IPC::Principal& aPrincipal,
-                                  InfallibleTArray<nsString>* aRetvals);
+                                  InfallibleTArray<nsString>* aRetvals) MOZ_OVERRIDE;
     virtual bool RecvAsyncMessage(const nsString& aMsg,
                                   const ClonedMessageData& aData,
                                   const InfallibleTArray<CpowEntry>& aCpows,
-                                  const IPC::Principal& aPrincipal);
+                                  const IPC::Principal& aPrincipal) MOZ_OVERRIDE;
 
     virtual bool RecvFilePathUpdateNotify(const nsString& aType,
                                           const nsString& aStorageName,
                                           const nsString& aFilePath,
-                                          const nsCString& aReason);
+                                          const nsCString& aReason) MOZ_OVERRIDE;
 
     virtual bool RecvAddGeolocationListener(const IPC::Principal& aPrincipal,
-                                            const bool& aHighAccuracy);
-    virtual bool RecvRemoveGeolocationListener();
-    virtual bool RecvSetGeolocationHigherAccuracy(const bool& aEnable);
+                                            const bool& aHighAccuracy) MOZ_OVERRIDE;
+    virtual bool RecvRemoveGeolocationListener() MOZ_OVERRIDE;
+    virtual bool RecvSetGeolocationHigherAccuracy(const bool& aEnable) MOZ_OVERRIDE;
 
-    virtual bool RecvConsoleMessage(const nsString& aMessage);
+    virtual bool RecvConsoleMessage(const nsString& aMessage) MOZ_OVERRIDE;
     virtual bool RecvScriptError(const nsString& aMessage,
                                  const nsString& aSourceName,
                                  const nsString& aSourceLine,
                                  const uint32_t& aLineNumber,
                                  const uint32_t& aColNumber,
                                  const uint32_t& aFlags,
-                                 const nsCString& aCategory);
+                                 const nsCString& aCategory) MOZ_OVERRIDE;
 
-    virtual bool RecvPrivateDocShellsExist(const bool& aExist);
+    virtual bool RecvPrivateDocShellsExist(const bool& aExist) MOZ_OVERRIDE;
 
-    virtual bool RecvFirstIdle();
+    virtual bool RecvFirstIdle() MOZ_OVERRIDE;
 
     virtual bool RecvAudioChannelGetState(const AudioChannelType& aType,
                                           const bool& aElementHidden,
                                           const bool& aElementWasHidden,
-                                          AudioChannelState* aValue);
+                                          AudioChannelState* aValue) MOZ_OVERRIDE;
 
     virtual bool RecvAudioChannelRegisterType(const AudioChannelType& aType,
-                                              const bool& aWithVideo);
+                                              const bool& aWithVideo) MOZ_OVERRIDE;
     virtual bool RecvAudioChannelUnregisterType(const AudioChannelType& aType,
                                                 const bool& aElementHidden,
-                                                const bool& aWithVideo);
+                                                const bool& aWithVideo) MOZ_OVERRIDE;
 
-    virtual bool RecvAudioChannelChangedNotification();
+    virtual bool RecvAudioChannelChangedNotification() MOZ_OVERRIDE;
 
-    virtual bool RecvAudioChannelChangeDefVolChannel(
-      const AudioChannelType& aType, const bool& aHidden);
+    virtual bool RecvAudioChannelChangeDefVolChannel(const AudioChannelType& aType,
+                                                     const bool& aHidden) MOZ_OVERRIDE;
 
-    virtual bool RecvBroadcastVolume(const nsString& aVolumeName);
+    virtual bool RecvBroadcastVolume(const nsString& aVolumeName) MOZ_OVERRIDE;
 
-    virtual bool RecvSpeakerManagerGetSpeakerStatus(bool* aValue);
+    virtual bool RecvSpeakerManagerGetSpeakerStatus(bool* aValue) MOZ_OVERRIDE;
 
-    virtual bool RecvSpeakerManagerForceSpeaker(const bool& aEnable);
+    virtual bool RecvSpeakerManagerForceSpeaker(const bool& aEnable) MOZ_OVERRIDE;
 
     virtual bool RecvSystemMessageHandled() MOZ_OVERRIDE;
 
     virtual bool RecvNuwaReady() MOZ_OVERRIDE;
 
     virtual bool RecvAddNewProcess(const uint32_t& aPid,
                                    const InfallibleTArray<ProtocolFdMapping>& aFds) MOZ_OVERRIDE;
 
     virtual bool RecvCreateFakeVolume(const nsString& fsName, const nsString& mountPoint) MOZ_OVERRIDE;
 
     virtual bool RecvSetFakeVolumeState(const nsString& fsName, const int32_t& fsState) MOZ_OVERRIDE;
 
     virtual bool RecvKeywordToURI(const nsCString& aKeyword, OptionalInputStreamParams* aPostData,
-                                  OptionalURIParams* aURI);
+                                  OptionalURIParams* aURI) MOZ_OVERRIDE;
 
     virtual void ProcessingError(Result what) MOZ_OVERRIDE;
 
     virtual bool RecvGetGraphicsFeatureStatus(const int32_t& aFeature,
                                               int32_t* aStatus,
-                                              bool* aSuccess);
+                                              bool* aSuccess) MOZ_OVERRIDE;
 
-    virtual bool RecvAddIdleObserver(const uint64_t& observerId, const uint32_t& aIdleTimeInS);
-    virtual bool RecvRemoveIdleObserver(const uint64_t& observerId, const uint32_t& aIdleTimeInS);
+    virtual bool RecvAddIdleObserver(const uint64_t& observerId,
+                                     const uint32_t& aIdleTimeInS) MOZ_OVERRIDE;
+    virtual bool RecvRemoveIdleObserver(const uint64_t& observerId,
+                                        const uint32_t& aIdleTimeInS) MOZ_OVERRIDE;
 
     // If you add strong pointers to cycle collected objects here, be sure to
     // release these objects in ShutDownProcess.  See the comment there for more
     // details.
 
     GeckoChildProcessHost* mSubprocess;
     base::ChildPrivileges mOSPrivileges;
 
--- a/dom/ipc/CrashReporterParent.h
+++ b/dom/ipc/CrashReporterParent.h
@@ -73,22 +73,22 @@ public:
     return mChildDumpID;
   }
 
   void
   AnnotateCrashReport(const nsCString& key, const nsCString& data);
 
  protected:
   virtual bool
-    RecvAnnotateCrashReport(const nsCString& key, const nsCString& data) {
+    RecvAnnotateCrashReport(const nsCString& key, const nsCString& data) MOZ_OVERRIDE {
     AnnotateCrashReport(key, data);
     return true;
   }
   virtual bool
-    RecvAppendAppNotes(const nsCString& data);
+    RecvAppendAppNotes(const nsCString& data) MOZ_OVERRIDE;
   virtual mozilla::ipc::IProtocol*
   CloneProtocol(Channel* aChannel,
                 mozilla::ipc::ProtocolCloneContext *aCtx) MOZ_OVERRIDE;
 
 #ifdef MOZ_CRASHREPORTER
   AnnotationTable mNotes;
 #endif
   nsCString mAppNotes;
--- a/dom/ipc/TabChild.h
+++ b/dom/ipc/TabChild.h
@@ -204,105 +204,112 @@ public:
                                        InfallibleTArray<nsString>* aJSONRetVal,
                                        bool aIsSync) MOZ_OVERRIDE;
     virtual bool DoSendAsyncMessage(JSContext* aCx,
                                     const nsAString& aMessage,
                                     const mozilla::dom::StructuredCloneData& aData,
                                     JS::Handle<JSObject *> aCpows,
                                     nsIPrincipal* aPrincipal) MOZ_OVERRIDE;
 
-    virtual bool RecvLoadURL(const nsCString& uri);
+    virtual bool RecvLoadURL(const nsCString& uri) MOZ_OVERRIDE;
     virtual bool RecvCacheFileDescriptor(const nsString& aPath,
                                          const FileDescriptor& aFileDescriptor)
                                          MOZ_OVERRIDE;
-    virtual bool RecvShow(const nsIntSize& size);
-    virtual bool RecvUpdateDimensions(const nsRect& rect, const nsIntSize& size, const ScreenOrientation& orientation);
-    virtual bool RecvUpdateFrame(const mozilla::layers::FrameMetrics& aFrameMetrics);
-    virtual bool RecvHandleDoubleTap(const CSSIntPoint& aPoint);
-    virtual bool RecvHandleSingleTap(const CSSIntPoint& aPoint);
-    virtual bool RecvHandleLongTap(const CSSIntPoint& aPoint);
-    virtual bool RecvHandleLongTapUp(const CSSIntPoint& aPoint);
-    virtual bool RecvNotifyTransformBegin(const ViewID& aViewId);
-    virtual bool RecvNotifyTransformEnd(const ViewID& aViewId);
-    virtual bool RecvActivate();
-    virtual bool RecvDeactivate();
+    virtual bool RecvShow(const nsIntSize& size) MOZ_OVERRIDE;
+    virtual bool RecvUpdateDimensions(const nsRect& rect,
+                                      const nsIntSize& size,
+                                      const ScreenOrientation& orientation) MOZ_OVERRIDE;
+    virtual bool RecvUpdateFrame(const mozilla::layers::FrameMetrics& aFrameMetrics) MOZ_OVERRIDE;
+    virtual bool RecvHandleDoubleTap(const CSSIntPoint& aPoint) MOZ_OVERRIDE;
+    virtual bool RecvHandleSingleTap(const CSSIntPoint& aPoint) MOZ_OVERRIDE;
+    virtual bool RecvHandleLongTap(const CSSIntPoint& aPoint) MOZ_OVERRIDE;
+    virtual bool RecvHandleLongTapUp(const CSSIntPoint& aPoint) MOZ_OVERRIDE;
+    virtual bool RecvNotifyTransformBegin(const ViewID& aViewId) MOZ_OVERRIDE;
+    virtual bool RecvNotifyTransformEnd(const ViewID& aViewId) MOZ_OVERRIDE;
+    virtual bool RecvActivate() MOZ_OVERRIDE;
+    virtual bool RecvDeactivate() MOZ_OVERRIDE;
     virtual bool RecvMouseEvent(const nsString& aType,
                                 const float&    aX,
                                 const float&    aY,
                                 const int32_t&  aButton,
                                 const int32_t&  aClickCount,
                                 const int32_t&  aModifiers,
-                                const bool&     aIgnoreRootScrollFrame);
-    virtual bool RecvRealMouseEvent(const mozilla::WidgetMouseEvent& event);
-    virtual bool RecvRealKeyEvent(const mozilla::WidgetKeyboardEvent& event);
-    virtual bool RecvMouseWheelEvent(const mozilla::WidgetWheelEvent& event);
+                                const bool&     aIgnoreRootScrollFrame) MOZ_OVERRIDE;
+    virtual bool RecvRealMouseEvent(const mozilla::WidgetMouseEvent& event) MOZ_OVERRIDE;
+    virtual bool RecvRealKeyEvent(const mozilla::WidgetKeyboardEvent& event) MOZ_OVERRIDE;
+    virtual bool RecvMouseWheelEvent(const mozilla::WidgetWheelEvent& event) MOZ_OVERRIDE;
     virtual bool RecvRealTouchEvent(const WidgetTouchEvent& aEvent,
-                                    const ScrollableLayerGuid& aGuid);
+                                    const ScrollableLayerGuid& aGuid) MOZ_OVERRIDE;
     virtual bool RecvRealTouchMoveEvent(const WidgetTouchEvent& aEvent,
-                                        const ScrollableLayerGuid& aGuid);
+                                        const ScrollableLayerGuid& aGuid) MOZ_OVERRIDE;
     virtual bool RecvKeyEvent(const nsString& aType,
                               const int32_t&  aKeyCode,
                               const int32_t&  aCharCode,
                               const int32_t&  aModifiers,
-                              const bool&     aPreventDefault);
-    virtual bool RecvCompositionEvent(const mozilla::WidgetCompositionEvent& event);
-    virtual bool RecvTextEvent(const mozilla::WidgetTextEvent& event);
-    virtual bool RecvSelectionEvent(const mozilla::WidgetSelectionEvent& event);
-    virtual bool RecvActivateFrameEvent(const nsString& aType, const bool& capture);
-    virtual bool RecvLoadRemoteScript(const nsString& aURL, const bool& aRunInGlobalScope);
+                              const bool&     aPreventDefault) MOZ_OVERRIDE;
+    virtual bool RecvCompositionEvent(const mozilla::WidgetCompositionEvent& event) MOZ_OVERRIDE;
+    virtual bool RecvTextEvent(const mozilla::WidgetTextEvent& event) MOZ_OVERRIDE;
+    virtual bool RecvSelectionEvent(const mozilla::WidgetSelectionEvent& event) MOZ_OVERRIDE;
+    virtual bool RecvActivateFrameEvent(const nsString& aType, const bool& capture) MOZ_OVERRIDE;
+    virtual bool RecvLoadRemoteScript(const nsString& aURL,
+                                      const bool& aRunInGlobalScope) MOZ_OVERRIDE;
     virtual bool RecvAsyncMessage(const nsString& aMessage,
                                   const ClonedMessageData& aData,
                                   const InfallibleTArray<CpowEntry>& aCpows,
                                   const IPC::Principal& aPrincipal) MOZ_OVERRIDE;
 
     virtual PDocumentRendererChild*
     AllocPDocumentRendererChild(const nsRect& documentRect, const gfx::Matrix& transform,
                                 const nsString& bgcolor,
                                 const uint32_t& renderFlags, const bool& flushLayout,
-                                const nsIntSize& renderSize);
-    virtual bool DeallocPDocumentRendererChild(PDocumentRendererChild* actor);
+                                const nsIntSize& renderSize) MOZ_OVERRIDE;
+    virtual bool DeallocPDocumentRendererChild(PDocumentRendererChild* actor) MOZ_OVERRIDE;
     virtual bool RecvPDocumentRendererConstructor(PDocumentRendererChild* actor,
                                                   const nsRect& documentRect,
                                                   const gfx::Matrix& transform,
                                                   const nsString& bgcolor,
                                                   const uint32_t& renderFlags,
                                                   const bool& flushLayout,
-                                                  const nsIntSize& renderSize);
+                                                  const nsIntSize& renderSize) MOZ_OVERRIDE;
 
     virtual PContentDialogChild* AllocPContentDialogChild(const uint32_t&,
                                                           const nsCString&,
                                                           const nsCString&,
                                                           const InfallibleTArray<int>&,
-                                                          const InfallibleTArray<nsString>&);
-    virtual bool DeallocPContentDialogChild(PContentDialogChild* aDialog);
+                                                          const InfallibleTArray<nsString>&)
+                                                          MOZ_OVERRIDE;
+    virtual bool DeallocPContentDialogChild(PContentDialogChild* aDialog) MOZ_OVERRIDE;
     static void ParamsToArrays(nsIDialogParamBlock* aParams,
                                InfallibleTArray<int>& aIntParams,
                                InfallibleTArray<nsString>& aStringParams);
     static void ArraysToParams(const InfallibleTArray<int>& aIntParams,
                                const InfallibleTArray<nsString>& aStringParams,
                                nsIDialogParamBlock* aParams);
 
 #ifdef DEBUG
     virtual PContentPermissionRequestChild*
     SendPContentPermissionRequestConstructor(PContentPermissionRequestChild* aActor,
                                              const nsCString& aType,
                                              const nsCString& aAccess,
                                              const IPC::Principal& aPrincipal);
 #endif /* DEBUG */
 
-    virtual PContentPermissionRequestChild* AllocPContentPermissionRequestChild(const nsCString& aType,
-                                                                                const nsCString& aAccess,
-                                                                                const IPC::Principal& aPrincipal);
-    virtual bool DeallocPContentPermissionRequestChild(PContentPermissionRequestChild* actor);
+    virtual PContentPermissionRequestChild*
+    AllocPContentPermissionRequestChild(const nsCString& aType,
+                                        const nsCString& aAccess,
+                                        const IPC::Principal& aPrincipal) MOZ_OVERRIDE;
+    virtual bool
+    DeallocPContentPermissionRequestChild(PContentPermissionRequestChild* actor) MOZ_OVERRIDE;
 
     virtual POfflineCacheUpdateChild* AllocPOfflineCacheUpdateChild(
             const URIParams& manifestURI,
             const URIParams& documentURI,
-            const bool& stickDocument);
-    virtual bool DeallocPOfflineCacheUpdateChild(POfflineCacheUpdateChild* offlineCacheUpdate);
+            const bool& stickDocument) MOZ_OVERRIDE;
+    virtual bool
+    DeallocPOfflineCacheUpdateChild(POfflineCacheUpdateChild* offlineCacheUpdate) MOZ_OVERRIDE;
 
     nsIWebNavigation* WebNavigation() { return mWebNav; }
 
     nsIPrincipal* GetPrincipal() { return mPrincipal; }
 
     /** Return the DPI of the widget this TabChild draws to. */
     void GetDPI(float* aDPI);
     void GetDefaultScale(double *aScale);
@@ -371,19 +378,19 @@ protected:
     virtual bool DeallocPRenderFrameChild(PRenderFrameChild* aFrame) MOZ_OVERRIDE;
     virtual bool RecvDestroy() MOZ_OVERRIDE;
     virtual bool RecvSetUpdateHitRegion(const bool& aEnabled) MOZ_OVERRIDE;
 
     nsEventStatus DispatchWidgetEvent(WidgetGUIEvent& event);
 
     virtual PIndexedDBChild* AllocPIndexedDBChild(const nsCString& aGroup,
                                                   const nsCString& aASCIIOrigin,
-                                                  bool* /* aAllowed */);
+                                                  bool* /* aAllowed */) MOZ_OVERRIDE;
 
-    virtual bool DeallocPIndexedDBChild(PIndexedDBChild* aActor);
+    virtual bool DeallocPIndexedDBChild(PIndexedDBChild* aActor) MOZ_OVERRIDE;
 
 private:
     /**
      * Create a new TabChild object.
      *
      * |aOwnOrContainingAppId| is the app-id of our frame or of the closest app
      * frame in the hierarchy which contains us.
      *
@@ -397,17 +404,17 @@ private:
     // sets the appropriate app-id and is-browser flags on our docshell.)
     //
     // You should call this after calling TabContext::SetTabContext().  We also
     // call this during Init().
     void NotifyTabContextUpdated();
 
     bool UseDirectCompositor();
 
-    void ActorDestroy(ActorDestroyReason why);
+    void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE;
 
     enum FrameScriptLoading { DONT_LOAD_SCRIPTS, DEFAULT_LOAD_SCRIPTS };
     bool InitTabChildGlobal(FrameScriptLoading aScriptLoading = DEFAULT_LOAD_SCRIPTS);
     bool InitRenderingState();
     void DestroyWindow();
     void SetProcessNameToAppName();
     bool ProcessUpdateFrame(const mozilla::layers::FrameMetrics& aFrameMetrics);
 
--- a/dom/ipc/TabParent.h
+++ b/dom/ipc/TabParent.h
@@ -105,91 +105,92 @@ public:
      *
      * It's an error to call TryCapture() if this isn't the event
      * capturer.
      */
     bool TryCapture(const WidgetGUIEvent& aEvent);
 
     void Destroy();
 
-    virtual bool RecvMoveFocus(const bool& aForward);
-    virtual bool RecvEvent(const RemoteDOMEvent& aEvent);
-    virtual bool RecvPRenderFrameConstructor(PRenderFrameParent* actor);
+    virtual bool RecvMoveFocus(const bool& aForward) MOZ_OVERRIDE;
+    virtual bool RecvEvent(const RemoteDOMEvent& aEvent) MOZ_OVERRIDE;
+    virtual bool RecvPRenderFrameConstructor(PRenderFrameParent* actor) MOZ_OVERRIDE;
     virtual bool RecvInitRenderFrame(PRenderFrameParent* aFrame,
                                      ScrollingBehavior* scrolling,
                                      TextureFactoryIdentifier* identifier,
                                      uint64_t* layersId,
-                                     bool *aSuccess);
+                                     bool *aSuccess) MOZ_OVERRIDE;
     virtual bool RecvBrowserFrameOpenWindow(PBrowserParent* aOpener,
                                             const nsString& aURL,
                                             const nsString& aName,
                                             const nsString& aFeatures,
-                                            bool* aOutWindowOpened);
-    virtual bool AnswerCreateWindow(PBrowserParent** retval);
+                                            bool* aOutWindowOpened) MOZ_OVERRIDE;
+    virtual bool AnswerCreateWindow(PBrowserParent** retval) MOZ_OVERRIDE;
     virtual bool RecvSyncMessage(const nsString& aMessage,
                                  const ClonedMessageData& aData,
                                  const InfallibleTArray<CpowEntry>& aCpows,
                                  const IPC::Principal& aPrincipal,
-                                 InfallibleTArray<nsString>* aJSONRetVal);
+                                 InfallibleTArray<nsString>* aJSONRetVal) MOZ_OVERRIDE;
     virtual bool AnswerRpcMessage(const nsString& aMessage,
                                   const ClonedMessageData& aData,
                                   const InfallibleTArray<CpowEntry>& aCpows,
                                   const IPC::Principal& aPrincipal,
-                                  InfallibleTArray<nsString>* aJSONRetVal);
+                                  InfallibleTArray<nsString>* aJSONRetVal) MOZ_OVERRIDE;
     virtual bool RecvAsyncMessage(const nsString& aMessage,
                                   const ClonedMessageData& aData,
                                   const InfallibleTArray<CpowEntry>& aCpows,
-                                  const IPC::Principal& aPrincipal);
+                                  const IPC::Principal& aPrincipal) MOZ_OVERRIDE;
     virtual bool RecvNotifyIMEFocus(const bool& aFocus,
                                     nsIMEUpdatePreference* aPreference,
-                                    uint32_t* aSeqno);
+                                    uint32_t* aSeqno) MOZ_OVERRIDE;
     virtual bool RecvNotifyIMETextChange(const uint32_t& aStart,
                                          const uint32_t& aEnd,
-                                         const uint32_t& aNewEnd);
+                                         const uint32_t& aNewEnd) MOZ_OVERRIDE;
     virtual bool RecvNotifyIMESelectedCompositionRect(const uint32_t& aOffset,
                                                       const nsIntRect& aRect,
                                                       const nsIntRect& aCaretRect) MOZ_OVERRIDE;
     virtual bool RecvNotifyIMESelection(const uint32_t& aSeqno,
                                         const uint32_t& aAnchor,
-                                        const uint32_t& aFocus);
-    virtual bool RecvNotifyIMETextHint(const nsString& aText);
+                                        const uint32_t& aFocus) MOZ_OVERRIDE;
+    virtual bool RecvNotifyIMETextHint(const nsString& aText) MOZ_OVERRIDE;
     virtual bool RecvEndIMEComposition(const bool& aCancel,
-                                       nsString* aComposition);
+                                       nsString* aComposition) MOZ_OVERRIDE;
     virtual bool RecvGetInputContext(int32_t* aIMEEnabled,
                                      int32_t* aIMEOpen,
-                                     intptr_t* aNativeIMEContext);
+                                     intptr_t* aNativeIMEContext) MOZ_OVERRIDE;
     virtual bool RecvSetInputContext(const int32_t& aIMEEnabled,
                                      const int32_t& aIMEOpen,
                                      const nsString& aType,
                                      const nsString& aInputmode,
                                      const nsString& aActionHint,
                                      const int32_t& aCause,
-                                     const int32_t& aFocusChange);
-    virtual bool RecvRequestFocus(const bool& aCanRaise);
-    virtual bool RecvSetCursor(const uint32_t& aValue);
-    virtual bool RecvSetBackgroundColor(const nscolor& aValue);
-    virtual bool RecvSetStatus(const uint32_t& aType, const nsString& aStatus);
-    virtual bool RecvGetDPI(float* aValue);
-    virtual bool RecvGetDefaultScale(double* aValue);
-    virtual bool RecvGetWidgetNativeData(WindowsHandle* aValue);
+                                     const int32_t& aFocusChange) MOZ_OVERRIDE;
+    virtual bool RecvRequestFocus(const bool& aCanRaise) MOZ_OVERRIDE;
+    virtual bool RecvSetCursor(const uint32_t& aValue) MOZ_OVERRIDE;
+    virtual bool RecvSetBackgroundColor(const nscolor& aValue) MOZ_OVERRIDE;
+    virtual bool RecvSetStatus(const uint32_t& aType, const nsString& aStatus) MOZ_OVERRIDE;
+    virtual bool RecvGetDPI(float* aValue) MOZ_OVERRIDE;
+    virtual bool RecvGetDefaultScale(double* aValue) MOZ_OVERRIDE;
+    virtual bool RecvGetWidgetNativeData(WindowsHandle* aValue) MOZ_OVERRIDE;
     virtual bool RecvZoomToRect(const uint32_t& aPresShellId,
                                 const ViewID& aViewId,
-                                const CSSRect& aRect);
+                                const CSSRect& aRect) MOZ_OVERRIDE;
     virtual bool RecvUpdateZoomConstraints(const uint32_t& aPresShellId,
                                            const ViewID& aViewId,
                                            const bool& aIsRoot,
-                                           const ZoomConstraints& aConstraints);
+                                           const ZoomConstraints& aConstraints) MOZ_OVERRIDE;
     virtual bool RecvContentReceivedTouch(const ScrollableLayerGuid& aGuid,
-                                          const bool& aPreventDefault);
-    virtual PContentDialogParent* AllocPContentDialogParent(const uint32_t& aType,
-                                                            const nsCString& aName,
-                                                            const nsCString& aFeatures,
-                                                            const InfallibleTArray<int>& aIntParams,
-                                                            const InfallibleTArray<nsString>& aStringParams);
-    virtual bool DeallocPContentDialogParent(PContentDialogParent* aDialog)
+                                          const bool& aPreventDefault) MOZ_OVERRIDE;
+    virtual PContentDialogParent*
+    AllocPContentDialogParent(const uint32_t& aType,
+                              const nsCString& aName,
+                              const nsCString& aFeatures,
+                              const InfallibleTArray<int>& aIntParams,
+                              const InfallibleTArray<nsString>& aStringParams) MOZ_OVERRIDE;
+    virtual bool DeallocPContentDialogParent(PContentDialogParent* aDialog) MOZ_OVERRIDE
     {
       delete aDialog;
       return true;
     }
 
 
     void LoadURL(nsIURI* aURI);
     // XXX/cjones: it's not clear what we gain by hiding these
@@ -222,40 +223,44 @@ public:
     bool SendRealKeyEvent(mozilla::WidgetKeyboardEvent& event);
     bool SendRealTouchEvent(WidgetTouchEvent& event);
     bool SendHandleSingleTap(const CSSIntPoint& aPoint);
     bool SendHandleLongTap(const CSSIntPoint& aPoint);
     bool SendHandleLongTapUp(const CSSIntPoint& aPoint);
     bool SendHandleDoubleTap(const CSSIntPoint& aPoint);
 
     virtual PDocumentRendererParent*
-    AllocPDocumentRendererParent(const nsRect& documentRect, const gfx::Matrix& transform,
+    AllocPDocumentRendererParent(const nsRect& documentRect,
+                                 const gfx::Matrix& transform,
                                  const nsString& bgcolor,
-                                 const uint32_t& renderFlags, const bool& flushLayout,
-                                 const nsIntSize& renderSize);
-    virtual bool DeallocPDocumentRendererParent(PDocumentRendererParent* actor);
+                                 const uint32_t& renderFlags,
+                                 const bool& flushLayout,
+                                 const nsIntSize& renderSize) MOZ_OVERRIDE;
+    virtual bool DeallocPDocumentRendererParent(PDocumentRendererParent* actor) MOZ_OVERRIDE;
 
     virtual PContentPermissionRequestParent*
-    AllocPContentPermissionRequestParent(const nsCString& aType, const nsCString& aAccess, const IPC::Principal& aPrincipal);
-    virtual bool DeallocPContentPermissionRequestParent(PContentPermissionRequestParent* actor);
+    AllocPContentPermissionRequestParent(const nsCString& aType,
+                                         const nsCString& aAccess,
+                                         const IPC::Principal& aPrincipal) MOZ_OVERRIDE;
+    virtual bool
+    DeallocPContentPermissionRequestParent(PContentPermissionRequestParent* actor) MOZ_OVERRIDE;
 
     virtual POfflineCacheUpdateParent*
     AllocPOfflineCacheUpdateParent(const URIParams& aManifestURI,
                                    const URIParams& aDocumentURI,
                                    const bool& aStickDocument) MOZ_OVERRIDE;
     virtual bool
     RecvPOfflineCacheUpdateConstructor(POfflineCacheUpdateParent* aActor,
                                        const URIParams& aManifestURI,
                                        const URIParams& aDocumentURI,
                                        const bool& stickDocument) MOZ_OVERRIDE;
     virtual bool
-    DeallocPOfflineCacheUpdateParent(POfflineCacheUpdateParent* aActor)
-                                     MOZ_OVERRIDE;
+    DeallocPOfflineCacheUpdateParent(POfflineCacheUpdateParent* aActor) MOZ_OVERRIDE;
 
-    virtual bool RecvSetOfflinePermission(const IPC::Principal& principal);
+    virtual bool RecvSetOfflinePermission(const IPC::Principal& principal) MOZ_OVERRIDE;
 
     bool GetGlobalJSObject(JSContext* cx, JSObject** globalp);
 
     NS_DECL_ISUPPORTS
     NS_DECL_NSIAUTHPROMPTPROVIDER
     NS_DECL_NSISECUREBROWSERUI
 
     void HandleDelayedDialogs();
@@ -287,25 +292,25 @@ protected:
 
     virtual bool Recv__delete__() MOZ_OVERRIDE;
 
     virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE;
 
     virtual PIndexedDBParent* AllocPIndexedDBParent(
                                                   const nsCString& aGroup,
                                                   const nsCString& aASCIIOrigin,
-                                                  bool* /* aAllowed */);
+                                                  bool* /* aAllowed */) MOZ_OVERRIDE;
 
-    virtual bool DeallocPIndexedDBParent(PIndexedDBParent* aActor);
+    virtual bool DeallocPIndexedDBParent(PIndexedDBParent* aActor) MOZ_OVERRIDE;
 
     virtual bool
     RecvPIndexedDBConstructor(PIndexedDBParent* aActor,
                               const nsCString& aGroup,
                               const nsCString& aASCIIOrigin,
-                              bool* aAllowed);
+                              bool* aAllowed) MOZ_OVERRIDE;
 
     Element* mFrameElement;
     nsCOMPtr<nsIBrowserDOMWindow> mBrowserDOMWindow;
 
     struct DelayedDialogData
     {
       DelayedDialogData(PContentDialogParent* aDialog, uint32_t aType,
                         const nsCString& aName,
--- a/dom/plugins/ipc/PluginInstanceParent.cpp
+++ b/dom/plugins/ipc/PluginInstanceParent.cpp
@@ -638,18 +638,19 @@ PluginInstanceParent::RecvShow(const NPR
         surface->MarkDirty(ur);
 
         ImageContainer *container = GetImageContainer();
         ImageFormat format = CAIRO_SURFACE;
         nsRefPtr<Image> image = container->CreateImage(&format, 1);
         NS_ASSERTION(image->GetFormat() == CAIRO_SURFACE, "Wrong format?");
         CairoImage* cairoImage = static_cast<CairoImage*>(image.get());
         CairoImage::Data cairoData;
-        cairoData.mSurface = surface;
+        cairoData.mDeprecatedSurface = surface;
         cairoData.mSize = surface->GetSize().ToIntSize();
+        cairoData.mSourceSurface = gfxPlatform::GetPlatform()->GetSourceSurfaceForSurface(nullptr, surface);
         cairoImage->SetData(cairoData);
 
         container->SetCurrentImage(cairoImage);
     }
     else if (mImageContainer) {
         mImageContainer->SetCurrentImage(nullptr);
     }
 
--- a/dom/tests/mochitest/localstorage/test_localStorageEnablePref.html
+++ b/dom/tests/mochitest/localstorage/test_localStorageEnablePref.html
@@ -11,16 +11,19 @@ function checkException(func, exc)
 {
   var exceptionThrew = false;
   try {
     func();
   }
   catch (ex) {
     exceptionThrew = true;
     is(ex.name, exc, "Expected "+exc+" exception");
+    if (ex.name != exc) {
+      ok(true, "The exception which was thrown is: " + ex);
+    }
   }
   ok(exceptionThrew, "Exception "+exc+" threw");
 }
 
 var storage;
 function test1() {
   is(typeof(window.localStorage), "object", "Storage is present");
   storage = window.localStorage;
--- a/gfx/layers/ImageContainer.cpp
+++ b/gfx/layers/ImageContainer.cpp
@@ -670,10 +670,27 @@ RemoteBitmapImage::DeprecatedGetAsSurfac
     memcpy(newSurf->Data() + newSurf->Stride() * y,
            mData + mStride * y,
            mSize.width * 4);
   }
 
   return newSurf.forget();
 }
 
+TemporaryRef<gfx::SourceSurface>
+RemoteBitmapImage::GetAsSourceSurface()
+{
+  gfx::SurfaceFormat fmt = mFormat == RemoteImageData::BGRX32
+                         ? gfx::SurfaceFormat::B8G8R8X8
+                         : gfx::SurfaceFormat::B8G8R8A8;
+  RefPtr<gfx::DataSourceSurface> newSurf = gfx::Factory::CreateDataSourceSurface(mSize, fmt);
+
+  for (int y = 0; y < mSize.height; y++) {
+    memcpy(newSurf->GetData() + newSurf->Stride() * y,
+           mData + mStride * y,
+           mSize.width * 4);
+  }
+
+  return newSurf;
+}
+
 } // namespace
 } // namespace
--- a/gfx/layers/ImageContainer.h
+++ b/gfx/layers/ImageContainer.h
@@ -36,16 +36,19 @@
  * or released off the main thread. We can ensure that we never AddRef
  * a gfxASurface off the main thread, but we might want to Release due
  * to an Image being destroyed off the main thread.
  *
  * We use nsCountedRef<nsMainThreadSurfaceRef> to reference the
  * gfxASurface. When AddRefing, we assert that we're on the main thread.
  * When Releasing, if we're not on the main thread, we post an event to
  * the main thread to do the actual release.
+ *
+ * This should be removed after after Image::DeprecatedGetAsSurface is
+ * removed. It is replaced by nsMainThreadSourceSurfaceRef
  */
 class nsMainThreadSurfaceRef;
 
 template <>
 class nsAutoRefTraits<nsMainThreadSurfaceRef> {
 public:
   typedef gfxASurface* RawRef;
 
@@ -75,16 +78,59 @@ public:
   static void AddRef(RawRef aRawRef)
   {
     NS_ASSERTION(NS_IsMainThread(),
                  "Can only add a reference on the main thread");
     aRawRef->AddRef();
   }
 };
 
+/**
+ * Same purpose as nsMainThreadSurfaceRef byt holds a gfx::SourceSurface instead.
+ * The specialization of nsMainThreadSurfaceRef should be removed after
+ * Image::DeprecatedGetAsSurface is removed
+ */
+class nsMainThreadSourceSurfaceRef;
+
+template <>
+class nsAutoRefTraits<nsMainThreadSourceSurfaceRef> {
+public:
+  typedef mozilla::gfx::SourceSurface* RawRef;
+
+  /**
+   * The XPCOM event that will do the actual release on the main thread.
+   */
+  class SurfaceReleaser : public nsRunnable {
+  public:
+    SurfaceReleaser(RawRef aRef) : mRef(aRef) {}
+    NS_IMETHOD Run() {
+      mRef->Release();
+      return NS_OK;
+    }
+    RawRef mRef;
+  };
+
+  static RawRef Void() { return nullptr; }
+  static void Release(RawRef aRawRef)
+  {
+    if (NS_IsMainThread()) {
+      aRawRef->Release();
+      return;
+    }
+    nsCOMPtr<nsIRunnable> runnable = new SurfaceReleaser(aRawRef);
+    NS_DispatchToMainThread(runnable);
+  }
+  static void AddRef(RawRef aRawRef)
+  {
+    NS_ASSERTION(NS_IsMainThread(),
+                 "Can only add a reference on the main thread");
+    aRawRef->AddRef();
+  }
+};
+
 #endif
 
 #ifdef XP_WIN
 struct ID3D10Texture2D;
 struct ID3D10Device;
 struct ID3D10ShaderResourceView;
 #endif
 
@@ -872,51 +918,67 @@ protected:
 /**
  * Currently, the data in a CairoImage surface is treated as being in the
  * device output color space. This class is very simple as all backends
  * have to know about how to deal with drawing a cairo image.
  */
 class CairoImage : public Image {
 public:
   struct Data {
-    gfxASurface* mSurface;
+    gfxASurface* mDeprecatedSurface;
     gfx::IntSize mSize;
+
+    // mSourceSurface wraps mDeprrecatedSurface's data, therefore it should not
+    // outlive mDeprecatedSurface
+    RefPtr<gfx::SourceSurface> mSourceSurface;
   };
 
   /**
    * This can only be called on the main thread. It may add a reference
    * to the surface (which will eventually be released on the main thread).
    * The surface must not be modified after this call!!!
    */
   void SetData(const Data& aData)
   {
-    mSurface = aData.mSurface;
+    mDeprecatedSurface = aData.mDeprecatedSurface;
     mSize = aData.mSize;
+    mSourceSurface = aData.mSourceSurface;
   }
 
+  virtual TemporaryRef<gfx::SourceSurface> GetAsSourceSurface()
+  {
+    return mSourceSurface.get();
+  }
 
   virtual already_AddRefed<gfxASurface> DeprecatedGetAsSurface()
   {
-    nsRefPtr<gfxASurface> surface = mSurface.get();
+    nsRefPtr<gfxASurface> surface = mDeprecatedSurface.get();
     return surface.forget();
   }
 
   gfx::IntSize GetSize() { return mSize; }
 
   CairoImage() : Image(nullptr, CAIRO_SURFACE) {}
 
-  nsCountedRef<nsMainThreadSurfaceRef> mSurface;
+private:
+
+  nsCountedRef<nsMainThreadSurfaceRef> mDeprecatedSurface;
   gfx::IntSize mSize;
+
+  // mSourceSurface wraps mDeprrecatedSurface's data, therefore it should not
+  // outlive mDeprecatedSurface
+  nsCountedRef<nsMainThreadSourceSurfaceRef> mSourceSurface;
 };
 
 class RemoteBitmapImage : public Image {
 public:
   RemoteBitmapImage() : Image(nullptr, REMOTE_IMAGE_BITMAP) {}
 
   already_AddRefed<gfxASurface> DeprecatedGetAsSurface();
+  TemporaryRef<gfx::SourceSurface> GetAsSourceSurface();
 
   gfx::IntSize GetSize() { return mSize; }
 
   unsigned char *mData;
   int mStride;
   gfx::IntSize mSize;
   RemoteImageData::Format mFormat;
 };
--- a/gfx/layers/composite/APZCTreeManager.cpp
+++ b/gfx/layers/composite/APZCTreeManager.cpp
@@ -198,17 +198,27 @@ APZCTreeManager::UpdatePanZoomController
           apzc->SetPrevSibling(nullptr);
           apzc->SetLastChild(nullptr);
         }
         APZC_LOG("Using APZC %p for layer %p with identifiers %lld %lld\n", apzc, aLayer, aLayersId, container->GetFrameMetrics().mScrollId);
 
         apzc->NotifyLayersUpdated(container->GetFrameMetrics(),
                                   aIsFirstPaint && (aLayersId == aFirstPaintLayersId));
 
+        // Use the composition bounds as the hit test region.
+        // Optionally, the GeckoContentController can provide a touch-sensitive
+        // region that constrains all frames associated with the controller.
+        // In this case we intersect the composition bounds with that region.
         ScreenRect visible(container->GetFrameMetrics().mCompositionBounds);
+        CSSRect touchSensitiveRegion;
+        if (state->mController->GetTouchSensitiveRegion(&touchSensitiveRegion)) {
+          visible = visible.Intersect(touchSensitiveRegion
+                                      * container->GetFrameMetrics().LayersPixelsPerCSSPixel()
+                                      * LayerToScreenScale(1.0));
+        }
         apzc->SetLayerHitTestData(visible, aTransform, aLayer->GetTransform());
         APZC_LOG("Setting rect(%f %f %f %f) as visible region for APZC %p\n", visible.x, visible.y,
                                                                               visible.width, visible.height,
                                                                               apzc);
 
         // Bind the APZC instance into the tree of APZCs
         if (aNextSibling) {
           aNextSibling->SetPrevSibling(apzc);
--- a/gfx/layers/d3d10/ImageLayerD3D10.cpp
+++ b/gfx/layers/d3d10/ImageLayerD3D10.cpp
@@ -122,31 +122,32 @@ ImageLayerD3D10::GetImageSRView(Image* a
 
     remoteImage->GetD3D10TextureBackendData(device());
 
     aHasAlpha = remoteImage->mFormat == RemoteImageData::BGRA32;
   } else if (aImage->GetFormat() == ImageFormat::CAIRO_SURFACE) {
     CairoImage *cairoImage =
       static_cast<CairoImage*>(aImage);
 
-    if (!cairoImage->mSurface) {
+    nsRefPtr<gfxASurface> surf = cairoImage->DeprecatedGetAsSurface();
+    if (!surf) {
       return nullptr;
     }
 
     if (!aImage->GetBackendData(mozilla::layers::LAYERS_D3D10)) {
       nsAutoPtr<TextureD3D10BackendData> dat(new TextureD3D10BackendData());
-      dat->mTexture = SurfaceToTexture(device(), cairoImage->mSurface, cairoImage->mSize);
+      dat->mTexture = SurfaceToTexture(device(), surf, cairoImage->GetSize());
 
       if (dat->mTexture) {
         device()->CreateShaderResourceView(dat->mTexture, nullptr, getter_AddRefs(dat->mSRView));
         aImage->SetBackendData(mozilla::layers::LAYERS_D3D10, dat.forget());
       }
     }
 
-    aHasAlpha = cairoImage->mSurface->GetContentType() == GFX_CONTENT_COLOR_ALPHA;
+    aHasAlpha = surf->GetContentType() == GFX_CONTENT_COLOR_ALPHA;
   } else if (aImage->GetFormat() == ImageFormat::D3D9_RGB32_TEXTURE) {
     if (!aImage->GetBackendData(mozilla::layers::LAYERS_D3D10)) {
       // Use resource sharing to open the D3D9 texture as a D3D10 texture,
       HRESULT hr;
       D3D9SurfaceImage* d3dImage = reinterpret_cast<D3D9SurfaceImage*>(aImage);
       nsRefPtr<ID3D10Texture2D> texture;
       hr = device()->OpenSharedResource(d3dImage->GetShareHandle(),
                                         IID_ID3D10Texture2D,
@@ -207,24 +208,24 @@ ImageLayerD3D10::RenderLayer()
   }
 
   IntSize size = image->GetSize();
 
   SetEffectTransformAndOpacity();
 
   ID3D10EffectTechnique *technique;
   nsRefPtr<IDXGIKeyedMutex> keyedMutex;
+  nsRefPtr<gfxASurface> surf = image->DeprecatedGetAsSurface();
 
   if (image->GetFormat() == ImageFormat::CAIRO_SURFACE ||
       image->GetFormat() == ImageFormat::REMOTE_IMAGE_BITMAP ||
       image->GetFormat() == ImageFormat::REMOTE_IMAGE_DXGI_TEXTURE ||
       image->GetFormat() == ImageFormat::D3D9_RGB32_TEXTURE) {
     NS_ASSERTION(image->GetFormat() != ImageFormat::CAIRO_SURFACE ||
-                 !static_cast<CairoImage*>(image)->mSurface ||
-                 static_cast<CairoImage*>(image)->mSurface->GetContentType() != GFX_CONTENT_ALPHA,
+                 !surf || surf->GetContentType() != GFX_CONTENT_ALPHA,
                  "Image layer has alpha image");
     bool hasAlpha = false;
 
     nsRefPtr<ID3D10ShaderResourceView> srView = GetImageSRView(image, hasAlpha, getter_AddRefs(keyedMutex));
     if (!srView) {
       return;
     }
 
--- a/gfx/layers/d3d9/ImageLayerD3D9.cpp
+++ b/gfx/layers/d3d9/ImageLayerD3D9.cpp
@@ -339,29 +339,30 @@ ImageLayerD3D9::GetTexture(Image *aImage
       }
     }
 
     aHasAlpha = remoteImage->mFormat == RemoteImageData::BGRA32;
   } else if (aImage->GetFormat() == CAIRO_SURFACE) {
     CairoImage *cairoImage =
       static_cast<CairoImage*>(aImage);
 
-    if (!cairoImage->mSurface) {
+    nsRefPtr<gfxASurface> surf = cairoImage->DeprecatedGetAsSurface();
+    if (!surf) {
       return nullptr;
     }
 
     if (!aImage->GetBackendData(mozilla::layers::LAYERS_D3D9)) {
       nsAutoPtr<TextureD3D9BackendData> dat(new TextureD3D9BackendData());
-      dat->mTexture = SurfaceToTexture(device(), cairoImage->mSurface, cairoImage->mSize);
+      dat->mTexture = SurfaceToTexture(device(), surf, cairoImage->GetSize());
       if (dat->mTexture) {
         aImage->SetBackendData(mozilla::layers::LAYERS_D3D9, dat.forget());
       }
     }
 
-    aHasAlpha = cairoImage->mSurface->GetContentType() == GFX_CONTENT_COLOR_ALPHA;
+    aHasAlpha = surf->GetContentType() == GFX_CONTENT_COLOR_ALPHA;
   } else if (aImage->GetFormat() == D3D9_RGB32_TEXTURE) {
     if (!aImage->GetBackendData(mozilla::layers::LAYERS_D3D9)) {
       // The texture in which the frame is stored belongs to DXVA's D3D9 device.
       // We need to open it on our device before we can use it.
       nsAutoPtr<TextureD3D9BackendData> backendData(new TextureD3D9BackendData());
       D3D9SurfaceImage* image = static_cast<D3D9SurfaceImage*>(aImage);
       backendData->mTexture = OpenSharedTexture(image->GetDesc(), image->GetShareHandle(), device());
       if (backendData->mTexture) {
@@ -408,19 +409,19 @@ ImageLayerD3D9::RenderLayer()
   SetShaderTransformAndOpacity();
 
   gfx::IntSize size = image->GetSize();
 
   if (image->GetFormat() == CAIRO_SURFACE ||
       image->GetFormat() == REMOTE_IMAGE_BITMAP ||
       image->GetFormat() == D3D9_RGB32_TEXTURE)
   {
+    nsRefPtr<gfxASurface> surf = image->DeprecatedGetAsSurface();
     NS_ASSERTION(image->GetFormat() != CAIRO_SURFACE ||
-                 !static_cast<CairoImage*>(image)->mSurface ||
-                 static_cast<CairoImage*>(image)->mSurface->GetContentType() != GFX_CONTENT_ALPHA,
+                 !surf || surf->GetContentType() != GFX_CONTENT_ALPHA,
                  "Image layer has alpha image");
 
     bool hasAlpha = false;
     nsRefPtr<IDirect3DTexture9> texture = GetTexture(image, hasAlpha);
 
     device()->SetVertexShaderConstantF(CBvLayerQuad,
                                        ShaderConstantRect(0,
                                                           0,
--- a/gfx/layers/ipc/CompositorParent.h
+++ b/gfx/layers/ipc/CompositorParent.h
@@ -81,17 +81,17 @@ public:
                 mozilla::ipc::ProtocolCloneContext* aCtx) MOZ_OVERRIDE;
 
   virtual bool RecvWillStop() MOZ_OVERRIDE;
   virtual bool RecvStop() MOZ_OVERRIDE;
   virtual bool RecvPause() MOZ_OVERRIDE;
   virtual bool RecvResume() MOZ_OVERRIDE;
   virtual bool RecvNotifyChildCreated(const uint64_t& child) MOZ_OVERRIDE;
   virtual bool RecvMakeSnapshot(const SurfaceDescriptor& aInSnapshot,
-                                SurfaceDescriptor* aOutSnapshot);
+                                SurfaceDescriptor* aOutSnapshot) MOZ_OVERRIDE;
   virtual bool RecvFlushRendering() MOZ_OVERRIDE;
   virtual bool RecvForceComposite() MOZ_OVERRIDE;
 
   virtual bool RecvNotifyRegionInvalidated(const nsIntRegion& aRegion) MOZ_OVERRIDE;
   virtual bool RecvStartFrameTimeRecording(const int32_t& aBufferSize, uint32_t* aOutStartIndex) MOZ_OVERRIDE;
   virtual bool RecvStopFrameTimeRecording(const uint32_t& aStartIndex, InfallibleTArray<float>* intervals) MOZ_OVERRIDE;
 
   virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE;
@@ -234,18 +234,18 @@ public:
    * Returns true if the calling thread is the compositor thread.
    */
   static bool IsInCompositorThread();
 protected:
   virtual PLayerTransactionParent*
     AllocPLayerTransactionParent(const nsTArray<LayersBackend>& aBackendHints,
                                  const uint64_t& aId,
                                  TextureFactoryIdentifier* aTextureFactoryIdentifier,
-                                 bool* aSuccess);
-  virtual bool DeallocPLayerTransactionParent(PLayerTransactionParent* aLayers);
+                                 bool* aSuccess) MOZ_OVERRIDE;
+  virtual bool DeallocPLayerTransactionParent(PLayerTransactionParent* aLayers) MOZ_OVERRIDE;
   virtual void ScheduleTask(CancelableTask*, int);
   void Composite();
   void CompositeInTransaction();
   virtual void ComposeToTarget(gfx::DrawTarget* aTarget);
 
   void SetEGLSurfaceSize(int width, int height);
 
 private:
--- a/gfx/layers/ipc/GeckoContentController.h
+++ b/gfx/layers/ipc/GeckoContentController.h
@@ -77,16 +77,32 @@ public:
    * last known zoom constraints.
    */
   virtual bool GetRootZoomConstraints(ZoomConstraints* aOutConstraints)
   {
     return false;
   }
 
   /**
+   * APZ uses |FrameMetrics::mCompositionBounds| for hit testing. Sometimes,
+   * widget code has knowledge of a touch-sensitive region that should
+   * additionally constrain hit testing for all frames associated with the
+   * controller. This method allows APZ to query the controller for such a
+   * region. A return value of true indicates that the controller has such a
+   * region, and it is returned in |aOutRegion|.
+   * TODO: once bug 928833 is implemented, this should be removed, as
+   * APZ can then get the correct touch-sensitive region for each frame
+   * directly from the layer.
+   */
+  virtual bool GetTouchSensitiveRegion(CSSRect* aOutRegion)
+  {
+    return false;
+  }
+
+  /**
    * General tranformation notices for consumers. These fire any time
    * the apzc is modifying the view, including panning, zooming, and
    * fling.
    */
   virtual void NotifyTransformBegin(const ScrollableLayerGuid& aGuid) {}
   virtual void NotifyTransformEnd(const ScrollableLayerGuid& aGuid) {}
 
   GeckoContentController() {}
--- a/gfx/layers/ipc/ImageBridgeParent.h
+++ b/gfx/layers/ipc/ImageBridgeParent.h
@@ -50,18 +50,18 @@ public:
   virtual PGrallocBufferParent*
   AllocPGrallocBufferParent(const IntSize&, const uint32_t&, const uint32_t&,
                             MaybeMagicGrallocBufferHandle*) MOZ_OVERRIDE;
 
   virtual bool
   DeallocPGrallocBufferParent(PGrallocBufferParent* actor) MOZ_OVERRIDE;
 
   // PImageBridge
-  virtual bool RecvUpdate(const EditArray& aEdits, EditReplyArray* aReply);
-  virtual bool RecvUpdateNoSwap(const EditArray& aEdits);
+  virtual bool RecvUpdate(const EditArray& aEdits, EditReplyArray* aReply) MOZ_OVERRIDE;
+  virtual bool RecvUpdateNoSwap(const EditArray& aEdits) MOZ_OVERRIDE;
 
   virtual bool IsAsync() const MOZ_OVERRIDE { return true; }
 
   PCompositableParent* AllocPCompositableParent(const TextureInfo& aInfo,
                                                 uint64_t*) MOZ_OVERRIDE;
   bool DeallocPCompositableParent(PCompositableParent* aActor) MOZ_OVERRIDE;
 
   virtual PTextureParent* AllocPTextureParent() MOZ_OVERRIDE;
--- a/gfx/layers/ipc/SharedRGBImage.cpp
+++ b/gfx/layers/ipc/SharedRGBImage.cpp
@@ -235,11 +235,17 @@ SharedRGBImage::GetTextureClient()
 }
 
 already_AddRefed<gfxASurface>
 SharedRGBImage::DeprecatedGetAsSurface()
 {
   return nullptr;
 }
 
+TemporaryRef<gfx::SourceSurface>
+SharedRGBImage::GetAsSourceSurface()
+{
+  return nullptr;
+}
+
 
 } // namespace layers
 } // namespace mozilla
--- a/gfx/layers/ipc/SharedRGBImage.h
+++ b/gfx/layers/ipc/SharedRGBImage.h
@@ -114,16 +114,18 @@ public:
   virtual uint8_t* GetBuffer() MOZ_OVERRIDE;
 
   gfx::IntSize GetSize();
 
   size_t GetBufferSize();
 
   already_AddRefed<gfxASurface> DeprecatedGetAsSurface();
 
+  TemporaryRef<gfx::SourceSurface> GetAsSourceSurface();
+
   bool Allocate(gfx::IntSize aSize, gfx::SurfaceFormat aFormat);
 private:
   gfx::IntSize mSize;
   RefPtr<ImageClient> mCompositable;
   RefPtr<BufferTextureClient> mTextureClient;
 };
 
 } // namespace layers
--- a/image/src/RasterImage.cpp
+++ b/image/src/RasterImage.cpp
@@ -948,19 +948,20 @@ RasterImage::GetCurrentImage()
   nsRefPtr<gfxASurface> imageSurface = GetFrame(FRAME_CURRENT, FLAG_NONE);
   NS_ENSURE_TRUE(imageSurface, nullptr);
 
   if (!mImageContainer) {
     mImageContainer = LayerManager::CreateImageContainer();
   }
 
   CairoImage::Data cairoData;
-  cairoData.mSurface = imageSurface;
+  cairoData.mDeprecatedSurface = imageSurface;
   GetWidth(&cairoData.mSize.width);
   GetHeight(&cairoData.mSize.height);
+  cairoData.mSourceSurface = gfxPlatform::GetPlatform()->GetSourceSurfaceForSurface(nullptr, imageSurface);
 
   ImageFormat cairoFormat = CAIRO_SURFACE;
   nsRefPtr<layers::Image> image = mImageContainer->CreateImage(&cairoFormat, 1);
   NS_ASSERTION(image, "Failed to create Image");
 
   NS_ASSERTION(image->GetFormat() == cairoFormat, "Wrong format");
   static_cast<CairoImage*>(image.get())->SetData(cairoData);
 
--- a/js/ipc/JavaScriptChild.h
+++ b/js/ipc/JavaScriptChild.h
@@ -20,59 +20,59 @@ class JavaScriptChild
 {
   public:
     JavaScriptChild(JSRuntime *rt);
     ~JavaScriptChild();
 
     bool init();
     void trace(JSTracer *trc);
 
-    bool RecvDropObject(const ObjectId &objId);
+    bool RecvDropObject(const ObjectId &objId) MOZ_OVERRIDE;
 
-    bool AnswerPreventExtensions(const ObjectId &objId, ReturnStatus *rs);
+    bool AnswerPreventExtensions(const ObjectId &objId, ReturnStatus *rs) MOZ_OVERRIDE;
     bool AnswerGetPropertyDescriptor(const ObjectId &objId, const nsString &id,
                                      const uint32_t &flags, ReturnStatus *rs,
-                                     PPropertyDescriptor *out);
+                                     PPropertyDescriptor *out) MOZ_OVERRIDE;
     bool AnswerGetOwnPropertyDescriptor(const ObjectId &objId,
                                         const nsString &id,
                                         const uint32_t &flags,
                                         ReturnStatus *rs,
-                                        PPropertyDescriptor *out);
+                                        PPropertyDescriptor *out) MOZ_OVERRIDE;
     bool AnswerDefineProperty(const ObjectId &objId, const nsString &id,
                               const PPropertyDescriptor &flags,
-                              ReturnStatus *rs);
+                              ReturnStatus *rs) MOZ_OVERRIDE;
     bool AnswerDelete(const ObjectId &objId, const nsString &id,
-                      ReturnStatus *rs, bool *success);
+                      ReturnStatus *rs, bool *success) MOZ_OVERRIDE;
 
     bool AnswerHas(const ObjectId &objId, const nsString &id,
-                       ReturnStatus *rs, bool *bp);
+                       ReturnStatus *rs, bool *bp) MOZ_OVERRIDE;
     bool AnswerHasOwn(const ObjectId &objId, const nsString &id,
-                          ReturnStatus *rs, bool *bp);
+                          ReturnStatus *rs, bool *bp) MOZ_OVERRIDE;
     bool AnswerGet(const ObjectId &objId, const ObjectId &receiverId,
                        const nsString &id,
-                       ReturnStatus *rs, JSVariant *result);
+                       ReturnStatus *rs, JSVariant *result) MOZ_OVERRIDE;
     bool AnswerSet(const ObjectId &objId, const ObjectId &receiverId,
                    const nsString &id, const bool &strict,
-                   const JSVariant &value, ReturnStatus *rs, JSVariant *result);
+                   const JSVariant &value, ReturnStatus *rs, JSVariant *result) MOZ_OVERRIDE;
 
     bool AnswerIsExtensible(const ObjectId &objId, ReturnStatus *rs,
-                            bool *result);
+                            bool *result) MOZ_OVERRIDE;
     bool AnswerCall(const ObjectId &objId, const nsTArray<JSParam> &argv,
                     ReturnStatus *rs, JSVariant *result,
-                    nsTArray<JSParam> *outparams);
+                    nsTArray<JSParam> *outparams) MOZ_OVERRIDE;
     bool AnswerObjectClassIs(const ObjectId &objId, const uint32_t &classValue,
-                             bool *result);
-    bool AnswerClassName(const ObjectId &objId, nsString *result);
+                             bool *result) MOZ_OVERRIDE;
+    bool AnswerClassName(const ObjectId &objId, nsString *result) MOZ_OVERRIDE;
 
     bool AnswerGetPropertyNames(const ObjectId &objId, const uint32_t &flags,
-                                ReturnStatus *rs, nsTArray<nsString> *names);
+                                ReturnStatus *rs, nsTArray<nsString> *names) MOZ_OVERRIDE;
     bool AnswerInstanceOf(const ObjectId &objId, const JSIID &iid,
-                          ReturnStatus *rs, bool *instanceof);
+                          ReturnStatus *rs, bool *instanceof) MOZ_OVERRIDE;
     bool AnswerDOMInstanceOf(const ObjectId &objId, const int &prototypeID, const int &depth,
-                             ReturnStatus *rs, bool *instanceof);
+                             ReturnStatus *rs, bool *instanceof) MOZ_OVERRIDE;
 
   protected:
     JSObject *unwrap(JSContext *cx, ObjectId id);
 
   private:
     bool makeId(JSContext *cx, JSObject *obj, ObjectId *idp);
     bool fail(JSContext *cx, ReturnStatus *rs);
     bool ok(ReturnStatus *rs);
--- a/js/src/configure.in
+++ b/js/src/configure.in
@@ -3368,20 +3368,24 @@ MOZ_ARG_ENABLE_BOOL(root-analysis,
     JSGC_ROOT_ANALYSIS= )
 if test -n "$JSGC_ROOT_ANALYSIS"; then
     AC_DEFINE(JSGC_ROOT_ANALYSIS)
 fi
 
 dnl ========================================================
 dnl = Use exact stack rooting for GC
 dnl ========================================================
-MOZ_ARG_ENABLE_BOOL(exact-rooting,
-[  --enable-exact-rooting  Enable use of exact stack roots for GC],
-    JSGC_USE_EXACT_ROOTING=1,
-    JSGC_USE_EXACT_ROOTING= )
+dnl Use exact rooting by default in all shell builds. The top-level mozilla
+dnl configure.in will configure SpiderMonkey with --disable-exact-rooting as
+dnl needed on a per-platform basis.
+JSGC_USE_EXACT_ROOTING=1
+MOZ_ARG_DISABLE_BOOL(exact-rooting,
+[  --disable-exact-rooting  Enable use of conservative stack scanning for GC],
+    JSGC_USE_EXACT_ROOTING= ,
+    JSGC_USE_EXACT_ROOTING=1 )
 if test -n "$JSGC_USE_EXACT_ROOTING"; then
     AC_DEFINE(JSGC_USE_EXACT_ROOTING)
 fi
 
 dnl ========================================================
 dnl = Use Valgrind
 dnl ========================================================
 MOZ_ARG_ENABLE_BOOL(valgrind,
--- a/js/src/jsscript.cpp
+++ b/js/src/jsscript.cpp
@@ -28,16 +28,17 @@
 
 #include "frontend/BytecodeEmitter.h"
 #include "frontend/SharedContext.h"
 #include "gc/Marking.h"
 #include "jit/BaselineJIT.h"
 #include "jit/IonCode.h"
 #include "js/OldDebugAPI.h"
 #include "vm/ArgumentsObject.h"
+#include "vm/Compression.h"
 #include "vm/Debugger.h"
 #include "vm/Shape.h"
 #include "vm/Xdr.h"
 
 #include "jsfuninlines.h"
 #include "jsinferinlines.h"
 #include "jsobjinlines.h"
 
@@ -1234,17 +1235,17 @@ ScriptSource::setSource(const jschar *sr
 {
     JS_ASSERT(!hasSourceData());
     length_ = length;
     JS_ASSERT(!argumentsNotIncluded_);
     data.source = const_cast<jschar *>(src);
 }
 
 bool
-SourceCompressionTask::compress()
+SourceCompressionTask::work()
 {
     // A given compression token can be compressed on any thread, and the ss
     // not being ready indicates to other threads that its fields might change
     // with no lock held.
     JS_ASSERT(!ss->ready());
 
     size_t compressedLength = 0;
     size_t nbytes = sizeof(jschar) * ss->length_;
--- a/js/src/jsutil.cpp
+++ b/js/src/jsutil.cpp
@@ -22,131 +22,16 @@
 
 #include "js/Utility.h"
 
 using namespace js;
 
 using mozilla::CeilingLog2Size;
 using mozilla::PodArrayZero;
 
-#if USE_ZLIB
-static void *
-zlib_alloc(void *cx, uInt items, uInt size)
-{
-    return js_calloc(items, size);
-}
-
-static void
-zlib_free(void *cx, void *addr)
-{
-    js_free(addr);
-}
-
-Compressor::Compressor(const unsigned char *inp, size_t inplen)
-    : inp(inp),
-      inplen(inplen),
-      outbytes(0)
-{
-    JS_ASSERT(inplen > 0);
-    zs.opaque = nullptr;
-    zs.next_in = (Bytef *)inp;
-    zs.avail_in = 0;
-    zs.next_out = nullptr;
-    zs.avail_out = 0;
-    zs.zalloc = zlib_alloc;
-    zs.zfree = zlib_free;
-}
-
-
-Compressor::~Compressor()
-{
-    int ret = deflateEnd(&zs);
-    if (ret != Z_OK) {
-        // If we finished early, we can get a Z_DATA_ERROR.
-        JS_ASSERT(ret == Z_DATA_ERROR);
-        JS_ASSERT(uInt(zs.next_in - inp) < inplen || !zs.avail_out);
-    }
-}
-
-bool
-Compressor::init()
-{
-    if (inplen >= UINT32_MAX)
-        return false;
-    // zlib is slow and we'd rather be done compression sooner
-    // even if it means decompression is slower which penalizes
-    // Function.toString()
-    int ret = deflateInit(&zs, Z_BEST_SPEED);
-    if (ret != Z_OK) {
-        JS_ASSERT(ret == Z_MEM_ERROR);
-        return false;
-    }
-    return true;
-}
-
-void
-Compressor::setOutput(unsigned char *out, size_t outlen)
-{
-    JS_ASSERT(outlen > outbytes);
-    zs.next_out = out + outbytes;
-    zs.avail_out = outlen - outbytes;
-}
-
-Compressor::Status
-Compressor::compressMore()
-{
-    JS_ASSERT(zs.next_out);
-    uInt left = inplen - (zs.next_in - inp);
-    bool done = left <= CHUNKSIZE;
-    if (done)
-        zs.avail_in = left;
-    else if (zs.avail_in == 0)
-        zs.avail_in = CHUNKSIZE;
-    Bytef *oldout = zs.next_out;
-    int ret = deflate(&zs, done ? Z_FINISH : Z_NO_FLUSH);
-    outbytes += zs.next_out - oldout;
-    if (ret == Z_MEM_ERROR) {
-        zs.avail_out = 0;
-        return OOM;
-    }
-    if (ret == Z_BUF_ERROR || (done && ret == Z_OK)) {
-        JS_ASSERT(zs.avail_out == 0);
-        return MOREOUTPUT;
-    }
-    JS_ASSERT_IF(!done, ret == Z_OK);
-    JS_ASSERT_IF(done, ret == Z_STREAM_END);
-    return done ? DONE : CONTINUE;
-}
-
-bool
-js::DecompressString(const unsigned char *inp, size_t inplen, unsigned char *out, size_t outlen)
-{
-    JS_ASSERT(inplen <= UINT32_MAX);
-    z_stream zs;
-    zs.zalloc = zlib_alloc;
-    zs.zfree = zlib_free;
-    zs.opaque = nullptr;
-    zs.next_in = (Bytef *)inp;
-    zs.avail_in = inplen;
-    zs.next_out = out;
-    JS_ASSERT(outlen);
-    zs.avail_out = outlen;
-    int ret = inflateInit(&zs);
-    if (ret != Z_OK) {
-        JS_ASSERT(ret == Z_MEM_ERROR);
-        return false;
-    }
-    ret = inflate(&zs, Z_FINISH);
-    JS_ASSERT(ret == Z_STREAM_END);
-    ret = inflateEnd(&zs);
-    JS_ASSERT(ret == Z_OK);
-    return true;
-}
-#endif
-
 #ifdef DEBUG
 /* For JS_OOM_POSSIBLY_FAIL in jsutil.h. */
 JS_PUBLIC_DATA(uint32_t) OOM_maxAllocations = UINT32_MAX;
 JS_PUBLIC_DATA(uint32_t) OOM_counter = 0;
 #endif
 
 /*
  * Checks the assumption that JS_FUNC_TO_DATA_PTR and JS_DATA_TO_FUNC_PTR
--- a/js/src/jsutil.h
+++ b/js/src/jsutil.h
@@ -11,20 +11,16 @@
 #ifndef jsutil_h
 #define jsutil_h
 
 #include "mozilla/Compiler.h"
 #include "mozilla/GuardObjects.h"
 
 #include <limits.h>
 
-#ifdef USE_ZLIB
-#include <zlib.h>
-#endif
-
 #include "js/Utility.h"
 
 static JS_ALWAYS_INLINE void *
 js_memcpy(void *dst_, const void *src_, size_t len)
 {
     char *dst = (char *) dst_;
     const char *src = (const char *) src_;
     JS_ASSERT_IF(dst >= src, (size_t) (dst - src) >= len);
@@ -259,51 +255,16 @@ ClearBitArrayElement(size_t *array, size
 
 static inline void
 ClearAllBitArrayElements(size_t *array, size_t length)
 {
     for (unsigned i = 0; i < length; ++i)
         array[i] = 0;
 }
 
-#ifdef USE_ZLIB
-class Compressor
-{
-    /* Number of bytes we should hand to zlib each compressMore() call. */
-    static const size_t CHUNKSIZE = 2048;
-    z_stream zs;
-    const unsigned char *inp;
-    size_t inplen;
-    size_t outbytes;
-
-  public:
-    enum Status {
-        MOREOUTPUT,
-        DONE,
-        CONTINUE,
-        OOM
-    };
-
-    Compressor(const unsigned char *inp, size_t inplen);
-    ~Compressor();
-    bool init();
-    void setOutput(unsigned char *out, size_t outlen);
-    size_t outWritten() const { return outbytes; }
-    /* Compress some of the input. Return true if it should be called again. */
-    Status compressMore();
-};
-
-/*
- * Decompress a string. The caller must know the length of the output and
- * allocate |out| to a string of that length.
- */
-bool DecompressString(const unsigned char *inp, size_t inplen,
-                      unsigned char *out, size_t outlen);
-#endif
-
 }  /* namespace js */
 
 /* Crash diagnostics */
 #ifdef DEBUG
 # define JS_CRASH_DIAGNOSTICS 1
 #endif
 #ifdef JS_CRASH_DIAGNOSTICS
 # define JS_POISON(p, val, size) memset((p), (val), (size))
--- a/js/src/jsworkers.cpp
+++ b/js/src/jsworkers.cpp
@@ -865,17 +865,17 @@ WorkerThread::handleCompressionWorkload(
     JS_ASSERT(state.canStartCompressionTask());
     JS_ASSERT(idle());
 
     compressionTask = state.compressionWorklist.popCopy();
     compressionTask->workerThread = this;
 
     {
         AutoUnlockWorkerThreadState unlock(runtime);
-        if (!compressionTask->compress())
+        if (!compressionTask->work())
             compressionTask->setOOM();
     }
 
     compressionTask->workerThread = nullptr;
     compressionTask = nullptr;
 
     // Notify the main thread in case it is waiting for the compression to finish.
     state.notifyAll(WorkerThreadState::CONSUMER);
--- a/js/src/jsworkers.h
+++ b/js/src/jsworkers.h
@@ -408,17 +408,17 @@ struct SourceCompressionTask
 #endif
     }
 
     ~SourceCompressionTask()
     {
         complete();
     }
 
-    bool compress();
+    bool work();
     bool complete();
     void abort() { abort_ = 1; }
     bool active() const { return !!ss; }
     ScriptSource *source() { return ss; }
     const jschar *uncompressedChars() { return chars; }
     void setOOM() { oom = true; }
 };
 
--- a/js/src/moz.build
+++ b/js/src/moz.build
@@ -150,16 +150,17 @@ UNIFIED_SOURCES += [
     'jsweakmap.cpp',
     'jsworkers.cpp',
     'jswrapper.cpp',
     'perf/jsperf.cpp',
     'prmjtime.cpp',
     'vm/ArgumentsObject.cpp',
     'vm/CallNonGenericMethod.cpp',
     'vm/CharacterEncoding.cpp',
+    'vm/Compression.cpp',
     'vm/DateTime.cpp',
     'vm/Debugger.cpp',
     'vm/ErrorObject.cpp',
     'vm/ForkJoin.cpp',
     'vm/GlobalObject.cpp',
     'vm/Id.cpp',
     'vm/Interpreter.cpp',
     'vm/MemoryMetrics.cpp',
new file mode 100644
--- /dev/null
+++ b/js/src/vm/Compression.cpp
@@ -0,0 +1,127 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ * vim: set ts=8 sts=4 et sw=4 tw=99:
+ * 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 "vm/Compression.h"
+
+#include "js/Utility.h"
+
+using namespace js;
+
+#if USE_ZLIB
+static void *
+zlib_alloc(void *cx, uInt items, uInt size)
+{
+    return js_calloc(items, size);
+}
+
+static void
+zlib_free(void *cx, void *addr)
+{
+    js_free(addr);
+}
+
+Compressor::Compressor(const unsigned char *inp, size_t inplen)
+    : inp(inp),
+      inplen(inplen),
+      outbytes(0)
+{
+    JS_ASSERT(inplen > 0);
+    zs.opaque = nullptr;
+    zs.next_in = (Bytef *)inp;
+    zs.avail_in = 0;
+    zs.next_out = nullptr;
+    zs.avail_out = 0;
+    zs.zalloc = zlib_alloc;
+    zs.zfree = zlib_free;
+}
+
+
+Compressor::~Compressor()
+{
+    int ret = deflateEnd(&zs);
+    if (ret != Z_OK) {
+        // If we finished early, we can get a Z_DATA_ERROR.
+        JS_ASSERT(ret == Z_DATA_ERROR);
+        JS_ASSERT(uInt(zs.next_in - inp) < inplen || !zs.avail_out);
+    }
+}
+
+bool
+Compressor::init()
+{
+    if (inplen >= UINT32_MAX)
+        return false;
+    // zlib is slow and we'd rather be done compression sooner
+    // even if it means decompression is slower which penalizes
+    // Function.toString()
+    int ret = deflateInit(&zs, Z_BEST_SPEED);
+    if (ret != Z_OK) {
+        JS_ASSERT(ret == Z_MEM_ERROR);
+        return false;
+    }
+    return true;
+}
+
+void
+Compressor::setOutput(unsigned char *out, size_t outlen)
+{
+    JS_ASSERT(outlen > outbytes);
+    zs.next_out = out + outbytes;
+    zs.avail_out = outlen - outbytes;
+}
+
+Compressor::Status
+Compressor::compressMore()
+{
+    JS_ASSERT(zs.next_out);
+    uInt left = inplen - (zs.next_in - inp);
+    bool done = left <= CHUNKSIZE;
+    if (done)
+        zs.avail_in = left;
+    else if (zs.avail_in == 0)
+        zs.avail_in = CHUNKSIZE;
+    Bytef *oldout = zs.next_out;
+    int ret = deflate(&zs, done ? Z_FINISH : Z_NO_FLUSH);
+    outbytes += zs.next_out - oldout;
+    if (ret == Z_MEM_ERROR) {
+        zs.avail_out = 0;
+        return OOM;
+    }
+    if (ret == Z_BUF_ERROR || (done && ret == Z_OK)) {
+        JS_ASSERT(zs.avail_out == 0);
+        return MOREOUTPUT;
+    }
+    JS_ASSERT_IF(!done, ret == Z_OK);
+    JS_ASSERT_IF(done, ret == Z_STREAM_END);
+    return done ? DONE : CONTINUE;
+}
+
+bool
+js::DecompressString(const unsigned char *inp, size_t inplen, unsigned char *out, size_t outlen)
+{
+    JS_ASSERT(inplen <= UINT32_MAX);
+    z_stream zs;
+    zs.zalloc = zlib_alloc;
+    zs.zfree = zlib_free;
+    zs.opaque = nullptr;
+    zs.next_in = (Bytef *)inp;
+    zs.avail_in = inplen;
+    zs.next_out = out;
+    JS_ASSERT(outlen);
+    zs.avail_out = outlen;
+    int ret = inflateInit(&zs);
+    if (ret != Z_OK) {
+        JS_ASSERT(ret == Z_MEM_ERROR);
+        return false;
+    }
+    ret = inflate(&zs, Z_FINISH);
+    JS_ASSERT(ret == Z_STREAM_END);
+    ret = inflateEnd(&zs);
+    JS_ASSERT(ret == Z_OK);
+    return true;
+}
+#endif /* USE_ZLIB */
+
new file mode 100644
--- /dev/null
+++ b/js/src/vm/Compression.h
@@ -0,0 +1,54 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ * vim: set ts=8 sts=4 et sw=4 tw=99:
+ * 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/. */
+
+#ifndef vm_Compression_h
+#define vm_Compression_h
+
+#ifdef USE_ZLIB
+
+#include <zlib.h>
+
+#include "jstypes.h"
+
+namespace js {
+
+class Compressor
+{
+    /* Number of bytes we should hand to zlib each compressMore() call. */
+    static const size_t CHUNKSIZE = 2048;
+    z_stream zs;
+    const unsigned char *inp;
+    size_t inplen;
+    size_t outbytes;
+
+  public:
+    enum Status {
+        MOREOUTPUT,
+        DONE,
+        CONTINUE,
+        OOM
+    };
+
+    Compressor(const unsigned char *inp, size_t inplen);
+    ~Compressor();
+    bool init();
+    void setOutput(unsigned char *out, size_t outlen);
+    size_t outWritten() const { return outbytes; }
+    /* Compress some of the input. Return true if it should be called again. */
+    Status compressMore();
+};
+
+/*
+ * Decompress a string. The caller must know the length of the output and
+ * allocate |out| to a string of that length.
+ */
+bool DecompressString(const unsigned char *inp, size_t inplen,
+                      unsigned char *out, size_t outlen);
+
+} /* namespace js */
+
+#endif /* USE_ZLIB */
+#endif /* vm_Compression_h */
--- a/js/src/vm/SelfHosting.cpp
+++ b/js/src/vm/SelfHosting.cpp
@@ -12,16 +12,17 @@
 #include "jshashutil.h"
 #include "jsobj.h"
 #include "jswrapper.h"
 #include "selfhosted.out.h"
 
 #include "builtin/Intl.h"
 #include "builtin/TypedObject.h"
 #include "gc/Marking.h"
+#include "vm/Compression.h"
 #include "vm/ForkJoin.h"
 #include "vm/Interpreter.h"
 
 #include "jsfuninlines.h"
 #include "jsscriptinlines.h"
 
 #include "vm/BooleanObject-inl.h"
 #include "vm/NumberObject-inl.h"
--- a/layout/base/FrameLayerBuilder.cpp
+++ b/layout/base/FrameLayerBuilder.cpp
@@ -3813,18 +3813,19 @@ ContainerState::SetupMaskLayer(Layer *aL
 
     // build the image and container
     container = aLayer->Manager()->CreateImageContainer();
     NS_ASSERTION(container, "Could not create image container for mask layer.");
     static const ImageFormat format = CAIRO_SURFACE;
     nsRefPtr<Image> image = container->CreateImage(&format, 1);
     NS_ASSERTION(image, "Could not create image container for mask layer.");
     CairoImage::Data data;
-    data.mSurface = surface;
+    data.mDeprecatedSurface = surface;
     data.mSize = surfaceSizeInt;
+    data.mSourceSurface = gfxPlatform::GetPlatform()->GetSourceSurfaceForSurface(nullptr, surface);
     static_cast<CairoImage*>(image.get())->SetData(data);
     container->SetCurrentImageInTransaction(image);
 
     GetMaskLayerImageCache()->PutImage(newKey.forget(), container);
   }
 
   maskLayer->SetContainer(container);
 
--- a/layout/ipc/RenderFrameParent.cpp
+++ b/layout/ipc/RenderFrameParent.cpp
@@ -605,30 +605,33 @@ public:
     }
   }
 
   virtual void PostDelayedTask(Task* aTask, int aDelayMs) MOZ_OVERRIDE
   {
     MessageLoop::current()->PostDelayedTask(FROM_HERE, aTask, aDelayMs);
   }
 
-  void SaveZoomConstraints(const ZoomConstraints& aConstraints)
-  {
-    mHaveZoomConstraints = true;
-    mZoomConstraints = aConstraints;
-  }
-
   virtual bool GetRootZoomConstraints(ZoomConstraints* aOutConstraints)
   {
     if (mHaveZoomConstraints && aOutConstraints) {
       *aOutConstraints = mZoomConstraints;
     }
     return mHaveZoomConstraints;
   }
 
+  virtual bool GetTouchSensitiveRegion(CSSRect* aOutRegion)
+  {
+    if (mTouchSensitiveRegion.IsEmpty())
+      return false;
+
+    *aOutRegion = CSSRect::FromAppUnits(mTouchSensitiveRegion.GetBounds());
+    return true;
+  }
+
   virtual void NotifyTransformBegin(const ScrollableLayerGuid& aGuid)
   {
     if (MessageLoop::current() != mUILoop) {
       mUILoop->PostTask(
         FROM_HERE,
         NewRunnableMethod(this, &RemoteContentController::NotifyTransformBegin,
                           aGuid));
       return;
@@ -649,30 +652,43 @@ public:
       return;
     }
     if (mRenderFrame) {
       TabParent* browser = static_cast<TabParent*>(mRenderFrame->Manager());
       browser->NotifyTransformEnd(aGuid.mScrollId);
     }
   }
 
+  // Methods used by RenderFrameParent to set fields stored here.
+
+  void SaveZoomConstraints(const ZoomConstraints& aConstraints)
+  {
+    mHaveZoomConstraints = true;
+    mZoomConstraints = aConstraints;
+  }
+
+  void SetTouchSensitiveRegion(const nsRegion& aRegion)
+  {
+    mTouchSensitiveRegion = aRegion;
+  }
 private:
   void DoRequestContentRepaint(const FrameMetrics& aFrameMetrics)
   {
     if (mRenderFrame) {
       TabParent* browser = static_cast<TabParent*>(mRenderFrame->Manager());
       browser->UpdateFrame(aFrameMetrics);
     }
   }
 
   MessageLoop* mUILoop;
   RenderFrameParent* mRenderFrame;
 
   bool mHaveZoomConstraints;
   ZoomConstraints mZoomConstraints;
+  nsRegion mTouchSensitiveRegion;
 };
 
 RenderFrameParent::RenderFrameParent()
   : mLayersId(0)
   , mFrameLoaderDestroyed(false)
   , mBackgroundColor(gfxRGBA(1, 1, 1))
 {
 }
@@ -936,16 +952,23 @@ RenderFrameParent::RecvNotifyCompositorT
   TriggerRepaint();
   return true;
 }
 
 bool
 RenderFrameParent::RecvUpdateHitRegion(const nsRegion& aRegion)
 {
   mTouchRegion = aRegion;
+  if (mContentController) {
+    // Tell the content controller about the touch-sensitive region, so
+    // that it can provide it to APZ. This is required for APZ to do
+    // correct hit testing for a remote 'mozpasspointerevents' iframe
+    // until bug 928833 is fixed.
+    mContentController->SetTouchSensitiveRegion(aRegion);
+  }
   return true;
 }
 
 PLayerTransactionParent*
 RenderFrameParent::AllocPLayerTransactionParent()
 {
   if (!mFrameLoader || mFrameLoaderDestroyed) {
     return nullptr;
--- a/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
+++ b/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
@@ -35,16 +35,17 @@
 #include "transportflow.h"
 #include "transportlayer.h"
 #include "transportlayerdtls.h"
 #include "transportlayerice.h"
 #include "runnable_utils.h"
 #include "gfxImageSurface.h"
 #include "libyuv/convert.h"
 #include "mozilla/gfx/Point.h"
+#include "mozilla/gfx/Types.h"
 
 using namespace mozilla;
 using namespace mozilla::gfx;
 
 // Logging context
 MOZ_MTLOG_MODULE("mediapipeline")
 
 namespace mozilla {
@@ -956,37 +957,35 @@ void MediaPipelineTransmit::PipelineList
     int c_size = half_width * half_height;
     int buffer_size = size.width * size.height + 2 * c_size;
     uint8* yuv = (uint8*) malloc(buffer_size);
     if (!yuv)
       return;
 
     int cb_offset = size.width * size.height;
     int cr_offset = cb_offset + c_size;
-    nsRefPtr<gfxImageSurface> surf = rgb->mSurface->GetAsImageSurface();
+    RefPtr<gfx::SourceSurface> tempSurf = rgb->GetAsSourceSurface();
+    RefPtr<gfx::DataSourceSurface> surf = tempSurf->GetDataSurface();
 
-    switch (surf->Format()) {
-      case gfxImageFormatARGB32:
-      case gfxImageFormatRGB24:
-        libyuv::ARGBToI420(static_cast<uint8*>(surf->Data()), surf->Stride(),
+    switch (surf->GetFormat()) {
+      case gfx::SurfaceFormat::B8G8R8A8:
+      case gfx::SurfaceFormat::B8G8R8X8:
+        libyuv::ARGBToI420(static_cast<uint8*>(surf->GetData()), surf->Stride(),
                            yuv, size.width,
                            yuv + cb_offset, half_width,
                            yuv + cr_offset, half_width,
                            size.width, size.height);
         break;
-      case gfxImageFormatRGB16_565:
-        libyuv::RGB565ToI420(static_cast<uint8*>(surf->Data()), surf->Stride(),
+      case gfx::SurfaceFormat::R5G6B5:
+        libyuv::RGB565ToI420(static_cast<uint8*>(surf->GetData()), surf->Stride(),
                              yuv, size.width,
                              yuv + cb_offset, half_width,
                              yuv + cr_offset, half_width,
                              size.width, size.height);
         break;
-      case gfxImageFormatA1:
-      case gfxImageFormatA8:
-      case gfxImageFormatUnknown:
       default:
         MOZ_MTLOG(ML_ERROR, "Unsupported RGB video format");
         MOZ_ASSERT(PR_FALSE);
     }
     conduit->SendVideoFrame(yuv, buffer_size, size.width, size.height, mozilla::kVideoI420, 0);
   } else {
     MOZ_MTLOG(ML_ERROR, "Unsupported video format");
     MOZ_ASSERT(PR_FALSE);
--- a/memory/build/mozmemory_wrap.c
+++ b/memory/build/mozmemory_wrap.c
@@ -83,16 +83,65 @@ strndup_impl(const char *src, size_t len
 MOZ_MEMORY_API char *
 strdup_impl(const char *src)
 {
   size_t len = strlen(src);
   return strndup_impl(src, len);
 }
 #endif /* XP_DARWIN */
 
+#ifdef ANDROID
+#include <stdarg.h>
+
+MOZ_MEMORY_API int
+vasprintf_impl(char **str, const char *fmt, va_list ap)
+{
+  if (str == NULL || fmt == NULL) {
+    return -1;
+  }
+
+  char* ptr = (char*)malloc_impl(128);
+  if (ptr == NULL) {
+    *str = NULL;
+    return -1;
+  }
+
+  int ret = vsnprintf(ptr, 128, fmt, ap);
+  if (ret < 0) {
+    free_impl(ptr);
+    *str = NULL;
+    return -1;
+  }
+
+  char* _ptr = realloc_impl(ptr, ret + 1);
+  if (_ptr == NULL) {
+    free_impl(ptr);
+    *str = NULL;
+    return -1;
+  }
+
+  *str = _ptr;
+
+  return ret;
+}
+
+MOZ_MEMORY_API int
+asprintf_impl(char **str, const char *fmt, ...)
+ {
+   va_list ap;
+   va_start(ap, fmt);
+
+   int ret = vasprintf_impl(str, fmt, ap);
+
+   va_end(ap);
+
+   return ret;
+}
+#endif
+
 #ifdef XP_WIN
 /*
  *  There's a fun allocator mismatch in (at least) the VS 2010 CRT
  *  (see the giant comment in $(topsrcdir)/mozglue/build/Makefile.in)
  *  that gets redirected here to avoid a crash on shutdown.
  */
 void
 dumb_free_thunk(void *ptr)
--- a/memory/build/mozmemory_wrap.h
+++ b/memory/build/mozmemory_wrap.h
@@ -207,14 +207,23 @@
 
 /* Duplication functions */
 #define strndup_impl   mozmem_dup_impl(strndup)
 #define strdup_impl    mozmem_dup_impl(strdup)
 #ifdef XP_WIN
 #  define wcsdup_impl  mozmem_dup_impl(wcsdup)
 #endif
 
+/* String functions */
+#ifdef ANDROID
+/* Bug 801571 and Bug 879668, libstagefright uses vasprintf, causing malloc()/
+ * free() to be mismatched between bionic and mozglue implementation.
+ */
+#define vasprintf_impl  mozmem_dup_impl(vasprintf)
+#define asprintf_impl   mozmem_dup_impl(asprintf)
+#endif
+
 /* Jemalloc specific function */
 #define jemalloc_stats_impl              mozmem_jemalloc_impl(jemalloc_stats)
 #define jemalloc_purge_freed_pages_impl  mozmem_jemalloc_impl(jemalloc_purge_freed_pages)
 #define jemalloc_free_dirty_pages_impl   mozmem_jemalloc_impl(jemalloc_free_dirty_pages)
 
 #endif /* mozmemory_wrap_h */
--- a/netwerk/dns/DNSRequestParent.h
+++ b/netwerk/dns/DNSRequestParent.h
@@ -23,17 +23,17 @@ public:
   NS_DECL_NSIDNSLISTENER
 
   DNSRequestParent();
   virtual ~DNSRequestParent();
 
   void DoAsyncResolve(const nsACString  &hostname, uint32_t flags);
 
 protected:
-  virtual void ActorDestroy(ActorDestroyReason why);
+  virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE;
 private:
   uint32_t mFlags;
   bool mIPCClosed;  // true if IPDL channel has been closed (child crash)
 };
 
 } // namespace net
 } // namespace mozilla
 #endif // mozilla_net_DNSRequestParent_h
--- a/netwerk/ipc/NeckoChild.h
+++ b/netwerk/ipc/NeckoChild.h
@@ -23,47 +23,50 @@ public:
   virtual ~NeckoChild();
 
   static void InitNeckoChild();
   static void DestroyNeckoChild();
 
 protected:
   virtual PHttpChannelChild*
     AllocPHttpChannelChild(PBrowserChild*, const SerializedLoadContext&,
-                           const HttpChannelCreationArgs& aOpenArgs);
-  virtual bool DeallocPHttpChannelChild(PHttpChannelChild*);
-  virtual PCookieServiceChild* AllocPCookieServiceChild();
-  virtual bool DeallocPCookieServiceChild(PCookieServiceChild*);
-  virtual PWyciwygChannelChild* AllocPWyciwygChannelChild();
-  virtual bool DeallocPWyciwygChannelChild(PWyciwygChannelChild*);
+                           const HttpChannelCreationArgs& aOpenArgs) MOZ_OVERRIDE;
+  virtual bool DeallocPHttpChannelChild(PHttpChannelChild*) MOZ_OVERRIDE;
+  virtual PCookieServiceChild* AllocPCookieServiceChild() MOZ_OVERRIDE;
+  virtual bool DeallocPCookieServiceChild(PCookieServiceChild*) MOZ_OVERRIDE;
+  virtual PWyciwygChannelChild* AllocPWyciwygChannelChild() MOZ_OVERRIDE;
+  virtual bool DeallocPWyciwygChannelChild(PWyciwygChannelChild*) MOZ_OVERRIDE;
   virtual PFTPChannelChild*
     AllocPFTPChannelChild(PBrowserChild* aBrowser,
                           const SerializedLoadContext& aSerialized,
-                          const FTPChannelCreationArgs& aOpenArgs);
-  virtual bool DeallocPFTPChannelChild(PFTPChannelChild*);
-  virtual PWebSocketChild* AllocPWebSocketChild(PBrowserChild*, const SerializedLoadContext&);
-  virtual bool DeallocPWebSocketChild(PWebSocketChild*);
-  virtual PTCPSocketChild* AllocPTCPSocketChild();
-  virtual bool DeallocPTCPSocketChild(PTCPSocketChild*);
-  virtual PTCPServerSocketChild* AllocPTCPServerSocketChild(const uint16_t& aLocalPort,
-                                                       const uint16_t& aBacklog,
-                                                       const nsString& aBinaryType);
-  virtual bool DeallocPTCPServerSocketChild(PTCPServerSocketChild*);
+                          const FTPChannelCreationArgs& aOpenArgs) MOZ_OVERRIDE;
+  virtual bool DeallocPFTPChannelChild(PFTPChannelChild*) MOZ_OVERRIDE;
+  virtual PWebSocketChild*
+    AllocPWebSocketChild(PBrowserChild*, const SerializedLoadContext&) MOZ_OVERRIDE;
+  virtual bool DeallocPWebSocketChild(PWebSocketChild*) MOZ_OVERRIDE;
+  virtual PTCPSocketChild* AllocPTCPSocketChild() MOZ_OVERRIDE;
+  virtual bool DeallocPTCPSocketChild(PTCPSocketChild*) MOZ_OVERRIDE;
+  virtual PTCPServerSocketChild*
+    AllocPTCPServerSocketChild(const uint16_t& aLocalPort,
+                               const uint16_t& aBacklog,
+                               const nsString& aBinaryType) MOZ_OVERRIDE;
+  virtual bool DeallocPTCPServerSocketChild(PTCPServerSocketChild*) MOZ_OVERRIDE;
   virtual PUDPSocketChild* AllocPUDPSocketChild(const nsCString& aHost,
                                                 const uint16_t& aPort,
-                                                const nsCString& aFilter);
-  virtual bool DeallocPUDPSocketChild(PUDPSocketChild*);
+                                                const nsCString& aFilter) MOZ_OVERRIDE;
+  virtual bool DeallocPUDPSocketChild(PUDPSocketChild*) MOZ_OVERRIDE;
   virtual PDNSRequestChild* AllocPDNSRequestChild(const nsCString& aHost,
-                                                  const uint32_t& aFlags);
-  virtual bool DeallocPDNSRequestChild(PDNSRequestChild*);
-  virtual PRemoteOpenFileChild* AllocPRemoteOpenFileChild(const URIParams&,
-                                                          const OptionalURIParams&);
-  virtual bool DeallocPRemoteOpenFileChild(PRemoteOpenFileChild*);
-  virtual PRtspControllerChild* AllocPRtspControllerChild();
-  virtual bool DeallocPRtspControllerChild(PRtspControllerChild*);
+                                                  const uint32_t& aFlags) MOZ_OVERRIDE;
+  virtual bool DeallocPDNSRequestChild(PDNSRequestChild*) MOZ_OVERRIDE;
+  virtual PRemoteOpenFileChild*
+    AllocPRemoteOpenFileChild(const URIParams&,
+                              const OptionalURIParams&) MOZ_OVERRIDE;
+  virtual bool DeallocPRemoteOpenFileChild(PRemoteOpenFileChild*) MOZ_OVERRIDE;
+  virtual PRtspControllerChild* AllocPRtspControllerChild() MOZ_OVERRIDE;
+  virtual bool DeallocPRtspControllerChild(PRtspControllerChild*) MOZ_OVERRIDE;
 };
 
 /**
  * Reference to the PNecko Child protocol.
  * Null if this is not a content process.
  */
 extern PNeckoChild *gNeckoChild;
 
--- a/netwerk/ipc/NeckoParent.h
+++ b/netwerk/ipc/NeckoParent.h
@@ -65,87 +65,89 @@ public:
   RecvPCookieServiceConstructor(PCookieServiceParent* aActor) MOZ_OVERRIDE
   {
     return PNeckoParent::RecvPCookieServiceConstructor(aActor);
   }
 
 protected:
   virtual PHttpChannelParent*
     AllocPHttpChannelParent(PBrowserParent*, const SerializedLoadContext&,
-                            const HttpChannelCreationArgs& aOpenArgs);
+                            const HttpChannelCreationArgs& aOpenArgs) MOZ_OVERRIDE;
   virtual bool
     RecvPHttpChannelConstructor(
                       PHttpChannelParent* aActor,
                       PBrowserParent* aBrowser,
                       const SerializedLoadContext& aSerialized,
-                      const HttpChannelCreationArgs& aOpenArgs);
-  virtual bool DeallocPHttpChannelParent(PHttpChannelParent*);
-  virtual bool DeallocPCookieServiceParent(PCookieServiceParent*);
-  virtual PWyciwygChannelParent* AllocPWyciwygChannelParent();
-  virtual bool DeallocPWyciwygChannelParent(PWyciwygChannelParent*);
+                      const HttpChannelCreationArgs& aOpenArgs) MOZ_OVERRIDE;
+  virtual bool DeallocPHttpChannelParent(PHttpChannelParent*) MOZ_OVERRIDE;
+  virtual bool DeallocPCookieServiceParent(PCookieServiceParent*) MOZ_OVERRIDE;
+  virtual PWyciwygChannelParent* AllocPWyciwygChannelParent() MOZ_OVERRIDE;
+  virtual bool DeallocPWyciwygChannelParent(PWyciwygChannelParent*) MOZ_OVERRIDE;
   virtual PFTPChannelParent*
     AllocPFTPChannelParent(PBrowserParent* aBrowser,
                            const SerializedLoadContext& aSerialized,
-                           const FTPChannelCreationArgs& aOpenArgs);
+                           const FTPChannelCreationArgs& aOpenArgs) MOZ_OVERRIDE;
   virtual bool
     RecvPFTPChannelConstructor(
                       PFTPChannelParent* aActor,
                       PBrowserParent* aBrowser,
                       const SerializedLoadContext& aSerialized,
-                      const FTPChannelCreationArgs& aOpenArgs);
-  virtual bool DeallocPFTPChannelParent(PFTPChannelParent*);
-  virtual PWebSocketParent* AllocPWebSocketParent(PBrowserParent* browser,
-                                                  const SerializedLoadContext& aSerialized);
-  virtual bool DeallocPWebSocketParent(PWebSocketParent*);
-  virtual PTCPSocketParent* AllocPTCPSocketParent();
+                      const FTPChannelCreationArgs& aOpenArgs) MOZ_OVERRIDE;
+  virtual bool DeallocPFTPChannelParent(PFTPChannelParent*) MOZ_OVERRIDE;
+  virtual PWebSocketParent*
+    AllocPWebSocketParent(PBrowserParent* browser,
+                          const SerializedLoadContext& aSerialized) MOZ_OVERRIDE;
+  virtual bool DeallocPWebSocketParent(PWebSocketParent*) MOZ_OVERRIDE;
+  virtual PTCPSocketParent* AllocPTCPSocketParent() MOZ_OVERRIDE;
 
   virtual PRemoteOpenFileParent* AllocPRemoteOpenFileParent(const URIParams& aFileURI,
                                                             const OptionalURIParams& aAppURI)
                                                             MOZ_OVERRIDE;
   virtual bool RecvPRemoteOpenFileConstructor(PRemoteOpenFileParent* aActor,
                                               const URIParams& aFileURI,
                                               const OptionalURIParams& aAppURI)
                                               MOZ_OVERRIDE;
   virtual bool DeallocPRemoteOpenFileParent(PRemoteOpenFileParent* aActor)
                                             MOZ_OVERRIDE;
 
-  virtual bool DeallocPTCPSocketParent(PTCPSocketParent*);
-  virtual PTCPServerSocketParent* AllocPTCPServerSocketParent(const uint16_t& aLocalPort,
-                                                        const uint16_t& aBacklog,
-                                                        const nsString& aBinaryType);
+  virtual bool DeallocPTCPSocketParent(PTCPSocketParent*) MOZ_OVERRIDE;
+  virtual PTCPServerSocketParent*
+    AllocPTCPServerSocketParent(const uint16_t& aLocalPort,
+                                const uint16_t& aBacklog,
+                                const nsString& aBinaryType) MOZ_OVERRIDE;
   virtual bool RecvPTCPServerSocketConstructor(PTCPServerSocketParent*,
                                                const uint16_t& aLocalPort,
                                                const uint16_t& aBacklog,
-                                               const nsString& aBinaryType);
-  virtual bool DeallocPTCPServerSocketParent(PTCPServerSocketParent*);
+                                               const nsString& aBinaryType) MOZ_OVERRIDE;
+  virtual bool DeallocPTCPServerSocketParent(PTCPServerSocketParent*) MOZ_OVERRIDE;
   virtual PUDPSocketParent* AllocPUDPSocketParent(const nsCString& aHost,
                                                   const uint16_t& aPort,
-                                                  const nsCString& aFilter);
+                                                  const nsCString& aFilter) MOZ_OVERRIDE;
   virtual bool RecvPUDPSocketConstructor(PUDPSocketParent*,
                                          const nsCString& aHost,
                                          const uint16_t& aPort,
-                                         const nsCString& aFilter);
-  virtual bool DeallocPUDPSocketParent(PUDPSocketParent*);
+                                         const nsCString& aFilter) MOZ_OVERRIDE;
+  virtual bool DeallocPUDPSocketParent(PUDPSocketParent*) MOZ_OVERRIDE;
   virtual PDNSRequestParent* AllocPDNSRequestParent(const nsCString& aHost,
-                                                    const uint32_t& aFlags);
+                                                    const uint32_t& aFlags) MOZ_OVERRIDE;
   virtual bool RecvPDNSRequestConstructor(PDNSRequestParent* actor,
                                           const nsCString& hostName,
-                                          const uint32_t& flags);
-  virtual bool DeallocPDNSRequestParent(PDNSRequestParent*);
+                                          const uint32_t& flags) MOZ_OVERRIDE;
+  virtual bool DeallocPDNSRequestParent(PDNSRequestParent*) MOZ_OVERRIDE;
   virtual bool RecvHTMLDNSPrefetch(const nsString& hostname,
-                                   const uint16_t& flags);
+                                   const uint16_t& flags) MOZ_OVERRIDE;
   virtual bool RecvCancelHTMLDNSPrefetch(const nsString& hostname,
                                          const uint16_t& flags,
-                                         const nsresult& reason);
+                                         const nsresult& reason) MOZ_OVERRIDE;
 
   virtual mozilla::ipc::IProtocol*
   CloneProtocol(Channel* aChannel,
                 mozilla::ipc::ProtocolCloneContext* aCtx) MOZ_OVERRIDE;
-  virtual PRtspControllerParent* AllocPRtspControllerParent();
-  virtual bool DeallocPRtspControllerParent(PRtspControllerParent*);
+  virtual PRtspControllerParent* AllocPRtspControllerParent() MOZ_OVERRIDE;
+  virtual bool DeallocPRtspControllerParent(PRtspControllerParent*) MOZ_OVERRIDE;
 
 private:
   nsCString mCoreAppsBasePath;
   nsCString mWebAppsBasePath;
 };
 
 } // namespace net
 } // namespace mozilla
--- a/netwerk/protocol/http/HttpChannelChild.h
+++ b/netwerk/protocol/http/HttpChannelChild.h
@@ -95,35 +95,35 @@ protected:
                           const bool& useResponseHead,
                           const nsHttpHeaderArray& requestHeaders,
                           const bool& isFromCache,
                           const bool& cacheEntryAvailable,
                           const uint32_t& cacheExpirationTime,
                           const nsCString& cachedCharset,
                           const nsCString& securityInfoSerialization,
                           const NetAddr& selfAddr,
-                          const NetAddr& peerAddr);
+                          const NetAddr& peerAddr) MOZ_OVERRIDE;
   bool RecvOnTransportAndData(const nsresult& status,
                               const uint64_t& progress,
                               const uint64_t& progressMax,
                               const nsCString& data,
                               const uint64_t& offset,
-                              const uint32_t& count);
+                              const uint32_t& count) MOZ_OVERRIDE;
   bool RecvOnStopRequest(const nsresult& statusCode);
-  bool RecvOnProgress(const uint64_t& progress, const uint64_t& progressMax);
-  bool RecvOnStatus(const nsresult& status);
-  bool RecvFailedAsyncOpen(const nsresult& status);
+  bool RecvOnProgress(const uint64_t& progress, const uint64_t& progressMax) MOZ_OVERRIDE;
+  bool RecvOnStatus(const nsresult& status) MOZ_OVERRIDE;
+  bool RecvFailedAsyncOpen(const nsresult& status) MOZ_OVERRIDE;
   bool RecvRedirect1Begin(const uint32_t& newChannel,
                           const URIParams& newURI,
                           const uint32_t& redirectFlags,
-                          const nsHttpResponseHead& responseHead);
-  bool RecvRedirect3Complete();
+                          const nsHttpResponseHead& responseHead) MOZ_OVERRIDE;
+  bool RecvRedirect3Complete() MOZ_OVERRIDE;
   bool RecvAssociateApplicationCache(const nsCString& groupID,
-                                     const nsCString& clientID);
-  bool RecvDeleteSelf();
+                                     const nsCString& clientID) MOZ_OVERRIDE;
+  bool RecvDeleteSelf() MOZ_OVERRIDE;
 
   bool GetAssociatedContentSecurity(nsIAssociatedContentSecurity** res = nullptr);
   virtual void DoNotifyListenerCleanup();
 
 private:
   RequestHeaderTuples mClientSetRequestHeaders;
   nsCOMPtr<nsIChildChannel> mRedirectChannelChild;
   nsCOMPtr<nsISupports> mSecurityInfo;
--- a/netwerk/protocol/http/HttpChannelParent.h
+++ b/netwerk/protocol/http/HttpChannelParent.h
@@ -72,30 +72,30 @@ protected:
                    const bool&                forceAllowThirdPartyCookie,
                    const bool&                doResumeAt,
                    const uint64_t&            startPos,
                    const nsCString&           entityID,
                    const bool&                chooseApplicationCache,
                    const nsCString&           appCacheClientID,
                    const bool&                allowSpdy);
 
-  virtual bool RecvSetPriority(const uint16_t& priority);
-  virtual bool RecvSetCacheTokenCachedCharset(const nsCString& charset);
-  virtual bool RecvSuspend();
-  virtual bool RecvResume();
-  virtual bool RecvCancel(const nsresult& status);
+  virtual bool RecvSetPriority(const uint16_t& priority) MOZ_OVERRIDE;
+  virtual bool RecvSetCacheTokenCachedCharset(const nsCString& charset) MOZ_OVERRIDE;
+  virtual bool RecvSuspend() MOZ_OVERRIDE;
+  virtual bool RecvResume() MOZ_OVERRIDE;
+  virtual bool RecvCancel(const nsresult& status) MOZ_OVERRIDE;
   virtual bool RecvRedirect2Verify(const nsresult& result,
                                    const RequestHeaderTuples& changedHeaders,
-                                   const OptionalURIParams&   apiRedirectUri);
+                                   const OptionalURIParams& apiRedirectUri) MOZ_OVERRIDE;
   virtual bool RecvUpdateAssociatedContentSecurity(const int32_t& broken,
-                                                   const int32_t& no);
-  virtual bool RecvDocumentChannelCleanup();
-  virtual bool RecvMarkOfflineCacheEntryAsForeign();
+                                                   const int32_t& no) MOZ_OVERRIDE;
+  virtual bool RecvDocumentChannelCleanup() MOZ_OVERRIDE;
+  virtual bool RecvMarkOfflineCacheEntryAsForeign() MOZ_OVERRIDE;
 
-  virtual void ActorDestroy(ActorDestroyReason why);
+  virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE;
 
 protected:
   friend class HttpChannelParentListener;
   nsRefPtr<mozilla::dom::TabParent> mTabParent;
 
 private:
   nsCOMPtr<nsIChannel>                    mChannel;
   nsCOMPtr<nsICacheEntry>       mCacheEntry;
--- a/netwerk/protocol/websocket/WebSocketChannelChild.h
+++ b/netwerk/protocol/websocket/WebSocketChannelChild.h
@@ -34,23 +34,22 @@ class WebSocketChannelChild : public Bas
   NS_IMETHOD SendBinaryMsg(const nsACString &aMsg);
   NS_IMETHOD SendBinaryStream(nsIInputStream *aStream, uint32_t aLength);
   NS_IMETHOD GetSecurityInfo(nsISupports **aSecurityInfo);
 
   void AddIPDLReference();
   void ReleaseIPDLReference();
 
  private:
-  bool RecvOnStart(const nsCString& aProtocol, const nsCString& aExtensions);
-  bool RecvOnStop(const nsresult& aStatusCode);
-  bool RecvOnMessageAvailable(const nsCString& aMsg);
-  bool RecvOnBinaryMessageAvailable(const nsCString& aMsg);
-  bool RecvOnAcknowledge(const uint32_t& aSize);
-  bool RecvOnServerClose(const uint16_t& aCode, const nsCString &aReason);
-  bool RecvAsyncOpenFailed();
+  bool RecvOnStart(const nsCString& aProtocol, const nsCString& aExtensions) MOZ_OVERRIDE;
+  bool RecvOnStop(const nsresult& aStatusCode) MOZ_OVERRIDE;
+  bool RecvOnMessageAvailable(const nsCString& aMsg) MOZ_OVERRIDE;
+  bool RecvOnBinaryMessageAvailable(const nsCString& aMsg) MOZ_OVERRIDE;
+  bool RecvOnAcknowledge(const uint32_t& aSize) MOZ_OVERRIDE;
+  bool RecvOnServerClose(const uint16_t& aCode, const nsCString &aReason) MOZ_OVERRIDE;
 
   void OnStart(const nsCString& aProtocol, const nsCString& aExtensions);
   void OnStop(const nsresult& aStatusCode);
   void OnMessageAvailable(const nsCString& aMsg);
   void OnBinaryMessageAvailable(const nsCString& aMsg);
   void OnAcknowledge(const uint32_t& aSize);
   void OnServerClose(const uint16_t& aCode, const nsCString& aReason);
   void AsyncOpenFailed();  
--- a/netwerk/protocol/websocket/WebSocketChannelParent.h
+++ b/netwerk/protocol/websocket/WebSocketChannelParent.h
@@ -37,25 +37,25 @@ class WebSocketChannelParent : public PW
  private:
   bool RecvAsyncOpen(const URIParams& aURI,
                      const nsCString& aOrigin,
                      const nsCString& aProtocol,
                      const bool& aSecure,
                      const uint32_t& aPingInterval,
                      const bool& aClientSetPingInterval,
                      const uint32_t& aPingTimeout,
-                     const bool& aClientSetPingTimeout);
-  bool RecvClose(const uint16_t & code, const nsCString & reason);
-  bool RecvSendMsg(const nsCString& aMsg);
-  bool RecvSendBinaryMsg(const nsCString& aMsg);
+                     const bool& aClientSetPingTimeout) MOZ_OVERRIDE;
+  bool RecvClose(const uint16_t & code, const nsCString & reason) MOZ_OVERRIDE;
+  bool RecvSendMsg(const nsCString& aMsg) MOZ_OVERRIDE;
+  bool RecvSendBinaryMsg(const nsCString& aMsg) MOZ_OVERRIDE;
   bool RecvSendBinaryStream(const InputStreamParams& aStream,
-                            const uint32_t& aLength);
-  bool RecvDeleteSelf();
+                            const uint32_t& aLength) MOZ_OVERRIDE;
+  bool RecvDeleteSelf() MOZ_OVERRIDE;
 
-  void ActorDestroy(ActorDestroyReason why);
+  void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE;
 
   nsCOMPtr<nsIAuthPromptProvider> mAuthProvider;
   nsCOMPtr<nsIWebSocketChannel> mChannel;
   nsCOMPtr<nsILoadContext> mLoadContext;
   bool mIPCOpen;
 
 };
 
--- a/netwerk/protocol/wyciwyg/WyciwygChannelChild.h
+++ b/netwerk/protocol/wyciwyg/WyciwygChannelChild.h
@@ -55,21 +55,21 @@ public:
 
   bool IsSuspended();
 
 protected:
   bool RecvOnStartRequest(const nsresult& statusCode,
                           const int64_t& contentLength,
                           const int32_t& source,
                           const nsCString& charset,
-                          const nsCString& securityInfo);
+                          const nsCString& securityInfo) MOZ_OVERRIDE;
   bool RecvOnDataAvailable(const nsCString& data,
-                           const uint64_t& offset);
-  bool RecvOnStopRequest(const nsresult& statusCode);
-  bool RecvCancelEarly(const nsresult& statusCode);
+                           const uint64_t& offset) MOZ_OVERRIDE;
+  bool RecvOnStopRequest(const nsresult& statusCode) MOZ_OVERRIDE;
+  bool RecvCancelEarly(const nsresult& statusCode) MOZ_OVERRIDE;
 
   void OnStartRequest(const nsresult& statusCode,
                       const int64_t& contentLength,
                       const int32_t& source,
                       const nsCString& charset,
                       const nsCString& securityInfo);
   void OnDataAvailable(const nsCString& data,
                        const uint64_t& offset);
--- a/netwerk/protocol/wyciwyg/WyciwygChannelParent.h
+++ b/netwerk/protocol/wyciwyg/WyciwygChannelParent.h
@@ -29,31 +29,31 @@ public:
   NS_DECL_NSIREQUESTOBSERVER
   NS_DECL_NSISTREAMLISTENER
   NS_DECL_NSIINTERFACEREQUESTOR
 
   WyciwygChannelParent();
   virtual ~WyciwygChannelParent();
 
 protected:
-  virtual bool RecvInit(const URIParams& uri);
+  virtual bool RecvInit(const URIParams& uri) MOZ_OVERRIDE;
   virtual bool RecvAsyncOpen(const URIParams& original,
                              const uint32_t& loadFlags,
                              const IPC::SerializedLoadContext& loadContext,
-                             PBrowserParent* parent);
-  virtual bool RecvWriteToCacheEntry(const nsString& data);
-  virtual bool RecvCloseCacheEntry(const nsresult& reason);
+                             PBrowserParent* parent) MOZ_OVERRIDE;
+  virtual bool RecvWriteToCacheEntry(const nsString& data) MOZ_OVERRIDE;
+  virtual bool RecvCloseCacheEntry(const nsresult& reason) MOZ_OVERRIDE;
   virtual bool RecvSetCharsetAndSource(const int32_t& source,
-                                       const nsCString& charset);
-  virtual bool RecvSetSecurityInfo(const nsCString& securityInfo);
-  virtual bool RecvCancel(const nsresult& statusCode);
+                                       const nsCString& charset) MOZ_OVERRIDE;
+  virtual bool RecvSetSecurityInfo(const nsCString& securityInfo) MOZ_OVERRIDE;
+  virtual bool RecvCancel(const nsresult& statusCode) MOZ_OVERRIDE;
   virtual bool RecvAppData(const IPC::SerializedLoadContext& loadContext,
-                           PBrowserParent* parent);
+                           PBrowserParent* parent) MOZ_OVERRIDE;
 
-  virtual void ActorDestroy(ActorDestroyReason why);
+  virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE;
 
   bool SetupAppData(const IPC::SerializedLoadContext& loadContext,
                     PBrowserParent* aParent);
 
   nsCOMPtr<nsIWyciwygChannel> mChannel;
   bool mIPCClosed;
   bool mReceivedAppData;
   nsCOMPtr<nsILoadContext> mLoadContext;
--- a/python/mozboot/mozboot/fedora.py
+++ b/python/mozboot/mozboot/fedora.py
@@ -17,16 +17,17 @@ class FedoraBootstrapper(BaseBootstrappe
         self.yum_groupinstall(
             'Development Tools',
             'Development Libraries',
             'GNOME Software Development')
 
         self.yum_install(
             'alsa-lib-devel',
             'autoconf213',
+            'gcc-c++',
             'glibc-static',
             'gstreamer-devel',
             'gstreamer-plugins-base-devel',
             'libstdc++-static',
             'libXt-devel',
             'mercurial',
             'mesa-libGL-devel',
             'pulseaudio-libs-devel',
--- a/security/manager/ssl/public/nsIX509CertDB.idl
+++ b/security/manager/ssl/public/nsIX509CertDB.idl
@@ -26,17 +26,17 @@ interface nsIOpenSignedJARFileCallback :
                                  in nsIZipReader aZipReader,
                                  in nsIX509Cert3 aSignerCert);
 };
 
 /**
  * This represents a service to access and manipulate 
  * X.509 certificates stored in a database.
  */
-[scriptable, uuid(3c2a5658-466a-11e3-a244-180373d97f23)]
+[scriptable, uuid(6502291d-4477-43a3-9688-4b453d055c1d)]
 interface nsIX509CertDB : nsISupports {
 
   /**
    *  Constants that define which usages a certificate
    *  is trusted for.
    */
   const unsigned long UNTRUSTED       =      0;
   const unsigned long TRUSTED_SSL     = 1 << 0;
@@ -295,33 +295,41 @@ interface nsIX509CertDB : nsISupports {
    *
    * @param certDER The raw DER encoding of a certificate.
    * @param aTrust decoded by CERT_DecodeTrustString. 3 comma separated characters,
    *                indicating SSL, Email, and Obj signing trust
    * @param aName name of the cert for display purposes.
    */
   void addCert(in ACString certDER, in string aTrust, in string aName);
 
+  // Flags for verifyCertNow (these must match the values in CertVerifier.cpp):
+  // Prevent network traffic. Doesn't work with classic verification.
+  const uint32_t FLAG_LOCAL_ONLY = 1 << 0;
+  // Do not fall back to DV verification after attempting EV validation.
+  // Actually does prevent network traffic, but can cause a valid EV
+  // certificate to not be considered valid.
+  const uint32_t FLAG_NO_DV_FALLBACK_FOR_EV = 1 << 1;
+
   /** Warning: This interface is inteded to use only for testing only as:
    *    1. It can create IO on the main thread.
    *    2. It is in constant change, so in/out can change at any release.
    *
    *  Obtain the verification result for a cert given a particular usage.
    *  On success, the call returns 0, the chain built during verification,
    *  and whether the cert is good for EV usage.
    *  On failure, the call returns the PRErrorCode for the verification failure
    *
    *  @param aCert Obtain the stored trust of this certificate
    *  @param aUsage a integer representing the usage from NSS
-   *  @param aLocalOnly prevent network activity for revocation
+   *  @param aFlags flags as described above
    *  @param verifedChain chain of verification up to the root if success
    *  @param aHasEVPolicy bool that signified that the cert was an EV cert
    *  @return 0 if success or the value or the error code for the verification
    *          failure
    */
   int32_t /*PRErrorCode*/
     verifyCertNow(in nsIX509Cert aCert,
                   in int64_t /*SECCertificateUsage*/ aUsage,
-                  in bool aLocalOnly,
+                  in uint32_t aFlags,
                   out nsIX509CertList verifiedChain,
                   out bool aHasEVPolicy);
 
 };
--- a/security/manager/ssl/src/CertVerifier.cpp
+++ b/security/manager/ssl/src/CertVerifier.cpp
@@ -14,16 +14,17 @@ extern PRLogModuleInfo* gPIPNSSLog;
 #endif
 
 namespace mozilla { namespace psm {
 
 extern SECStatus getFirstEVPolicy(CERTCertificate *cert, SECOidTag &outOidTag);
 extern CERTCertList* getRootsForOid(SECOidTag oid_tag);
 
 const CertVerifier::Flags CertVerifier::FLAG_LOCAL_ONLY = 1;
+const CertVerifier::Flags CertVerifier::FLAG_NO_DV_FALLBACK_FOR_EV = 2;
 
 CertVerifier::CertVerifier(missing_cert_download_config mcdc,
                            crl_download_config cdc,
                            ocsp_download_config odc,
                            ocsp_strict_config osc,
                            ocsp_get_config ogc)
   : mMissingCertDownloadEnabled(mcdc == missing_cert_download_on)
   , mCRLDownloadEnabled(cdc == crl_download_allowed)
@@ -151,16 +152,19 @@ CertVerifier::VerifyCert(CERTCertificate
       return SECFailure;
   }
 
   ScopedCERTCertList trustAnchors;
   SECStatus rv;
   SECOidTag evPolicy = SEC_OID_UNKNOWN;
 
 #ifdef NSS_NO_LIBPKIX
+  if (flags & FLAG_NO_DV_FALLBACK_FOR_EV) {
+    return SECSuccess;
+  }
   return ClassicVerifyCert(cert, usage, time, pinArg, validationChain,
                            verifyLog);
 #else
   // Do EV checking only for sslserver usage
   if (usage == certificateUsageSSLServer) {
     SECStatus srv = getFirstEVPolicy(cert, evPolicy);
     if (srv == SECSuccess) {
       if (evPolicy != SEC_OID_UNKNOWN) {
@@ -310,16 +314,22 @@ CertVerifier::VerifyCert(CERTCertificate
       }
       verifyLog->count = 0;
       verifyLog->head = nullptr;
       verifyLog->tail = nullptr;
     }
 
   }
 
+  // If we're here, PKIX EV verification failed.
+  // If requested, don't do DV fallback.
+  if (flags & FLAG_NO_DV_FALLBACK_FOR_EV) {
+    return SECSuccess;
+  }
+
   if (!nsNSSComponent::globalConstFlagUsePKIXVerification){
     // XXX: we do not care about the localOnly flag (currently) as the
     // caller that wants localOnly should disable and reenable the fetching.
     return ClassicVerifyCert(cert, usage, time, pinArg, validationChain,
                              verifyLog);
   }
 
   // The current flags check the chain the same way as the leafs
--- a/security/manager/ssl/src/CertVerifier.h
+++ b/security/manager/ssl/src/CertVerifier.h
@@ -16,18 +16,20 @@ class nsNSSComponent;
 namespace mozilla { namespace psm {
 
 class CertVerifier
 {
 public:
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CertVerifier)
 
   typedef unsigned int Flags;
+  // XXX: FLAG_LOCAL_ONLY is ignored in the classic verification case
   static const Flags FLAG_LOCAL_ONLY;
-  // XXX: The localonly flag is ignored in the classic verification case
+  // Don't perform fallback DV validation on EV validation failure.
+  static const Flags FLAG_NO_DV_FALLBACK_FOR_EV;
 
   // *evOidPolicy == SEC_OID_UNKNOWN means the cert is NOT EV
   // Only one usage per verification is supported.
   SECStatus VerifyCert(CERTCertificate * cert,
                        const SECCertificateUsage usage,
                        const PRTime time,
                        nsIInterfaceRequestor * pinArg,
                        const Flags flags = 0,
--- a/security/manager/ssl/src/SSLServerCertVerification.cpp
+++ b/security/manager/ssl/src/SSLServerCertVerification.cpp
@@ -207,27 +207,22 @@ void StopSSLServerCertVerificationThread
     delete gSSLVerificationPK11Mutex;
     gSSLVerificationPK11Mutex = nullptr;
   }
 }
 
 namespace {
 
 void
-LogInvalidCertError(TransportSecurityInfo *socketInfo, 
-                    const nsACString &host, 
-                    const nsACString &hostWithPort,
-                    int32_t port,
+LogInvalidCertError(TransportSecurityInfo *socketInfo,
                     PRErrorCode errorCode,
-                    ::mozilla::psm::SSLErrorMessageType errorMessageType,
-                    nsIX509Cert* ix509)
+                    ::mozilla::psm::SSLErrorMessageType errorMessageType)
 {
   nsString message;
   socketInfo->GetErrorLogMessage(errorCode, errorMessageType, message);
-  
   if (!message.IsEmpty()) {
     nsContentUtils::LogSimpleConsoleError(message, "SSL");
   }
 }
 
 // Dispatched to the STS thread to notify the infoObject of the verification
 // result.
 //
@@ -419,22 +414,18 @@ CertErrorRunnable::CheckCertOverrides()
   SSLServerCertVerificationResult *result = 
     new SSLServerCertVerificationResult(mInfoObject, 
                                         errorCodeToReport,
                                         Telemetry::HistogramCount,
                                         -1,
                                         OverridableCertErrorMessage);
 
   LogInvalidCertError(mInfoObject,
-                      mInfoObject->GetHostName(),
-                      hostWithPortString,
-                      port,
                       result->mErrorCode,
-                      result->mErrorMessageType,
-                      mCert);
+                      result->mErrorMessageType);
 
   return result;
 }
 
 void 
 CertErrorRunnable::RunOnTargetThread()
 {
   MOZ_ASSERT(NS_IsMainThread());
--- a/security/manager/ssl/src/nsIdentityChecking.cpp
+++ b/security/manager/ssl/src/nsIdentityChecking.cpp
@@ -1282,20 +1282,22 @@ nsNSSCertificate::hasValidEVOidTag(SECOi
   nssComponent->EnsureIdentityInfoLoaded();
 
   RefPtr<mozilla::psm::CertVerifier> certVerifier(mozilla::psm::GetDefaultCertVerifier());
   NS_ENSURE_TRUE(certVerifier, NS_ERROR_UNEXPECTED);
 
   validEV = false;
   resultOidTag = SEC_OID_UNKNOWN;
 
+  uint32_t flags = mozilla::psm::CertVerifier::FLAG_LOCAL_ONLY |
+                   mozilla::psm::CertVerifier::FLAG_NO_DV_FALLBACK_FOR_EV;
   SECStatus rv = certVerifier->VerifyCert(mCert,
                                           certificateUsageSSLServer, PR_Now(),
                                           nullptr /* XXX pinarg*/,
-                                          0, nullptr, &resultOidTag);
+                                          flags, nullptr, &resultOidTag);
 
   if (rv != SECSuccess) {
     resultOidTag = SEC_OID_UNKNOWN;
   }
   if (resultOidTag != SEC_OID_UNKNOWN) {
     validEV = true;
   }
   return NS_OK;
--- a/security/manager/ssl/src/nsNSSCertificateDB.cpp
+++ b/security/manager/ssl/src/nsNSSCertificateDB.cpp
@@ -1674,17 +1674,17 @@ nsNSSCertificateDB::GetRecentBadCerts(bo
     NS_ADDREF(*result = mPublicRecentBadCerts);
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNSSCertificateDB::VerifyCertNow(nsIX509Cert* aCert,
                                   int64_t /*SECCertificateUsage*/ aUsage,
-                                  bool aLocalOnly,
+                                  uint32_t aFlags,
                                   nsIX509CertList** verifiedChain,
                                   bool* aHasEVPolicy,
                                   int32_t* /*PRErrorCode*/ _retval )
 {
   NS_ENSURE_ARG_POINTER(aCert);
   NS_ENSURE_ARG_POINTER(aHasEVPolicy);
   NS_ENSURE_ARG_POINTER(verifiedChain);
   NS_ENSURE_ARG_POINTER(_retval);
@@ -1711,25 +1711,24 @@ nsNSSCertificateDB::VerifyCertNow(nsIX50
   if (!x509Cert) {
     return NS_ERROR_INVALID_ARG;
   }
   ScopedCERTCertificate nssCert(x509Cert->GetCert());
 
   RefPtr<CertVerifier> certVerifier(GetDefaultCertVerifier());
   NS_ENSURE_TRUE(certVerifier, NS_ERROR_FAILURE);
 
-  CertVerifier::Flags flags = aLocalOnly ? CertVerifier::FLAG_LOCAL_ONLY : 0;
   CERTCertList* resultChain = nullptr;
   SECOidTag evOidPolicy;
   SECStatus srv;
 
   srv = certVerifier->VerifyCert(nssCert,
                                  aUsage, PR_Now(),
                                  nullptr, // Assume no context
-                                 flags,
+                                 aFlags,
                                  &resultChain,
                                  &evOidPolicy,
                                  nullptr);
 
   PRErrorCode error = PR_GetError();
 
   nsCOMPtr<nsIX509CertList> nssCertList;
   // This adopts the list
--- a/security/manager/ssl/tests/unit/test_ev_certs.js
+++ b/security/manager/ssl/tests/unit/test_ev_certs.js
@@ -167,8 +167,44 @@ add_test(function() {
 
   clearOCSPCache();
   let ocspResponder = start_ocsp_responder(
                         isDebugBuild ? ["int-ev-valid", "ev-valid"]
                                      : ["ev-valid"]);
   check_ee_for_ev("ev-valid", isDebugBuild);
   ocspResponder.stop(run_next_test);
 });
+
+// bug 950240: add FLAG_NO_DV_FALLBACK_FOR_EV to CertVerifier::VerifyCert
+// to prevent spurious OCSP requests that race with OCSP stapling.
+// This has the side-effect of saying an EV certificate is not EV if
+// it hasn't already been verified (e.g. on the verification thread when
+// connecting to a site).
+function check_no_ocsp_requests(cert_name) {
+  clearOCSPCache();
+  let ocspResponder = failingOCSPResponder();
+  let cert = certdb.findCertByNickname(null, cert_name);
+  let hasEVPolicy = {};
+  let verifiedChain = {};
+  let flags = Ci.nsIX509CertDB.FLAG_LOCAL_ONLY |
+              Ci.nsIX509CertDB.FLAG_NO_DV_FALLBACK_FOR_EV;
+  let error = certdb.verifyCertNow(cert, certificateUsageSSLServer, flags,
+                                   verifiedChain, hasEVPolicy);
+  // Since we're not doing OCSP requests, no certificate will be EV.
+  do_check_eq(hasEVPolicy.value, false);
+  do_check_eq(0, error);
+  // Also check that isExtendedValidation doesn't cause OCSP requests.
+  let identityInfo = cert.QueryInterface(Ci.nsIIdentityInfo);
+  do_check_eq(identityInfo.isExtendedValidation, false);
+  ocspResponder.stop(run_next_test);
+}
+
+add_test(function() {
+  check_no_ocsp_requests("ev-valid");
+});
+
+add_test(function() {
+  check_no_ocsp_requests("non-ev-root");
+});
+
+add_test(function() {
+  check_no_ocsp_requests("no-ocsp-url-cert");
+});
--- a/testing/mochitest/manifestLibrary.js
+++ b/testing/mochitest/manifestLibrary.js
@@ -37,19 +37,24 @@ function parseTestManifest(testManifest,
 }
 
 function getTestManifest(url, params, callback) {
   var req = new XMLHttpRequest();
   req.open("GET", url);
   req.onload = function() {
     if (req.readyState == 4) {
       if (req.status == 200) {
-        parseTestManifest(JSON.parse(req.responseText), params, callback);
+        try {
+          parseTestManifest(JSON.parse(req.responseText), params, callback);
+        } catch (e) {
+          dump("TEST-UNEXPECTED-FAIL: setup.js | error parsing " + url + " (" + e + ")\n");
+          throw e;
+        }
       } else {
-        dump("TEST-ERROR: setup.js | error loading " + url + "\n");
+        dump("TEST-UNEXPECTED-FAIL: setup.js | error loading " + url + "\n");
         callback({});
       }
     }
   }
   req.send();
 }
 
 // Test Filtering Code
@@ -135,9 +140,8 @@ function filterTests(filter, testList, r
       }
     }
     if (!found) {
       refilteredTests.push(testpath);
     }
   }
   return refilteredTests;
 }
-
--- a/toolkit/components/protobuf/README.txt
+++ b/toolkit/components/protobuf/README.txt
@@ -9,8 +9,11 @@ available at http://code.google.com/p/pr
 This import includes only files in protobuf-lite, a lighter-weight library that
 does not support reflection or descriptors. Manual changes include removing all
 tests, testdata, config.h, and all files not used in protobuf-lite.
 
 Applied Patches
 ===============
 r512.patch:
   Support VS2013 (from revision r512)
+
+vs2013.patch
+  Additional changes to support VS2013 missed from revision r512.
--- a/toolkit/components/protobuf/google/protobuf/wire_format_lite_inl.h
+++ b/toolkit/components/protobuf/google/protobuf/wire_format_lite_inl.h
@@ -31,16 +31,17 @@
 // Author: kenton@google.com (Kenton Varda)
 //         wink@google.com (Wink Saville) (refactored from wire_format.h)
 //  Based on original Protocol Buffers design by
 //  Sanjay Ghemawat, Jeff Dean, and others.
 
 #ifndef GOOGLE_PROTOBUF_WIRE_FORMAT_LITE_INL_H__
 #define GOOGLE_PROTOBUF_WIRE_FORMAT_LITE_INL_H__
 
+#include <algorithm>
 #include <string>
 #include <google/protobuf/stubs/common.h>
 #include <google/protobuf/message_lite.h>
 #include <google/protobuf/repeated_field.h>
 #include <google/protobuf/wire_format_lite.h>
 #include <google/protobuf/generated_message_util.h>
 #include <google/protobuf/io/coded_stream.h>
 
new file mode 100644
--- /dev/null
+++ b/toolkit/components/protobuf/vs2013.patch
@@ -0,0 +1,21 @@
+diff --git a/toolkit/components/protobuf/google/protobuf/wire_format_lite_inl.h b/toolkit/components/protobuf/google/protobuf/wire_format_lite_inl.h
+--- a/toolkit/components/protobuf/google/protobuf/wire_format_lite_inl.h
++++ b/toolkit/components/protobuf/google/protobuf/wire_format_lite_inl.h
+@@ -31,16 +31,17 @@
+ // Author: kenton@google.com (Kenton Varda)
+ //         wink@google.com (Wink Saville) (refactored from wire_format.h)
+ //  Based on original Protocol Buffers design by
+ //  Sanjay Ghemawat, Jeff Dean, and others.
+ 
+ #ifndef GOOGLE_PROTOBUF_WIRE_FORMAT_LITE_INL_H__
+ #define GOOGLE_PROTOBUF_WIRE_FORMAT_LITE_INL_H__
+ 
++#include <algorithm>
+ #include <string>
+ #include <google/protobuf/stubs/common.h>
+ #include <google/protobuf/message_lite.h>
+ #include <google/protobuf/repeated_field.h>
+ #include <google/protobuf/wire_format_lite.h>
+ #include <google/protobuf/generated_message_util.h>
+ #include <google/protobuf/io/coded_stream.h>
+ 
--- a/uriloader/exthandler/ExternalHelperAppChild.h
+++ b/uriloader/exthandler/ExternalHelperAppChild.h
@@ -23,17 +23,17 @@ public:
 
     ExternalHelperAppChild();
     virtual ~ExternalHelperAppChild();
 
     // Give the listener a real nsExternalAppHandler to complete processing on
     // the child.
     void SetHandler(nsIStreamListener *handler) { mHandler = handler; }
 
-    virtual bool RecvCancel(const nsresult& aStatus);
+    virtual bool RecvCancel(const nsresult& aStatus) MOZ_OVERRIDE;
 private:
     nsCOMPtr<nsIStreamListener> mHandler;
     nsresult mStatus;
 };
 
 } // namespace dom
 } // namespace mozilla
 
--- a/uriloader/exthandler/ExternalHelperAppParent.h
+++ b/uriloader/exthandler/ExternalHelperAppParent.h
@@ -35,19 +35,21 @@ class ExternalHelperAppParent : public P
 
 public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSIREQUEST
     NS_DECL_NSICHANNEL
     NS_DECL_NSIMULTIPARTCHANNEL
     NS_DECL_NSIRESUMABLECHANNEL
 
-    bool RecvOnStartRequest(const nsCString& entityID);
-    bool RecvOnDataAvailable(const nsCString& data, const uint64_t& offset, const uint32_t& count);
-    bool RecvOnStopRequest(const nsresult& code);
+    bool RecvOnStartRequest(const nsCString& entityID) MOZ_OVERRIDE;
+    bool RecvOnDataAvailable(const nsCString& data,
+                             const uint64_t& offset,
+                             const uint32_t& count) MOZ_OVERRIDE;
+    bool RecvOnStopRequest(const nsresult& code) MOZ_OVERRIDE;
 
     ExternalHelperAppParent(const OptionalURIParams& uri, const int64_t& contentLength);
     void Init(ContentParent *parent,
               const nsCString& aMimeContentType,
               const nsCString& aContentDisposition,
               const bool& aForceSave,
               const OptionalURIParams& aReferrer,
               PBrowserParent* aBrowser);
--- a/xpcom/glue/nsTArray.h
+++ b/xpcom/glue/nsTArray.h
@@ -519,16 +519,21 @@ public:
     // ints.  We don't want that because it can be a performance issue
     // and people don't expect it; nsTArray should work like a regular
     // C/C++ array in this respect.
     new (static_cast<void *>(e)) E;
   }
   // Invoke the copy-constructor in place.
   template<class A>
   static inline void Construct(E *e, const A &arg) {
+    typedef typename mozilla::RemoveCV<E>::Type E_NoCV;
+    typedef typename mozilla::RemoveCV<A>::Type A_NoCV;
+    static_assert(!mozilla::IsSame<E_NoCV*, A_NoCV>::value,
+                  "For safety, we disallow constructing nsTArray<E> elements "
+                  "from E* pointers. See bug 960591.");
     new (static_cast<void *>(e)) E(arg);
   }
   // Invoke the destructor in place.
   static inline void Destruct(E *e) {
     e->~E();
   }
 };