Bug 1464025 - Change accept header if locale changes. r=gandalf
authorMichael Kaply <mozilla@kaply.com>
Wed, 06 Jun 2018 19:12:45 -0500
changeset 421821 dc080b49ef9c91ce0282d00712f7ddd2349b54d8
parent 421820 fcbec6eece3f7ebbf006b5daeef939c2b4df3a1e
child 421822 e6d89c09bc10800ddc6a7f544da7809ad1105a56
push id104125
push useraciure@mozilla.com
push dateThu, 07 Jun 2018 21:57:03 +0000
treeherdermozilla-inbound@38c222c1bf73 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgandalf
bugs1464025
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1464025 - Change accept header if locale changes. r=gandalf MozReview-Commit-ID: HshY3mCab4M
netwerk/protocol/http/nsHttpHandler.cpp
--- a/netwerk/protocol/http/nsHttpHandler.cpp
+++ b/netwerk/protocol/http/nsHttpHandler.cpp
@@ -546,16 +546,17 @@ nsHttpHandler::Init()
         obsService->AddObserver(this, "net:prune-all-connections", true);
         obsService->AddObserver(this, "net:cancel-all-connections", true);
         obsService->AddObserver(this, "last-pb-context-exited", true);
         obsService->AddObserver(this, "browser:purge-session-history", true);
         obsService->AddObserver(this, NS_NETWORK_LINK_TOPIC, true);
         obsService->AddObserver(this, "application-background", true);
         obsService->AddObserver(this, "psm:user-certificate-added", true);
         obsService->AddObserver(this, "psm:user-certificate-deleted", true);
+        obsService->AddObserver(this, "intl:app-locales-changed", true);
 
         if (!IsNeckoChild()) {
             obsService->AddObserver(this,
                                     "net:current-toplevel-outer-content-windowid",
                                     true);
         }
 
         if (mFastOpenSupported) {
@@ -2444,16 +2445,19 @@ nsHttpHandler::Observe(nsISupports *subj
     } else if (!strcmp(topic, "psm:user-certificate-added")) {
         // A user certificate has just been added.
         // We should immediately disable speculative connect
         mSpeculativeConnectEnabled = false;
     } else if (!strcmp(topic, "psm:user-certificate-deleted")) {
         // If a user certificate has been removed, we need to check if there
         // are others installed
         mSpeculativeConnectEnabled = CanEnableSpeculativeConnect();
+    } else if (!strcmp(topic, "intl:app-locales-changed")) {
+        // If the locale changed, there's a chance the accept language did too
+        mAcceptLanguagesIsDirty = true;
     }
 
     return NS_OK;
 }
 
 // nsISpeculativeConnect
 
 static bool