Merge mozilla-central into services-central
authorGregory Szorc <gps@mozilla.com>
Wed, 30 Jan 2013 16:11:37 -0800
changeset 130234 20bbf73921f4a9092189efb8ecde905939551786
parent 130233 34a80b4e0acdaeb9c4d5c6e7741df0eadde874c6 (current diff)
parent 130229 faf255e4400222ee23c29ddcc76fb3dce56145f4 (diff)
child 130235 cbeab7da0e3aad6f051ddfd50a089c3265b01ae4
child 130795 e8482b89eaed5d8c90a5ab46741555cfdefbdce9
child 138157 834edbd584aeb56ee483731dfa908e3b98ff2661
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone21.0a1
first release with
nightly linux32
20bbf73921f4 / 21.0a1 / 20130131031009 / files
nightly linux64
20bbf73921f4 / 21.0a1 / 20130131031009 / files
nightly mac
20bbf73921f4 / 21.0a1 / 20130131031009 / files
nightly win32
20bbf73921f4 / 21.0a1 / 20130131031009 / files
nightly win64
20bbf73921f4 / 21.0a1 / 20130131031009 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge mozilla-central into services-central
--- a/accessible/src/base/DocManager.cpp
+++ b/accessible/src/base/DocManager.cpp
@@ -190,17 +190,18 @@ DocManager::OnStateChange(nsIWebProgress
   NS_ENSURE_STATE(docShell);
 
   bool isReloading = false;
   uint32_t loadType;
   docShell->GetLoadType(&loadType);
   if (loadType == LOAD_RELOAD_NORMAL ||
       loadType == LOAD_RELOAD_BYPASS_CACHE ||
       loadType == LOAD_RELOAD_BYPASS_PROXY ||
-      loadType == LOAD_RELOAD_BYPASS_PROXY_AND_CACHE) {
+      loadType == LOAD_RELOAD_BYPASS_PROXY_AND_CACHE ||
+      loadType == LOAD_RELOAD_ALLOW_MIXED_CONTENT) {
     isReloading = true;
   }
 
   docAcc->NotifyOfLoading(isReloading);
   return NS_OK;
 }
 
 NS_IMETHODIMP
--- a/accessible/src/base/Logging.cpp
+++ b/accessible/src/base/Logging.cpp
@@ -268,16 +268,19 @@ LogShellLoadType(nsIDocShell* aDocShell)
       printf("reload bypass cache; ");
       break;
     case LOAD_RELOAD_BYPASS_PROXY:
       printf("reload bypass proxy; ");
       break;
     case LOAD_RELOAD_BYPASS_PROXY_AND_CACHE:
       printf("reload bypass proxy and cache; ");
       break;
+    case LOAD_RELOAD_ALLOW_MIXED_CONTENT:
+      printf("reload allow mixed content; ");
+      break;
     case LOAD_LINK:
       printf("link; ");
       break;
     case LOAD_REFRESH:
       printf("refresh; ");
       break;
     case LOAD_RELOAD_CHARSET_CHANGE:
       printf("reload charset change; ");
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -752,16 +752,17 @@ pref("urlclassifier.gethashtables", "goo
 
 // If an urlclassifier table has not been updated in this number of seconds,
 // a gethash request will be forced to check that the result is still in
 // the database.
 pref("urlclassifier.max-complete-age", 2700);
 #endif
 
 pref("browser.geolocation.warning.infoURL", "http://www.mozilla.com/%LOCALE%/firefox/geolocation/");
+pref("browser.mixedcontent.warning.infoURL", "http://support.mozilla.org/1/%APP%/%VERSION%/%OS%/%LOCALE%/mixed-content/");
 
 pref("browser.EULA.version", 3);
 pref("browser.rights.version", 3);
 pref("browser.rights.3.shown", false);
 
 #ifdef DEBUG
 // Don't show the about:rights notification in debug builds.
 pref("browser.rights.override", true);
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -6643,24 +6643,66 @@ var gIdentityHandler = {
     let nsIWebProgressListener = Ci.nsIWebProgressListener;
     if (location.protocol == "chrome:" || location.protocol == "about:") {
       this.setMode(this.IDENTITY_MODE_CHROMEUI);
     } else if (state & nsIWebProgressListener.STATE_IDENTITY_EV_TOPLEVEL) {
       this.setMode(this.IDENTITY_MODE_IDENTIFIED);
     } else if (state & nsIWebProgressListener.STATE_IS_SECURE) {
       this.setMode(this.IDENTITY_MODE_DOMAIN_VERIFIED);
     } else if (state & nsIWebProgressListener.STATE_IS_BROKEN) {
-      if (gBrowser.docShell.hasMixedActiveContentLoaded) {
+      if (state & nsIWebProgressListener.STATE_LOADED_MIXED_ACTIVE_CONTENT) {
         this.setMode(this.IDENTITY_MODE_MIXED_ACTIVE_CONTENT);
       } else {
         this.setMode(this.IDENTITY_MODE_MIXED_CONTENT);
       }
     } else {
       this.setMode(this.IDENTITY_MODE_UNKNOWN);
     }
+
+    // Ensure the doorhanger is shown when mixed active content is blocked.
+    if (state & nsIWebProgressListener.STATE_BLOCKED_MIXED_ACTIVE_CONTENT)
+      this.showMixedContentDoorhanger();
+  },
+
+  /**
+   * Display the Mixed Content Blocker doohanger, providing an option
+   * to the user to override mixed content blocking
+   */
+  showMixedContentDoorhanger : function() {
+    // If we've already got an active notification, bail out to avoid showing it repeatedly.
+    if (PopupNotifications.getNotification("mixed-content-blocked", gBrowser.selectedBrowser))
+      return;
+
+    let helplink = document.getElementById("mixed-content-blocked-helplink");
+    helplink.href = Services.urlFormatter.formatURLPref("browser.mixedcontent.warning.infoURL");
+
+    let brandBundle = document.getElementById("bundle_brand");
+    let brandShortName = brandBundle.getString("brandShortName");
+    let messageString = gNavigatorBundle.getFormattedString("mixedContentBlocked.message", [brandShortName]);
+    let action = {
+      label: gNavigatorBundle.getString("mixedContentBlocked.keepBlockingButton.label"),
+      accessKey: gNavigatorBundle.getString("mixedContentBlocked.keepBlockingButton.accesskey"),
+      callback: function() { /* NOP */ }
+    };
+    let secondaryActions = [
+      {
+        label: gNavigatorBundle.getString("mixedContentBlocked.unblock.label"),
+        accessKey: gNavigatorBundle.getString("mixedContentBlocked.unblock.accesskey"),
+        callback: function() {
+          // Reload the page with the content unblocked
+          BrowserReloadWithFlags(nsIWebNavigation.LOAD_FLAGS_ALLOW_MIXED_CONTENT);
+        }
+      }
+    ];
+    let options = {
+      dismissed: true,
+    };
+    PopupNotifications.show(gBrowser.selectedBrowser, "mixed-content-blocked",
+                            messageString, "mixed-content-blocked-notification-icon",
+                            action, secondaryActions, options);
   },
 
   /**
    * Return the eTLD+1 version of the current hostname
    */
   getEffectiveHost : function() {
     if (!this._IDNService)
       this._IDNService = Cc["@mozilla.org/network/idn-service;1"]
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -468,16 +468,27 @@
     </popupnotification>
 
     <popupnotification id="geolocation-notification" hidden="true">
       <popupnotificationcontent orient="vertical" align="start">
         <separator class="thin"/>
         <label id="geolocation-learnmore-link" class="text-link"/>
       </popupnotificationcontent>
     </popupnotification>
+
+    <popupnotification id="mixed-content-blocked-notification" hidden="true">
+      <popupnotificationcontent orient="vertical" align="start">
+        <separator/>
+        <description id="mixed-content-blocked-moreinfo">&mixedContentBlocked.moreinfo;</description>
+        <separator/>
+        <label id="mixed-content-blocked-helplink" class="text-link"
+               value="&mixedContentBlocked.helplink;"/>
+      </popupnotificationcontent>
+    </popupnotification>
+
   </popupset>
 
 #ifdef CAN_DRAW_IN_TITLEBAR
 <vbox id="titlebar">
   <hbox id="titlebar-content">
     <hbox id="appmenu-button-container">
       <button id="appmenu-button"
               type="menu"
@@ -582,16 +593,17 @@
             <image id="identity-notification-icon" class="notification-anchor-icon" role="button"/>
             <image id="geo-notification-icon" class="notification-anchor-icon" role="button"/>
             <image id="addons-notification-icon" class="notification-anchor-icon" role="button"/>
             <image id="indexedDB-notification-icon" class="notification-anchor-icon" role="button"/>
             <image id="password-notification-icon" class="notification-anchor-icon" role="button"/>
             <image id="webapps-notification-icon" class="notification-anchor-icon" role="button"/>
             <image id="plugins-notification-icon" class="notification-anchor-icon" role="button"/>
             <image id="blocked-plugins-notification-icon" class="notification-anchor-icon" role="button"/>
+            <image id="mixed-content-blocked-notification-icon" class="notification-anchor-icon" role="button"/>
             <image id="webRTC-shareDevices-notification-icon" class="notification-anchor-icon" role="button"/>
             <image id="webRTC-sharingDevices-notification-icon" class="notification-anchor-icon" role="button"/>
           </box>
           <!-- Use onclick instead of normal popup= syntax since the popup
                code fires onmousedown, and hence eats our favicon drag events.
                We only add the identity-box button to the tab order when the location bar
                has focus, otherwise pressing F6 focuses it instead of the location bar -->
           <box id="identity-box" role="button"
--- a/browser/locales/en-US/chrome/browser/browser.dtd
+++ b/browser/locales/en-US/chrome/browser/browser.dtd
@@ -626,8 +626,11 @@ just addresses the organization to follo
 
 <!ENTITY getUserMedia.selectCamera.label "Camera to share:">
 <!ENTITY getUserMedia.selectCamera.accesskey "C">
 <!ENTITY getUserMedia.selectMicrophone.label "Microphone to share:">
 <!ENTITY getUserMedia.selectMicrophone.accesskey "M">
 
 <!ENTITY webrtcIndicatorButton.label "Camera / Microphone Access">
 <!ENTITY webrtcIndicatorButton.tooltip "Display sites you are currently sharing your camera or microphone with">
+
+<!ENTITY mixedContentBlocked.helplink "Learn more">
+<!ENTITY mixedContentBlocked.moreinfo "Most websites will still work properly even when this content is blocked.">
--- a/browser/locales/en-US/chrome/browser/browser.properties
+++ b/browser/locales/en-US/chrome/browser/browser.properties
@@ -430,8 +430,16 @@ getUserMedia.noVideo.label = No Video
 getUserMedia.noAudio.label = No Audio
 getUserMedia.shareSelectedDevices.label = Share Selected Device;Share Selected Devices
 getUserMedia.shareSelectedDevices.accesskey = S
 getUserMedia.denyRequest.label = Don't Share
 getUserMedia.denyRequest.accesskey = D
 getUserMedia.sharingCamera.message = You are currently sharing your camera with %S.
 getUserMedia.sharingMicrophone.message = You are currently sharing your microphone with %S.
 getUserMedia.sharingCameraAndMicrophone.message = You are currently sharing your camera and microphone with %S.
+
+# Mixed Content Blocker Doorhanger Notification
+# LOCALIZATION NOTE - %S is brandShortName
+mixedContentBlocked.message = %S has blocked content that isn't secure.
+mixedContentBlocked.keepBlockingButton.label = Keep Blocking
+mixedContentBlocked.keepBlockingButton.accesskey = B
+mixedContentBlocked.unblock.label = Disable Protection on This Page
+mixedContentBlocked.unblock.accesskey = D
--- a/browser/themes/gnomestripe/browser.css
+++ b/browser/themes/gnomestripe/browser.css
@@ -1297,16 +1297,20 @@ toolbar[iconsize="small"] #webrtc-status
   from {
     opacity: 0;
   }
   to {
     opacity: 1;
   }
 }
 
+#mixed-content-blocked-notification-icon {
+  list-style-image: url(chrome://browser/skin/mixed-content-blocked-16.png);
+}
+
 #webRTC-shareDevices-notification-icon {
   list-style-image: url(chrome://browser/skin/webRTC-shareDevice-16.png);
 }
 
 #webRTC-sharingDevices-notification-icon {
   list-style-image: url(chrome://browser/skin/webRTC-sharingDevice-16.png);
 }
 
--- a/browser/themes/gnomestripe/jar.mn
+++ b/browser/themes/gnomestripe/jar.mn
@@ -25,16 +25,17 @@ browser.jar:
   skin/classic/browser/Go-arrow.png
   skin/classic/browser/identity.png
   skin/classic/browser/identity-icons-generic.png
   skin/classic/browser/identity-icons-https.png
   skin/classic/browser/identity-icons-https-ev.png
   skin/classic/browser/identity-icons-https-mixed-active.png
   skin/classic/browser/Info.png
   skin/classic/browser/KUI-close.png
+  skin/classic/browser/mixed-content-blocked-16.png
   skin/classic/browser/monitor.png
   skin/classic/browser/monitor_16-10.png
 * skin/classic/browser/pageInfo.css
   skin/classic/browser/pageInfo.png
   skin/classic/browser/page-livemarks.png
   skin/classic/browser/Privacy-16.png
   skin/classic/browser/Privacy-48.png
   skin/classic/browser/privatebrowsing-mask.png
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..7cf33ec4c5acc81330208f5f5ac45fa5435c3d1a
GIT binary patch
literal 346
zc$@)R0j2(lP)<h;3K|Lk000e1NJLTq000mG000mO1^@s6AM^iV0003YNkl<Zc-p1Y
zu}Z^G6o6rI6kNJ=3;GC7f|I3C+AcnXu6+Wh#1KLVgcuT%!P(7@(kBqi0~nvcC=S}m
z2K4w3XK1+54jn!?xhMQta(6^zE1ic$QCM(L;Ynv}V<6A-9#S+AeBwjrMt8l=K$c|_
zyg;zP7<<^&c>zI<i4jQC^c5?d;}Ey_TK}5vR;Z0Yk|ZVWaEc`aqI&@PPH6<<IG*DX
z7Z7CxI4dzX0#Ovjs4<2pBcShG8-XwkXAm4gR4c&qJ_Iu(5Cp*xf)gxtZUuNghG1v}
zeBbXwaEU9OTLIk(`t5-7Jg>q#MmWRs+HRz~>d!yXb=?8p@Piv1z|#3!cZ2SLavaCP
sJp_#sJ+n4nCS}|96c1|p-)-E=FZ@fcYF)+4`v3p{07*qoM6N<$f<M=eoB#j-
--- a/browser/themes/pinstripe/browser.css
+++ b/browser/themes/pinstripe/browser.css
@@ -3090,16 +3090,25 @@ toolbarbutton.chevron > .toolbarbutton-m
 }
 
 @media (min-resolution: 2dppx) {
   #plugins-notification-icon {
     list-style-image: url(chrome://mozapps/skin/plugins/pluginGeneric.png);
   }
 }
 
+#mixed-content-blocked-notification-icon {
+  list-style-image: url(chrome://browser/skin/mixed-content-blocked-16.png);
+}
+@media (min-resolution: 2dppx) {
+  #mixed-content-blocked-notification-icon {
+    list-style-image: url(chrome://browser/skin/mixed-content-blocked-16@2x.png);
+  }
+}
+
 #webRTC-shareDevices-notification-icon {
   list-style-image: url(chrome://browser/skin/webRTC-shareDevice-16.png);
 }
 @media (min-resolution: 2dppx) {
   #webRTC-shareDevices-notification-icon {
     list-style-image: url(chrome://browser/skin/webRTC-shareDevice-16@2x.png);
   }
 }
