Bug 683280 - 'Workers: creating workers from 'localhost' or an IP address fails'. r=sicking.

This commit is contained in:
Ben Turner
2011-09-08 17:07:11 -07:00
parent 89e1c977ea
commit 47f974339e
8 changed files with 137 additions and 48 deletions

View File

@@ -39,11 +39,11 @@
#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"
@@ -2329,14 +2329,14 @@ WorkerPrivate::Create(JSContext* aCx, JSObject* aObj, WorkerPrivate* aParent,
domain = file;
}
else {
nsCOMPtr<nsIEffectiveTLDService> tldService =
do_GetService(NS_EFFECTIVETLDSERVICE_CONTRACTID);
if (!tldService) {
JS_ReportError(aCx, "Could not get TLD service!");
nsCOMPtr<mozIThirdPartyUtil> thirdPartyUtil =
do_GetService(THIRDPARTYUTIL_CONTRACTID);
if (!thirdPartyUtil) {
JS_ReportError(aCx, "Could not get third party helper service!");
return nsnull;
}
if (NS_FAILED(tldService->GetBaseDomain(codebase, 0, domain))) {
if (NS_FAILED(thirdPartyUtil->GetBaseDomain(codebase, domain))) {
JS_ReportError(aCx, "Could not get domain!");
return nsnull;
}