2015-05-03 19:32:37 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* 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/. */
|
2008-11-27 06:16:40 +00:00
|
|
|
|
2011-07-17 19:09:13 +00:00
|
|
|
#ifndef mozilla_dom_workers_scriptloader_h__
|
|
|
|
#define mozilla_dom_workers_scriptloader_h__
|
|
|
|
|
|
|
|
#include "Workers.h"
|
2015-06-17 01:21:08 +00:00
|
|
|
#include "nsIContentPolicyBase.h"
|
2011-07-17 19:09:13 +00:00
|
|
|
|
2013-03-07 22:27:21 +00:00
|
|
|
class nsIPrincipal;
|
|
|
|
class nsIURI;
|
|
|
|
class nsIDocument;
|
2014-12-12 16:06:00 +00:00
|
|
|
class nsILoadGroup;
|
2013-03-07 22:27:21 +00:00
|
|
|
class nsString;
|
|
|
|
class nsIChannel;
|
|
|
|
|
2013-11-05 14:16:26 +00:00
|
|
|
namespace mozilla {
|
|
|
|
|
|
|
|
class ErrorResult;
|
|
|
|
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2011-07-17 19:09:13 +00:00
|
|
|
BEGIN_WORKERS_NAMESPACE
|
|
|
|
|
2015-03-17 10:15:19 +00:00
|
|
|
enum WorkerScriptType {
|
|
|
|
WorkerScript,
|
|
|
|
DebuggerScript
|
|
|
|
};
|
|
|
|
|
2011-07-17 19:09:13 +00:00
|
|
|
namespace scriptloader {
|
|
|
|
|
2013-03-07 22:27:21 +00:00
|
|
|
nsresult
|
|
|
|
ChannelFromScriptURLMainThread(nsIPrincipal* aPrincipal,
|
|
|
|
nsIURI* aBaseURI,
|
|
|
|
nsIDocument* aParentDoc,
|
2014-12-12 16:06:00 +00:00
|
|
|
nsILoadGroup* aLoadGroup,
|
2013-06-05 14:04:23 +00:00
|
|
|
const nsAString& aScriptURL,
|
2015-06-17 01:21:08 +00:00
|
|
|
nsContentPolicyType aContentPolicyType,
|
2016-04-28 07:44:08 +00:00
|
|
|
bool aDefaultURIEncoding,
|
2013-03-07 22:27:21 +00:00
|
|
|
nsIChannel** aChannel);
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
ChannelFromScriptURLWorkerThread(JSContext* aCx,
|
|
|
|
WorkerPrivate* aParent,
|
2013-06-05 14:04:23 +00:00
|
|
|
const nsAString& aScriptURL,
|
2013-03-07 22:27:21 +00:00
|
|
|
nsIChannel** aChannel);
|
|
|
|
|
2016-02-29 19:52:42 +00:00
|
|
|
void ReportLoadError(ErrorResult& aRv, nsresult aLoadResult,
|
2016-02-26 20:23:13 +00:00
|
|
|
const nsAString& aScriptURL);
|
2013-03-07 22:27:21 +00:00
|
|
|
|
2016-02-29 19:52:42 +00:00
|
|
|
void LoadMainScript(WorkerPrivate* aWorkerPrivate,
|
|
|
|
const nsAString& aScriptURL,
|
2015-10-15 12:06:55 +00:00
|
|
|
WorkerScriptType aWorkerScriptType,
|
|
|
|
ErrorResult& aRv);
|
2011-07-17 19:09:13 +00:00
|
|
|
|
2016-02-29 19:52:42 +00:00
|
|
|
void Load(WorkerPrivate* aWorkerPrivate,
|
2015-03-31 10:22:40 +00:00
|
|
|
const nsTArray<nsString>& aScriptURLs,
|
|
|
|
WorkerScriptType aWorkerScriptType,
|
2013-11-05 14:16:26 +00:00
|
|
|
mozilla::ErrorResult& aRv);
|
2011-07-17 19:09:13 +00:00
|
|
|
|
|
|
|
} // namespace scriptloader
|
|
|
|
|
|
|
|
END_WORKERS_NAMESPACE
|
|
|
|
|
|
|
|
#endif /* mozilla_dom_workers_scriptloader_h__ */
|