Backed out 2 changesets (bug 1028187) for mochitest-oth orange
authorWes Kocher <wkocher@mozilla.com>
Wed, 02 Jul 2014 17:29:33 -0700
changeset 191965 878fe076a95fa357de15fd07e15e032fbf876ca1
parent 191964 81ebf5784ed982002849a4df6a6e5275262ee23f
child 191966 56b54954e7fb18b1a7f6be81c7e2f43c8ab841cb
push id45720
push userkwierso@gmail.com
push dateThu, 03 Jul 2014 00:29:54 +0000
treeherdermozilla-inbound@878fe076a95f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1028187
milestone33.0a1
backs out01cba8ff52dd84718cd185bfffabbb97cd6364e6
caf43baf3306ea4b7e60d0f269f49cb31eb72a8e
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
Backed out 2 changesets (bug 1028187) for mochitest-oth orange Backed out changeset 01cba8ff52dd (bug 1028187) Backed out changeset caf43baf3306 (bug 1028187)
browser/components/about/AboutRedirector.cpp
docshell/base/nsAboutRedirector.cpp
dom/base/nsGlobalWindow.cpp
netwerk/protocol/about/nsAboutBlank.cpp
netwerk/protocol/about/nsAboutBloat.cpp
netwerk/protocol/about/nsAboutCache.cpp
netwerk/protocol/about/nsAboutCacheEntry.cpp
netwerk/protocol/about/nsIAboutModule.idl
--- a/browser/components/about/AboutRedirector.cpp
+++ b/browser/components/about/AboutRedirector.cpp
@@ -4,28 +4,26 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 // See also: docshell/base/nsAboutRedirector.cpp
 
 #include "AboutRedirector.h"
 #include "nsNetUtil.h"
 #include "nsIScriptSecurityManager.h"
 #include "mozilla/ArrayUtils.h"