@@ -3183,16 +3192,29 @@ toolbarbutton.chevron > .toolbarbutton-m
 .popup-notification-icon[popupid="password-change"] {
   list-style-image: url(chrome://mozapps/skin/passwordmgr/key-64.png);
 }
 
 .popup-notification-icon[popupid="webapps-install"] {
   list-style-image: url(chrome://browser/skin/webapps-64.png);
 }
 
+.popup-notification-icon[popupid="mixed-content-blocked"] {
+  list-style-image: url(chrome://browser/skin/mixed-content-blocked-64.png);
+}
+@media (min-resolution: 2dppx) {
+  .popup-notification-icon[popupid="mixed-content-blocked"] {
+    list-style-image: url(chrome://browser/skin/mixed-content-blocked-64@2x.png);
+  }
+}
+
+#mixed-content-blocked-helplink {
+  margin: 0px;
+}
+
 .popup-notification-icon[popupid="webRTC-sharingDevices"],
 .popup-notification-icon[popupid="webRTC-shareDevices"] {
   list-style-image: url(chrome://browser/skin/webRTC-shareDevice-64.png);
 }
 @media (min-resolution: 2dppx) {
   .popup-notification-icon[popupid="webRTC-sharingDevices"],
   .popup-notification-icon[popupid="webRTC-shareDevices"] {
     list-style-image: url(chrome://browser/skin/webRTC-shareDevice-64@2x.png);
--- a/browser/themes/pinstripe/jar.mn
+++ b/browser/themes/pinstripe/jar.mn
@@ -35,16 +35,20 @@ browser.jar:
   skin/classic/browser/identity-icons-https-ev@2x.png
   skin/classic/browser/identity-icons-https-mixed-active.png
   skin/classic/browser/identity-icons-https-mixed-active@2x.png
   skin/classic/browser/Info.png
   skin/classic/browser/KUI-background.png
   skin/classic/browser/KUI-close.png
   skin/classic/browser/menu-back.png
   skin/classic/browser/menu-forward.png
+  skin/classic/browser/mixed-content-blocked-16.png
+  skin/classic/browser/mixed-content-blocked-16@2x.png
+  skin/classic/browser/mixed-content-blocked-64.png
+  skin/classic/browser/mixed-content-blocked-64@2x.png
   skin/classic/browser/panel-expander-closed.png
   skin/classic/browser/panel-expander-closed@2x.png
   skin/classic/browser/panel-expander-open.png
   skin/classic/browser/panel-expander-open@2x.png
   skin/classic/browser/panel-plus-sign.png
   skin/classic/browser/page-livemarks.png
   skin/classic/browser/page-livemarks@2x.png
   skin/classic/browser/pageInfo.css
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..7cf33ec4c5acc81330208f5f5ac45fa5435c3d1a
GIT binary patch
literal 346
zc$@)R0j2(lP)<h;3K|Lk000e1NJLTq000mG000mO1^@s6AM^iV0003YNkl<Zc-p1Y
zu}Z^G6o6rI6kNJ=3;GC7f|I3C+AcnXu6+Wh#1KLVgcuT%!P(7@(kBqi0~nvcC=S}m
z2K4w3XK1+54jn!?xhMQta(6^zE1ic$QCM(L;Ynv}V<6A-9#S+AeBwjrMt8l=K$c|_
zyg;zP7<<^&c>zI<i4jQC^c5?d;}Ey_TK}5vR;Z0Yk|ZVWaEc`aqI&@PPH6<<IG*DX
z7Z7C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HYG54A%g0C*6lFtauJ*&8b-8fem*Er;M>+hQec%H67|`GW6yVOREn
z|F<gZ9PhFDApr>n084VYi>$Tz@6Hk_Zri%p9rD6kjoEGRoz@o}Q`g+Smu6NxbQ~b@
z0DvVXH!<;a%Aano9W7h0EQf##0DQpYTMBI~`W*ZE%DiSOc;lh-kN^Nh$OVt*Gn<sZ
zUbgv0C&laG5y*e`?Nip@xm)RAP0=3Y;_<}&nVq6?o}^;d$3K3e|3@LL2=4#>iXWnb
ztnzt(xNEm^lqbFLB}$M3JRgkX26}DJTYXboc4Ujzg;(<lG+nd$x<j<Hp4~+r(*!#}
z4ycSL*gNf5$+8LS?Dn3$2+G$YTH!I9e)@;&4pGh%MZ0|AC)@#YALKEM?7HN?Tz#xi
zQ@xkro@Tu*2JXB4-MnTRSyOZni4yMsIi}+*WnJIKAHMzVrF{-};5nfuS)Y3B8_Vaf
z%&TV;Px`}8yaT%TK{D4+i2Ck`cfWKl$Gh2gzmeF+Y@D(F`U(X5c&Dhj2j4S+0OSz*
zay=s)WzE>_SGQ$pJ_xeAf_Y~0rrG-phhwZQss{LM0`MS=;7jB>%3I?<n9-5pElyV?
z!RsxB@87aFVAH^cqH=)G0RVVhVJuhE*HYgq*fqU9)0_SAuF9Cr6Sm#DD`<0uO?*`3
zz~=*i2cdu&WH`#&{2kNJ_H$>1&h3Orb(6Q=_;=Hxh4<N0WCMJD0C*5oCNP~$cz@W|
zsdXb11st-DPWj-vgR0;R+t^(c2KYPz@SKp(mGpx{8SB0f*01|uTrE(?7Rua{|2zZm
zFbrcVBT)c2$_@^?GhPA!Bv6@5!QcaGNSH4D<!SzjbqT;F0G9w<0`R}vuhx<`I^x9u
O0000<MNUMnLSTa1*%j;n
--- a/browser/themes/winstripe/browser.css
+++ b/browser/themes/winstripe/browser.css
@@ -2299,16 +2299,20 @@ toolbarbutton.bookmark-item[dragover="tr
 .popup-notification-icon[popupid="password-change"] {
   list-style-image: url(chrome://mozapps/skin/passwordmgr/key-64.png);
 }
 
 .popup-notification-icon[popupid="webapps-install"] {
   list-style-image: url(chrome://browser/skin/webapps-64.png);
 }
 
+.popup-notification-icon[popupid="mixed-content-blocked"] {
+  list-style-image: url(chrome://browser/skin/mixed-content-blocked-64.png);
+}
+
 .popup-notification-icon[popupid="webRTC-sharingDevices"],
 .popup-notification-icon[popupid="webRTC-shareDevices"] {
   list-style-image: url(chrome://browser/skin/webRTC-shareDevice-64.png);
 }
 
 /* Notification icon box */
 #notification-popup-box {
   position: relative;
@@ -2386,16 +2390,20 @@ toolbarbutton.bookmark-item[dragover="tr
   from {
     opacity: 0;
   }
   to {
     opacity: 1;
   }
 }
 
+#mixed-content-blocked-notification-icon {
+  list-style-image: url(chrome://browser/skin/mixed-content-blocked-16.png);
+}
+
 #webRTC-shareDevices-notification-icon {
   list-style-image: url(chrome://browser/skin/webRTC-shareDevice-16.png);
 }
 
 #webRTC-sharingDevices-notification-icon {
   list-style-image: url(chrome://browser/skin/webRTC-sharingDevice-16.png);
 }
 
--- a/browser/themes/winstripe/jar.mn
+++ b/browser/themes/winstripe/jar.mn
@@ -33,16 +33,17 @@ browser.jar:
         skin/classic/browser/identity-icons-https-ev.png
         skin/classic/browser/identity-icons-https-mixed-active.png
         skin/classic/browser/keyhole-forward-mask.svg
         skin/classic/browser/KUI-background.png
         skin/classic/browser/KUI-close.png
         skin/classic/browser/livemark-folder.png
         skin/classic/browser/menu-back.png
         skin/classic/browser/menu-forward.png
+        skin/classic/browser/mixed-content-blocked-16.png
         skin/classic/browser/monitor.png
         skin/classic/browser/monitor_16-10.png
         skin/classic/browser/pageInfo.css
         skin/classic/browser/pageInfo.png
         skin/classic/browser/page-livemarks.png                      (feeds/feedIcon16.png)
         skin/classic/browser/Privacy-16.png
         skin/classic/browser/Privacy-48.png
         skin/classic/browser/privatebrowsing-light.png
@@ -260,16 +261,17 @@ browser.jar:
         skin/classic/aero/browser/identity-icons-https-ev.png
         skin/classic/aero/browser/identity-icons-https-mixed-active.png
         skin/classic/aero/browser/keyhole-forward-mask.svg
         skin/classic/aero/browser/KUI-background.png
         skin/classic/aero/browser/KUI-close.png
         skin/classic/aero/browser/livemark-folder.png                (livemark-folder-aero.png)
         skin/classic/aero/browser/menu-back.png                      (menu-back-aero.png)
         skin/classic/aero/browser/menu-forward.png                   (menu-forward-aero.png)
+        skin/classic/aero/browser/mixed-content-blocked-16.png
         skin/classic/aero/browser/monitor.png
         skin/classic/aero/browser/monitor_16-10.png
         skin/classic/aero/browser/pageInfo.css
         skin/classic/aero/browser/pageInfo.png                       (pageInfo-aero.png)
         skin/classic/aero/browser/page-livemarks.png                 (feeds/feedIcon16-aero.png)
         skin/classic/aero/browser/Privacy-16.png                     (Privacy-16-aero.png)
         skin/classic/aero/browser/Privacy-48.png                     (Privacy-48-aero.png)
         skin/classic/aero/browser/privatebrowsing-light.png
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..7cf33ec4c5acc81330208f5f5ac45fa5435c3d1a
GIT binary patch
literal 346
zc$@)R0j2(lP)<h;3K|Lk000e1NJLTq000mG000mO1^@s6AM^iV0003YNkl<Zc-p1Y
zu}Z^G6o6rI6kNJ=3;GC7f|I3C+AcnXu6+Wh#1KLVgcuT%!P(7@(kBqi0~nvcC=S}m
z2K4w3XK1+54jn!?xhMQta(6^zE1ic$QCM(L;Ynv}V<6A-9#S+AeBwjrMt8l=K$c|_
zyg;zP7<<^&c>zI<i4jQC^c5?d;}Ey_TK}5vR;Z0Yk|ZVWaEc`aqI&@PPH6<<IG*DX
z7Z7CxI4dzX0#Ovjs4<2pBcShG8-XwkXAm4gR4c&qJ_Iu(5Cp*xf)gxtZUuNghG1v}
zeBbXwaEU9OTLIk(`t5-7Jg>q#MmWRs+HRz~>d!yXb=?8p@Piv1z|#3!cZ2SLavaCP
sJp_#sJ+n4nCS}|96c1|p-)-E=FZ@fcYF)+4`v3p{07*qoM6N<$f<M=eoB#j-
--- a/content/base/public/nsIDocument.h
+++ b/content/base/public/nsIDocument.h
@@ -97,18 +97,18 @@ class HTMLBodyElement;
 class Link;
 class ProcessingInstruction;
 class UndoManager;
 template<typename> class Sequence;
 } // namespace dom
 } // namespace mozilla
 
 #define NS_IDOCUMENT_IID \
-{ 0x2df7f766, 0xf70b, 0x4de4, \
- { 0xb0, 0xba, 0x78, 0x25, 0x07, 0x41, 0xd6, 0xce } }
+{ 0x4e6f7d97, 0x091e, 0x4eda, \
+  { 0xb7, 0xd6, 0xfe, 0xb0, 0xb8, 0x01, 0x2a, 0x93 } }
 
 // Flag for AddStyleSheet().
 #define NS_STYLESHEET_FROM_CATALOG                (1 << 0)
 
 // Enum for requesting a particular type of document when creating a doc
 enum DocumentFlavor {
   DocumentFlavorLegacyGuess, // compat with old code until made HTML5-compliant
   DocumentFlavorHTML, // HTMLDocument with HTMLness bit set to true
@@ -441,16 +441,63 @@ public:
   /**
    * Set the has mixed active content loaded flag for this document.
    */
   void SetHasMixedActiveContentLoaded(bool aHasMixedActiveContentLoaded)
   {
     mHasMixedActiveContentLoaded = aHasMixedActiveContentLoaded;
   }
 
+  /**
+   * Get mixed active content blocked flag for this document.
+   */
+  bool GetHasMixedActiveContentBlocked()
+  {
+    return mHasMixedActiveContentBlocked;
+  }
+
+  /**
+   * Set the mixed active content blocked flag for this document.
+   */
+  void SetHasMixedActiveContentBlocked(bool aHasMixedActiveContentBlocked)
+  {
+    mHasMixedActiveContentBlocked = aHasMixedActiveContentBlocked;
+  }
+
+  /**
+   * Get the has mixed display content loaded flag for this document.
+   */
+  bool GetHasMixedDisplayContentLoaded()
+  {
+    return mHasMixedDisplayContentLoaded;
+  }
+
+  /**
+   * Set the has mixed display content loaded flag for this document.
+   */
+  void SetHasMixedDisplayContentLoaded(bool aHasMixedDisplayContentLoaded)
+  {
+    mHasMixedDisplayContentLoaded = aHasMixedDisplayContentLoaded;
+  }
+
+  /**
+   * Get mixed display content blocked flag for this document.
+   */
+  bool GetHasMixedDisplayContentBlocked()
+  {
+    return mHasMixedDisplayContentBlocked;
+  }
+
+  /**
+   * Set the mixed display content blocked flag for this document.
+   */
+  void SetHasMixedDisplayContentBlocked(bool aHasMixedDisplayContentBlocked)
+  {
+    mHasMixedDisplayContentBlocked = aHasMixedDisplayContentBlocked;
+  }
 
   /**
    * Get the sandbox flags for this document.
    * @see nsSandboxFlags.h for the possible flags
    */
   uint32_t GetSandboxFlags() const
   {
     return mSandboxFlags;
@@ -2161,16 +2208,25 @@ protected:
   bool mNeedStyleFlush;
 
   // True if a DOMMutationObserver is perhaps attached to a node in the document.
   bool mMayHaveDOMMutationObservers;
 
   // True if a document has loaded Mixed Active Script (see nsMixedContentBlocker.cpp)
   bool mHasMixedActiveContentLoaded;
 
+  // True if a document has blocked Mixed Active Script (see nsMixedContentBlocker.cpp)
+  bool mHasMixedActiveContentBlocked;
+
+  // True if a document has loaded Mixed Display/Passive Content (see nsMixedContentBlocker.cpp)
+  bool mHasMixedDisplayContentLoaded;
+
+  // True if a document has blocked Mixed Display/Passive Content (see nsMixedContentBlocker.cpp)
+  bool mHasMixedDisplayContentBlocked;
+
   // True if DisallowBFCaching has been called on this document.
   bool mBFCacheDisallowed;
 
   // If true, we have an input encoding.  If this is false, then the
   // document was created entirely in memory
   bool mHaveInputEncoding;
 
   // The document's script global object, the object from which the
--- a/content/base/src/nsMixedContentBlocker.cpp
+++ b/content/base/src/nsMixedContentBlocker.cpp
@@ -16,16 +16,19 @@
 #include "nsNetUtil.h"
 #include "nsIRequest.h"
 #include "nsIDocument.h"
 #include "nsIContentViewer.h"
 #include "nsIChannel.h"
 #include "nsIHttpChannel.h"
 #include "mozilla/Preferences.h"
 #include "nsIScriptObjectPrincipal.h"
+#include "nsISecureBrowserUI.h"
+#include "nsIDocumentLoader.h"
+#include "nsLoadGroup.h"
 
 #include "prlog.h"
 
 using namespace mozilla;
 
 // Is mixed script blocking (fonts, plugin content, scripts, stylesheets,
 // iframes, websockets, XHR) enabled?
 bool nsMixedContentBlocker::sBlockMixedScript = false;
@@ -67,32 +70,42 @@ public:
     NS_ASSERTION(sameTypeRoot, "No document shell root tree item from document shell tree item!");
 
     // now get the document from sameTypeRoot
     nsCOMPtr<nsIDocument> rootDoc = do_GetInterface(sameTypeRoot);
     NS_ASSERTION(rootDoc, "No root document from document shell root tree item.");
 
 
     if (mType == eMixedScript) {
-      rootDoc->SetHasMixedActiveContentLoaded(true);
+       // See if the pref will change here. If it will, only then do we need to call OnSecurityChange() to update the UI.
+       if (rootDoc->GetHasMixedActiveContentLoaded()) {
+         return NS_OK;
+       }
+       rootDoc->SetHasMixedActiveContentLoaded(true);
 
-      // Update the security UI in the tab with the blocked mixed content
+      // Update the security UI in the tab with the allowed mixed active content
       nsCOMPtr<nsISecurityEventSink> eventSink = do_QueryInterface(docShell);
       if (eventSink) {
-        eventSink->OnSecurityChange(mContext, nsIWebProgressListener::STATE_IS_BROKEN);
+        eventSink->OnSecurityChange(mContext, (nsIWebProgressListener::STATE_IS_BROKEN | nsIWebProgressListener::STATE_LOADED_MIXED_ACTIVE_CONTENT));
       }
 
-    } else {
-        if (mType == eMixedDisplay) {
-          //Do Nothing for now; state will already be set STATE_IS_BROKEN
-        }
+    } else if (mType == eMixedDisplay) {
+      // See if the pref will change here. If it will, only then do we need to call OnSecurityChange() to update the UI.
+      if (rootDoc->GetHasMixedDisplayContentLoaded()) {
+        return NS_OK;
+      }
+      rootDoc->SetHasMixedDisplayContentLoaded(true);
+
+      // Update the security UI in the tab with the allowed mixed display content.
+      nsCOMPtr<nsISecurityEventSink> eventSink = do_QueryInterface(docShell);
+      if (eventSink) {
+        eventSink->OnSecurityChange(mContext, (nsIWebProgressListener::STATE_IS_BROKEN | nsIWebProgressListener::STATE_LOADED_MIXED_DISPLAY_CONTENT));
+      }
     }
 
-
-
     return NS_OK;
   }
 private:
   // The requesting context for the content load. Generally, a DOM node from
   // the document that caused the load.
   nsCOMPtr<nsISupports> mContext;
 
   // The type of mixed content detected, e.g. active or display
@@ -319,21 +332,109 @@ nsMixedContentBlocker::ShouldLoad(uint32
     return NS_OK;
   }
   if (!parentIsHttps) {
     *aDecision = ACCEPT;
     return NS_OK;
   }
 
   // If we are here we have mixed content.
+
+  // Determine if the rootDoc is https and if the user decided to allow Mixed Content
+  nsCOMPtr<nsIDocShell> docShell = NS_CP_GetDocShellFromContext(aRequestingContext);
+  NS_ENSURE_TRUE(docShell, NS_OK);
+  bool rootHasSecureConnection = false;
+  bool allowMixedContent = false;
+  bool isRootDocShell = false;
+  rv = docShell->GetAllowMixedContentAndConnectionData(&rootHasSecureConnection, &allowMixedContent, &isRootDocShell);
+  if (NS_FAILED(rv)) {
+     return rv;
+  }
+
+  // Get the root document from the docshell
+  nsCOMPtr<nsIDocShellTreeItem> currentDocShellTreeItem(do_QueryInterface(docShell));
+  NS_ASSERTION(currentDocShellTreeItem, "No DocShellTreeItem from docshell");  
+  nsCOMPtr<nsIDocShellTreeItem> sameTypeRoot;
+  currentDocShellTreeItem->GetSameTypeRootTreeItem(getter_AddRefs(sameTypeRoot));
+  NS_ASSERTION(sameTypeRoot, "No document shell root tree item from document shell tree item!");
+  nsCOMPtr<nsIDocument> rootDoc = do_GetInterface(sameTypeRoot);
+  NS_ASSERTION(rootDoc, "No root document from document shell root tree item.");
+
+  // Get eventSink and the current security state from the docShell
+  nsCOMPtr<nsISecurityEventSink> eventSink = do_QueryInterface(docShell);
+  NS_ASSERTION(eventSink, "No eventSink from docShell.");
+  nsCOMPtr<nsIDocShell> rootShell = do_GetInterface(sameTypeRoot);
+  NS_ASSERTION(rootShell, "No root docshell from document shell root tree item.");
+  uint32_t State = nsIWebProgressListener::STATE_IS_BROKEN;
+  nsCOMPtr<nsISecureBrowserUI> SecurityUI;
+  rootShell->GetSecurityUI(getter_AddRefs(SecurityUI));
+  NS_ASSERTION(SecurityUI, "No SecurityUI from the root docShell.");
+  nsresult stateRV = SecurityUI->GetState(&State);
+
   // If the content is display content, and the pref says display content should be blocked, block it.
-  // If the content is mixed content, and the pref says mixed content should be blocked, block it.
-  if ( (sBlockMixedDisplay && classification == eMixedDisplay) || (sBlockMixedScript && classification == eMixedScript) ) {
-     *aDecision = nsIContentPolicy::REJECT_REQUEST;
-     return NS_OK;
+  if (sBlockMixedDisplay && classification == eMixedDisplay) {
+    if (allowMixedContent) {
+      *aDecision = nsIContentPolicy::ACCEPT;
+      rootDoc->SetHasMixedActiveContentLoaded(true);
+      if (!rootDoc->GetHasMixedDisplayContentLoaded() && NS_SUCCEEDED(stateRV)) {
+        eventSink->OnSecurityChange(aRequestingContext, (State | nsIWebProgressListener::STATE_LOADED_MIXED_DISPLAY_CONTENT));
+      }
+    } else {
+      *aDecision = nsIContentPolicy::REJECT_REQUEST;
+      if (!rootDoc->GetHasMixedDisplayContentBlocked() && NS_SUCCEEDED(stateRV)) {
+        eventSink->OnSecurityChange(aRequestingContext, (State | nsIWebProgressListener::STATE_BLOCKED_MIXED_DISPLAY_CONTENT));
+      }
+    }
+    return NS_OK;
+
+  } else if (sBlockMixedScript && classification == eMixedScript) {
+    // If the content is active content, and the pref says active content should be blocked, block it
+    // unless the user has choosen to override the pref
+    if (allowMixedContent) {
+       *aDecision = nsIContentPolicy::ACCEPT;
+       // See if the pref will change here. If it will, only then do we need to call OnSecurityChange() to update the UI.
+       if (rootDoc->GetHasMixedActiveContentLoaded()) {
+         return NS_OK;
+       }
+       rootDoc->SetHasMixedActiveContentLoaded(true);
+
+       if (rootHasSecureConnection) {
+         // User has decided to override the pref and the root is https, so change the Security State.
+         if (rootDoc->GetHasMixedDisplayContentLoaded()) {
+           // If mixed display content is loaded, make sure to include that in the state.
+           eventSink->OnSecurityChange(aRequestingContext, (nsIWebProgressListener::STATE_IS_BROKEN | nsIWebProgressListener::STATE_LOADED_MIXED_ACTIVE_CONTENT | nsIWebProgressListener::STATE_LOADED_MIXED_DISPLAY_CONTENT));
+         } else {
+           eventSink->OnSecurityChange(aRequestingContext, (nsIWebProgressListener::STATE_IS_BROKEN | nsIWebProgressListener::STATE_LOADED_MIXED_ACTIVE_CONTENT));
+         }
+         return NS_OK;
+       } else {
+         // User has already overriden the pref and the root is not https;
+         // mixed content was allowed on an https subframe.
+         if (NS_SUCCEEDED(stateRV)) {
+           eventSink->OnSecurityChange(aRequestingContext, (State | nsIWebProgressListener::STATE_LOADED_MIXED_ACTIVE_CONTENT));
+         }
+         return NS_OK;
+       }
+    } else {
+       //User has not overriden the pref by Disabling protection. Reject the request and update the security state.
+       *aDecision = nsIContentPolicy::REJECT_REQUEST;
+       // See if the pref will change here. If it will, only then do we need to call OnSecurityChange() to update the UI.
+       if (rootDoc->GetHasMixedActiveContentBlocked()) {
+         return NS_OK;
+       }
+       rootDoc->SetHasMixedActiveContentBlocked(true);
+
+       // The user has not overriden the pref, so make sure they still have an option by calling eventSink
+       // which will invoke the doorhanger
+       if (NS_SUCCEEDED(stateRV)) {
+          eventSink->OnSecurityChange(aRequestingContext, (State | nsIWebProgressListener::STATE_BLOCKED_MIXED_ACTIVE_CONTENT));
+       }
+       return NS_OK;
+    }
+
   } else {
     // The content is not blocked by the mixed content prefs.
 
     // Fire the event from a script runner as it is unsafe to run script
     // from within ShouldLoad
     nsContentUtils::AddScriptRunner(
       new nsMixedContentEvent(aRequestingContext, classification));
     return NS_OK;
--- a/content/base/test/Makefile.in
+++ b/content/base/test/Makefile.in
@@ -605,16 +605,25 @@ MOCHITEST_FILES_B = \
 		test_XHR_parameters.html \
 		test_ipc_messagemanager_blob.html \
 		test_mixed_content_blocker.html \
 		file_mixed_content_main.html \
 		file_mixed_content_server.sjs \
     test_mixed_content_blocker_bug803225.html \
     file_mixed_content_main_bug803225.html \
     file_mixed_content_main_bug803225_websocket_wsh.py \
+    file_bug822367_1.html \
+    file_bug822367_1.js \
+    file_bug822367_2.html \
+    file_bug822367_3.html \
+    file_bug822367_4.html \
+    file_bug822367_4.js \
+    file_bug822367_4B.html \
+    file_bug822367_5.html \
+    file_bug822367_6.html \
     bug803225_test_mailto.html \
 		test_bug789856.html \
 		file_bug804395.jar \
 		test_bug804395.html \
 		test_bug809003.html \
 		test_bug810494.html \
 		test_textnode_split_in_selection.html \
 		test_textnode_normalize_in_selection.html \
--- a/content/base/test/chrome/Makefile.in
+++ b/content/base/test/chrome/Makefile.in
@@ -52,9 +52,12 @@ MOCHITEST_CHROME_FILES = \
     test_bug816340.xul \
     file_bug816340.xul \
     test_domparsing.xul \
     test_bug814638.xul \
     host_bug814638.xul \
     frame_bug814638.xul \
     $(NULL)
 
+MOCHITEST_BROWSER_FILES = \
+    browser_bug822367.js \
+
 include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/content/base/test/chrome/browser_bug822367.js
@@ -0,0 +1,192 @@
+/*
+ * User Override Mixed Content Block - Tests for Bug 822367
+ */
+
+
+const PREF_DISPLAY = "security.mixed_content.block_display_content";
+const PREF_ACTIVE = "security.mixed_content.block_active_content";
+const gHttpTestRoot = "https://example.com/tests/content/base/test/";
+var origBlockDisplay;
+var origBlockActive;
+var gTestBrowser = null;
+
+registerCleanupFunction(function() {
+  // Set preferences back to their original values
+  Services.prefs.setBoolPref(PREF_DISPLAY, origBlockDisplay);
+  Services.prefs.setBoolPref(PREF_ACTIVE, origBlockActive);
+});
+
+function MixedTestsCompleted() {
+  gBrowser.removeCurrentTab();
+  window.focus();
+  finish();
+}
+
+function test() {
+  waitForExplicitFinish();
+
+  origBlockDisplay = Services.prefs.getBoolPref(PREF_DISPLAY);
+  origBlockActive = Services.prefs.getBoolPref(PREF_ACTIVE);
+
+  Services.prefs.setBoolPref(PREF_DISPLAY, true);
+  Services.prefs.setBoolPref(PREF_ACTIVE, true);
+
+  var newTab = gBrowser.addTab();
+  gBrowser.selectedTab = newTab;
+  gTestBrowser = gBrowser.selectedBrowser;
+  newTab.linkedBrowser.stop()
+
+  // Mixed Script Test
+  gTestBrowser.addEventListener("load", MixedTest1A, true);
+  var url = gHttpTestRoot + "file_bug822367_1.html";
+  gTestBrowser.contentWindow.location = url;
+}
+
+// Mixed Script Test
+function MixedTest1A() {
+  gTestBrowser.removeEventListener("load", MixedTest1A, true);
+  gTestBrowser.addEventListener("load", MixedTest1B, true);
+  var notification = PopupNotifications.getNotification("mixed-content-blocked", gTestBrowser);
+  ok(notification, "Mixed Content Doorhanger didn't appear");
+  notification.secondaryActions[0].callback();
+}
+function MixedTest1B() {
+  waitForCondition(function() content.document.getElementById('p1').innerHTML == "hello", MixedTest1C, "Waited too long for mixed script to run in Test 1");
+}
+function MixedTest1C() {
+  ok(content.document.getElementById('p1').innerHTML == "hello","Mixed script didn't load in Test 1");
+  gTestBrowser.removeEventListener("load", MixedTest1B, true);
+  MixedTest2();
+}
+
+//Mixed Display Test - Doorhanger should not appear
+function MixedTest2() {
+  gTestBrowser.addEventListener("load", MixedTest2A, true);
+  var url = gHttpTestRoot + "file_bug822367_2.html";
+  gTestBrowser.contentWindow.location = url;
+}
+
+function MixedTest2A() {
+  var notification = PopupNotifications.getNotification("mixed-content-blocked", gTestBrowser);
+  ok(!notification, "Mixed Content Doorhanger appears for mixed display content!");
+  MixedTest3();
+}
+
+// Mixed Script and Display Test - User Override should cause both the script and the image to load.
+function MixedTest3() {
+  gTestBrowser.removeEventListener("load", MixedTest2A, true);
+  gTestBrowser.addEventListener("load", MixedTest3A, true);
+  var url = gHttpTestRoot + "file_bug822367_3.html";
+  gTestBrowser.contentWindow.location = url;
+}
+function MixedTest3A() {
+  gTestBrowser.removeEventListener("load", MixedTest3A, true);
+  gTestBrowser.addEventListener("load", MixedTest3B, true);
+  var notification = PopupNotifications.getNotification("mixed-content-blocked", gTestBrowser);
+  ok(notification, "Mixed Content Doorhanger doesn't appear for test 3");
+  notification.secondaryActions[0].callback();
+}
+function MixedTest3B() {
+  waitForCondition(function() content.document.getElementById('p1').innerHTML == "hello", MixedTest3C, "Waited too long for mixed script to run in Test 3");
+}
+function MixedTest3C() {
+  waitForCondition(function() content.document.getElementById('p2').innerHTML == "bye", MixedTest3D, "Waited too long for mixed image to load in Test 3");
+}
+function MixedTest3D() {
+  ok(content.document.getElementById('p1').innerHTML == "hello","Mixed script didn't load in Test 3");
+  ok(content.document.getElementById('p2').innerHTML == "bye","Mixed image didn't load in Test 3");
+  MixedTest4();
+}
+
+// Location change - User override on one page doesn't propogate to another page after location change.
+function MixedTest4() {
+  gTestBrowser.removeEventListener("load", MixedTest3B, true);
+  gTestBrowser.addEventListener("load", MixedTest4A, true);
+  var url = gHttpTestRoot + "file_bug822367_4.html";
+  gTestBrowser.contentWindow.location = url;
+}
+function MixedTest4A() {
+  gTestBrowser.removeEventListener("load", MixedTest4A, true);
+  gTestBrowser.addEventListener("load", MixedTest4B, true);
+  var notification = PopupNotifications.getNotification("mixed-content-blocked", gTestBrowser);
+  ok(notification, "Mixed Content Doorhanger doesn't appear for Test 4");
+  notification.secondaryActions[0].callback();
+}
+function MixedTest4B() {
+  waitForCondition(function() content.document.location == gHttpTestRoot + "file_bug822367_4B.html", MixedTest4C, "Waited too long for mixed script to run in Test 4");
+}
+function MixedTest4C() {
+  ok(content.document.location == gHttpTestRoot + "file_bug822367_4B.html", "Location didn't change in test 4");
+  var notification = PopupNotifications.getNotification("mixed-content-blocked", gTestBrowser);
+  ok(notification, "Mixed Content Doorhanger doesn't appear after location change in Test 4");
+  waitForCondition(function() content.document.getElementById('p1').innerHTML == "", MixedTest4D, "Mixed script loaded in test 4 after location change!");
+}
+function MixedTest4D() {
+  ok(content.document.getElementById('p1').innerHTML == "","p1.innerHTML changed; mixed script loaded after location change in Test 4");
+  MixedTest5();
+}
+
+// Mixed script attempts to load in a document.open()
+function MixedTest5() {
+  gTestBrowser.removeEventListener("load", MixedTest4B, true);
+  gTestBrowser.addEventListener("load", MixedTest5A, true);
+  var url = gHttpTestRoot + "file_bug822367_5.html";
+  gTestBrowser.contentWindow.location = url;
+}
+function MixedTest5A() {
+  gTestBrowser.removeEventListener("load", MixedTest5A, true);
+  gTestBrowser.addEventListener("load", MixedTest5B, true);
+  var notification = PopupNotifications.getNotification("mixed-content-blocked", gTestBrowser);
+  ok(notification, "Mixed Content Doorhanger doesn't appear for Test 5");
+  notification.secondaryActions[0].callback();
+}
+function MixedTest5B() {
+  waitForCondition(function() content.document.getElementById('p1').innerHTML == "hello", MixedTest5C, "Waited too long for mixed script to run in Test 5");
+}
+function MixedTest5C() {
+  ok(content.document.getElementById('p1').innerHTML == "hello","Mixed script didn't load in Test 5");
+  MixedTest6();
+}
+
+// Mixed script attempts to load in a document.open() that is within an iframe.
+function MixedTest6() {
+  gTestBrowser.removeEventListener("load", MixedTest5B, true);
+  gTestBrowser.addEventListener("load", MixedTest6A, true);
+  var url = gHttpTestRoot + "file_bug822367_6.html";
+  gTestBrowser.contentWindow.location = url;
+}
+function MixedTest6A() {
+  gTestBrowser.removeEventListener("load", MixedTest6A, true);
+  waitForCondition(function() PopupNotifications.getNotification("mixed-content-blocked", gTestBrowser), MixedTest6B, "waited to long for doorhanger");
+}
+
+function MixedTest6B() {
+  var notification = PopupNotifications.getNotification("mixed-content-blocked", gTestBrowser);
+  ok(notification, "Mixed Content Doorhanger doesn't appear for Test 6");
+  gTestBrowser.addEventListener("load", MixedTest6C, true);
+  notification.secondaryActions[0].callback();
+}
+
+function MixedTest6C() {
+  gTestBrowser.removeEventListener("load", MixedTest6C, true);
+  waitForCondition(function() content.document.getElementById('f1').contentDocument.getElementById('p1').innerHTML == "hello", MixedTest6D, "Waited too long for mixed script to run in Test 6");
+}
+function MixedTest6D() {
+  ok(content.document.getElementById('f1').contentDocument.getElementById('p1').innerHTML == "hello","Mixed script didn't load in Test 6");
+  MixedTestsCompleted();
+}
+
+function waitForCondition(condition, nextTest, errorMsg) {
+  var tries = 0;
+  var interval = setInterval(function() {
+    if (tries >= 30) {
+      ok(false, errorMsg);
+      moveOn();
+    }
+    if (condition()) {
+      moveOn();
+    }
+    tries++;
+  }, 100);
+  var moveOn = function() { clearInterval(interval); nextTest(); };
+}
new file mode 100644
--- /dev/null
+++ b/content/base/test/file_bug822367_1.html
@@ -0,0 +1,18 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+Test 1 for Mixed Content Blocker User Override - Mixed Script
+https://bugzilla.mozilla.org/show_bug.cgi?id=822367
+-->
+<head>
+  <meta charset="utf-8">
+  <title>Test 1 for Bug 822367</title>
+</head>
+<body>
+  <div id="testContent">
+    <p id="p1"></p>
+  </div>
+  <script src="http://example.com/tests/content/base/test/file_bug822367_1.js">
+  </script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/content/base/test/file_bug822367_1.js
@@ -0,0 +1,1 @@
+document.getElementById('p1').innerHTML="hello";
new file mode 100644
--- /dev/null
+++ b/content/base/test/file_bug822367_2.html
@@ -0,0 +1,16 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+Test 2 for Mixed Content Blocker User Override - Mixed Display
+https://bugzilla.mozilla.org/show_bug.cgi?id=822367
+-->
+<head>
+  <meta charset="utf-8">
+  <title>Test 2 for Bug 822367 - Mixed Display</title>
+</head>
+<body>
+  <div id="testContent">
+    <img src="http://example.com/tests/image/test/mochitest/blue.png">
+  </div>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/content/base/test/file_bug822367_3.html
@@ -0,0 +1,27 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+Test 3 for Mixed Content Blocker User Override - Mixed Script and Display
+https://bugzilla.mozilla.org/show_bug.cgi?id=822367
+-->
+<head>
+  <meta charset="utf-8">
+  <title>Test 3 for Bug 822367</title>
+  <script>
+  function foo() {
+    var x = document.createElement('p');
+    x.setAttribute("id", "p2");
+    x.innerHTML = "bye";
+    document.getElementById("testContent").appendChild(x);
+  }
+  </script>
+</head>
+<body>
+  <div id="testContent">
+    <p id="p1"></p>
+    <img src="http://example.com/tests/image/test/mochitest/blue.png" onload="foo()">
+  </div>
+  <script src="http://example.com/tests/content/base/test/file_bug822367_1.js">
+  </script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/content/base/test/file_bug822367_4.html
@@ -0,0 +1,18 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+Test 4 for Mixed Content Blocker User Override - Mixed Script and Display
+https://bugzilla.mozilla.org/show_bug.cgi?id=822367
+-->
+<head>
+  <meta charset="utf-8">
+  <title>Test 4 for Bug 822367</title>
+</head>
+<body>
+  <div id="testContent">
+    <p id="p1"></p>
+  </div>
+  <script src="http://example.com/tests/content/base/test/file_bug822367_4.js">
+  </script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/content/base/test/file_bug822367_4.js
@@ -0,0 +1,1 @@
+document.location = "https://example.com/tests/content/base/test/file_bug822367_4B.html";
new file mode 100644
--- /dev/null
+++ b/content/base/test/file_bug822367_4B.html
@@ -0,0 +1,18 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+Test 4B for Mixed Content Blocker User Override - Location Changed
+https://bugzilla.mozilla.org/show_bug.cgi?id=822367
+-->
+<head>
+  <meta charset="utf-8">
+  <title>Test 4B Location Change for Bug 822367</title>
+</head>
+<body>
+  <div id="testContent">
+    <p id="p1"></p>
+  </div>
+  <script src="http://example.com/tests/content/base/test/file_bug822367_1.js">
+  </script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/content/base/test/file_bug822367_5.html
@@ -0,0 +1,24 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+Test 5 for Mixed Content Blocker User Override - Mixed Script in document.open()
+https://bugzilla.mozilla.org/show_bug.cgi?id=822367
+-->
+<head>
+  <meta charset="utf-8">
+  <title>Test 5 for Bug 822367</title>
+  <script>
+    function createDoc()
+    {
+      var doc=document.open("text/html","replace");
+      doc.write('<!DOCTYPE html><html><body><p id="p1">This is some content</p><script src="http://example.com/tests/content/base/test/file_bug822367_1.js">\<\/script\>\<\/body>\<\/html>');
+      doc.close();
+    }
+  </script>
+</head>
+<body>
+  <div id="testContent">
+    <img src="https://example.com/tests/image/test/mochitest/blue.png" onload="createDoc()">
+  </div>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/content/base/test/file_bug822367_6.html
@@ -0,0 +1,16 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+Test 6 for Mixed Content Blocker User Override - Mixed Script in document.open() within an iframe
+https://bugzilla.mozilla.org/show_bug.cgi?id=822367
+-->
+<head>
+  <meta charset="utf-8">
+  <title>Test 6 for Bug 822367</title>
+</head>
+<body>
+  <div id="testContent">
+    <iframe name="f1" id="f1" src="https://example.com/tests/content/base/test/file_bug822367_5.html"></iframe>
+  </div>
+</body>
+</html>
--- a/content/html/document/src/nsHTMLDocument.cpp
+++ b/content/html/document/src/nsHTMLDocument.cpp
@@ -1615,16 +1615,26 @@ nsHTMLDocument::Open(JSContext* cx,
     }
 
     loadFlags |= callerLoadFlags & nsIRequest::INHIBIT_PERSISTENT_CACHING;
 
     rv = channel->SetLoadFlags(loadFlags);
     if (rv.Failed()) {
       return nullptr;
     }
+
+    // If the user has allowed mixed content on the rootDoc, then we should propogate it
+    // down to the new document channel.
+    bool rootHasSecureConnection = false;
+    bool allowMixedContent = false;
+    bool isDocShellRoot = false;
+    nsresult rvalue = shell->GetAllowMixedContentAndConnectionData(&rootHasSecureConnection, &allowMixedContent, &isDocShellRoot);
+    if (NS_SUCCEEDED(rvalue) && allowMixedContent && isDocShellRoot) {
+       shell->SetMixedContentChannel(channel);
+    }
   }
 
   // Before we reset the doc notify the globalwindow of the change,
   // but only if we still have a window (i.e. our window object the
   // current inner window in our outer window).
 
   // Hold onto ourselves on the offchance that we're down to one ref
   nsCOMPtr<nsIDocument> kungFuDeathGrip = this;
--- a/content/media/webrtc/MediaEngine.h
+++ b/content/media/webrtc/MediaEngine.h
@@ -84,21 +84,16 @@ public:
                           SourceMediaStream *aSource,
                           TrackID aId,
                           StreamTime aDesiredTime,
                           TrackTicks &aLastEndTime) = 0;
 
   /* Stop the device and release the corresponding MediaStream */
   virtual nsresult Stop(SourceMediaStream *aSource, TrackID aID) = 0;
 
-  /* Change device configuration.  */
-  virtual nsresult Config(bool aEchoOn, uint32_t aEcho,
-                          bool aAgcOn, uint32_t aAGC,
-                          bool aNoiseOn, uint32_t aNoise) = 0;
-
   /* Return false if device is currently allocated or started */
   bool IsAvailable() {
     if (mState == kAllocated || mState == kStarted) {
       return false;
     } else {
       return true;
     }
   }
--- a/content/media/webrtc/MediaEngineDefault.h
+++ b/content/media/webrtc/MediaEngineDefault.h
@@ -39,19 +39,16 @@ public:
   virtual void GetUUID(nsAString&);
 
   virtual const MediaEngineVideoOptions *GetOptions();
   virtual nsresult Allocate();
   virtual nsresult Deallocate();
   virtual nsresult Start(SourceMediaStream*, TrackID);
   virtual nsresult Stop(SourceMediaStream*, TrackID);
   virtual nsresult Snapshot(uint32_t aDuration, nsIDOMFile** aFile);
-  virtual nsresult Config(bool aEchoOn, uint32_t aEcho,
-                          bool aAgcOn, uint32_t aAGC,
-                          bool aNoiseOn, uint32_t aNoise) { return NS_OK; };
   virtual void NotifyPull(MediaStreamGraph* aGraph, StreamTime aDesiredTime);
   virtual void NotifyPull(MediaStreamGraph* aGraph,
                           SourceMediaStream *aSource,
                           TrackID aId,
                           StreamTime aDesiredTime,
                           TrackTicks &aLastEndTime) {}
 
   NS_DECL_ISUPPORTS
@@ -84,19 +81,16 @@ public:
   virtual void GetName(nsAString&);
   virtual void GetUUID(nsAString&);
 
   virtual nsresult Allocate();
   virtual nsresult Deallocate();
   virtual nsresult Start(SourceMediaStream*, TrackID);
   virtual nsresult Stop(SourceMediaStream*, TrackID);
   virtual nsresult Snapshot(uint32_t aDuration, nsIDOMFile** aFile);
-  virtual nsresult Config(bool aEchoOn, uint32_t aEcho,
-                          bool aAgcOn, uint32_t aAGC,
-                          bool aNoiseOn, uint32_t aNoise) { return NS_OK; };
   virtual void NotifyPull(MediaStreamGraph* aGraph, StreamTime aDesiredTime);
   virtual void NotifyPull(MediaStreamGraph* aGraph,
                           SourceMediaStream *aSource,
                           TrackID aId,
                           StreamTime aDesiredTime,
                           TrackTicks &aLastEndTime) {}
 
   NS_DECL_ISUPPORTS
--- a/content/media/webrtc/MediaEngineWebRTC.h
+++ b/content/media/webrtc/MediaEngineWebRTC.h
@@ -30,17 +30,16 @@
 // Audio Engine
 #include "voice_engine/include/voe_base.h"
 #include "voice_engine/include/voe_codec.h"
 #include "voice_engine/include/voe_hardware.h"
 #include "voice_engine/include/voe_network.h"
 #include "voice_engine/include/voe_audio_processing.h"
 #include "voice_engine/include/voe_volume_control.h"
 #include "voice_engine/include/voe_external_media.h"
-#include "voice_engine/include/voe_audio_processing.h"
 
 // Video Engine
 #include "video_engine/include/vie_base.h"
 #include "video_engine/include/vie_codec.h"
 #include "video_engine/include/vie_render.h"
 #include "video_engine/include/vie_capture.h"
 #include "video_engine/include/vie_file.h"
 
@@ -86,19 +85,16 @@ public:
   virtual void GetName(nsAString&);
   virtual void GetUUID(nsAString&);
   virtual const MediaEngineVideoOptions *GetOptions();
   virtual nsresult Allocate();
   virtual nsresult Deallocate();
   virtual nsresult Start(SourceMediaStream*, TrackID);
   virtual nsresult Stop(SourceMediaStream*, TrackID);
   virtual nsresult Snapshot(uint32_t aDuration, nsIDOMFile** aFile);
-  virtual nsresult Config(bool aEchoOn, uint32_t aEcho,
-                          bool aAgcOn, uint32_t aAGC,
-                          bool aNoiseOn, uint32_t aNoise) { return NS_OK; };
   virtual void NotifyPull(MediaStreamGraph* aGraph,
                           SourceMediaStream *aSource,
                           TrackID aId,
                           StreamTime aDesiredTime,
                           TrackTicks &aLastEndTime);
 
   NS_DECL_ISUPPORTS
 
@@ -176,20 +172,16 @@ class MediaEngineWebRTCAudioSource : pub
 public:
   MediaEngineWebRTCAudioSource(webrtc::VoiceEngine* aVoiceEnginePtr, int aIndex,
     const char* name, const char* uuid)
     : mVoiceEngine(aVoiceEnginePtr)
     , mMonitor("WebRTCMic.Monitor")
     , mCapIndex(aIndex)
     , mChannel(-1)
     , mInitDone(false)
-    , mEchoOn(false), mAgcOn(false), mNoiseOn(false)
-    , mEchoCancel(webrtc::kEcDefault)
-    , mAGC(webrtc::kAgcDefault)
-    , mNoiseSuppress(webrtc::kNsDefault)
     , mNullTransport(nullptr) {
     MOZ_ASSERT(aVoiceEnginePtr);
     mState = kReleased;
     mDeviceName.Assign(NS_ConvertUTF8toUTF16(name));
     mDeviceUUID.Assign(NS_ConvertUTF8toUTF16(uuid));
     Init();
   }
   ~MediaEngineWebRTCAudioSource() { Shutdown(); }
@@ -197,20 +189,16 @@ public:
   virtual void GetName(nsAString&);
   virtual void GetUUID(nsAString&);
 
   virtual nsresult Allocate();
   virtual nsresult Deallocate();
   virtual nsresult Start(SourceMediaStream*, TrackID);
   virtual nsresult Stop(SourceMediaStream*, TrackID);
   virtual nsresult Snapshot(uint32_t aDuration, nsIDOMFile** aFile);
-  virtual nsresult Config(bool aEchoOn, uint32_t aEcho,
-                          bool aAgcOn, uint32_t aAGC,
-                          bool aNoiseOn, uint32_t aNoise);
-
   virtual void NotifyPull(MediaStreamGraph* aGraph,
                           SourceMediaStream *aSource,
                           TrackID aId,
                           StreamTime aDesiredTime,
                           TrackTicks &aLastEndTime);
 
   // VoEMediaProcess.
   void Process(const int channel, const webrtc::ProcessingTypes type,
@@ -225,37 +213,31 @@ private:
 
   void Init();
   void Shutdown();
 
   webrtc::VoiceEngine* mVoiceEngine;
   webrtc::VoEBase* mVoEBase;
   webrtc::VoEExternalMedia* mVoERender;
   webrtc::VoENetwork*  mVoENetwork;
-  webrtc::VoEAudioProcessing *mVoEProcessing;
 
   // mMonitor protects mSources[] access/changes, and transitions of mState
   // from kStarted to kStopped (which are combined with EndTrack()).
   // mSources[] is accessed from webrtc threads.
   mozilla::ReentrantMonitor mMonitor;
   nsTArray<SourceMediaStream *> mSources; // When this goes empty, we shut down HW
 
   int mCapIndex;
   int mChannel;
   TrackID mTrackID;
   bool mInitDone;
 
   nsString mDeviceName;
   nsString mDeviceUUID;
 
-  bool mEchoOn, mAgcOn, mNoiseOn;
-  webrtc::EcModes  mEchoCancel;
-  webrtc::AgcModes mAGC;
-  webrtc::NsModes  mNoiseSuppress;
-
   NullTransport *mNullTransport;
 };
 
 class MediaEngineWebRTC : public MediaEngine
 {
 public:
   MediaEngineWebRTC()
   : mMutex("mozilla::MediaEngineWebRTC")
--- a/content/media/webrtc/MediaEngineWebRTCAudio.cpp
+++ b/content/media/webrtc/MediaEngineWebRTCAudio.cpp
@@ -42,70 +42,16 @@ MediaEngineWebRTCAudioSource::GetUUID(ns
   if (mInitDone) {
     aUUID.Assign(mDeviceUUID);
   }
 
   return;
 }
 
 nsresult
-MediaEngineWebRTCAudioSource::Config(bool aEchoOn, uint32_t aEcho,
-                                     bool aAgcOn, uint32_t aAGC,
-                                     bool aNoiseOn, uint32_t aNoise)
-{
-  LOG(("Audio config: aec: %d, agc: %d, noise: %d",
-       aEchoOn ? aEcho : -1,
-       aAgcOn ? aAGC : -1,
-       aNoiseOn ? aNoise : -1));
-
-  bool update_agc = (mAgcOn == aAgcOn);
-  bool update_noise = (mNoiseOn == aNoiseOn);
-  mAgcOn = aAgcOn;
-  mNoiseOn = aNoiseOn;
-
-  if ((webrtc::AgcModes) aAGC != webrtc::kAgcUnchanged) {
-    if (mAGC != (webrtc::AgcModes) aAGC) {
-      update_agc = true;
-      mAGC = (webrtc::AgcModes) aAGC;
-    }
-  }
-  if ((webrtc::NsModes) aNoise != webrtc::kNsUnchanged) {
-    if (mNoiseSuppress != (webrtc::NsModes) aNoise) {
-      update_noise = true;
-      mNoiseSuppress = (webrtc::NsModes) aNoise;
-    }
-  }
-
-  if (mInitDone) {
-    int error;
-#if 0
-    // Until we can support feeding our full output audio from the browser
-    // through the MediaStream, this won't work.  Or we need to move AEC to
-    // below audio input and output, perhaps invoked from here.
-    mEchoOn = aEchoOn;
-    if ((webrtc::EcModes) aEcho != webrtc::kEcUnchanged)
-      mEchoCancel = (webrtc::EcModes) aEcho;
-    mVoEProcessing->SetEcStatus(mEchoOn, aEcho);
-#else
-    (void) aEcho; (void) aEchoOn; // suppress warnings
-#endif
-
-    if (update_agc &&
-      0 != (error = mVoEProcessing->SetAgcStatus(mAgcOn, (webrtc::AgcModes) aAGC))) {
-      LOG(("%s Error setting AGC Status: %d ",__FUNCTION__, error));
-    }
-    if (update_noise &&
-      0 != (error = mVoEProcessing->SetNsStatus(mNoiseOn, (webrtc::NsModes) aNoise))) {
-      LOG(("%s Error setting NoiseSuppression Status: %d ",__FUNCTION__, error));
-    }
-  }
-  return NS_OK;
-}
-
-nsresult
 MediaEngineWebRTCAudioSource::Allocate()
 {
   if (mState == kReleased && mInitDone) {
     webrtc::VoEHardware* ptrVoEHw = webrtc::VoEHardware::GetInterface(mVoiceEngine);
     int res = ptrVoEHw->SetRecordingDevice(mCapIndex);
     ptrVoEHw->Release();
     if (res) {
       return NS_ERROR_FAILURE;
@@ -155,21 +101,16 @@ MediaEngineWebRTCAudioSource::Start(Sour
   LOG(("Initial audio"));
   mTrackID = aID;
 
   if (mState == kStarted) {
     return NS_OK;
   }
   mState = kStarted;
 
-  // Configure audio processing in webrtc code
-  Config(mEchoOn, webrtc::kEcUnchanged,
-         mAgcOn, webrtc::kAgcUnchanged,
-         mNoiseOn, webrtc::kNsUnchanged);
-
   if (mVoEBase->StartReceive(mChannel)) {
     return NS_ERROR_FAILURE;
   }
   if (mVoEBase->StartSend(mChannel)) {
     return NS_ERROR_FAILURE;
   }
 
   // Attach external media processor, so this::Process will be called.
@@ -246,21 +187,16 @@ MediaEngineWebRTCAudioSource::Init()
   if (!mVoERender) {
     return;
   }
   mVoENetwork = webrtc::VoENetwork::GetInterface(mVoiceEngine);
   if (!mVoENetwork) {
     return;
   }
 
-  mVoEProcessing = webrtc::VoEAudioProcessing::GetInterface(mVoiceEngine);
-  if (!mVoEProcessing) {
-    return;
-  }
-
   mChannel = mVoEBase->CreateChannel();
   if (mChannel < 0) {
     return;
   }
   mNullTransport = new NullTransport();
   if (mVoENetwork->RegisterExternalTransport(mChannel, *mNullTransport)) {
     return;
   }
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -69,16 +69,18 @@
 #include "nsView.h"
 #include "nsViewManager.h"
 #include "nsIScriptChannel.h"
 #include "nsIOfflineCacheUpdate.h"
 #include "nsITimedChannel.h"
 #include "nsIPrivacyTransitionObserver.h"
 #include "nsCPrefetchService.h"
 #include "nsJSON.h"
+#include "nsIDocShellTreeItem.h"
+#include "nsIChannel.h"
 #include "IHistory.h"
 #include "mozilla/Services.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/AutoRestore.h"
 #include "mozilla/Attributes.h"
 
 // we want to explore making the document own the load group
@@ -656,16 +658,17 @@ ConvertLoadTypeToNavigationType(uint32_t
     case LOAD_HISTORY:
         result = dom::PerformanceNavigation::TYPE_BACK_FORWARD;
         break;
     case LOAD_RELOAD_NORMAL:
     case LOAD_RELOAD_CHARSET_CHANGE:
     case LOAD_RELOAD_BYPASS_CACHE:
     case LOAD_RELOAD_BYPASS_PROXY:
     case LOAD_RELOAD_BYPASS_PROXY_AND_CACHE:
+    case LOAD_RELOAD_ALLOW_MIXED_CONTENT:
         result = dom::PerformanceNavigation::TYPE_RELOAD;
         break;
     case LOAD_STOP_CONTENT_AND_REPLACE:
     case LOAD_REFRESH:
     case LOAD_BYPASS_HISTORY:
     case LOAD_ERROR_PAGE:
     case LOAD_PUSHSTATE:
         result = dom::PerformanceNavigation::TYPE_RESERVED;
@@ -1140,16 +1143,19 @@ ConvertDocShellLoadInfoToLoadType(nsDocS
         loadType = LOAD_STOP_CONTENT_AND_REPLACE;
         break;
     case nsIDocShellLoadInfo::loadPushState:
         loadType = LOAD_PUSHSTATE;
         break;
     case nsIDocShellLoadInfo::loadReplaceBypassCache:
         loadType = LOAD_REPLACE_BYPASS_CACHE;
         break;
+    case nsIDocShellLoadInfo::loadMixedContent:
+        loadType = LOAD_RELOAD_ALLOW_MIXED_CONTENT;
+        break;
     default:
         NS_NOTREACHED("Unexpected nsDocShellInfoLoadType value");
     }
 
     return loadType;
 }
 
 
@@ -1211,16 +1217,19 @@ nsDocShell::ConvertLoadTypeToDocShellLoa
         docShellLoadType = nsIDocShellLoadInfo::loadStopContentAndReplace;
         break;
     case LOAD_PUSHSTATE:
         docShellLoadType = nsIDocShellLoadInfo::loadPushState;
         break;
     case LOAD_REPLACE_BYPASS_CACHE:
         docShellLoadType = nsIDocShellLoadInfo::loadReplaceBypassCache;
         break;
+    case LOAD_RELOAD_ALLOW_MIXED_CONTENT:
+        docShellLoadType = nsIDocShellLoadInfo::loadMixedContent;
+        break;
     default:
         NS_NOTREACHED("Unexpected load type value");
     }
 
     return docShellLoadType;
 }                                                                               
 
 //*****************************************************************************
@@ -1955,24 +1964,48 @@ nsDocShell::GetChannelIsUnsafe(bool *aUn
     if (!jarChannel) {
         return NS_OK;
     }
 
     return jarChannel->GetIsUnsafe(aUnsafe);
 }
 
 NS_IMETHODIMP
-nsDocShell::GetHasMixedActiveContentLoaded(bool *aHasMixedActiveContentLoaded)
+nsDocShell::GetHasMixedActiveContentLoaded(bool* aHasMixedActiveContentLoaded)
 {
     nsCOMPtr<nsIDocument> doc(do_GetInterface(GetAsSupports(this)));
     *aHasMixedActiveContentLoaded = doc && doc->GetHasMixedActiveContentLoaded();
     return NS_OK;
 }
 
 NS_IMETHODIMP
+nsDocShell::GetHasMixedActiveContentBlocked(bool* aHasMixedActiveContentBlocked)
+{
+    nsCOMPtr<nsIDocument> doc(do_GetInterface(GetAsSupports(this)));
+    *aHasMixedActiveContentBlocked = doc && doc->GetHasMixedActiveContentBlocked();
+    return NS_OK;
+}
+
+NS_IMETHODIMP
+nsDocShell::GetHasMixedDisplayContentLoaded(bool* aHasMixedDisplayContentLoaded)
+{
+    nsCOMPtr<nsIDocument> doc(do_GetInterface(GetAsSupports(this)));
+    *aHasMixedDisplayContentLoaded = doc && doc->GetHasMixedDisplayContentLoaded();
+    return NS_OK;
+}
+
+NS_IMETHODIMP
+nsDocShell::GetHasMixedDisplayContentBlocked(bool* aHasMixedDisplayContentBlocked)
+{
+    nsCOMPtr<nsIDocument> doc(do_GetInterface(GetAsSupports(this)));
+    *aHasMixedDisplayContentBlocked = doc && doc->GetHasMixedDisplayContentBlocked();
+    return NS_OK;
+}
+
+NS_IMETHODIMP
 nsDocShell::GetAllowPlugins(bool * aAllowPlugins)
 {
     NS_ENSURE_ARG_POINTER(aAllowPlugins);
 
     *aAllowPlugins = mAllowPlugins;
     if (!mAllowPlugins) {
         return NS_OK;
     }
@@ -5306,16 +5339,83 @@ nsDocShell::SetSandboxFlags(uint32_t aSa
 NS_IMETHODIMP
 nsDocShell::GetSandboxFlags(uint32_t  *aSandboxFlags)
 {
     *aSandboxFlags = mSandboxFlags;
     return NS_OK;
 }
 
 NS_IMETHODIMP
+nsDocShell::SetMixedContentChannel(nsIChannel* aMixedContentChannel)
+{
+#ifdef DEBUG
+     // if the channel is non-null
+     if (aMixedContentChannel) {
+       // Get the root docshell.
+       nsCOMPtr<nsIDocShellTreeItem> root;
+       GetSameTypeRootTreeItem(getter_AddRefs(root));
+       NS_WARN_IF_FALSE(
+         root.get() == static_cast<nsIDocShellTreeItem *>(this), 
+         "Setting mMixedContentChannel on a docshell that is not the root docshell"
+       );
+    }
+#endif
+     mMixedContentChannel = aMixedContentChannel;
+     return NS_OK;
+}
+
+NS_IMETHODIMP
+nsDocShell::GetMixedContentChannel(nsIChannel **aMixedContentChannel)
+{
+    NS_ENSURE_ARG_POINTER(aMixedContentChannel);
+    NS_IF_ADDREF(*aMixedContentChannel = mMixedContentChannel);
+    return NS_OK;
+}
+
+NS_IMETHODIMP
+nsDocShell::GetAllowMixedContentAndConnectionData(bool* aRootHasSecureConnection, bool* aAllowMixedContent, bool* aIsRootDocShell)
+{
+  *aRootHasSecureConnection = false;
+  *aAllowMixedContent = false;
+  *aIsRootDocShell = false;
+
+  nsCOMPtr<nsIDocShellTreeItem> sameTypeRoot;
+  GetSameTypeRootTreeItem(getter_AddRefs(sameTypeRoot));
+  NS_ASSERTION(sameTypeRoot, "No document shell root tree item from document shell tree item!");
+  *aIsRootDocShell = sameTypeRoot.get() == static_cast<nsIDocShellTreeItem *>(this);
+
+  // now get the document from sameTypeRoot
+  nsCOMPtr<nsIDocument> rootDoc = do_GetInterface(sameTypeRoot);
+  NS_ASSERTION(rootDoc, "No root document from document shell root tree item.");
+
+  nsCOMPtr<nsIPrincipal> rootPrincipal = rootDoc->NodePrincipal();
+  NS_ASSERTION(rootPrincipal, "No root principal from root document");
+
+  // For things with system principal (e.g. scratchpad) there is no uri
+  // aRootHasSecureConnection should remain false.
+  if (!nsContentUtils::IsSystemPrincipal(rootPrincipal)) {
+     nsCOMPtr<nsIURI> rootUri;
+     rootPrincipal->GetURI(getter_AddRefs(rootUri));
+     NS_ASSERTION(rootUri, "No root uri from root principal");
+     nsresult rv = rootUri->SchemeIs("https", aRootHasSecureConnection);
+     NS_ENSURE_SUCCESS(rv, rv);
+  }
+
+  // Check the root doc's channel against the root docShell's mMixedContentChannel to see
+  // if they are the same.  If they are the same, the user has overriden
+  // the block.
+  nsCOMPtr<nsIDocShell> rootDocShell = do_GetInterface(sameTypeRoot);
+  nsCOMPtr<nsIChannel> mixedChannel;
+  rootDocShell->GetMixedContentChannel(getter_AddRefs(mixedChannel));
+  *aAllowMixedContent = mixedChannel && (mixedChannel == rootDoc->GetChannel());
+
+  return NS_OK;
+}
+
+NS_IMETHODIMP
 nsDocShell::SetVisibility(bool aVisibility)
 {
     if (!mContentViewer)
         return NS_OK;
     if (aVisibility) {
         mContentViewer->Show();
     }
     else {
@@ -9323,16 +9423,24 @@ nsDocShell::DoURILoad(nsIURI * aURI,
         rv = channel->SetContentDisposition(nsIChannel::DISPOSITION_ATTACHMENT);
         NS_ENSURE_SUCCESS(rv, rv);
         if (!aFileName.IsEmpty()) {
             rv = channel->SetContentDispositionFilename(aFileName);
             NS_ENSURE_SUCCESS(rv, rv);
         }
     }
 
+    if (mLoadType == LOAD_RELOAD_ALLOW_MIXED_CONTENT) {
+          rv = SetMixedContentChannel(channel);
+          NS_ENSURE_SUCCESS(rv, rv);
+    } else {
+          rv = SetMixedContentChannel(nullptr);
+          NS_ENSURE_SUCCESS(rv, rv);
+    }
+
     //hack
     nsCOMPtr<nsIHttpChannel> httpChannel(do_QueryInterface(channel));
     nsCOMPtr<nsIHttpChannelInternal> httpChannelInternal(do_QueryInterface(channel));
     if (httpChannelInternal) {
       if (aForceAllowCookies) {
         httpChannelInternal->SetForceAllowThirdPartyCookie(true);
       } 
       if (aFirstParty) {
@@ -9590,16 +9698,17 @@ nsresult nsDocShell::DoChannelLoad(nsICh
         break;
 
     case LOAD_NORMAL_BYPASS_CACHE:
     case LOAD_NORMAL_BYPASS_PROXY:
     case LOAD_NORMAL_BYPASS_PROXY_AND_CACHE:
     case LOAD_RELOAD_BYPASS_CACHE:
     case LOAD_RELOAD_BYPASS_PROXY:
     case LOAD_RELOAD_BYPASS_PROXY_AND_CACHE:
+    case LOAD_RELOAD_ALLOW_MIXED_CONTENT:
     case LOAD_REPLACE_BYPASS_CACHE:
         loadFlags |= nsIRequest::LOAD_BYPASS_CACHE |
                      nsIRequest::LOAD_FRESH_CONNECTION;
         break;
 
     case LOAD_NORMAL:
     case LOAD_LINK:
         // Set cache checking flags
@@ -9887,17 +9996,18 @@ nsDocShell::OnNewURI(nsIURI * aURI, nsIC
 
     /* If the user pressed shift-reload, cache will create a new cache key
      * for the page. Save the new cacheKey in Session History. 
      * see bug 90098
      */
     if (aChannel &&
         (aLoadType == LOAD_RELOAD_BYPASS_CACHE ||
          aLoadType == LOAD_RELOAD_BYPASS_PROXY ||
-         aLoadType == LOAD_RELOAD_BYPASS_PROXY_AND_CACHE)) {
+         aLoadType == LOAD_RELOAD_BYPASS_PROXY_AND_CACHE ||
+         aLoadType == LOAD_RELOAD_ALLOW_MIXED_CONTENT)) {
         NS_ASSERTION(!updateSHistory,
                      "We shouldn't be updating session history for forced"
                      " reloads!");
         
         nsCOMPtr<nsICachingChannel> cacheChannel(do_QueryInterface(aChannel));
         nsCOMPtr<nsISupports>  cacheKey;
         // Get the Cache Key and store it in SH.
         if (cacheChannel)
--- a/docshell/base/nsDocShell.h
+++ b/docshell/base/nsDocShell.h
@@ -740,16 +740,20 @@ protected:
 
     // Set in LoadErrorPage from the method argument and used later
     // in CreateContentViewer. We have to delay an shistory entry creation
     // for which these objects are needed.
     nsCOMPtr<nsIURI>           mFailedURI;
     nsCOMPtr<nsIChannel>       mFailedChannel;
     uint32_t                   mFailedLoadType;
 
+    // Set in DoURILoad when the LOAD_RELOAD_ALLOW_MIXED_CONTENT flag is set.
+    // Checked in nsMixedContentBlocker, to see if the channels match.
+    nsCOMPtr<nsIChannel>       mMixedContentChannel;
+
     // WEAK REFERENCES BELOW HERE.
     // Note these are intentionally not addrefd.  Doing so will create a cycle.
     // For that reasons don't use nsCOMPtr.
 
     nsIDocShellTreeOwner *     mTreeOwner; // Weak Reference
     nsIDOMEventTarget *       mChromeEventHandler; //Weak Reference
 
     eCharsetReloadState        mCharsetReloadState;
--- a/docshell/base/nsDocShellLoadTypes.h
+++ b/docshell/base/nsDocShellLoadTypes.h
@@ -23,18 +23,17 @@
 #define LOAD_TYPE_HAS_FLAGS(type, flags) ((type) & ((flags) << 16))
 
 /**
  * These are flags that confuse ConvertLoadTypeToDocShellLoadInfo and should
  * not be passed to MAKE_LOAD_TYPE.  In particular this includes all flags
  * above 0xffff (e.g. LOAD_FLAGS_BYPASS_CLASSIFIER), since MAKE_LOAD_TYPE would
  * just shift them out anyway.
  */
-#define EXTRA_LOAD_FLAGS (LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP | \
-                          LOAD_FLAGS_FIRST_LOAD              | \
+#define EXTRA_LOAD_FLAGS (LOAD_FLAGS_FIRST_LOAD              | \
                           LOAD_FLAGS_ALLOW_POPUPS            | \
                           0xffff0000)
 
 
 
 /* load types are legal combinations of load commands and flags 
  *  
  * NOTE:
@@ -47,16 +46,17 @@ enum LoadType {
     LOAD_NORMAL_EXTERNAL = MAKE_LOAD_TYPE(nsIDocShell::LOAD_CMD_NORMAL, nsIWebNavigation::LOAD_FLAGS_FROM_EXTERNAL),
     LOAD_HISTORY = MAKE_LOAD_TYPE(nsIDocShell::LOAD_CMD_HISTORY, nsIWebNavigation::LOAD_FLAGS_NONE),
     LOAD_NORMAL_BYPASS_CACHE = MAKE_LOAD_TYPE(nsIDocShell::LOAD_CMD_NORMAL, nsIWebNavigation::LOAD_FLAGS_BYPASS_CACHE),
     LOAD_NORMAL_BYPASS_PROXY = MAKE_LOAD_TYPE(nsIDocShell::LOAD_CMD_NORMAL, nsIWebNavigation::LOAD_FLAGS_BYPASS_PROXY),
     LOAD_NORMAL_BYPASS_PROXY_AND_CACHE = MAKE_LOAD_TYPE(nsIDocShell::LOAD_CMD_NORMAL, nsIWebNavigation::LOAD_FLAGS_BYPASS_CACHE | nsIWebNavigation::LOAD_FLAGS_BYPASS_PROXY),
     LOAD_RELOAD_NORMAL = MAKE_LOAD_TYPE(nsIDocShell::LOAD_CMD_RELOAD, nsIWebNavigation::LOAD_FLAGS_NONE),
     LOAD_RELOAD_BYPASS_CACHE = MAKE_LOAD_TYPE(nsIDocShell::LOAD_CMD_RELOAD, nsIWebNavigation::LOAD_FLAGS_BYPASS_CACHE),
     LOAD_RELOAD_BYPASS_PROXY = MAKE_LOAD_TYPE(nsIDocShell::LOAD_CMD_RELOAD, nsIWebNavigation::LOAD_FLAGS_BYPASS_PROXY),
+    LOAD_RELOAD_ALLOW_MIXED_CONTENT = MAKE_LOAD_TYPE(nsIDocShell::LOAD_CMD_RELOAD, nsIWebNavigation::LOAD_FLAGS_ALLOW_MIXED_CONTENT | nsIWebNavigation::LOAD_FLAGS_BYPASS_CACHE),
     LOAD_RELOAD_BYPASS_PROXY_AND_CACHE = MAKE_LOAD_TYPE(nsIDocShell::LOAD_CMD_RELOAD, nsIWebNavigation::LOAD_FLAGS_BYPASS_CACHE | nsIWebNavigation::LOAD_FLAGS_BYPASS_PROXY),
     LOAD_LINK = MAKE_LOAD_TYPE(nsIDocShell::LOAD_CMD_NORMAL, nsIWebNavigation::LOAD_FLAGS_IS_LINK),
     LOAD_REFRESH = MAKE_LOAD_TYPE(nsIDocShell::LOAD_CMD_NORMAL, nsIWebNavigation::LOAD_FLAGS_IS_REFRESH),
     LOAD_RELOAD_CHARSET_CHANGE = MAKE_LOAD_TYPE(nsIDocShell::LOAD_CMD_RELOAD, nsIWebNavigation::LOAD_FLAGS_CHARSET_CHANGE),
     LOAD_BYPASS_HISTORY = MAKE_LOAD_TYPE(nsIDocShell::LOAD_CMD_NORMAL, nsIWebNavigation::LOAD_FLAGS_BYPASS_HISTORY),
     LOAD_STOP_CONTENT = MAKE_LOAD_TYPE(nsIDocShell::LOAD_CMD_NORMAL, nsIWebNavigation::LOAD_FLAGS_STOP_CONTENT),
     LOAD_STOP_CONTENT_AND_REPLACE = MAKE_LOAD_TYPE(nsIDocShell::LOAD_CMD_NORMAL, nsIWebNavigation::LOAD_FLAGS_STOP_CONTENT | nsIWebNavigation::LOAD_FLAGS_REPLACE_HISTORY),
     LOAD_PUSHSTATE = MAKE_LOAD_TYPE(nsIDocShell::LOAD_CMD_PUSHSTATE, nsIWebNavigation::LOAD_FLAGS_NONE),
@@ -80,16 +80,17 @@ static inline bool IsValidLoadType(uint3
     case LOAD_NORMAL_BYPASS_CACHE:
     case LOAD_NORMAL_BYPASS_PROXY:
     case LOAD_NORMAL_BYPASS_PROXY_AND_CACHE:
     case LOAD_HISTORY:
     case LOAD_RELOAD_NORMAL:
     case LOAD_RELOAD_BYPASS_CACHE:
     case LOAD_RELOAD_BYPASS_PROXY:
     case LOAD_RELOAD_BYPASS_PROXY_AND_CACHE:
+    case LOAD_RELOAD_ALLOW_MIXED_CONTENT:
     case LOAD_LINK:
     case LOAD_REFRESH:
     case LOAD_RELOAD_CHARSET_CHANGE:
     case LOAD_BYPASS_HISTORY:
     case LOAD_STOP_CONTENT:
     case LOAD_STOP_CONTENT_AND_REPLACE:
     case LOAD_PUSHSTATE:
     case LOAD_REPLACE_BYPASS_CACHE:
--- a/docshell/base/nsIDocShell.idl
+++ b/docshell/base/nsIDocShell.idl
@@ -34,17 +34,17 @@ interface nsISHEntry;
 interface nsILayoutHistoryState;
 interface nsISecureBrowserUI;
 interface nsIDOMStorage;
 interface nsIPrincipal;
 interface nsIWebBrowserPrint;
 interface nsIVariant;
 interface nsIPrivacyTransitionObserver;
 
-[scriptable, builtinclass, uuid(ca15d803-1330-4154-b3f9-063fb2b443e7)]
+[scriptable, builtinclass, uuid(5ea80008-a166-4692-8a7e-39690dd192c6)]
 interface nsIDocShell : nsISupports
 {
   /**
    * Loads a given URI.  This will give priority to loading the requested URI
    * in the object implementing	this interface.  If it can't be loaded here
    * however, the URL dispatcher will go through its normal process of content
    * loading.
    *
@@ -462,24 +462,51 @@ interface nsIDocShell : nsISupports
    * (such as a JAR channel where the server-returned content type isn't a
    * known JAR type).
    */
   readonly attribute boolean channelIsUnsafe;
 
   /**
    * This attribute determines whether Mixed Active Content is loaded on the
    * document. When it is true, mixed active content was not blocked and has
-   * loaded on the page. When it is false, mixed active content has not loaded on
-   * the page, either because there was no mixed active content requests on the page
-   * or such requests were blocked by nsMixedContentBlocker.
+   * loaded (or is about to load) on the page. When it is false, mixed active content
+   * has not loaded on the page, either because there was no mixed active content
+   * requests on the page or such requests were blocked by nsMixedContentBlocker.
    * This boolean is set to true in nsMixedContentBlocker if Mixed Active Content
    * is allowed (either explicitly on the page by the user or when the about:config
    * setting security.mixed_content.block_active_content is set to false).
    */
-  readonly attribute boolean hasMixedActiveContentLoaded;
+  [infallible] readonly attribute boolean hasMixedActiveContentLoaded;
+
+   /**
+   * This attribute determines whether a document has Mixed Active Content
+   * that has been blocked from loading. When it is true, there is definitely
+   * mixed active content on a page that has been blocked by
+   * nsMixedContentBlocker.  When it is false, there may or may not be mixed
+   * active content on a page, but if there is, it will load. Note that if the
+   * about:config setting security.mixed_content.block_active_content is set
+   * false, this boolean will be false, since blocking active content has been
+   * disabled.
+   */
+  [infallible] readonly attribute boolean hasMixedActiveContentBlocked;
+
+  /**
+   * This attribute determines whether Mixed Display Content is loaded on the
+   * document. When it is true, mixed display content was not blocked and has
+   * loaded (or is about to load) on the page. Similar behavior to
+   * hasMixedActiveContentLoaded.
+   */
+  [infallible] readonly attribute boolean hasMixedDisplayContentLoaded;
+
+   /**
+   * This attribute determines whether a document has Mixed Display Content
+   * that has been blocked from loading. Similar behavior to
+   * hasMixedActiveContentBlocked.
+   */
+  [infallible] readonly attribute boolean hasMixedDisplayContentBlocked;
 
   /**
    * Disconnects this docshell's editor from its window, and stores the
    * editor data in the open document's session history entry.  This
    * should be called only during page transitions.
    */
   [noscript, notxpcom] void DetachEditorFromWindow();
 
@@ -699,16 +726,45 @@ interface nsIDocShell : nsISupports
    * loaded.
    * The sandbox flags of a document depend on the sandbox flags on its
    * docshell and of its parent document, if any.
    * See nsSandboxFlags.h for the possible flags.
    */
   attribute unsigned long sandboxFlags;
 
   /**
+   * This member variable determines whether a document has Mixed Active Content that
+   * was initially blocked from loading, but the user has choosen to override the
+   * block and allow the content to load. mMixedContentChannel is set to the document's
+   * channel when the user allows mixed content. The nsMixedContentBlocker content policy
+   * checks if the document's root channel matches the mMixedContentChannel.  If it matches,
+   * then Mixed Content is loaded.  If it does match, mixed content is blocked.
+   *
+   * A match implies that there is definitely mixed active content on a page that was
+   * initially blocked by nsMixedContentBlocker and then allowed and loaded by the user.
+   * A miss imples that IF there is mixed active content on the page AND it was
+   * blocked by nsMixedContentBlocker.cpp, the user has not choosen to override
+   * the block. Note that if the about:config setting
+   * security.mixed_content.block_active_content is set to false, this boolean
+   * will be false, mMixedContentChannel will remain null since blocking active content has
+   * been disabled and hence mMixedContentChannel will never be set.
+   */
+  attribute nsIChannel mixedContentChannel;
+
+  /**
+   * Checks whether the channel associated with the root docShell is equal to
+   * mMixedContentChannel. If they are the same, allowMixedContent is set to true.
+   * Checks if the root document has a secure connection. If it is, sets 
+   * rootHasSecureConnection to true. If the docShell is the root doc shell, 
+   * isRootDocShell is set to true. 
+   */
+  void GetAllowMixedContentAndConnectionData(out boolean rootHasSecureConnection, out boolean allowMixedContent, out boolean isRootDocShell);
+
+
+  /**
    * Are plugins allowed in the current document loaded in this docshell ?
    * (if there is one). This depends on whether plugins are allowed by this
    * docshell itself or if the document is sandboxed and hence plugins should
    * not be allowed.
    */
   [noscript, notxpcom] bool pluginsAllowedInCurrentDoc();
   
 
--- a/docshell/base/nsIDocShellLoadInfo.idl
+++ b/docshell/base/nsIDocShellLoadInfo.idl
@@ -12,17 +12,17 @@
  */
  
 interface nsIURI;
 interface nsIInputStream;
 interface nsISHEntry;
 
 typedef long nsDocShellInfoLoadType;
 
-[scriptable, uuid(92a0a637-373e-4647-9476-ead11e005c75)]
+[scriptable, uuid(5b041ea4-6655-434c-b3d3-cbbc9441f86a)]
 interface nsIDocShellLoadInfo : nsISupports
 {
     /** This is the referrer for the load. */
     attribute nsIURI referrer;
 
     /** The owner of the load, that is, the entity responsible for 
      *  causing the load to occur. This should be a nsIPrincipal typically.
      */
@@ -56,16 +56,17 @@ interface nsIDocShellLoadInfo : nsISuppo
     const long loadStopContent = 11;
     const long loadStopContentAndReplace = 12;
     const long loadNormalExternal = 13;
     const long loadNormalBypassCache = 14;
     const long loadNormalBypassProxy = 15;
     const long loadNormalBypassProxyAndCache = 16;
     const long loadPushState = 17;                 // history.pushState or replaceState
     const long loadReplaceBypassCache = 18;
+    const long loadMixedContent = 19;
 
     /** Contains a load type as specified by the load* constants */
     attribute nsDocShellInfoLoadType loadType;
 
     /** SHEntry for this page */
     attribute nsISHEntry SHEntry;
 
     /** Target for load, like _content, _blank etc. */
--- a/docshell/base/nsIWebNavigation.idl
+++ b/docshell/base/nsIWebNavigation.idl
@@ -11,17 +11,17 @@ interface nsISHistory;
 interface nsIURI;
 
 /**
  * The nsIWebNavigation interface defines an interface for navigating the web.
  * It provides methods and attributes to direct an object to navigate to a new
  * location, stop or restart an in process load, or determine where the object
  * has previously gone.
  */
-[scriptable, uuid(F5D9E7B0-D930-11d3-B057-00A024FFC08C)]
+[scriptable, uuid(28404f7e-0f17-4dc3-a21a-2074d8659b02)]
 interface nsIWebNavigation : nsISupports
 {
   /**
    * Indicates if the object can go back.  If true this indicates that
    * there is back session history available for navigation.
    */
   readonly attribute boolean canGoBack;
 
@@ -140,23 +140,22 @@ interface nsIWebNavigation : nsISupports
    * STOP_CONTENT flag to Stop(), in addition to the STOP_NETWORK flag.
    */
   const unsigned long LOAD_FLAGS_STOP_CONTENT    = 0x0800;
 
   /**
    * A hint this load was prompted by an external program: take care!
    */
   const unsigned long LOAD_FLAGS_FROM_EXTERNAL   = 0x1000;
-  
+
   /**
-   * This flag specifies that the URI may be submitted to a third-party
-   * server for correction. This should only be applied to non-sensitive
-   * URIs entered by users.  This flag must not be passed to Reload.
-   */
-  const unsigned long LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP = 0x2000;
+    This flag is set when a user explicitly disables the Mixed Content
+    Blocker, and allows Mixed Content to load on an https page.
+  */
+  const unsigned long LOAD_FLAGS_ALLOW_MIXED_CONTENT = 0x2000;
 
   /**
    * This flag specifies that this is the first load in this object.
    * Set with care, since setting incorrectly can cause us to assume that
    * nothing was actually loaded in this object if the load ends up being 
    * handled by an external application.  This flag must not be passed to
    * Reload.
    */
@@ -186,16 +185,23 @@ interface nsIWebNavigation : nsISupports
   const unsigned long LOAD_FLAGS_DISALLOW_INHERIT_OWNER = 0x40000;
 
   /**
    * Assume the URI is encoded in UTF-8.
    */
   const unsigned long LOAD_FLAGS_URI_IS_UTF8 = 0x80000;
 
   /**
+   * This flag specifies that the URI may be submitted to a third-party
+   * server for correction. This should only be applied to non-sensitive
+   * URIs entered by users.  This flag must not be passed to Reload.
+   */
+  const unsigned long LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP = 0x100000;
+
+  /**
    * Loads a given URI.  This will give priority to loading the requested URI
    * in the object implementing	this interface.  If it can't be loaded here
    * however, the URI dispatcher will go through its normal process of content
    * loading.
    *
    * @param aURI
    *        The URI string to load.  For HTTP and FTP URLs and possibly others,
    *        characters above U+007F will be converted to UTF-8 and then URL-
--- a/docshell/shistory/src/nsSHistory.cpp
+++ b/docshell/shistory/src/nsSHistory.cpp
@@ -869,21 +869,25 @@ nsSHistory::Reload(uint32_t aReloadFlags
   else if (aReloadFlags & nsIWebNavigation::LOAD_FLAGS_BYPASS_CACHE)
   {
     loadType = nsIDocShellLoadInfo::loadReloadBypassCache;
   }
   else if (aReloadFlags & nsIWebNavigation::LOAD_FLAGS_CHARSET_CHANGE)
   {
     loadType = nsIDocShellLoadInfo::loadReloadCharsetChange;
   }
+  else if (aReloadFlags & nsIWebNavigation::LOAD_FLAGS_ALLOW_MIXED_CONTENT)
+  {
+    loadType = nsIDocShellLoadInfo::loadMixedContent;
+  }
   else
   {
     loadType = nsIDocShellLoadInfo::loadReloadNormal;
   }
-  
+
   // We are reloading. Send Reload notifications.
   // nsDocShellLoadFlagType is not public, where as nsIWebNavigation
   // is public. So send the reload notifications with the
   // nsIWebNavigation flags.
   bool canNavigate = true;
   nsCOMPtr<nsIURI> currentURI;
   rv = GetCurrentURI(getter_AddRefs(currentURI));
   NOTIFY_LISTENERS_CANCELABLE(OnHistoryReload, canNavigate,
--- a/dom/base/nsJSEnvironment.cpp
+++ b/dom/base/nsJSEnvironment.cpp
@@ -144,16 +144,18 @@ static nsITimer *sInterSliceGCTimer;
 static PRTime sLastCCEndTime;
 
 static bool sCCLockedOut;
 static PRTime sCCLockedOutTime;
 
 static JS::GCSliceCallback sPrevGCSliceCallback;
 static js::AnalysisPurgeCallback sPrevAnalysisPurgeCallback;
 
+static bool sHasRunGC;
+
 // The number of currently pending document loads. This count isn't
 // guaranteed to always reflect reality and can't easily as we don't
 // have an easy place to know when a load ends or is interrupted in
 // all cases. This counter also gets reset if we end up GC'ing while
 // we're waiting for a slow page to load. IOW, this count may be 0
 // even when there are pending loads.
 static uint32_t sPendingLoadCount;
 static bool sLoadingInProgress;
@@ -3075,17 +3077,17 @@ nsJSContext::PokeShrinkGCBuffers()
                                               NS_SHRINK_GC_BUFFERS_DELAY,
                                               nsITimer::TYPE_ONE_SHOT);
 }
 
 // static
 void
 nsJSContext::MaybePokeCC()
 {
-  if (sCCTimer || sShuttingDown) {
+  if (sCCTimer || sShuttingDown || !sHasRunGC) {
     return;
   }
 
   if (ShouldTriggerCC(nsCycleCollector_suspectedCount())) {
     sCCTimerFireCount = 0;
     CallCreateInstance("@mozilla.org/timer;1", &sCCTimer);
     if (!sCCTimer) {
       return;
@@ -3234,16 +3236,17 @@ DOMGCSliceCallback(JSRuntime *aRt, JS::G
 
   if (aProgress == JS::GC_CYCLE_END) {
     // May need to kill the inter-slice GC timer
     nsJSContext::KillInterSliceGCTimer();
 
     sCCollectedWaitingForGC = 0;
     sCleanupsSinceLastGC = 0;
     sNeedsFullCC = true;
+    sHasRunGC = true;
     nsJSContext::MaybePokeCC();
 
     if (aDesc.isCompartment) {
       ++sCompartmentGCCount;
       if (!sFullGCTimer && !sShuttingDown) {
         CallCreateInstance("@mozilla.org/timer;1", &sFullGCTimer);
         JS::gcreason::Reason reason = JS::gcreason::FULL_GC_TIMER;
         sFullGCTimer->InitWithFuncCallback(FullGCTimerFired,
@@ -3353,16 +3356,17 @@ nsJSRuntime::CreateContext(bool aGCOnDes
 void
 nsJSRuntime::Startup()
 {
   // initialize all our statics, so that we can restart XPCOM
   sGCTimer = sFullGCTimer = sCCTimer = nullptr;
   sCCLockedOut = false;
   sCCLockedOutTime = 0;
   sLastCCEndTime = 0;
+  sHasRunGC = false;
   sPendingLoadCount = 0;
   sLoadingInProgress = false;
   sCCollectedWaitingForGC = 0;
   sPostGCEventsToConsole = false;
   sDisableExplicitCompartmentGC = false;
   sNeedsFullCC = false;
   gNameSpaceManager = nullptr;
   sRuntimeService = nullptr;
--- a/dom/camera/CameraControlImpl.cpp
+++ b/dom/camera/CameraControlImpl.cpp
@@ -415,13 +415,13 @@ GetPreviewStreamResult::Run()
    * The camera preview stream object is DOM-facing, and as such
    * must be a cycle-collection participant created on the main
    * thread.
    */
   MOZ_ASSERT(NS_IsMainThread());
 
   nsCOMPtr<nsICameraPreviewStreamCallback> onSuccess = mOnSuccessCb.get();
   if (onSuccess && nsDOMCameraManager::IsWindowStillActive(mWindowId)) {
-    nsCOMPtr<nsIDOMMediaStream> stream = new DOMCameraPreview(mCameraControl, mWidth, mHeight, mFramesPerSecond);
+    nsCOMPtr<nsIDOMMediaStream> stream = new DOMCameraPreview(mCameraControl, mWidth, mHeight, mWindowId, mFramesPerSecond);
     onSuccess->HandleEvent(stream);
   }
   return NS_OK;
 }
--- a/dom/camera/DOMCameraPreview.cpp
+++ b/dom/camera/DOMCameraPreview.cpp
@@ -2,16 +2,18 @@
  * 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 "base/basictypes.h"
 #include "Layers.h"
 #include "VideoUtils.h"
 #include "DOMCameraPreview.h"
 #include "CameraCommon.h"
+#include "nsGlobalWindow.h"
+#include "nsPIDOMWindow.h"
 
 using namespace mozilla;
 using namespace mozilla::layers;
 
 /**
  * 'PreviewControl' is a helper class that dispatches preview control
  * events from the main thread.
  *
@@ -133,17 +135,17 @@ public:
     }
   }
 
 protected:
   // Raw pointer; if we exist, 'mDOMPreview' exists as well
   DOMCameraPreview* mDOMPreview;
 };
 
-DOMCameraPreview::DOMCameraPreview(ICameraControl* aCameraControl, uint32_t aWidth, uint32_t aHeight, uint32_t aFrameRate)
+DOMCameraPreview::DOMCameraPreview(ICameraControl* aCameraControl, uint32_t aWidth, uint32_t aHeight, uint64_t aWindowId, uint32_t aFrameRate)
   : nsDOMMediaStream()
   , mState(STOPPED)
   , mWidth(aWidth)
   , mHeight(aHeight)
   , mFramesPerSecond(aFrameRate)
   , mFrameCount(0)
   , mCameraControl(aCameraControl)
 {
@@ -154,16 +156,22 @@ DOMCameraPreview::DOMCameraPreview(ICame
   mStream = gm->CreateSourceStream(this);
   mInput = GetStream()->AsSourceStream();
 
   mListener = new DOMCameraPreviewListener(this);
   mInput->AddListener(mListener);
 
   mInput->AddTrack(TRACK_VIDEO, mFramesPerSecond, 0, new VideoSegment());
   mInput->AdvanceKnownTracksTime(MEDIA_TIME_MAX);
+
+  nsPIDOMWindow *window = static_cast<nsPIDOMWindow*>
+     (nsGlobalWindow::GetInnerWindowWithId(aWindowId));
+  if (window && window->GetExtantDoc()) {
+    this->CombineWithPrincipal(window->GetExtantDoc()->NodePrincipal());
+  }
 }
 
 DOMCameraPreview::~DOMCameraPreview()
 {
   DOM_CAMERA_LOGT("%s:%d : this=%p, mListener=%p\n", __func__, __LINE__, this, mListener);
   mInput->RemoveListener(mListener);
 }
 
--- a/dom/camera/DOMCameraPreview.h
+++ b/dom/camera/DOMCameraPreview.h
@@ -21,17 +21,17 @@ typedef void (*FrameBuilder)(mozilla::la
  * which is a cycle-collection participant already.
  */
 class DOMCameraPreview : public nsDOMMediaStream
 {
 protected:
   enum { TRACK_VIDEO = 1 };
 
 public:
-  DOMCameraPreview(ICameraControl* aCameraControl, uint32_t aWidth, uint32_t aHeight, uint32_t aFramesPerSecond = 30);
+  DOMCameraPreview(ICameraControl* aCameraControl, uint32_t aWidth, uint32_t aHeight, uint64_t aWindowId, uint32_t aFramesPerSecond = 30);
   bool ReceiveFrame(void* aBuffer, ImageFormat aFormat, mozilla::FrameBuilder aBuilder);
   bool HaveEnoughBuffered();
 
   NS_IMETHODIMP
   GetCurrentTime(double* aCurrentTime) {
     return nsDOMMediaStream::GetCurrentTime(aCurrentTime);
   }
 
--- a/dom/media/MediaManager.cpp
+++ b/dom/media/MediaManager.cpp
@@ -6,18 +6,16 @@
 
 #include "MediaStreamGraph.h"
 #include "nsIDOMFile.h"
 #include "nsIEventTarget.h"
 #include "nsIUUIDGenerator.h"
 #include "nsIScriptGlobalObject.h"
 #include "nsIPopupWindowManager.h"
 #include "nsISupportsArray.h"
-#include "nsIPrefService.h"
-#include "nsIPrefBranch.h"
 
 // For PR_snprintf
 #include "prprf.h"
 
 #include "nsJSUtils.h"
 #include "nsDOMFile.h"
 #include "nsGlobalWindow.h"
 
@@ -379,43 +377,16 @@ public:
     // Dispatch to the media thread to ask it to start the sources,
     // because that can take a while
     nsIThread *mediaThread = MediaManager::GetThread();
     nsRefPtr<MediaOperationRunnable> runnable(
       new MediaOperationRunnable(MEDIA_START, mListener,
                                  mAudioSource, mVideoSource, false));
     mediaThread->Dispatch(runnable, NS_DISPATCH_NORMAL);
 
-#ifdef MOZ_WEBRTC
-    // Right now these configs are only of use if webrtc is available
-    nsresult rv;
-    nsCOMPtr<nsIPrefService> prefs = do_GetService("@mozilla.org/preferences-service;1", &rv);
-    if (NS_SUCCEEDED(rv)) {
-      nsCOMPtr<nsIPrefBranch> branch = do_QueryInterface(prefs);
-
-      if (branch) {
-        int32_t aec = (int32_t) webrtc::kEcUnchanged;
-        int32_t agc = (int32_t) webrtc::kAgcUnchanged;
-        int32_t noise = (int32_t) webrtc::kNsUnchanged;
-        bool aec_on = false, agc_on = false, noise_on = false;
-
-        branch->GetBoolPref("media.peerconnection.aec_enabled", &aec_on);
-        branch->GetIntPref("media.peerconnection.aec", &aec);
-        branch->GetBoolPref("media.peerconnection.agc_enabled", &agc_on);
-        branch->GetIntPref("media.peerconnection.agc", &agc);
-        branch->GetBoolPref("media.peerconnection.noise_enabled", &noise_on);
-        branch->GetIntPref("media.peerconnection.noise", &noise);
-
-        mListener->AudioConfig(aec_on, (uint32_t) aec,
-                               agc_on, (uint32_t) agc,
-                               noise_on, (uint32_t) noise);
-      }
-    }
-#endif
-
     // We're in the main thread, so no worries here either.
     nsCOMPtr<nsIDOMGetUserMediaSuccessCallback> success(mSuccess);
     nsCOMPtr<nsIDOMGetUserMediaErrorCallback> error(mError);
 
     if (!(mManager->IsWindowStillActive(mWindowID))) {
       return NS_OK;
     }
     // This is safe since we're on main-thread, and the windowlist can only
--- a/dom/media/MediaManager.h
+++ b/dom/media/MediaManager.h
@@ -16,20 +16,16 @@
 
 #include "nsPIDOMWindow.h"
 #include "nsIDOMNavigatorUserMedia.h"
 #include "nsXULAppAPI.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/StaticPtr.h"
 #include "prlog.h"
 
-#ifdef MOZ_WEBRTC
-#include "mtransport/runnable_utils.h"
-#endif
-
 namespace mozilla {
 
 #ifdef PR_LOGGING
 extern PRLogModuleInfo* GetMediaManagerLog();
 #define MM_LOG(msg) PR_LOG(GetMediaManagerLog(), PR_LOG_DEBUG, msg)
 #else
 #define MM_LOG(msg)
 #endif
@@ -128,33 +124,16 @@ public:
     return mStream->AsSourceStream();
   }
 
   // implement in .cpp to avoid circular dependency with MediaOperationRunnable
   // Can be invoked from EITHER MainThread or MSG thread
   void Invalidate();
 
   void
-  AudioConfig(bool aEchoOn, uint32_t aEcho,
-              bool aAgcOn, uint32_t aAGC,
-              bool aNoiseOn, uint32_t aNoise)
-  {
-    if (mAudioSource) {
-#ifdef MOZ_WEBRTC
-      // Right now these configs are only of use if webrtc is available
-      RUN_ON_THREAD(mMediaThread,
-                    WrapRunnable(nsRefPtr<MediaEngineSource>(mAudioSource), // threadsafe
-                                 &MediaEngineSource::Config,
-                                 aEchoOn, aEcho, aAgcOn, aAGC, aNoiseOn, aNoise),
-                    NS_DISPATCH_NORMAL);
-#endif
-    }
-  }
-
-  void
   Remove()
   {
     NS_ASSERTION(NS_IsMainThread(), "Only call on main thread");
     // allow calling even if inactive (!mStream) for easier cleanup
     // Caller holds strong reference to us, so no death grip required
     MutexAutoLock lock(mLock); // protect access to mRemoved
     if (mStream && !mRemoved) {
       MM_LOG(("Listener removed on purpose, mFinished = %d", (int) mFinished));
--- a/media/mtransport/build/Makefile.in
+++ b/media/mtransport/build/Makefile.in
@@ -32,17 +32,16 @@ EXPORTS_mtransport = \
   ../transportlayer.h \
   ../transportlayerdtls.h \
   ../transportlayerice.h \
   ../transportlayerlog.h \
   ../transportlayerloopback.h \
   ../transportlayerprsock.h \
   ../m_cpp_utils.h \
   ../runnable_utils.h \
-  ../runnable_utils_generated.h \
   ../sigslot.h \
   $(NULL)
 
 CPPSRCS = \
 	$(MTRANSPORT_LCPPSRCS) \
 	$(NULL)
 
 include $(srcdir)/../objs.mk
--- a/media/webrtc/signaling/src/media-conduit/AudioConduit.cpp
+++ b/media/webrtc/signaling/src/media-conduit/AudioConduit.cpp
@@ -1,159 +1,116 @@
 /* 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 "AudioConduit.h"
-#include "nsCOMPtr.h"
-#include "mozilla/Services.h"
-#include "nsServiceManagerUtils.h"
-#include "nsIPrefService.h"
-#include "nsIPrefBranch.h"
-#include "nsThreadUtils.h"
-
 #include "CSFLog.h"
 #include "voice_engine/include/voe_errors.h"
 
 
 namespace mozilla {
 
 static const char* logTag ="WebrtcAudioSessionConduit";
 
 // 32 bytes is what WebRTC CodecInst expects
 const unsigned int WebrtcAudioConduit::CODEC_PLNAME_SIZE = 32;
 
 /**
  * Factory Method for AudioConduit
  */
-mozilla::RefPtr<AudioSessionConduit> AudioSessionConduit::Create(AudioSessionConduit *aOther)
+mozilla::RefPtr<AudioSessionConduit> AudioSessionConduit::Create()
 {
   CSFLogDebug(logTag,  "%s ", __FUNCTION__);
-  NS_ASSERTION(NS_IsMainThread(), "Only call on main thread");
-
   WebrtcAudioConduit* obj = new WebrtcAudioConduit();
-  if(obj->Init(static_cast<WebrtcAudioConduit*>(aOther)) != kMediaConduitNoError)
+  if(obj->Init() != kMediaConduitNoError)
   {
     CSFLogError(logTag,  "%s AudioConduit Init Failed ", __FUNCTION__);
     delete obj;
     return NULL;
   }
   CSFLogDebug(logTag,  "%s Successfully created AudioConduit ", __FUNCTION__);
   return obj;
 }
 
 /**
  * Destruction defines for our super-classes
  */
 WebrtcAudioConduit::~WebrtcAudioConduit()
 {
-  NS_ASSERTION(NS_IsMainThread(), "Only call on main thread");
-
   CSFLogDebug(logTag,  "%s ", __FUNCTION__);
   for(std::vector<AudioCodecConfig*>::size_type i=0;i < mRecvCodecList.size();i++)
   {
     delete mRecvCodecList[i];
   }
 
   delete mCurSendCodecConfig;
 
-  // The first one of a pair to be deleted shuts down media for both
   if(mPtrVoEXmedia)
   {
-    if (!mShutDown) {
-      mPtrVoEXmedia->SetExternalRecordingStatus(false);
-      mPtrVoEXmedia->SetExternalPlayoutStatus(false);
-    }
+    mPtrVoEXmedia->SetExternalRecordingStatus(false);
+    mPtrVoEXmedia->SetExternalPlayoutStatus(false);
     mPtrVoEXmedia->Release();
   }
 
-  if(mPtrVoEProcessing)
-  {
-    mPtrVoEProcessing->Release();
-  }
-
   //Deal with the transport
   if(mPtrVoENetwork)
   {
-    if (!mShutDown) {
-      mPtrVoENetwork->DeRegisterExternalTransport(mChannel);
-    }
+    mPtrVoENetwork->DeRegisterExternalTransport(mChannel);
     mPtrVoENetwork->Release();
   }
 
   if(mPtrVoECodec)
   {
     mPtrVoECodec->Release();
   }
 
   if(mPtrVoEBase)
   {
-    if (!mShutDown) {
-      mPtrVoEBase->StopPlayout(mChannel);
-      mPtrVoEBase->StopSend(mChannel);
-      mPtrVoEBase->StopReceive(mChannel);
-      mPtrVoEBase->DeleteChannel(mChannel);
-      mPtrVoEBase->Terminate();
-    }
+    mPtrVoEBase->StopPlayout(mChannel);
+    mPtrVoEBase->StopSend(mChannel);
+    mPtrVoEBase->StopReceive(mChannel);
+    mPtrVoEBase->DeleteChannel(mChannel);
+    mPtrVoEBase->Terminate();
     mPtrVoEBase->Release();
   }
 
-  if (mOtherDirection)
+  if(mVoiceEngine)
   {
-    // mOtherDirection owns these now!
-    mOtherDirection->mOtherDirection = NULL;
-    // let other side we terminated the channel
-    mOtherDirection->mShutDown = true;
-    mVoiceEngine = nullptr;
-  } else {
-    // only one opener can call Delete.  Have it be the last to close.
-    if(mVoiceEngine)
-    {
-      webrtc::VoiceEngine::Delete(mVoiceEngine);
-    }
+    webrtc::VoiceEngine::Delete(mVoiceEngine);
   }
 }
 
 /*
  * WebRTCAudioConduit Implementation
  */
-MediaConduitErrorCode WebrtcAudioConduit::Init(WebrtcAudioConduit *other)
+MediaConduitErrorCode WebrtcAudioConduit::Init()
 {
-  CSFLogDebug(logTag,  "%s this=%p other=%p", __FUNCTION__, this, other);
+  CSFLogDebug(logTag,  "%s ", __FUNCTION__);
 
-  if (other) {
-    MOZ_ASSERT(!other->mOtherDirection);
-    other->mOtherDirection = this;
-    mOtherDirection = other;
+  //Per WebRTC APIs below function calls return NULL on failure
+  if(!(mVoiceEngine = webrtc::VoiceEngine::Create()))
+  {
+    CSFLogError(logTag, "%s Unable to create voice engine", __FUNCTION__);
+    return kMediaConduitSessionNotInited;
+  }
 
-    // only one can call ::Create()/GetVoiceEngine()
-    MOZ_ASSERT(other->mVoiceEngine);
-    mVoiceEngine = other->mVoiceEngine;
-  } else {
-    //Per WebRTC APIs below function calls return NULL on failure
-    if(!(mVoiceEngine = webrtc::VoiceEngine::Create()))
-    {
-      CSFLogError(logTag, "%s Unable to create voice engine", __FUNCTION__);
-      return kMediaConduitSessionNotInited;
-    }
+  PRLogModuleInfo *logs = GetWebRTCLogInfo();
+  if (!gWebrtcTraceLoggingOn && logs && logs->level > 0) {
+    // no need to a critical section or lock here
+    gWebrtcTraceLoggingOn = 1;
 
-    PRLogModuleInfo *logs = GetWebRTCLogInfo();
-    if (!gWebrtcTraceLoggingOn && logs && logs->level > 0) {
-      // no need to a critical section or lock here
-      gWebrtcTraceLoggingOn = 1;
-
-      const char *file = PR_GetEnv("WEBRTC_TRACE_FILE");
-      if (!file) {
-        file = "WebRTC.log";
-      }
-      CSFLogDebug(logTag,  "%s Logging webrtc to %s level %d", __FUNCTION__,
-                  file, logs->level);
-      mVoiceEngine->SetTraceFilter(logs->level);
-      mVoiceEngine->SetTraceFile(file);
+    const char *file = PR_GetEnv("WEBRTC_TRACE_FILE");
+    if (!file) {
+      file = "WebRTC.log";
     }
+    CSFLogDebug(logTag,  "%s Logging webrtc to %s level %d", __FUNCTION__,
+                file, logs->level);
+    mVoiceEngine->SetTraceFilter(logs->level);
+    mVoiceEngine->SetTraceFile(file);
   }
 
   if(!(mPtrVoEBase = VoEBase::GetInterface(mVoiceEngine)))
   {
     CSFLogError(logTag, "%s Unable to initialize VoEBase", __FUNCTION__);
     return kMediaConduitSessionNotInited;
   }
 
@@ -164,70 +121,61 @@ MediaConduitErrorCode WebrtcAudioConduit
   }
 
   if(!(mPtrVoECodec = VoECodec::GetInterface(mVoiceEngine)))
   {
     CSFLogError(logTag, "%s Unable to initialize VoEBCodec", __FUNCTION__);
     return kMediaConduitSessionNotInited;
   }
 
-  if(!(mPtrVoEProcessing = VoEAudioProcessing::GetInterface(mVoiceEngine)))
-  {
-    CSFLogError(logTag, "%s Unable to initialize VoEProcessing", __FUNCTION__);
-    return kMediaConduitSessionNotInited;
-  }
-
   if(!(mPtrVoEXmedia = VoEExternalMedia::GetInterface(mVoiceEngine)))
   {
     CSFLogError(logTag, "%s Unable to initialize VoEExternalMedia", __FUNCTION__);
     return kMediaConduitSessionNotInited;
   }
 
-  if (other) {
-    mChannel = other->mChannel;
-  } else {
-    // init the engine with our audio device layer
-    if(mPtrVoEBase->Init() == -1)
-    {
-      CSFLogError(logTag, "%s VoiceEngine Base Not Initialized", __FUNCTION__);
-      return kMediaConduitSessionNotInited;
-    }
+  // init the engine with our audio device layer
+  if(mPtrVoEBase->Init() == -1)
+  {
+    CSFLogError(logTag, "%s VoiceEngine Base Not Initialized", __FUNCTION__);
+    return kMediaConduitSessionNotInited;
+  }
 
-    if( (mChannel = mPtrVoEBase->CreateChannel()) == -1)
-    {
-      CSFLogError(logTag, "%s VoiceEngine Channel creation failed",__FUNCTION__);
-      return kMediaConduitChannelError;
-    }
+  if( (mChannel = mPtrVoEBase->CreateChannel()) == -1)
+  {
+    CSFLogError(logTag, "%s VoiceEngine Channel creation failed",__FUNCTION__);
+    return kMediaConduitChannelError;
+  }
 
-    CSFLogDebug(logTag, "%s Channel Created %d ",__FUNCTION__, mChannel);
+  CSFLogDebug(logTag, "%s Channel Created %d ",__FUNCTION__, mChannel);
 
-    if(mPtrVoENetwork->RegisterExternalTransport(mChannel, *this) == -1)
-    {
-      CSFLogError(logTag, "%s VoiceEngine, External Transport Failed",__FUNCTION__);
-      return kMediaConduitTransportRegistrationFail;
-    }
+  if(mPtrVoENetwork->RegisterExternalTransport(mChannel, *this) == -1)
+  {
+    CSFLogError(logTag, "%s VoiceEngine, External Transport Failed",__FUNCTION__);
+    return kMediaConduitTransportRegistrationFail;
+  }
 
-    if(mPtrVoEXmedia->SetExternalRecordingStatus(true) == -1)
-    {
-      CSFLogError(logTag, "%s SetExternalRecordingStatus Failed %d",__FUNCTION__,
-                  mPtrVoEBase->LastError());
-      return kMediaConduitExternalPlayoutError;
-    }
+  if(mPtrVoEXmedia->SetExternalRecordingStatus(true) == -1)
+  {
+    CSFLogError(logTag, "%s SetExternalRecordingStatus Failed %d",__FUNCTION__,
+                                                      mPtrVoEBase->LastError());
+    return kMediaConduitExternalPlayoutError;
+  }
 
-    if(mPtrVoEXmedia->SetExternalPlayoutStatus(true) == -1)
-    {
-      CSFLogError(logTag, "%s SetExternalPlayoutStatus Failed %d ",__FUNCTION__,
-                  mPtrVoEBase->LastError());
-      return kMediaConduitExternalRecordingError;
-    }
-    CSFLogDebug(logTag ,  "%s AudioSessionConduit Initialization Done (%p)",__FUNCTION__, this);
+  if(mPtrVoEXmedia->SetExternalPlayoutStatus(true) == -1)
+  {
+    CSFLogError(logTag, "%s SetExternalPlayoutStatus Failed %d ",__FUNCTION__,
+                                                     mPtrVoEBase->LastError());
+    return kMediaConduitExternalRecordingError;
   }
+  CSFLogDebug(logTag ,  "%s AudioSessionConduit Initialization Done",__FUNCTION__);
   return kMediaConduitNoError;
 }
 
+
 // AudioSessionConduit Implementation
 MediaConduitErrorCode
 WebrtcAudioConduit::AttachTransport(mozilla::RefPtr<TransportInterface> aTransport)
 {
   CSFLogDebug(logTag,  "%s ", __FUNCTION__);
 
   if(!aTransport)
   {
@@ -282,43 +230,16 @@ WebrtcAudioConduit::ConfigureSendMediaCo
     if(error ==  VE_CANNOT_SET_SEND_CODEC || error == VE_CODEC_ERROR)
     {
       return kMediaConduitInvalidSendCodec;
     }
 
     return kMediaConduitUnknownError;
   }
 
-  // TEMPORARY - see bug 694814 comment 2
-  nsresult rv;
-  nsCOMPtr<nsIPrefService> prefs = do_GetService("@mozilla.org/preferences-service;1", &rv);
-  if (NS_SUCCEEDED(rv)) {
-    nsCOMPtr<nsIPrefBranch> branch = do_QueryInterface(prefs);
-
-    if (branch) {
-      int32_t aec = 0; // 0 == unchanged
-      bool aec_on = false;
-
-      branch->GetBoolPref("media.peerconnection.aec_enabled", &aec_on);
-      branch->GetIntPref("media.peerconnection.aec", &aec);
-
-      CSFLogDebug(logTag,"Audio config: aec: %d", aec_on ? aec : -1);
-      mEchoOn = aec_on;
-      if (static_cast<webrtc::EcModes>(aec) != webrtc::kEcUnchanged)
-        mEchoCancel = static_cast<webrtc::EcModes>(aec);
-
-      branch->GetIntPref("media.peerconnection.capture_delay", &mCaptureDelay);
-    }
-  }
-
-  if (0 != (error = mPtrVoEProcessing->SetEcStatus(mEchoOn, mEchoCancel))) {
-    CSFLogError(logTag,"%s Error setting EVStatus: %d ",__FUNCTION__, error);
-    return kMediaConduitUnknownError;
-  }
-
   //Let's Send Transport State-machine on the Engine
   if(mPtrVoEBase->StartSend(mChannel) == -1)
   {
     error = mPtrVoEBase->LastError();
     CSFLogError(logTag, "%s StartSend failed %d", __FUNCTION__, error);
     return kMediaConduitUnknownError;
   }
 
@@ -478,17 +399,17 @@ WebrtcAudioConduit::SendAudioFrame(const
 
   // if transmission is not started .. conduit cannot insert frames
   if(!mEngineTransmitting)
   {
     CSFLogError(logTag, "%s Engine not transmitting ", __FUNCTION__);
     return kMediaConduitSessionNotInited;
   }
 
-  capture_delay = mCaptureDelay;
+
   //Insert the samples
   if(mPtrVoEXmedia->ExternalRecordingInsertData(audio_data,
                                                 lengthSamples,
                                                 samplingFreqHz,
                                                 capture_delay) == -1)
   {
     int error = mPtrVoEBase->LastError();
     CSFLogError(logTag,  "%s Inserting audio data Failed %d", __FUNCTION__, error);
@@ -618,63 +539,44 @@ WebrtcAudioConduit::ReceivedRTCPPacket(c
   //good here
   return kMediaConduitNoError;
 }
 
 //WebRTC::RTP Callback Implementation
 
 int WebrtcAudioConduit::SendPacket(int channel, const void* data, int len)
 {
-  CSFLogDebug(logTag,  "%s : channel %d %s",__FUNCTION__,channel,
-              (mEngineReceiving && mOtherDirection) ? "(using mOtherDirection)" : "");
+  CSFLogDebug(logTag,  "%s : channel %d",__FUNCTION__,channel);
 
-  if (mEngineReceiving)
-  {
-    if (mOtherDirection)
-    {
-      return mOtherDirection->SendPacket(channel, data, len);
-    }
-    CSFLogDebug(logTag,  "%s : Asked to send RTP without an RTP sender",
-                __FUNCTION__, channel);
-    return -1;
-  } else {
-    if(mTransport && (mTransport->SendRtpPacket(data, len) == NS_OK))
-    {
+   if(mTransport && (mTransport->SendRtpPacket(data, len) == NS_OK))
+   {
       CSFLogDebug(logTag, "%s Sent RTP Packet ", __FUNCTION__);
       return len;
-    } else {
-      CSFLogError(logTag, "%s RTP Packet Send Failed ", __FUNCTION__);
-      return -1;
-    }
-  }
+   } else {
+     CSFLogError(logTag, "%s RTP Packet Send Failed ", __FUNCTION__);
+     return -1;
+   }
+
 }
 
 int WebrtcAudioConduit::SendRTCPPacket(int channel, const void* data, int len)
 {
   CSFLogDebug(logTag,  "%s : channel %d", __FUNCTION__, channel);
 
-  if (mEngineTransmitting)
+  // can't enable this assertion, because we do.  Suppress it
+  // NS_ASSERTION(mEngineReceiving,"We shouldn't send RTCP on the receiver side");
+  if(mEngineReceiving && mTransport && mTransport->SendRtcpPacket(data, len) == NS_OK)
   {
-    if (mOtherDirection)
-    {
-      return mOtherDirection->SendRTCPPacket(channel, data, len);
-    }
-    CSFLogDebug(logTag,  "%s : Asked to send RTCP without an RTP receiver",
-                __FUNCTION__, channel);
-    return -1;
+    CSFLogDebug(logTag, "%s Sent RTCP Packet ", __FUNCTION__);
+    return len;
   } else {
-    if(mTransport && mTransport->SendRtcpPacket(data, len) == NS_OK)
-    {
-      CSFLogDebug(logTag, "%s Sent RTCP Packet ", __FUNCTION__);
-      return len;
-    } else {
-      CSFLogError(logTag, "%s RTCP Packet Send Failed ", __FUNCTION__);
-      return -1;
-    }
+    CSFLogError(logTag, "%s RTCP Packet Send Failed ", __FUNCTION__);
+    return -1;
   }
+
 }
 
 /**
  * Converts between CodecConfig to WebRTC Codec Structure.
  */
 
 bool
 WebrtcAudioConduit::CodecConfigToWebRTCCodec(const AudioCodecConfig* codecInfo,
@@ -841,8 +743,9 @@ WebrtcAudioConduit::DumpCodecDB() const
       CSFLogDebug(logTag,"Payload Type: %d", mRecvCodecList[i]->mType);
       CSFLogDebug(logTag,"Payload Frequency: %d", mRecvCodecList[i]->mFreq);
       CSFLogDebug(logTag,"Payload PacketSize: %d", mRecvCodecList[i]->mPacSize);
       CSFLogDebug(logTag,"Payload Channels: %d", mRecvCodecList[i]->mChannels);
       CSFLogDebug(logTag,"Payload Sampling Rate: %d", mRecvCodecList[i]->mRate);
     }
  }
 }// end namespace
+
--- a/media/webrtc/signaling/src/media-conduit/AudioConduit.h
+++ b/media/webrtc/signaling/src/media-conduit/AudioConduit.h
@@ -13,24 +13,22 @@
 // Audio Engine Includes
 #include "common_types.h"
 #include "voice_engine/include/voe_base.h"
 #include "voice_engine/include/voe_volume_control.h"
 #include "voice_engine/include/voe_codec.h"
 #include "voice_engine/include/voe_file.h"
 #include "voice_engine/include/voe_network.h"
 #include "voice_engine/include/voe_external_media.h"
-#include "voice_engine/include/voe_audio_processing.h"
 
 //Some WebRTC types for short notations
  using webrtc::VoEBase;
  using webrtc::VoENetwork;
  using webrtc::VoECodec;
  using webrtc::VoEExternalMedia;
- using webrtc::VoEAudioProcessing;
 
 /** This file hosts several structures identifying different aspects
  * of a RTP Session.
  */
 
 namespace mozilla {
 
 /**
@@ -138,33 +136,28 @@ public:
    * Webrtc transport implementation to send and receive RTCP packet.
    * AudioConduit registers itself as ExternalTransport to the VoiceEngine
    */
   virtual int SendRTCPPacket(int channel, const void *data, int len) ;
 
 
 
   WebrtcAudioConduit():
-                      mOtherDirection(NULL),
-                      mShutDown(false),
                       mVoiceEngine(NULL),
                       mTransport(NULL),
                       mEngineTransmitting(false),
                       mEngineReceiving(false),
                       mChannel(-1),
-                      mCurSendCodecConfig(NULL),
-                      mCaptureDelay(150),
-                      mEchoOn(true),
-                      mEchoCancel(webrtc::kEcAec)
+                      mCurSendCodecConfig(NULL)
   {
   }
 
   virtual ~WebrtcAudioConduit();
 
-  MediaConduitErrorCode Init(WebrtcAudioConduit *other);
+  MediaConduitErrorCode Init();
 
 private:
   WebrtcAudioConduit(const WebrtcAudioConduit& other) MOZ_DELETE;
   void operator=(const WebrtcAudioConduit& other) MOZ_DELETE;
 
   //Local database of currently applied receive codecs
   typedef std::vector<AudioCodecConfig* > RecvCodecList;
 
@@ -187,41 +180,28 @@ private:
   bool CheckCodecsForMatch(const AudioCodecConfig* curCodecConfig,
                            const AudioCodecConfig* codecInfo) const;
   //Checks the codec to be applied
   MediaConduitErrorCode ValidateCodecConfig(const AudioCodecConfig* codecInfo, bool send) const;
 
   //Utility function to dump recv codec database
   void DumpCodecDB() const;
 
-  WebrtcAudioConduit*  mOtherDirection;
-  // Other side has shut down our channel and related items already
-  bool mShutDown;
-
-  // These are shared by both directions.  They're released by the last
-  // conduit to die
   webrtc::VoiceEngine* mVoiceEngine;
   mozilla::RefPtr<TransportInterface> mTransport;
   webrtc::VoENetwork*  mPtrVoENetwork;
   webrtc::VoEBase*     mPtrVoEBase;
   webrtc::VoECodec*    mPtrVoECodec;
   webrtc::VoEExternalMedia* mPtrVoEXmedia;
-  webrtc::VoEAudioProcessing* mPtrVoEProcessing;
 
   //engine states of our interets
   bool mEngineTransmitting; // If true => VoiceEngine Send-subsystem is up
   bool mEngineReceiving;    // If true => VoiceEngine Receive-subsystem is up
                             // and playout is enabled
 
   int mChannel;
   RecvCodecList    mRecvCodecList;
   AudioCodecConfig* mCurSendCodecConfig;
-
-  // Current "capture" delay (really output plus input delay)
-  int32_t mCaptureDelay;
-
-  bool mEchoOn;
-  webrtc::EcModes  mEchoCancel;
 };
 
 } // end namespace
 
 #endif
--- a/media/webrtc/signaling/src/media-conduit/MediaConduitInterface.h
+++ b/media/webrtc/signaling/src/media-conduit/MediaConduitInterface.h
@@ -221,17 +221,17 @@ class AudioSessionConduit : public Media
 {
 public:
 
    /**
     * Factory function to create and initialize a Video Conduit Session
     * return: Concrete VideoSessionConduitObject or NULL in the case
     *         of failure
     */
-  static mozilla::RefPtr<AudioSessionConduit> Create(AudioSessionConduit *aOther);
+  static mozilla::RefPtr<AudioSessionConduit> Create();
 
   virtual ~AudioSessionConduit() {}
 
   virtual Type type() const { return AUDIO; }
 
 
   /**
    * Function to deliver externally captured audio sample for encoding and transport
--- a/media/webrtc/signaling/src/media/VcmSIPCCBinding.cpp
+++ b/media/webrtc/signaling/src/media/VcmSIPCCBinding.cpp
@@ -1298,28 +1298,22 @@ static int vcmRxStartICE_m(cc_mcapid_t m
                              fingerprint_alg, fingerprint);
   if (!rtcp_flow) {
       CSFLogError( logTag, "Could not create RTCP flow");
       return VCM_ERROR;
   }
 
   if (CC_IS_AUDIO(mcap_id)) {
     std::vector<mozilla::AudioCodecConfig *> configs;
-
     // Instantiate an appropriate conduit
-    mozilla::RefPtr<mozilla::AudioSessionConduit> tx_conduit =
-      pc.impl()->media()->GetConduit(level, false);
-
     mozilla::RefPtr<mozilla::AudioSessionConduit> conduit =
-                    mozilla::AudioSessionConduit::Create(tx_conduit);
+                    mozilla::AudioSessionConduit::Create();
     if(!conduit)
       return VCM_ERROR;
 
-    pc.impl()->media()->AddConduit(level, true, conduit);
-
     mozilla::AudioCodecConfig *config_raw;
 
     for(int i=0; i <num_payloads ; i++)
     {
       config_raw = new mozilla::AudioCodecConfig(
         payloads[i].remote_rtp_pt,
         ccsdpCodecName(payloads[i].codec_type),
         payloads[i].audio.frequency,
@@ -1954,27 +1948,22 @@ static int vcmTxStartICE_m(cc_mcapid_t m
       payload->audio.packet_size,
       payload->audio.channels,
       payload->audio.bitrate);
 
     // Take possession of this pointer
     mozilla::ScopedDeletePtr<mozilla::AudioCodecConfig> config(config_raw);
 
     // Instantiate an appropriate conduit
-    mozilla::RefPtr<mozilla::AudioSessionConduit> rx_conduit =
-      pc.impl()->media()->GetConduit(level, true);
-
     mozilla::RefPtr<mozilla::AudioSessionConduit> conduit =
-      mozilla::AudioSessionConduit::Create(rx_conduit);
+      mozilla::AudioSessionConduit::Create();
 
     if (!conduit || conduit->ConfigureSendMediaCodec(config))
       return VCM_ERROR;
 
-    pc.impl()->media()->AddConduit(level, false, conduit);
-
     mozilla::RefPtr<mozilla::MediaPipeline> pipeline =
         new mozilla::MediaPipelineTransmit(
             pc.impl()->GetHandle(),
             pc.impl()->GetMainThread().get(),
             pc.impl()->GetSTSThread(),
             stream->GetMediaStream()->GetStream(),
             pc_track_id,
             conduit, rtp_flow, rtcp_flow);
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.h
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.h
@@ -288,38 +288,19 @@ class PeerConnectionMedia : public sigsl
     return mTransportFlows[index_inner];
   }
 
   // Add a transport flow
   void AddTransportFlow(int aIndex, bool aRtcp,
                         mozilla::RefPtr<mozilla::TransportFlow> aFlow) {
     int index_inner = aIndex * 2 + (aRtcp ? 1 : 0);
 
-    MOZ_ASSERT(!mTransportFlows[index_inner]);
     mTransportFlows[index_inner] = aFlow;
   }
 
-  mozilla::RefPtr<mozilla::AudioSessionConduit> GetConduit(int aStreamIndex, bool aReceive) {
-    int index_inner = aStreamIndex * 2 + (aReceive ? 0 : 1);
-
-    if (mAudioConduits.find(index_inner) == mAudioConduits.end())
-      return NULL;
-
-    return mAudioConduits[index_inner];
-  }
-
-  // Add a conduit
-  void AddConduit(int aIndex, bool aReceive,
-                  const mozilla::RefPtr<mozilla::AudioSessionConduit> &aConduit) {
-    int index_inner = aIndex * 2 + (aReceive ? 0 : 1);
-
-    MOZ_ASSERT(!mAudioConduits[index_inner]);
-    mAudioConduits[index_inner] = aConduit;
-  }
-
   // ICE state signals
   sigslot::signal1<mozilla::NrIceCtx *> SignalIceGatheringCompleted;  // Done gathering
   sigslot::signal1<mozilla::NrIceCtx *> SignalIceCompleted;  // Done handshaking
 
  private:
   // Disconnect the media streams. Must be called on the
   // main thread.
   void DisconnectMediaStreams();
@@ -345,17 +326,13 @@ class PeerConnectionMedia : public sigsl
 
   // ICE objects
   mozilla::RefPtr<mozilla::NrIceCtx> mIceCtx;
   std::vector<mozilla::RefPtr<mozilla::NrIceMediaStream> > mIceStreams;
 
   // Transport flows: even is RTP, odd is RTCP
   std::map<int, mozilla::RefPtr<mozilla::TransportFlow> > mTransportFlows;
 
-  // Conduits: even is receive, odd is transmit (for easier correlation with
-  // flows)
-  std::map<int, mozilla::RefPtr<mozilla::AudioSessionConduit> > mAudioConduits;
-
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(PeerConnectionMedia)
 };
 
 }  // namespace sipcc
 #endif
--- a/media/webrtc/signaling/test/mediaconduit_unittests.cpp
+++ b/media/webrtc/signaling/test/mediaconduit_unittests.cpp
@@ -485,21 +485,21 @@ class TransportConduitTest : public ::te
   {
   }
 
   //1. Dump audio samples to dummy external transport
   void TestDummyAudioAndTransport()
   {
     //get pointer to AudioSessionConduit
     int err=0;
-    mAudioSession = mozilla::AudioSessionConduit::Create(NULL);
+    mAudioSession = mozilla::AudioSessionConduit::Create();
     if( !mAudioSession )
       ASSERT_NE(mAudioSession, (void*)NULL);
 
-    mAudioSession2 = mozilla::AudioSessionConduit::Create(NULL);
+    mAudioSession2 = mozilla::AudioSessionConduit::Create();
     if( !mAudioSession2 )
       ASSERT_NE(mAudioSession2, (void*)NULL);
 
     FakeMediaTransport* xport = new FakeMediaTransport();
     ASSERT_NE(xport, (void*)NULL);
     xport->SetAudioSession(mAudioSession, mAudioSession2);
     mAudioTransport = xport;
 
--- a/media/webrtc/signaling/test/mediapipeline_unittest.cpp
+++ b/media/webrtc/signaling/test/mediapipeline_unittest.cpp
@@ -43,17 +43,17 @@ MtransportTestUtils *test_utils;
 namespace {
 class TestAgent {
  public:
   TestAgent() :
       audio_flow_(new TransportFlow()),
       audio_prsock_(new TransportLayerPrsock()),
       audio_dtls_(new TransportLayerDtls()),
       audio_config_(109, "opus", 48000, 480, 1, 64000),
-      audio_conduit_(mozilla::AudioSessionConduit::Create(NULL)),
+      audio_conduit_(mozilla::AudioSessionConduit::Create()),
       audio_(),
       audio_pipeline_(),
       video_flow_(new TransportFlow()),
       video_prsock_(new TransportLayerPrsock()),
       video_config_(120, "VP8", 640, 480),
       video_conduit_(mozilla::VideoSessionConduit::Create()),
       video_(),
       video_pipeline_() {
--- a/media/webrtc/webrtc_config.gypi
+++ b/media/webrtc/webrtc_config.gypi
@@ -1,28 +1,23 @@
 # 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/.
 
 # definitions to control what gets built in webrtc
-# NOTE!!! if you change something here, due to .gyp files not
-# being reprocessed on .gypi changes, run this before building:
-# "find . -name '*.gyp' | xargs touch"
 {
   'variables': {
     # basic stuff for everything
     'include_internal_video_render': 0,
     'clang_use_chrome_plugins': 0,
     'enable_protobuf': 0,
     'include_pulse_audio': 0,
     'include_tests': 0,
     'use_system_libjpeg': 1,
     'use_system_libvpx': 1,
-# Creates AEC internal sample dump files in current directory
-#    'aec_debug_dump': 1,
 
     # codec enable/disables:
     # Note: if you change one here, you must modify shared_libs.mk!
     'codec_g711_enable': 1,
     'codec_opus_enable': 1,
     'codec_g722_enable': 0,
     'codec_ilbc_enable': 0,
     'codec_isac_enable': 0,
--- a/modules/libpref/src/init/all.js
+++ b/modules/libpref/src/init/all.js
@@ -173,25 +173,16 @@ pref("media.dash.enabled", false);
 #endif
 #ifdef MOZ_GSTREAMER
 pref("media.gstreamer.enabled", true);
 #endif
 #ifdef MOZ_WEBRTC
 pref("media.navigator.enabled", true);
 pref("media.peerconnection.enabled", false);
 pref("media.navigator.permission.disabled", false);
-// These values (aec, agc, and noice) are from media/webrtc/trunk/webrtc/common_types.h
-// kXxxUnchanged = 0, kXxxDefault = 1, and higher values are specific to each 
-// setting (for Xxx = Ec, Agc, or Ns).  Defaults are all set to kXxxDefault here.
-pref("media.peerconnection.aec_enabled", true);
-pref("media.peerconnection.aec", 1);
-pref("media.peerconnection.agc_enabled", false);
-pref("media.peerconnection.agc", 1);
-pref("media.peerconnection.noise_enabled", false);
-pref("media.peerconnection.noise", 1);
 #else
 #ifdef ANDROID
 pref("media.navigator.enabled", true);
 #endif
 #endif
 
 // Whether to enable Web Audio support
 pref("media.webaudio.enabled", false);
--- a/security/manager/boot/src/nsSecureBrowserUIImpl.cpp
+++ b/security/manager/boot/src/nsSecureBrowserUIImpl.cpp
@@ -280,17 +280,39 @@ nsSecureBrowserUIImpl::MapInternalToExte
     default:
     case lis_no_security:
       *aState = STATE_IS_INSECURE;
       break;
   }
 
   if (ev && (*aState & STATE_IS_SECURE))
     *aState |= nsIWebProgressListener::STATE_IDENTITY_EV_TOPLEVEL;
-  
+
+  nsCOMPtr<nsPIDOMWindow> piwin = do_QueryReferent(mWindow);
+  MOZ_ASSERT(piwin);
+
+  nsIDocShell* docShell = piwin->GetDocShell();
+  MOZ_ASSERT(docShell);
+
+  // Has a Mixed Content Load initiated in nsMixedContentBlocker?
+  // If so, the state should be broken; overriding the previous state
+  // set by the lock parameter.
+  if (docShell->GetHasMixedActiveContentLoaded())
+    *aState = STATE_IS_BROKEN | nsIWebProgressListener::STATE_LOADED_MIXED_ACTIVE_CONTENT;
+
+  if (docShell->GetHasMixedDisplayContentLoaded())
+    *aState = STATE_IS_BROKEN | nsIWebProgressListener::STATE_LOADED_MIXED_DISPLAY_CONTENT;
+
+  // Has Mixed Content Been Blocked in nsMixedContentBlocker?
+  if (docShell->GetHasMixedActiveContentBlocked())
+    *aState |= nsIWebProgressListener::STATE_BLOCKED_MIXED_ACTIVE_CONTENT;
+
+  if (docShell->GetHasMixedDisplayContentBlocked())
+    *aState |= nsIWebProgressListener::STATE_BLOCKED_MIXED_DISPLAY_CONTENT;
+
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsSecureBrowserUIImpl::GetTooltipText(nsAString& aText)
 {
   lockIconState state;
   nsXPIDLString tooltip;
--- a/security/manager/boot/src/nsSecureBrowserUIImpl.h
+++ b/security/manager/boot/src/nsSecureBrowserUIImpl.h
@@ -94,17 +94,17 @@ protected:
   bool mRestoreSubrequests;
   bool mOnLocationChangeSeen;
 #ifdef DEBUG
   /* related to mReentrantMonitor */
   int32_t mOnStateLocationChangeReentranceDetection;
 #endif
 
   static already_AddRefed<nsISupports> ExtractSecurityInfo(nsIRequest* aRequest);
-  static nsresult MapInternalToExternalState(uint32_t* aState, lockIconState lock, bool ev);
+  nsresult MapInternalToExternalState(uint32_t* aState, lockIconState lock, bool ev);
   nsresult UpdateSecurityState(nsIRequest* aRequest, bool withNewLocation,
                                bool withUpdateStatus, bool withUpdateTooltip);
   bool UpdateMyFlags(lockIconState &warnSecurityState);
   nsresult TellTheWorld(lockIconState warnSecurityState, 
                         nsIRequest* aRequest);
 
   nsresult EvaluateAndUpdateSecurityState(nsIRequest* aRequest, nsISupports *info,
                                           bool withNewLocation);
--- a/security/manager/ssl/tests/mochitest/mixedcontent/mixedContentTest.js
+++ b/security/manager/ssl/tests/mochitest/mixedcontent/mixedContentTest.js
@@ -147,21 +147,16 @@ function is(a, b, message)
 function todo(a, message)
 {
   if (a)
     postMsg("FAILURE: TODO works? " + message);
   else
     postMsg("TODO: " + message);
 }
 
-function todoSecurityState(expectedState, message)
-{
-  isSecurityState(expectedState, message, todo);
-}
-
 function isSecurityState(expectedState, message, test)
 {
   if (!test)
     test = ok;
 
   // Quit nasty but working :)
   var ui = SpecialPowers.wrap(window)
     .QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor)
--- a/security/manager/ssl/tests/mochitest/mixedcontent/test_dynDelayedUnsecureXHR.html
+++ b/security/manager/ssl/tests/mochitest/mixedcontent/test_dynDelayedUnsecureXHR.html
@@ -19,17 +19,17 @@
     {
       try
       {
         var req = new XMLHttpRequest();
         req.open("GET", "http://example.com/tests/security/ssl/mixedcontent/alloworigin.sjs", false);
         req.send(null);
 
         // Change should be immediate, the request was sent synchronously
-        todoSecurityState("broken", "security broken after insecure XHR");
+        isSecurityState("broken", "security broken after insecure XHR");
       }
       catch (ex)
       {
         ok(false, ex);
       }
 
       finish();
     }, 0);
--- a/uriloader/base/nsIWebProgressListener.idl
+++ b/uriloader/base/nsIWebProgressListener.idl
@@ -165,16 +165,46 @@ interface nsIWebProgressListener : nsISu
    *   received over a secure channel.  The degree of security is expressed by
    *   STATE_SECURE_HIGH, STATE_SECURE_MED, or STATE_SECURE_LOW.
    */
   const unsigned long STATE_IS_INSECURE     = 0x00000004;
   const unsigned long STATE_IS_BROKEN       = 0x00000001;
   const unsigned long STATE_IS_SECURE       = 0x00000002;
 
   /**
+   * Mixed active content flags
+   *
+   * May be set in addition to the State Security Flags, to indicate that
+   * mixed active content has been encountered.
+   *
+   * STATE_BLOCKED_MIXED_ACTIVE_CONTENT
+   *   Mixed active content has been blocked from loading.
+   *
+   * STATE_LOADED_MIXED_ACTIVE_CONTENT
+   *   Mixed active content has been loaded. State should be STATE_IS_BROKEN.
+   */
+  const unsigned long STATE_BLOCKED_MIXED_ACTIVE_CONTENT  = 0x00000010;
+  const unsigned long STATE_LOADED_MIXED_ACTIVE_CONTENT   = 0x00000020;
+
+  /**
+   * Mixed display content flags
+   *
+   * May be set in addition to the State Security Flags, to indicate that
+   * mixed display content has been encountered.
+   *
+   * STATE_BLOCKED_MIXED_DISPLAY_CONTENT
+   *   Mixed display content has been blocked from loading.
+   *
+   * STATE_LOADED_MIXED_DISPLAY_CONTENT
+   *   Mixed display content has been loaded. State should be STATE_IS_BROKEN.
+   */
+  const unsigned long STATE_BLOCKED_MIXED_DISPLAY_CONTENT = 0x00000100;
+  const unsigned long STATE_LOADED_MIXED_DISPLAY_CONTENT  = 0x00000200;
+
+  /**
    * Security Strength Flags
    *
    * These flags describe the security strength and accompany STATE_IS_SECURE
    * in a call to the onSecurityChange method.  These flags are mutually
    * exclusive.
    *
    * These flags are not meant to provide a precise description of data
    * transfer security.  These are instead intended as a rough indicator that
--- a/widget/windows/nsTextStore.cpp
+++ b/widget/windows/nsTextStore.cpp
@@ -7,25 +7,27 @@
 #include <algorithm>
 
 #ifdef MOZ_LOGGING
 #define FORCE_PR_LOG /* Allow logging in the release build */
 #endif // MOZ_LOGGING
 #include "prlog.h"
 
 #include "nscore.h"
-#include "nsTextStore.h"
 #include "nsWindow.h"
 #ifdef MOZ_METRO
 #include "winrt/MetroWidget.h"
 #endif
 #include "nsPrintfCString.h"
 #include "WinUtils.h"
 #include "mozilla/Preferences.h"
 
+#define INPUTSCOPE_INIT_GUID
+#include "nsTextStore.h"
+
 using namespace mozilla;
 using namespace mozilla::widget;
 
 #ifdef PR_LOGGING
 /**
  * TSF related code should log its behavior even on release build especially
  * in the interface methods.
  *
@@ -47,21 +49,16 @@ PRLogModuleInfo* sTextStoreLog = nullptr
 #endif // #ifdef PR_LOGGING
 
 #define IS_SEARCH static_cast<InputScope>(50)
 
 /******************************************************************/
 /* InputScopeImpl                                                 */
 /******************************************************************/
 
-// InputScope property GUID
-static const GUID GUID_PROP_INPUTSCOPE =
-  { 0x1713dd5a, 0x68e7, 0x4a5b,
-    { 0x9a, 0xf6, 0x59, 0x2a, 0x59, 0x5c, 0x77, 0x8d } };
-
 class InputScopeImpl MOZ_FINAL : public ITfInputScope
 {
 public:
   InputScopeImpl(const nsTArray<InputScope>& aList) :
     mRefCnt(1),
     mInputScopes(aList)
   {
     PR_LOG(sTextStoreLog, PR_LOG_ALWAYS,
--- a/widget/windows/nsTextStore.h
+++ b/widget/windows/nsTextStore.h
@@ -11,17 +11,23 @@
 #include "nsCOMPtr.h"
 #include "nsITimer.h"
 #include "nsIWidget.h"
 #include "nsWindowBase.h"
 #include "mozilla/Attributes.h"
 
 #include <msctf.h>
 #include <textstor.h>
-#include <InputScope.h>
+
+// GUID_PROP_INPUTSCOPE is declared in inputscope.h using INIT_GUID.
+// With initguid.h, we get its instance instead of extern declaration.
+#ifdef INPUTSCOPE_INIT_GUID
+#include <initguid.h>
+#endif
+#include <inputscope.h>
 
 struct ITfThreadMgr;
 struct ITfDocumentMgr;
 struct ITfDisplayAttributeMgr;
 struct ITfCategoryMgr;
 class nsWindow;
 class nsTextEvent;
 #ifdef MOZ_METRO