Bug 1382079 part 2 - Backed out changeset c17e14e79d1a (
bug 1365643) to fix intermittent leaking about:newtab and
bug 1381804 awsy regression.
Revert "
Bug 1365643 - make activity stream, but not tiles, load in the child, r=Mardak"
This reverts commit 709ccd1a4621145c67131e7a9d783ec18f0a005c.
MozReview-Commit-ID: DGH4VXqr0Ds
--- a/browser/components/about/AboutRedirector.cpp
+++ b/browser/components/about/AboutRedirector.cpp
@@ -17,17 +17,16 @@
#include "nsServiceManagerUtils.h"
namespace mozilla {
namespace browser {
NS_IMPL_ISUPPORTS(AboutRedirector, nsIAboutModule)
bool AboutRedirector::sUseOldPreferences = false;
-bool AboutRedirector::sActivityStreamEnabled = false;
struct RedirEntry {
const char* id;
const char* url;
uint32_t flags;
};
/*
@@ -202,36 +201,18 @@ AboutRedirector::NewChannel(nsIURI* aURI
NS_IMETHODIMP
AboutRedirector::GetURIFlags(nsIURI *aURI, uint32_t *result)
{
NS_ENSURE_ARG_POINTER(aURI);
nsAutoCString name = GetAboutModuleName(aURI);
- static bool sASEnabledCacheInited = false;
- if (!sASEnabledCacheInited) {
- Preferences::AddBoolVarCache(&sActivityStreamEnabled,
- "browser.newtabpage.activity-stream.enabled");
- sASEnabledCacheInited = true;
- }
-
for (auto & redir : kRedirMap) {
if (name.Equals(redir.id)) {
-
- // Once ActivityStream is fully rolled out and we've removed Tiles,
- // this special case can go away and the flag can just become part
- // of the normal about:newtab entry in kRedirMap.
- if (name.EqualsLiteral("newtab")) {
- if (sActivityStreamEnabled) {
- *result = redir.flags | nsIAboutModule::URI_MUST_LOAD_IN_CHILD;
- return NS_OK;
- }
- }
-
*result = redir.flags;
return NS_OK;
}
}
return NS_ERROR_ILLEGAL_VALUE;
}
--- a/browser/components/about/AboutRedirector.h
+++ b/browser/components/about/AboutRedirector.h
@@ -22,15 +22,14 @@ public:
static nsresult
Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
protected:
virtual ~AboutRedirector() {}
private:
static bool sUseOldPreferences;
- static bool sActivityStreamEnabled;
};
} // namespace browser
} // namespace mozilla
#endif // AboutRedirector_h__
--- a/browser/components/about/moz.build
+++ b/browser/components/about/moz.build
@@ -6,18 +6,16 @@
with Files("**"):
BUG_COMPONENT = ("Firefox", "General")
EXPORTS.mozilla.browser += [
'AboutRedirector.h',
]
-XPCSHELL_TESTS_MANIFESTS += ['test/unit/xpcshell.ini']
-
SOURCES += [
'AboutRedirector.cpp',
]
FINAL_LIBRARY = 'browsercomps'
LOCAL_INCLUDES += [
'../build',
deleted file mode 100644
--- a/browser/components/about/test/unit/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "plugin:mozilla/browser-test"
- ]
-};
deleted file mode 100644
--- a/browser/components/about/test/unit/test_getURIFlags.js
+++ /dev/null
@@ -1,33 +0,0 @@
-const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-
-Cu.import("resource://gre/modules/Services.jsm");
-
-const contract = "@mozilla.org/network/protocol/about;1?what=newtab";
-const am = Cc[contract].getService(Ci.nsIAboutModule);
-const uri = Services.io.newURI("about:newtab");
-
-function run_test() {
- test_AS_enabled_flags();
- test_AS_disabled_flags();
-}
-
-// Since tiles isn't e10s capable, it shouldn't advertise that it can load in
-// the child.
-function test_AS_disabled_flags() {
- Services.prefs.setBoolPref("browser.newtabpage.activity-stream.enabled",
- false);
-
- let flags = am.getURIFlags(uri);
-
- ok(!(flags & Ci.nsIAboutModule.URI_MUST_LOAD_IN_CHILD));
-}
-
-// Activity Stream, however, is e10s-capable, and should advertise it.
-function test_AS_enabled_flags() {
- Services.prefs.setBoolPref("browser.newtabpage.activity-stream.enabled",
- true);
-
- let flags = am.getURIFlags(uri);
-
- ok(flags & Ci.nsIAboutModule.URI_MUST_LOAD_IN_CHILD);
-}
deleted file mode 100644
--- a/browser/components/about/test/unit/xpcshell.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[DEFAULT]
-head =
-# make the firefox services (eg newtab-service) available to xpcshell
-firefox-appdir = browser
-
-[test_getURIFlags.js]