-#include "nsDOMString.h"
 
 namespace mozilla {
 namespace browser {
 
 NS_IMPL_ISUPPORTS(AboutRedirector, nsIAboutModule)
 
 struct RedirEntry {
   const char* id;
   const char* url;
   uint32_t flags;
-  const char* idbOriginPostfix;
 };
 
 /*
   Entries which do not have URI_SAFE_FOR_UNTRUSTED_CONTENT will run with chrome
   privileges. This is potentially dangerous. Please use
   URI_SAFE_FOR_UNTRUSTED_CONTENT in the third argument to each map item below
   unless your about: page really needs chrome privileges. Security review is
   required before adding new map entries without
@@ -75,19 +73,17 @@ static RedirEntry kRedirMap[] = {
 #ifdef MOZ_SERVICES_SYNC
   { "sync-progress", "chrome://browser/content/sync/progress.xhtml",
     nsIAboutModule::ALLOW_SCRIPT },
   { "sync-tabs", "chrome://browser/content/sync/aboutSyncTabs.xul",
     nsIAboutModule::ALLOW_SCRIPT },
 #endif
   { "home", "chrome://browser/content/abouthome/aboutHome.xhtml",
     nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
-    nsIAboutModule::ALLOW_SCRIPT |
-    nsIAboutModule::ENABLE_INDEXED_DB,
-    "home" },
+    nsIAboutModule::ALLOW_SCRIPT },
   { "newtab", "chrome://browser/content/newtab/newTab.xul",
     nsIAboutModule::ALLOW_SCRIPT },
   { "permissions", "chrome://browser/content/preferences/aboutPermissions.xul",
     nsIAboutModule::ALLOW_SCRIPT },
   { "preferences", "chrome://browser/content/preferences/in-content/preferences.xul",
     nsIAboutModule::ALLOW_SCRIPT },
   { "downloads", "chrome://browser/content/downloads/contentAreaDownloadsView.xul",
     nsIAboutModule::ALLOW_SCRIPT },
@@ -100,25 +96,21 @@ static RedirEntry kRedirMap[] = {
   { "app-manager", "chrome://browser/content/devtools/app-manager/index.xul",
     nsIAboutModule::ALLOW_SCRIPT },
   { "customizing", "chrome://browser/content/customizableui/aboutCustomizing.xul",
     nsIAboutModule::ALLOW_SCRIPT },
 #ifdef MOZ_LOOP
   { "loopconversation", "chrome://browser/content/loop/conversation.html",
     nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
     nsIAboutModule::ALLOW_SCRIPT |
-    nsIAboutModule::HIDE_FROM_ABOUTABOUT |
-    nsIAboutModule::ENABLE_INDEXED_DB },
+    nsIAboutModule::HIDE_FROM_ABOUTABOUT },
   { "looppanel", "chrome://browser/content/loop/panel.html",
     nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
     nsIAboutModule::ALLOW_SCRIPT |
-    nsIAboutModule::HIDE_FROM_ABOUTABOUT |
-    nsIAboutModule::ENABLE_INDEXED_DB,
-    // Shares an IndexedDB origin with about:loopconversation.
-    "loopconversation" },
+    nsIAboutModule::HIDE_FROM_ABOUTABOUT },
 #endif
 };
 static const int kRedirTotal = ArrayLength(kRedirMap);
 
 static nsAutoCString
 GetAboutModuleName(nsIURI *aURI)
 {
   nsAutoCString path;
@@ -177,39 +169,16 @@ AboutRedirector::GetURIFlags(nsIURI *aUR
       *result = kRedirMap[i].flags;
       return NS_OK;
     }
   }
 
   return NS_ERROR_ILLEGAL_VALUE;
 }
 
-NS_IMETHODIMP
-AboutRedirector::GetIndexedDBOriginPostfix(nsIURI *aURI, nsAString &result)
-{
-  NS_ENSURE_ARG_POINTER(aURI);
-
-  nsAutoCString name = GetAboutModuleName(aURI);
-
-  for (int i = 0; i < kRedirTotal; i++) {
-    if (name.Equals(kRedirMap[i].id)) {
-      const char* postfix = kRedirMap[i].idbOriginPostfix;
-      if (!postfix) {
-        break;
-      }
-
-      result.AssignASCII(postfix);
-      return NS_OK;
-    }
-  }
-
-  SetDOMStringToNull(result);
-  return NS_ERROR_ILLEGAL_VALUE;
-}
-
 nsresult
 AboutRedirector::Create(nsISupports *aOuter, REFNSIID aIID, void **result)
 {
   AboutRedirector* about = new AboutRedirector();
   if (about == nullptr)
     return NS_ERROR_OUT_OF_MEMORY;
   NS_ADDREF(about);
   nsresult rv = about->QueryInterface(aIID, result);
--- a/docshell/base/nsAboutRedirector.cpp
+++ b/docshell/base/nsAboutRedirector.cpp
@@ -3,17 +3,16 @@
 /* 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 "nsAboutRedirector.h"
 #include "nsNetUtil.h"
 #include "nsAboutProtocolUtils.h"
 #include "mozilla/ArrayUtils.h"
-#include "nsDOMString.h"
 
 NS_IMPL_ISUPPORTS(nsAboutRedirector, nsIAboutModule)
 
 struct RedirEntry {
     const char* id;
     const char* url;
     uint32_t flags;
 };
@@ -132,23 +131,16 @@ nsAboutRedirector::GetURIFlags(nsIURI *a
             return NS_OK;
         }
     }
 
     NS_ERROR("nsAboutRedirector called for unknown case");
     return NS_ERROR_ILLEGAL_VALUE;
 }
 
-NS_IMETHODIMP
-nsAboutRedirector::GetIndexedDBOriginPostfix(nsIURI *aURI, nsAString &result)
-{
-    SetDOMStringToNull(result);
-    return NS_ERROR_NOT_IMPLEMENTED;
-}
-
 nsresult
 nsAboutRedirector::Create(nsISupports *aOuter, REFNSIID aIID, void **aResult)
 {
     nsAboutRedirector* about = new nsAboutRedirector();
     if (about == nullptr)
         return NS_ERROR_OUT_OF_MEMORY;
     NS_ADDREF(about);
     nsresult rv = about->QueryInterface(aIID, aResult);
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -63,17 +63,16 @@
 #include "nsJSPrincipals.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/Debug.h"
 #include "mozilla/EventListenerManager.h"
 #include "mozilla/EventStates.h"
 #include "mozilla/MouseEvents.h"
 #include "AudioChannelService.h"
 #include "MessageEvent.h"
-#include "nsAboutProtocolUtils.h"
 
 // Interfaces Needed
 #include "nsIFrame.h"
 #include "nsCanvasFrame.h"
 #include "nsIWidget.h"
 #include "nsIWidgetListener.h"
 #include "nsIBaseWindow.h"
 #include "nsIDeviceSensors.h"
@@ -10507,80 +10506,41 @@ nsGlobalWindow::GetLocalStorage(nsIDOMSt
 
   ErrorResult rv;
   nsCOMPtr<nsIDOMStorage> storage = GetLocalStorage(rv);
   storage.forget(aLocalStorage);
 
   return rv.ErrorCode();
 }
 
-static nsAutoCString
-GetIndexedDBOriginPostfixForAboutURI(nsIURI *aURI)
-{
-  nsAutoCString result;
-
-  nsCOMPtr<nsIAboutModule> module;
-  nsresult rv = NS_GetAboutModule(aURI, getter_AddRefs(module));
-  NS_ENSURE_SUCCESS(rv, result);
-
-  uint32_t flags;
-  rv = module->GetURIFlags(aURI, &flags);
-  if (NS_FAILED(rv) || !(flags & nsIAboutModule::ENABLE_INDEXED_DB)) {
-    return result;
-  }
-
-  nsAutoString postfix;
-  rv = module->GetIndexedDBOriginPostfix(aURI, postfix);
-  if (NS_FAILED(rv) || DOMStringIsNull(postfix)) {
-    return result;
-  }
-
-  nsCOMPtr<nsIURI> origin = NS_GetInnermostURI(aURI);
-  NS_ENSURE_TRUE(origin, result);
-
-  nsAutoCString scheme;
-  rv = origin->GetScheme(scheme);
-  NS_ENSURE_SUCCESS(rv, result);
-
-  result = scheme + NS_LITERAL_CSTRING(":") + NS_ConvertUTF16toUTF8(postfix);
-  ToLowerCase(result);
-  return result;
-}
-
 indexedDB::IDBFactory*
 nsGlobalWindow::GetIndexedDB(ErrorResult& aError)
 {
   if (!mIndexedDB) {
     // If the document has the sandboxed origin flag set
     // don't allow access to indexedDB.
     if (mDoc && (mDoc->GetSandboxFlags() & SANDBOXED_ORIGIN)) {
       aError.Throw(NS_ERROR_DOM_SECURITY_ERR);
       return nullptr;
     }
 
-    nsCString origin;
-
     if (!IsChromeWindow()) {
       // Whitelist about:home, since it doesn't have a base domain it would not
       // pass the thirdPartyUtil check, though it should be able to use
       // indexedDB.
       bool skipThirdPartyCheck = false;
       nsIPrincipal *principal = GetPrincipal();
       if (principal) {
         nsCOMPtr<nsIURI> uri;
         principal->GetURI(getter_AddRefs(uri));
-
-        if (uri) {
-          bool isAbout = false;
-          nsresult rv = uri->SchemeIs("about", &isAbout);
-
-          if (NS_SUCCEEDED(rv) && isAbout) {
-            origin = GetIndexedDBOriginPostfixForAboutURI(uri);
-            skipThirdPartyCheck = !origin.IsEmpty();
-          }
+        bool isAbout = false;
+        if (uri && NS_SUCCEEDED(uri->SchemeIs("about", &isAbout)) && isAbout) {
+          nsAutoCString path;
+          skipThirdPartyCheck = NS_SUCCEEDED(uri->GetPath(path)) &&
+                                path.EqualsLiteral("home");
         }
       }
 
       if (!skipThirdPartyCheck) {
         nsCOMPtr<mozIThirdPartyUtil> thirdPartyUtil =
           do_GetService(THIRDPARTYUTIL_CONTRACTID);
         if (!thirdPartyUtil) {
           aError.Throw(NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
@@ -10594,17 +10554,17 @@ nsGlobalWindow::GetIndexedDB(ErrorResult
           NS_WARN_IF_FALSE(aError.Failed(),
                            "IndexedDB is not permitted in a third-party window.");
           return nullptr;
         }
       }
     }
 
     // This may be null if being created from a file.
-    aError = indexedDB::IDBFactory::Create(this, origin, origin, nullptr,
+    aError = indexedDB::IDBFactory::Create(this, nullptr,
                                            getter_AddRefs(mIndexedDB));
   }
 
   return mIndexedDB;
 }
 
 NS_IMETHODIMP
 nsGlobalWindow::GetIndexedDB(nsISupports** _retval)
--- a/netwerk/protocol/about/nsAboutBlank.cpp
+++ b/netwerk/protocol/about/nsAboutBlank.cpp
@@ -1,16 +1,15 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* 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 "nsAboutBlank.h"
 #include "nsStringStream.h"
-#include "nsDOMString.h"
 #include "nsNetUtil.h"
 
 NS_IMPL_ISUPPORTS(nsAboutBlank, nsIAboutModule)
 
 NS_IMETHODIMP
 nsAboutBlank::NewChannel(nsIURI *aURI, nsIChannel **result)
 {
     NS_ENSURE_ARG_POINTER(aURI);
@@ -32,23 +31,16 @@ nsAboutBlank::NewChannel(nsIURI *aURI, n
 NS_IMETHODIMP
 nsAboutBlank::GetURIFlags(nsIURI *aURI, uint32_t *result)
 {
     *result = nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
               nsIAboutModule::HIDE_FROM_ABOUTABOUT;
     return NS_OK;
 }
 
-NS_IMETHODIMP
-nsAboutBlank::GetIndexedDBOriginPostfix(nsIURI *aURI, nsAString &result)
-{
-    SetDOMStringToNull(result);
-    return NS_ERROR_NOT_IMPLEMENTED;
-}
-
 nsresult
 nsAboutBlank::Create(nsISupports *aOuter, REFNSIID aIID, void **aResult)
 {
     nsAboutBlank* about = new nsAboutBlank();
     if (about == nullptr)
         return NS_ERROR_OUT_OF_MEMORY;
     NS_ADDREF(about);
     nsresult rv = about->QueryInterface(aIID, aResult);
--- a/netwerk/protocol/about/nsAboutBloat.cpp
+++ b/netwerk/protocol/about/nsAboutBloat.cpp
@@ -5,17 +5,16 @@
 
 #include "nsTraceRefcnt.h"
 
 // if NS_BUILD_REFCNT_LOGGING isn't defined, don't try to build
 #ifdef NS_BUILD_REFCNT_LOGGING
 
 #include "nsAboutBloat.h"
 #include "nsStringStream.h"
-#include "nsDOMString.h"
 #include "nsIURI.h"
 #include "nsCOMPtr.h"
 #include "nsNetUtil.h"
 #include "nsDirectoryServiceDefs.h"
 #include "nsIFile.h"
 
 static void GC_gcollect() {}
 
@@ -120,23 +119,16 @@ nsAboutBloat::NewChannel(nsIURI *aURI, n
 
 NS_IMETHODIMP
 nsAboutBloat::GetURIFlags(nsIURI *aURI, uint32_t *result)
 {
     *result = 0;
     return NS_OK;
 }
 
-NS_IMETHODIMP
-nsAboutBloat::GetIndexedDBOriginPostfix(nsIURI *aURI, nsAString &result)
-{
-    SetDOMStringToNull(result);
-    return NS_ERROR_NOT_IMPLEMENTED;
-}
-
 nsresult
 nsAboutBloat::Create(nsISupports *aOuter, REFNSIID aIID, void **aResult)
 {
     nsAboutBloat* about = new nsAboutBloat();
     if (about == nullptr)
         return NS_ERROR_OUT_OF_MEMORY;
     NS_ADDREF(about);
     nsresult rv = about->QueryInterface(aIID, aResult);
--- a/netwerk/protocol/about/nsAboutCache.cpp
+++ b/netwerk/protocol/about/nsAboutCache.cpp
@@ -7,17 +7,16 @@
 #include "nsIInputStream.h"
 #include "nsIStorageStream.h"
 #include "nsIURI.h"
 #include "nsCOMPtr.h"
 #include "nsNetUtil.h"
 #include "nsEscape.h"
 #include "nsAboutProtocolUtils.h"
 #include "nsPrintfCString.h"
-#include "nsDOMString.h"
 
 #include "nsICacheStorageService.h"
 #include "nsICacheStorage.h"
 #include "CacheFileUtils.h"
 #include "CacheObserver.h"
 
 #include "nsThreadUtils.h"
 
@@ -481,23 +480,16 @@ nsAboutCache::FlushBuffer()
 
 NS_IMETHODIMP
 nsAboutCache::GetURIFlags(nsIURI *aURI, uint32_t *result)
 {
     *result = 0;
     return NS_OK;
 }
 
-NS_IMETHODIMP
-nsAboutCache::GetIndexedDBOriginPostfix(nsIURI *aURI, nsAString &result)
-{
-    SetDOMStringToNull(result);
-    return NS_ERROR_NOT_IMPLEMENTED;
-}
-
 // static
 nsresult
 nsAboutCache::Create(nsISupports *aOuter, REFNSIID aIID, void **aResult)
 {
     nsAboutCache* about = new nsAboutCache();
     if (about == nullptr)
         return NS_ERROR_OUT_OF_MEMORY;
     NS_ADDREF(about);
--- a/netwerk/protocol/about/nsAboutCacheEntry.cpp
+++ b/netwerk/protocol/about/nsAboutCacheEntry.cpp
@@ -2,17 +2,16 @@
 /* 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 "nsAboutCacheEntry.h"
 #include "nsAboutCache.h"
 #include "nsICacheStorage.h"
 #include "CacheObserver.h"
-#include "nsDOMString.h"
 #include "nsNetUtil.h"
 #include "prprf.h"
 #include "nsEscape.h"
 #include "nsIAsyncInputStream.h"
 #include "nsIAsyncOutputStream.h"
 #include "nsAboutProtocolUtils.h"
 #include "nsInputStreamPump.h"
 #include "CacheFileUtils.h"
@@ -104,23 +103,16 @@ nsAboutCacheEntry::NewChannel(nsIURI *ur
 
 NS_IMETHODIMP
 nsAboutCacheEntry::GetURIFlags(nsIURI *aURI, uint32_t *result)
 {
     *result = nsIAboutModule::HIDE_FROM_ABOUTABOUT;
     return NS_OK;
 }
 
-NS_IMETHODIMP
-nsAboutCacheEntry::GetIndexedDBOriginPostfix(nsIURI *aURI, nsAString &result)
-{
-    SetDOMStringToNull(result);
-    return NS_ERROR_NOT_IMPLEMENTED;
-}
-
 //-----------------------------------------------------------------------------
 // nsAboutCacheEntry
 
 nsresult
 nsAboutCacheEntry::GetContentStream(nsIURI *uri, nsIInputStream **result)
 {
     nsresult rv;
 
--- a/netwerk/protocol/about/nsIAboutModule.idl
+++ b/netwerk/protocol/about/nsIAboutModule.idl
@@ -3,17 +3,17 @@
  * 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 "nsISupports.idl"
 
 interface nsIURI;
 interface nsIChannel;
 
-[scriptable, uuid(1d5992c3-28b0-4ec1-9dbb-f5fde7f72199)]
+[scriptable, uuid(9575693c-60d9-4332-b6b8-6c29289339cb)]
 interface nsIAboutModule : nsISupports 
 {
     /**
      * Constructs a new channel for the about protocol module. 
      *
      * @param aURI the uri of the new channel
      */
     nsIChannel newChannel(in nsIURI aURI);
@@ -37,33 +37,21 @@ interface nsIAboutModule : nsISupports
 
     /**
      * A flag that indicates whether this about: URI doesn't want to be listed
      * in about:about, especially if it's not useful without a query string.
      */
     const unsigned long HIDE_FROM_ABOUTABOUT = (1 << 2);
 
     /**
-     * A flag that indicates whether this about: URI wants Indexed DB enabled.
-     */
-    const unsigned long ENABLE_INDEXED_DB = (1 << 3);
-
-    /**
      * A method to get the flags that apply to a given about: URI.  The URI
      * passed in is guaranteed to be one of the URIs that this module
      * registered to deal with.
      */
     unsigned long getURIFlags(in nsIURI aURI);
-
-    /**
-     * Returns the Indexed DB origin's postfix used for the given about: URI.
-     * If the postfix returned is null then the URI's path (e.g. "home" for
-     * about:home) will be used to construct the origin.
-     */
-    DOMString getIndexedDBOriginPostfix(in nsIURI aURI);
 };
 
 %{C++
 
 #define NS_ABOUT_MODULE_CONTRACTID        "@mozilla.org/network/protocol/about;1" 
 #define NS_ABOUT_MODULE_CONTRACTID_PREFIX NS_ABOUT_MODULE_CONTRACTID "?what=" 
 #define NS_ABOUT_MODULE_CONTRACTID_LENGTH 49      // strlen(NS_ABOUT_MODULE_CONTRACTID_PREFIX)