Backout changesets 58d026601240, c5a9a439d72c and cfdf675266b2 because of mochitest-3 crash
authorEhsan Akhgari <ehsan@mozilla.com>
Thu, 08 Sep 2011 22:04:43 -0400
changeset 78117 cc0753a23f8b1411ca0780c7b018beb4166655bc
parent 78116 45f55ff3fab87706fbd7f70eee74e644ba662ab8
child 78118 71486524f1ed28a41a8bfb6ac6188f5c31202858
push id78
push userclegnitto@mozilla.com
push dateFri, 16 Dec 2011 17:32:24 +0000
treeherdermozilla-release@79d24e644fdd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone9.0a1
backs out58d026601240cec8a26acc78a7cfdb6dc0bb55ae
c5a9a439d72ca0811d977e0c7103b96ba14c8289
cfdf675266b2e1f81664dcef4e6fe30cb7ba43d2
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
Backout changesets 58d026601240, c5a9a439d72c and cfdf675266b2 because of mochitest-3 crash
content/base/src/ThirdPartyUtil.cpp
content/base/src/ThirdPartyUtil.h
dom/workers/ChromeWorkerScope.cpp
dom/workers/EventTarget.cpp
dom/workers/RuntimeService.cpp
dom/workers/Worker.cpp
dom/workers/Worker.h
dom/workers/WorkerPrivate.cpp
dom/workers/WorkerPrivate.h
dom/workers/test/Makefile.in
dom/workers/test/chromeWorker_worker.js
dom/workers/test/ipAddressOrigin_iframe.html
dom/workers/test/ipAddressOrigin_worker.js
dom/workers/test/test_ipAddressOrigin.html
dom/workers/test/test_terminate.html
netwerk/base/public/mozIThirdPartyUtil.idl
--- a/content/base/src/ThirdPartyUtil.cpp
+++ b/content/base/src/ThirdPartyUtil.cpp
@@ -52,16 +52,56 @@ ThirdPartyUtil::Init()
 {
   NS_ENSURE_TRUE(NS_IsMainThread(), NS_ERROR_NOT_AVAILABLE);
 
   nsresult rv;
   mTLDService = do_GetService(NS_EFFECTIVETLDSERVICE_CONTRACTID, &rv);
   return rv;
 }
 
+// Get the base domain for aHostURI; e.g. for "www.bbc.co.uk", this would be
+// "bbc.co.uk". Only properly-formed URI's are tolerated, though a trailing
+// dot may be present. If aHostURI is an IP address, an alias such as
+// 'localhost', an eTLD such as 'co.uk', or the empty string, aBaseDomain will
+// be the exact host. The result of this function should only be used in exact
+// string comparisons, since substring comparisons will not be valid for the
+// special cases elided above.
+nsresult
+ThirdPartyUtil::GetBaseDomain(nsIURI* aHostURI,
+                              nsCString& aBaseDomain)
+{
+  // Get the base domain. this will fail if the host contains a leading dot,
+  // more than one trailing dot, or is otherwise malformed.
+  nsresult rv = mTLDService->GetBaseDomain(aHostURI, 0, aBaseDomain);
+  if (rv == NS_ERROR_HOST_IS_IP_ADDRESS ||
+      rv == NS_ERROR_INSUFFICIENT_DOMAIN_LEVELS) {
+    // aHostURI is either an IP address, an alias such as 'localhost', an eTLD
+    // such as 'co.uk', or the empty string. Uses the normalized host in such
+    // cases.
+    rv = aHostURI->GetAsciiHost(aBaseDomain);
+  }
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  // aHostURI (and thus aBaseDomain) may be the string '.'. If so, fail.
+  if (aBaseDomain.Length() == 1 && aBaseDomain.Last() == '.')
+    return NS_ERROR_INVALID_ARG;
+
+  // Reject any URIs without a host that aren't file:// URIs. This makes it the
+  // only way we can get a base domain consisting of the empty string, which
+  // means we can safely perform foreign tests on such URIs where "not foreign"
+  // means "the involved URIs are all file://".
+  if (aBaseDomain.IsEmpty()) {
+    PRBool isFileURI = PR_FALSE;
+    aHostURI->SchemeIs("file", &isFileURI);
+    NS_ENSURE_TRUE(isFileURI, NS_ERROR_INVALID_ARG);
+  }
+
+  return NS_OK;
+}
+
 // Determine if aFirstDomain is a different base domain to aSecondURI; or, if
 // the concept of base domain does not apply, determine if the two hosts are not
 // string-identical.
 nsresult
 ThirdPartyUtil::IsThirdPartyInternal(const nsCString& aFirstDomain,
                                      nsIURI* aSecondURI,
                                      PRBool* aResult)
 {
@@ -271,47 +311,8 @@ ThirdPartyUtil::IsThirdPartyChannel(nsIC
     ourWin = parentWin;
   }
 
   // Check the window hierarchy. This covers most cases for an ordinary page
   // load from the location bar.
   return IsThirdPartyWindow(ourWin, channelURI, aResult);
 }
 
-// Get the base domain for aHostURI; e.g. for "www.bbc.co.uk", this would be
-// "bbc.co.uk". Only properly-formed URI's are tolerated, though a trailing
-// dot may be present. If aHostURI is an IP address, an alias such as
-// 'localhost', an eTLD such as 'co.uk', or the empty string, aBaseDomain will
-// be the exact host. The result of this function should only be used in exact
-// string comparisons, since substring comparisons will not be valid for the
-// special cases elided above.
-NS_IMETHODIMP
-ThirdPartyUtil::GetBaseDomain(nsIURI* aHostURI,
-                              nsACString& aBaseDomain)
-{
-  // Get the base domain. this will fail if the host contains a leading dot,
-  // more than one trailing dot, or is otherwise malformed.
-  nsresult rv = mTLDService->GetBaseDomain(aHostURI, 0, aBaseDomain);
-  if (rv == NS_ERROR_HOST_IS_IP_ADDRESS ||
-      rv == NS_ERROR_INSUFFICIENT_DOMAIN_LEVELS) {
-    // aHostURI is either an IP address, an alias such as 'localhost', an eTLD
-    // such as 'co.uk', or the empty string. Uses the normalized host in such
-    // cases.
-    rv = aHostURI->GetAsciiHost(aBaseDomain);
-  }
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  // aHostURI (and thus aBaseDomain) may be the string '.'. If so, fail.
-  if (aBaseDomain.Length() == 1 && aBaseDomain.Last() == '.')
-    return NS_ERROR_INVALID_ARG;
-
-  // Reject any URIs without a host that aren't file:// URIs. This makes it the
-  // only way we can get a base domain consisting of the empty string, which
-  // means we can safely perform foreign tests on such URIs where "not foreign"
-  // means "the involved URIs are all file://".
-  if (aBaseDomain.IsEmpty()) {
-    PRBool isFileURI = PR_FALSE;
-    aHostURI->SchemeIs("file", &isFileURI);
-    NS_ENSURE_TRUE(isFileURI, NS_ERROR_INVALID_ARG);
-  }
-
-  return NS_OK;
-}
--- a/content/base/src/ThirdPartyUtil.h
+++ b/content/base/src/ThirdPartyUtil.h
@@ -51,16 +51,17 @@ class ThirdPartyUtil : public mozIThirdP
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_MOZITHIRDPARTYUTIL
 
   nsresult Init();
 
 private:
