Bug 683280 - 'Workers: creating workers from 'localhost' or an IP address fails'. r=sicking.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user