+  nsresult GetBaseDomain(nsIURI* aHostURI, nsCString& aBaseDomain);
   nsresult IsThirdPartyInternal(const nsCString& aFirstDomain,
     nsIURI* aSecondURI, PRBool* aResult);
   static already_AddRefed<nsIURI> GetURIFromWindow(nsIDOMWindow* aWin);
 
   nsCOMPtr<nsIEffectiveTLDService> mTLDService;
 };
 
 #endif
--- a/dom/workers/ChromeWorkerScope.cpp
+++ b/dom/workers/ChromeWorkerScope.cpp
@@ -40,20 +40,16 @@
 
 #include "jsapi.h"
 #include "jscntxt.h"
 
 #include "nsXPCOM.h"
 #include "nsNativeCharsetUtils.h"
 #include "nsStringGlue.h"
 
-#include "WorkerPrivate.h"
-
-#define CTYPES_STR "ctypes"
-
 USING_WORKERS_NAMESPACE
 
 namespace {
 
 #ifdef BUILD_CTYPES
 char*
 UnicodeToNative(JSContext* aCx, const jschar* aSource, size_t aSourceLen)
 {
@@ -73,75 +69,34 @@ UnicodeToNative(JSContext* aCx, const js
   memcpy(result, native.get(), native.Length());
   result[native.Length()] = 0;
   return result;
 }
 
 JSCTypesCallbacks gCTypesCallbacks = {
   UnicodeToNative
 };
-
-JSBool
-CTypesLazyGetter(JSContext* aCx, JSObject* aObj, jsid aId, jsval* aVp)
-{
-  NS_ASSERTION(JS_GetGlobalObject(aCx) == aObj, "Not a global object!");
-  NS_ASSERTION(JSID_IS_STRING(aId), "Bad id!");
-  NS_ASSERTION(JS_FlatStringEqualsAscii(JSID_TO_FLAT_STRING(aId), CTYPES_STR),
-               "Bad id!");
-
-  WorkerPrivate* worker = GetWorkerPrivateFromContext(aCx);
-  NS_ASSERTION(worker->IsChromeWorker(), "This should always be true!");
-
-  if (!worker->DisableMemoryReporter()) {
-    return false;
-  }
-
-  jsval ctypes;
-  return JS_DeletePropertyById(aCx, aObj, aId) &&
-         JS_InitCTypesClass(aCx, aObj) &&
-         JS_GetPropertyById(aCx, aObj, aId, &ctypes) &&
-         JS_SetCTypesCallbacks(aCx, JSVAL_TO_OBJECT(ctypes),
-                               &gCTypesCallbacks) &&
-         JS_GetPropertyById(aCx, aObj, aId, aVp);
-}
 #endif
 
-inline bool
-DefineCTypesLazyGetter(JSContext* aCx, JSObject* aGlobal)
-{
-#ifdef BUILD_CTYPES
-  {
-    JSString* ctypesStr = JS_InternString(aCx, CTYPES_STR);
-    if (!ctypesStr) {
-      return false;
-    }
-
-    jsid ctypesId = INTERNED_STRING_TO_JSID(aCx, ctypesStr);
-
-    // We use a lazy getter here to let us unregister the blocking memory
-    // reporter since ctypes can easily block the worker thread and we can
-    // deadlock. Remove once bug 673323 is fixed.
-    if (!JS_DefinePropertyById(aCx, aGlobal, ctypesId, JSVAL_VOID,
-                               CTypesLazyGetter, NULL, 0)) {
-      return false;
-    }
-  }
-#endif
-
-  return true;
-}
-
 } // anonymous namespace
 
 BEGIN_WORKERS_NAMESPACE
 
 namespace chromeworker {
 
 bool
 DefineChromeWorkerFunctions(JSContext* aCx, JSObject* aGlobal)
 {
-  // Currently ctypes is the only special property given to ChromeWorkers.
-  return DefineCTypesLazyGetter(aCx, aGlobal);
+#ifdef BUILD_CTYPES
+  jsval ctypes;
+  if (!JS_InitCTypesClass(aCx, aGlobal) ||
+      !JS_GetProperty(aCx, aGlobal, "ctypes", &ctypes) ||
+      !JS_SetCTypesCallbacks(aCx, JSVAL_TO_OBJECT(ctypes), &gCTypesCallbacks)) {
+    return false;
+  }
+#endif
+
+  return true;
 }
 
 } // namespace chromeworker
 
 END_WORKERS_NAMESPACE
--- a/dom/workers/EventTarget.cpp
+++ b/dom/workers/EventTarget.cpp
@@ -136,19 +136,17 @@ EventTarget::FromJSObject(JSContext* aCx
 
 // static
 JSBool
 EventTarget::AddEventListener(JSContext* aCx, uintN aArgc, jsval* aVp)
 {
   JSObject* obj = JS_THIS_OBJECT(aCx, aVp);
 
   EventTarget* self = GetPrivate(aCx, obj);
-  if (!self) {
-    return true;
-  }
+  JS_ASSERT(self);
 
   JSString* type;
   JSObject* listener;
   JSBool capturing = false, wantsUntrusted = false;
   if (!JS_ConvertArguments(aCx, aArgc, JS_ARGV(aCx, aVp), "So/bb", &type,
                            &listener, &capturing, &wantsUntrusted)) {
     return false;
   }
@@ -164,19 +162,17 @@ EventTarget::AddEventListener(JSContext*
 
 // static
 JSBool
 EventTarget::RemoveEventListener(JSContext* aCx, uintN aArgc, jsval* aVp)
 {
   JSObject* obj = JS_THIS_OBJECT(aCx, aVp);
 
   EventTarget* self = GetPrivate(aCx, obj);
-  if (!self) {
-    return true;
-  }
+  JS_ASSERT(self);
 
   JSString* type;
   JSObject* listener;
   JSBool capturing = false;
   if (!JS_ConvertArguments(aCx, aArgc, JS_ARGV(aCx, aVp), "So/b", &type,
                            &listener, &capturing)) {
     return false;
   }
@@ -192,19 +188,17 @@ EventTarget::RemoveEventListener(JSConte
 
 // static
 JSBool
 EventTarget::DispatchEvent(JSContext* aCx, uintN aArgc, jsval* aVp)
 {
   JSObject* obj = JS_THIS_OBJECT(aCx, aVp);
 
   EventTarget* self = GetPrivate(aCx, obj);
-  if (!self) {
-    return true;
-  }
+  JS_ASSERT(self);
 
   JSObject* event;
   if (!JS_ConvertArguments(aCx, aArgc, JS_ARGV(aCx, aVp), "o", &event)) {
     return false;
   }
 
   bool preventDefaultCalled;
   if (!self->mListenerManager.DispatchEvent(aCx, obj, event,
--- a/dom/workers/RuntimeService.cpp
+++ b/dom/workers/RuntimeService.cpp
@@ -41,21 +41,23 @@
 
 #include "nsIDOMChromeWindow.h"
 #include "nsIDocument.h"
 #include "nsIEffectiveTLDService.h"
 #include "nsIObserverService.h"
 #include "nsIPlatformCharset.h"
 #include "nsIPrincipal.h"
 #include "nsIJSContextStack.h"
+#include "nsIMemoryReporter.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsISupportsPriority.h"
 #include "nsITimer.h"
 #include "nsPIDOMWindow.h"
 
+#include "jsprf.h"
 #include "mozilla/Preferences.h"
 #include "nsContentUtils.h"
 #include "nsDOMJSUtils.h"
 #include "nsGlobalWindow.h"
 #include "nsNetUtil.h"
 #include "nsServiceManagerUtils.h"
 #include "nsThreadUtils.h"
 #include "nsXPCOM.h"
@@ -280,16 +282,71 @@ CreateJSContextForWorker(WorkerPrivate* 
 
   if (aWorkerPrivate->IsChromeWorker()) {
     JS_SetVersion(workerCx, JSVERSION_LATEST);
   }
 
   return workerCx;
 }
 
+class WorkerMemoryReporter : public nsIMemoryMultiReporter
+{
+  WorkerPrivate* mWorkerPrivate;
+  nsCString mPathPrefix;
+
+public:
+  NS_DECL_ISUPPORTS
+
+  WorkerMemoryReporter(WorkerPrivate* aWorkerPrivate)
+  : mWorkerPrivate(aWorkerPrivate)
+  {
+    aWorkerPrivate->AssertIsOnWorkerThread();
+
+    nsCString escapedDomain(aWorkerPrivate->Domain());
+    escapedDomain.ReplaceChar('/', '\\');
+
+    NS_ConvertUTF16toUTF8 escapedURL(aWorkerPrivate->ScriptURL());
+    escapedURL.ReplaceChar('/', '\\');
+
+    // 64bit address plus '0x' plus null terminator.
+    char address[21];
+    JSUint32 addressSize =
+      JS_snprintf(address, sizeof(address), "0x%llx", aWorkerPrivate);
+    if (addressSize == JSUint32(-1)) {
+      NS_WARNING("JS_snprintf failed!");
+      address[0] = '\0';
+      addressSize = 0;
+    }
+
+    mPathPrefix = NS_LITERAL_CSTRING("explicit/dom/workers(") +
+                  escapedDomain + NS_LITERAL_CSTRING(")/worker(") +
+                  escapedURL + NS_LITERAL_CSTRING(", ") +
+                  nsDependentCString(address, addressSize) +
+                  NS_LITERAL_CSTRING(")/");
+  }
+
+  NS_IMETHOD
+  CollectReports(nsIMemoryMultiReporterCallback* aCallback,
+                 nsISupports* aClosure)
+  {
+    AssertIsOnMainThread();
+
+    IterateData data;
+    if (!mWorkerPrivate->BlockAndCollectRuntimeStats(&data)) {
+      return NS_ERROR_FAILURE;
+    }
+
+    ReportJSRuntimeStats(data, mPathPrefix, aCallback, aClosure);
+
+    return NS_OK;
+  }
+};
+
+NS_IMPL_THREADSAFE_ISUPPORTS1(WorkerMemoryReporter, nsIMemoryMultiReporter)
+
 class WorkerThreadRunnable : public nsRunnable
 {
   WorkerPrivate* mWorkerPrivate;
 
 public:
   WorkerThreadRunnable(WorkerPrivate* aWorkerPrivate)
   : mWorkerPrivate(aWorkerPrivate)
   {
@@ -306,21 +363,35 @@ public:
 
     JSContext* cx = CreateJSContextForWorker(workerPrivate);
     if (!cx) {
       // XXX need to fire an error at parent.
       NS_ERROR("Failed to create runtime and context!");
       return NS_ERROR_FAILURE;
     }
 
+    nsRefPtr<WorkerMemoryReporter> reporter =
+      new WorkerMemoryReporter(workerPrivate);
+    if (NS_FAILED(NS_RegisterMemoryMultiReporter(reporter))) {
+      NS_WARNING("Failed to register memory reporter!");
+      reporter = nsnull;
+    }
+
     {
       JSAutoRequest ar(cx);
       workerPrivate->DoRunLoop(cx);
     }
 
+    if (reporter) {
+      if (NS_FAILED(NS_UnregisterMemoryMultiReporter(reporter))) {
+        NS_WARNING("Failed to unregister memory reporter!");
+      }
+      reporter = nsnull;
+    }
+
     JSRuntime* rt = JS_GetRuntime(cx);
 
     // XXX Bug 666963 - CTypes can create another JSContext for use with
     // closures, and then it holds that context in a reserved slot on the CType
     // prototype object. We have to destroy that context before we can destroy
     // the runtime, and we also have to make sure that it isn't the last context
     // to be destroyed (otherwise it will assert). To accomplish this we create
     // an unused dummy context, destroy our real context, and then destroy the
--- a/dom/workers/Worker.cpp
+++ b/dom/workers/Worker.cpp
@@ -107,37 +107,16 @@ public:
                               PRIVATE_TO_JSVAL(parent))) {
         return NULL;
       }
     }
 
     return proto;
   }
 
-  static void
-  ClearPrivateSlot(JSContext* aCx, JSObject* aObj)
-  {
-    JS_ASSERT(!JS_IsExceptionPending(aCx));
-
-    WorkerPrivate* worker = GetJSPrivateSafeish<WorkerPrivate>(aCx, aObj);
-    JS_ASSERT(worker);
-
-    for (int index = 0; index < STRING_COUNT; index++) {
-      const char* name = sEventStrings[index];
-      jsval listener;
-      if (!worker->GetEventListenerOnEventTarget(aCx, name + 2, &listener) ||
-          !JS_DefineProperty(aCx, aObj, name, listener, NULL, NULL,
-                             (PROPERTY_FLAGS & ~JSPROP_SHARED))) {
-        JS_ClearPendingException(aCx);
-      }
-    }
-
-    SetJSPrivateSafeish(aCx, aObj, NULL);
-  }
-
 protected:
   static WorkerPrivate*
   GetInstancePrivate(JSContext* aCx, JSObject* aObj, const char* aFunctionName);
 
   static JSBool
   ConstructInternal(JSContext* aCx, uintN aArgc, jsval* aVp,
                     bool aIsChromeWorker)
   {
@@ -353,22 +332,16 @@ public:
                               PRIVATE_TO_JSVAL(parent))) {
         return NULL;
       }
     }
 
     return proto;
   }
 
-  static void
-  ClearPrivateSlot(JSContext* aCx, JSObject* aObj)
-  {
-    Worker::ClearPrivateSlot(aCx, aObj);
-  }
-
 private:
   // No instance of this class should ever be created so these are explicitly
   // left without an implementation to prevent linking in case someone tries to
   // make one.
   ChromeWorker();
   ~ChromeWorker();
 
   static WorkerPrivate*
@@ -447,30 +420,16 @@ namespace worker {
 
 JSObject*
 InitClass(JSContext* aCx, JSObject* aGlobal, JSObject* aProto,
           bool aMainRuntime)
 {
   return Worker::InitClass(aCx, aGlobal, aProto, aMainRuntime);
 }
 
-void
-ClearPrivateSlot(JSContext* aCx, JSObject* aObj)
-{
-  JSClass* clasp = JS_GET_CLASS(aCx, aObj);
-  JS_ASSERT(clasp == Worker::Class() || clasp == ChromeWorker::Class());
-
-  if (clasp == ChromeWorker::Class()) {
-    ChromeWorker::ClearPrivateSlot(aCx, aObj);
-  }
-  else {
-    Worker::ClearPrivateSlot(aCx, aObj);
-  }
-}
-
 } // namespace worker
 
 namespace chromeworker {
 
 bool
 InitClass(JSContext* aCx, JSObject* aGlobal, JSObject* aProto,
           bool aMainRuntime)
 {
--- a/dom/workers/Worker.h
+++ b/dom/workers/Worker.h
@@ -46,19 +46,16 @@
 BEGIN_WORKERS_NAMESPACE
 
 namespace worker {
 
 JSObject*
 InitClass(JSContext* aCx, JSObject* aGlobal, JSObject* aProto,
           bool aMainRuntime);
 
-void
-ClearPrivateSlot(JSContext* aCx, JSObject* aObj);
-
 } // namespace worker
 
 namespace chromeworker {
 
 bool
 InitClass(JSContext* aCx, JSObject* aGlobal, JSObject* aProto,
           bool aMainRuntime);
 
--- a/dom/workers/WorkerPrivate.cpp
+++ b/dom/workers/WorkerPrivate.cpp
@@ -34,36 +34,34 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "WorkerPrivate.h"
 
-#include "mozIThirdPartyUtil.h"
 #include "nsIClassInfo.h"
 #include "nsIConsoleService.h"
 #include "nsIDOMFile.h"
 #include "nsIDocument.h"
+#include "nsIEffectiveTLDService.h"
 #include "nsIJSContextStack.h"
-#include "nsIMemoryReporter.h"
 #include "nsIScriptError.h"
 #include "nsIScriptGlobalObject.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsPIDOMWindow.h"
 #include "nsITextToSubURI.h"
 #include "nsITimer.h"
 #include "nsIURI.h"
 #include "nsIURL.h"
 #include "nsIXPConnect.h"
 
 #include "jscntxt.h"
 #include "jsdbgapi.h"
-#include "jsprf.h"
 #include "nsAlgorithm.h"
 #include "nsContentUtils.h"
 #include "nsDOMClassInfo.h"
 #include "nsDOMJSUtils.h"
 #include "nsGUIEvent.h"
 #include "nsJSEnvironment.h"
 #include "nsJSUtils.h"
 #include "nsNetUtil.h"
@@ -71,17 +69,16 @@
 #include "xpcpublic.h"
 
 #include "Events.h"
 #include "Exceptions.h"
 #include "File.h"
 #include "Principal.h"
 #include "RuntimeService.h"
 #include "ScriptLoader.h"
-#include "Worker.h"
 #include "WorkerFeature.h"
 #include "WorkerScope.h"
 
 #include "WorkerInlines.h"
 
 #if 0 // Define to run GC more often.
 #define EXTRA_GC
 #endif
@@ -138,97 +135,16 @@ SwapToISupportsArray(SmartPtr<T>& aSrc,
   T* raw = nsnull;
   aSrc.swap(raw);
 
   nsISupports* rawSupports =
     static_cast<typename ISupportsBaseInfo<T>::ISupportsBase*>(raw);
   dest->swap(rawSupports);
 }
 
-class WorkerMemoryReporter : public nsIMemoryMultiReporter
-{
-  WorkerPrivate* mWorkerPrivate;
-  nsCString mAddressString;
-  nsCString mPathPrefix;
-
-public:
-  NS_DECL_ISUPPORTS
-
-  WorkerMemoryReporter(WorkerPrivate* aWorkerPrivate)
-  : mWorkerPrivate(aWorkerPrivate)
-  {
-    aWorkerPrivate->AssertIsOnWorkerThread();
-
-    nsCString escapedDomain(aWorkerPrivate->Domain());
-    escapedDomain.ReplaceChar('/', '\\');
-
-    NS_ConvertUTF16toUTF8 escapedURL(aWorkerPrivate->ScriptURL());
-    escapedURL.ReplaceChar('/', '\\');
-
-    {
-      // 64bit address plus '0x' plus null terminator.
-      char address[21];
-      JSUint32 addressSize =
-        JS_snprintf(address, sizeof(address), "0x%llx", aWorkerPrivate);
-      if (addressSize != JSUint32(-1)) {
-        mAddressString.Assign(address, addressSize);
-      }
-      else {
-        NS_WARNING("JS_snprintf failed!");
-        mAddressString.AssignLiteral("<unknown address>");
-      }
-    }
-
-    mPathPrefix = NS_LITERAL_CSTRING("explicit/dom/workers(") +
-                  escapedDomain + NS_LITERAL_CSTRING(")/worker(") +
-                  escapedURL + NS_LITERAL_CSTRING(", ") + mAddressString +
-                  NS_LITERAL_CSTRING(")/");
-  }
-
-  NS_IMETHOD
-  CollectReports(nsIMemoryMultiReporterCallback* aCallback,
-                 nsISupports* aClosure)
-  {
-    AssertIsOnMainThread();
-
-    IterateData data;
-
-    if (mWorkerPrivate) {
-      bool disabled;
-      if (!mWorkerPrivate->BlockAndCollectRuntimeStats(&data, &disabled)) {
-        return NS_ERROR_FAILURE;
-      }
-
-      // Don't ever try to talk to the worker again.
-      if (disabled) {
-#ifdef DEBUG
-        {
-          nsCAutoString message("Unable to report memory for ");
-          if (mWorkerPrivate->IsChromeWorker()) {
-            message.AppendLiteral("Chrome");
-          }
-          message += NS_LITERAL_CSTRING("Worker (") + mAddressString +
-                     NS_LITERAL_CSTRING(")! It is either using ctypes or is in "
-                                        "the process of being destroyed");
-          NS_WARNING(message.get());
-        }
-#endif
-        mWorkerPrivate = nsnull;
-      }
-    }
-
-    // Always report, even if we're disabled, so that we at least get an entry
-    // in about::memory.
-    ReportJSRuntimeStats(data, mPathPrefix, aCallback, aClosure);
-    return NS_OK;
-  }
-};
-
-NS_IMPL_THREADSAFE_ISUPPORTS1(WorkerMemoryReporter, nsIMemoryMultiReporter)
-
 struct WorkerStructuredCloneCallbacks
 {
   static JSObject*
   Read(JSContext* aCx, JSStructuredCloneReader* aReader, uint32 aTag,
        uint32 aData, void* aClosure)
   {
     // See if object is a nsIDOMFile pointer.
     if (aTag == DOMWORKER_SCTAG_FILE) {
@@ -1361,29 +1277,29 @@ public:
 };
 #endif
 
 class CollectRuntimeStatsRunnable : public WorkerControlRunnable
 {
   typedef mozilla::Mutex Mutex;
   typedef mozilla::CondVar CondVar;
 
-  Mutex mMutex;
-  CondVar mCondVar;
-  volatile bool mDone;
+  Mutex* mMutex;
+  CondVar* mCondVar;
+  volatile bool* mDoneFlag;
   IterateData* mData;
-  bool* mSucceeded;
+  volatile bool* mSucceeded;
 
 public:
-  CollectRuntimeStatsRunnable(WorkerPrivate* aWorkerPrivate, IterateData* aData,
-                              bool* aSucceeded)
+  CollectRuntimeStatsRunnable(WorkerPrivate* aWorkerPrivate, Mutex* aMutex,
+                              CondVar* aCondVar, volatile bool* aDoneFlag,
+                              IterateData* aData, volatile bool* aSucceeded)
   : WorkerControlRunnable(aWorkerPrivate, WorkerThread, UnchangedBusyCount),
-    mMutex("CollectRuntimeStatsRunnable::mMutex"),
-    mCondVar(mMutex, "CollectRuntimeStatsRunnable::mCondVar"), mDone(false),
-    mData(aData), mSucceeded(aSucceeded)
+    mMutex(aMutex), mCondVar(aCondVar), mDoneFlag(aDoneFlag), mData(aData),
+    mSucceeded(aSucceeded)
   { }
 
   bool
   PreDispatch(JSContext* aCx, WorkerPrivate* aWorkerPrivate)
   {
     AssertIsOnMainThread();
     return true;
   }
@@ -1391,46 +1307,29 @@ public:
   void
   PostDispatch(JSContext* aCx, WorkerPrivate* aWorkerPrivate,
                bool aDispatchResult)
   {
     AssertIsOnMainThread();
   }
 
   bool
-  DispatchInternal()
-  {
-    AssertIsOnMainThread();
-
-    if (!WorkerControlRunnable::DispatchInternal()) {
-      NS_WARNING("Failed to dispatch runnable!");
-      return false;
-    }
-
-    {
-      MutexAutoLock lock(mMutex);
-      while (!mDone) {
-        mCondVar.Wait();
-      }
-    }
-
-    return true;
-  }
-
-  bool
   WorkerRun(JSContext* aCx, WorkerPrivate* aWorkerPrivate)
   {
     JSAutoSuspendRequest asr(aCx);
 
     *mSucceeded = CollectCompartmentStatsForRuntime(JS_GetRuntime(aCx), mData);
 
     {
-      MutexAutoLock lock(mMutex);
-      mDone = true;
-      mCondVar.Notify();
+      MutexAutoLock lock(*mMutex);
+
+      NS_ASSERTION(!*mDoneFlag, "Should be false!");
+
+      *mDoneFlag = true;
+      mCondVar->Notify();
     }
 
     return true;
   }
 };
 
 } /* anonymous namespace */
 
@@ -1869,17 +1768,17 @@ WorkerPrivateParent<Derived>::Resume(JSC
 template <class Derived>
 void
 WorkerPrivateParent<Derived>::FinalizeInstance(JSContext* aCx)
 {
   AssertIsOnParentThread();
 
   if (mJSObject) {
     // Decouple the object from the private now.
-    worker::ClearPrivateSlot(aCx, mJSObject);
+    SetJSPrivateSafeish(aCx, mJSObject, nsnull);
 
     // Clear the JS object.
     mJSObject = nsnull;
 
     // Unroot.
     RootJSObject(aCx, false);
 
     if (!Terminate(aCx)) {
@@ -2197,18 +2096,17 @@ WorkerPrivate::WorkerPrivate(JSContext* 
                              nsCOMPtr<nsIDocument>& aDocument)
 : WorkerPrivateParent<WorkerPrivate>(aCx, aObject, aParent, aParentJSContext,
                                      aScriptURL, aIsChromeWorker, aDomain,
                                      aWindow, aParentScriptContext, aBaseURI,
                                      aPrincipal, aDocument),
   mJSContext(nsnull), mErrorHandlerRecursionCount(0), mNextTimeoutId(1),
   mStatus(Pending), mSuspended(false), mTimerRunning(false),
   mRunningExpiredTimeouts(false), mCloseHandlerStarted(false),
-  mCloseHandlerFinished(false), mMemoryReporterRunning(false),
-  mMemoryReporterDisabled(false)
+  mCloseHandlerFinished(false)
 {
   MOZ_COUNT_CTOR(mozilla::dom::workers::WorkerPrivate);
 }
 
 WorkerPrivate::~WorkerPrivate()
 {
   MOZ_COUNT_DTOR(mozilla::dom::workers::WorkerPrivate);
 }
@@ -2325,24 +2223,24 @@ WorkerPrivate::Create(JSContext* aCx, JS
           return nsnull;
         }
 
         if (isFile) {
           // XXX Fix this, need a real domain here.
           domain = file;
         }
         else {
-          nsCOMPtr<mozIThirdPartyUtil> thirdPartyUtil =
-            do_GetService(THIRDPARTYUTIL_CONTRACTID);
-          if (!thirdPartyUtil) {
-            JS_ReportError(aCx, "Could not get third party helper service!");
+          nsCOMPtr<nsIEffectiveTLDService> tldService =
+            do_GetService(NS_EFFECTIVETLDSERVICE_CONTRACTID);
+          if (!tldService) {
+            JS_ReportError(aCx, "Could not get TLD service!");
             return nsnull;
           }
 
-          if (NS_FAILED(thirdPartyUtil->GetBaseDomain(codebase, domain))) {
+          if (NS_FAILED(tldService->GetBaseDomain(codebase, 0, domain))) {
             JS_ReportError(aCx, "Could not get domain!");
             return nsnull;
           }
         }
       }
     }
     else {
       // Not a window
@@ -2405,23 +2303,16 @@ WorkerPrivate::DoRunLoop(JSContext* aCx)
   {
     MutexAutoLock lock(mMutex);
     mJSContext = aCx;
 
     NS_ASSERTION(mStatus == Pending, "Huh?!");
     mStatus = Running;
   }
 
-  mMemoryReporter = new WorkerMemoryReporter(this);
-
-  if (NS_FAILED(NS_RegisterMemoryMultiReporter(mMemoryReporter))) {
-    NS_WARNING("Failed to register memory reporter!");
-    mMemoryReporter = nsnull;
-  }
-
   for (;;) {
     Status currentStatus;
     nsIRunnable* event;
     {
       MutexAutoLock lock(mMutex);
 
       while (!mControlQueue.Pop(event) && !mQueue.Pop(event)) {
         mCondVar.Wait();
@@ -2462,27 +2353,16 @@ WorkerPrivate::DoRunLoop(JSContext* aCx)
         NS_ASSERTION(currentStatus == Killing, "Should have changed status!");
 #else
         currentStatus = Killing;
 #endif
       }
 
       // If we're supposed to die then we should exit the loop.
       if (currentStatus == Killing) {
-        // Call this before unregistering the reporter as we may be racing with
-        // the main thread.
-        DisableMemoryReporter();
-
-        if (mMemoryReporter) {
-          if (NS_FAILED(NS_UnregisterMemoryMultiReporter(mMemoryReporter))) {
-            NS_WARNING("Failed to unregister memory reporter!");
-          }
-          mMemoryReporter = nsnull;
-        }
-
         StopAcceptingEvents();
         return;
       }
     }
   }
 
   NS_NOTREACHED("Shouldn't get here!");
 }
@@ -2491,17 +2371,31 @@ bool
 WorkerPrivate::OperationCallback(JSContext* aCx)
 {
   AssertIsOnWorkerThread();
 
   bool mayContinue = true;
 
   for (;;) {
     // Run all control events now.
-    mayContinue = ProcessAllControlRunnables();
+    for (;;) {
+      nsIRunnable* event;
+      {
+        MutexAutoLock lock(mMutex);
+        if (!mControlQueue.Pop(event)) {
+          break;
+        }
+      }
+
+      if (NS_FAILED(event->Run())) {
+        mayContinue = false;
+      }
+
+      NS_RELEASE(event);
+    }
 
     if (!mayContinue || !mSuspended) {
       break;
     }
 
     // Clean up before suspending.
     JS_FlushCaches(aCx);
     JS_GC(aCx);
@@ -2558,97 +2452,46 @@ WorkerPrivate::ScheduleDeletion(bool aWa
       new TopLevelWorkerFinishedRunnable(this, currentThread);
     if (NS_FAILED(NS_DispatchToMainThread(runnable, NS_DISPATCH_NORMAL))) {
       NS_WARNING("Failed to dispatch runnable!");
     }
   }
 }
 
 bool
-WorkerPrivate::BlockAndCollectRuntimeStats(IterateData* aData, bool* aDisabled)
+WorkerPrivate::BlockAndCollectRuntimeStats(IterateData* aData)
 {
   AssertIsOnMainThread();
+  mMutex.AssertNotCurrentThreadOwns();
   NS_ASSERTION(aData, "Null data!");
 
-  {
-    MutexAutoLock lock(mMutex);
-
-    if (mMemoryReporterDisabled) {
-      *aDisabled = true;
-      return true;
-    }
-
-    *aDisabled = false;
-    mMemoryReporterRunning = true;
-  }
-
-  bool succeeded;
+  mozilla::Mutex mutex("BlockAndCollectRuntimeStats mutex");
+  mozilla::CondVar condvar(mutex, "BlockAndCollectRuntimeStats condvar");
+  volatile bool doneFlag = false;
+  volatile bool succeeded = false;
 
   nsRefPtr<CollectRuntimeStatsRunnable> runnable =
-    new CollectRuntimeStatsRunnable(this, aData, &succeeded);
+    new CollectRuntimeStatsRunnable(this, &mutex, &condvar, &doneFlag, aData,
+                                    &succeeded);
   if (!runnable->Dispatch(nsnull)) {
     NS_WARNING("Failed to dispatch runnable!");
-    succeeded = false;
+    return false;
   }
 
   {
-    MutexAutoLock lock(mMutex);
-    mMemoryReporterRunning = false;
+    MutexAutoLock lock(mutex);
+    while (!doneFlag) {
+      condvar.Wait();
+    }
   }
 
   return succeeded;
 }
 
 bool
-WorkerPrivate::DisableMemoryReporter()
-{
-  AssertIsOnWorkerThread();
-
-  bool result = true;
-
-  {
-    MutexAutoLock lock(mMutex);
-
-    mMemoryReporterDisabled = true;
-
-    while (mMemoryReporterRunning) {
-      MutexAutoUnlock unlock(mMutex);
-      result = ProcessAllControlRunnables() && result;
-    }
-  }
-
-  return result;
-}
-
-bool
-WorkerPrivate::ProcessAllControlRunnables()
-{
-  AssertIsOnWorkerThread();
-
-  bool result = true;
-
-  for (;;) {
-    nsIRunnable* event;
-    {
-      MutexAutoLock lock(mMutex);
-      if (!mControlQueue.Pop(event)) {
-        break;
-      }
-    }
-
-    if (NS_FAILED(event->Run())) {
-      result = false;
-    }
-
-    NS_RELEASE(event);
-  }
-  return result;
-}
-
-bool
 WorkerPrivate::Dispatch(WorkerRunnable* aEvent, EventQueue* aQueue)
 {
   nsRefPtr<WorkerRunnable> event(aEvent);
 
   {
     MutexAutoLock lock(mMutex);
 
     if (mStatus == Dead) {
--- a/dom/workers/WorkerPrivate.h
+++ b/dom/workers/WorkerPrivate.h
@@ -58,17 +58,16 @@
 
 #include "EventTarget.h"
 #include "Queue.h"
 #include "WorkerFeature.h"
 
 class JSAutoStructuredCloneBuffer;
 class nsIDocument;
 class nsIPrincipal;
-class nsIMemoryMultiReporter;
 class nsIScriptContext;
 class nsIURI;
 class nsPIDOMWindow;
 class nsITimer;
 
 namespace mozilla {
 namespace xpconnect {
 namespace memory {
@@ -508,29 +507,26 @@ class WorkerPrivate : public WorkerPriva
   JSContext* mJSContext;
 
   // Things touched on worker thread only.
   nsTArray<ParentType*> mChildWorkers;
   nsTArray<WorkerFeature*> mFeatures;
   nsTArray<nsAutoPtr<TimeoutInfo> > mTimeouts;
 
   nsCOMPtr<nsITimer> mTimer;
-  nsCOMPtr<nsIMemoryMultiReporter> mMemoryReporter;
 
   mozilla::TimeStamp mKillTime;
   PRUint32 mErrorHandlerRecursionCount;
   PRUint32 mNextTimeoutId;
   Status mStatus;
   bool mSuspended;
   bool mTimerRunning;
   bool mRunningExpiredTimeouts;
   bool mCloseHandlerStarted;
   bool mCloseHandlerFinished;
-  bool mMemoryReporterRunning;
-  bool mMemoryReporterDisabled;
 
 #ifdef DEBUG
   nsCOMPtr<nsIThread> mThread;
 #endif
 
 public:
   ~WorkerPrivate();
 
@@ -653,21 +649,17 @@ public:
 
   void
   UpdateJSContextOptionsInternal(JSContext* aCx, PRUint32 aOptions);
 
   void
   ScheduleDeletion(bool aWasPending);
 
   bool
-  BlockAndCollectRuntimeStats(mozilla::xpconnect::memory::IterateData* aData,
-                              bool* aDisabled);
-
-  bool
-  DisableMemoryReporter();
+  BlockAndCollectRuntimeStats(mozilla::xpconnect::memory::IterateData* aData);
 
 #ifdef JS_GC_ZEAL
   void
   UpdateGCZealInternal(JSContext* aCx, PRUint8 aGCZeal);
 #endif
 
   JSContext*
   GetJSContext() const
@@ -746,19 +738,16 @@ private:
     mozilla::MutexAutoLock lock(mMutex);
 
     mStatus = Dead;
     mJSContext = nsnull;
 
     ClearQueue(&mQueue);
     ClearQueue(&mControlQueue);
   }
-
-  bool
-  ProcessAllControlRunnables();
 };
 
 WorkerPrivate*
 GetWorkerPrivateFromContext(JSContext* aCx);
 
 enum WorkerStructuredDataType
 {
   DOMWORKER_SCTAG_FILE = JS_SCTAG_USER_MIN + 0x1000,
--- a/dom/workers/test/Makefile.in
+++ b/dom/workers/test/Makefile.in
@@ -53,19 +53,16 @@ include $(topsrcdir)/config/rules.mk
   atob_worker.js \
   test_close.html \
   close_worker.js \
   test_errorPropagation.html \
   errorPropagation_iframe.html \
   errorPropagation_worker.js \
   test_eventDispatch.html \
   eventDispatch_worker.js \
-  test_ipAddressOrigin.html \
-  ipAddressOrigin_iframe.html \
-  ipAddressOrigin_worker.js \
   test_importScripts.html \
   importScripts_worker.js \
   importScripts_worker_imported1.js \
   importScripts_worker_imported2.js \
   importScripts_worker_imported3.js \
   importScripts_worker_imported4.js \
   test_json.html \
   json_worker.js \
--- a/dom/workers/test/chromeWorker_worker.js
+++ b/dom/workers/test/chromeWorker_worker.js
@@ -1,20 +1,15 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 if (!("ctypes" in self)) {
   throw "No ctypes!";
 }
 
-// Go ahead and verify that the ctypes lazy getter actually works.
-if (ctypes.toString() != "[object ctypes]") {
-  throw "Bad ctypes object: " + ctypes.toString();
-}
-
 onmessage = function(event) {
   let worker = new ChromeWorker("chromeWorker_subworker.js");
   worker.onmessage = function(event) {
     postMessage(event.data);
   }
   worker.postMessage(event.data);
 }
deleted file mode 100644
--- a/dom/workers/test/ipAddressOrigin_iframe.html
+++ /dev/null
@@ -1,23 +0,0 @@
-<!--
-  Any copyright is dedicated to the Public Domain.
-  http://creativecommons.org/publicdomain/zero/1.0/
--->
-<!DOCTYPE HTML>
-<html>
-<body>
-<script>
-
-  onmessage = function (event) {
-    var url = "http://127.0.0.1" +
-      window.location.pathname.replace("ipAddressOrigin_iframe.html",
-                                       "ipAddRessOrigin_worker.js");
-
-    var worker = new Worker(url);
-    worker.onmessage = function (event) {
-      window.parent.postMessage(event.data, "*");
-    };
-  }
-
-</script>
-</body>
-</html>
deleted file mode 100644
--- a/dom/workers/test/ipAddressOrigin_worker.js
+++ /dev/null
@@ -1,5 +0,0 @@
-/**
-* Any copyright is dedicated to the Public Domain.
-* http://creativecommons.org/publicdomain/zero/1.0/
-*/
-postMessage("done");
deleted file mode 100644
--- a/dom/workers/test/test_ipAddressOrigin.html
+++ /dev/null
@@ -1,42 +0,0 @@
-<!--
-  Any copyright is dedicated to the Public Domain.
-  http://creativecommons.org/publicdomain/zero/1.0/
--->
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>Test for Web Workers</title>
-  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body onload="go();">
-<p id="display"></p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-<iframe id="testFrame"></iframe>
-<script class="testbody" type="text/javascript">
-
-  function go() {
-    var iframe = document.getElementById("testFrame");
-
-    iframe.addEventListener("load", function() {
-      iframe.contentWindow.postMessage("go", "*");
-      window.addEventListener("message", function(event) {
-        is(event.data, "done", "Correct message");
-        SimpleTest.finish();
-      }, "false");
-    }, false);
-
-    iframe.src =
-      "http://127.0.0.1" +
-      window.location.pathname.replace("test_ipAddressOrigin.html",
-                                       "ipAddressOrigin_iframe.html");
-  }
-
-  SimpleTest.waitForExplicitFinish();
-
-</script>
-</pre>
-</body>
-</html>
--- a/dom/workers/test/test_terminate.html
+++ b/dom/workers/test/test_terminate.html
@@ -21,62 +21,36 @@ Tests of DOM Worker terminate feature
 <script class="testbody" language="javascript">
 
 
   var messageCount = 0;
   var intervalCount = 0;
 
   var interval;
 
-  var worker;
-
-  function messageListener(event) {
-    is(event.data, "Still alive!", "Correct message!");
-    if (messageCount++ == 20) {
-      ok(worker.onmessage === messageListener,
-         "Correct listener before terminate");
-
-      worker.terminate();
-
-      var exception = false;
-      try {
-        worker.addEventListener("message", messageListener, false);
-      }
-      catch (e) {
-        exception = true;
-      }
-      is(exception, false, "addEventListener didn't throw after terminate");
-
-      exception = false;
-      try {
-        worker.removeEventListener("message", messageListener, false);
-      }
-      catch (e) {
-        exception = true;
-      }
-      is(exception, false, "removeEventListener didn't throw after terminate");
-
-      ok(worker.onmessage === messageListener,
-         "Correct listener after terminate");
-
-      worker.onmessage = function(event) { }
-
-      interval = setInterval(testCount, 1000);
-    }
-  }
-
   function testCount() {
     is(messageCount, 21, "Received another message after terminated!");
     if (intervalCount++ == 5) {
       clearInterval(interval);
       SimpleTest.finish();
     }
   }
 
-  worker = new Worker("terminate_worker.js");
-  worker.onmessage = messageListener;
+  var worker = new Worker("terminate_worker.js");
+  worker.onmessage = function(event) {
+    is(event.data, "Still alive!", "Bad message!");
+    if (messageCount++ == 20) {
+      worker.terminate();
+      interval = setInterval(testCount, 1000);
+    }
+  };
+
+  worker.onerror = function(event) {
+    ok(false, "Worker had an error: " + event.data);
+    SimpleTest.finish();
+  }
 
   SimpleTest.waitForExplicitFinish();
 
 </script>
 </pre>
 </body>
 </html>
--- a/netwerk/base/public/mozIThirdPartyUtil.idl
+++ b/netwerk/base/public/mozIThirdPartyUtil.idl
@@ -40,17 +40,17 @@
 interface nsIURI;
 interface nsIDOMWindow;
 interface nsIChannel;
 
 /**
  * Utility functions for determining whether a given URI, channel, or window
  * hierarchy is third party with respect to a known URI.
  */
-[scriptable, uuid(d994fd1d-d2fe-4372-9ae7-88b08b7d9d90)]
+[scriptable, uuid(55385caa-1b94-4376-a34c-b47c51ef0837)]
 interface mozIThirdPartyUtil : nsISupports
 {
   /**
    * isThirdPartyURI
    *
    * Determine whether two URIs are third party with respect to each other.
    * This is determined by computing the base domain for both URIs. If they can
    * be determined, and the base domains match, the request is defined as first
@@ -150,34 +150,16 @@ interface mozIThirdPartyUtil : nsISuppor
    *         channel.
    *
    * @throws if 'aChannel' is null; the channel has no notification callbacks or
    *         an associated window; or isThirdPartyWindow throws.
    *
    * @see isThirdPartyWindow
    */
   boolean isThirdPartyChannel(in nsIChannel aChannel, [optional] in nsIURI aURI);
-
-  /**
-   * getBaseDomain
-   *
-   * Get the base domain for aHostURI; e.g. for "www.bbc.co.uk", this would be
-   * "bbc.co.uk". Only properly-formed URI's are tolerated, though a trailing
-   * dot may be present. If aHostURI is an IP address, an alias such as
-   * 'localhost', an eTLD such as 'co.uk', or the empty string, aBaseDomain will
-   * be the exact host. The result of this function should only be used in exact
-   * string comparisons, since substring comparisons will not be valid for the
-   * special cases elided above.
-   *
-   * @param aHostURI
-   *        The URI to analyze.
-   *
-   * @return the base domain.
-   */
-  AUTF8String getBaseDomain(in nsIURI aHostURI);
 };
 
 %{ C++
 /**
  * The mozIThirdPartyUtil implementation is an XPCOM service registered
  * under the ContractID:
  */
 #define THIRDPARTYUTIL_CONTRACTID "@mozilla.org/thirdpartyutil;1"