2015-05-03 22:32:37 +03: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 15:12:37 +04: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 09:16:40 +03:00
|
|
|
|
2011-07-17 23:09:13 +04:00
|
|
|
#ifndef mozilla_dom_workers_scriptloader_h__
|
|
|
|
#define mozilla_dom_workers_scriptloader_h__
|
|
|
|
|
2018-01-30 12:10:04 +03:00
|
|
|
#include "WorkerCommon.h"
|
2017-08-03 11:50:00 +03:00
|
|
|
#include "nsIContentPolicy.h"
|
2017-08-17 02:48:52 +03:00
|
|
|
#include "nsStringFwd.h"
|
2011-07-17 23:09:13 +04:00
|
|
|
|
2013-03-08 02:27:21 +04:00
|
|
|
class nsIPrincipal;
|
|
|
|
class nsIURI;
|
|
|
|
class nsIDocument;
|
2014-12-12 19:06:00 +03:00
|
|
|
class nsILoadGroup;
|
2013-03-08 02:27:21 +04:00
|
|
|
class nsIChannel;
|
|
|
|
|
2013-11-05 18:16:26 +04:00
|
|
|
namespace mozilla {
|
|
|
|
|
|
|
|
class ErrorResult;
|
|
|
|
|
2018-01-31 10:21:46 +03:00
|
|
|
namespace dom {
|
|
|
|
|
2018-01-31 10:22:03 +03:00
|
|
|
struct WorkerLoadInfo;
|
2018-01-31 10:24:08 +03:00
|
|
|
class WorkerPrivate;
|
2011-07-17 23:09:13 +04:00
|
|
|
|
2015-03-17 13:15:19 +03:00
|
|
|
enum WorkerScriptType {
|
|
|
|
WorkerScript,
|
|
|
|
DebuggerScript
|
|
|
|
};
|
|
|
|
|
2018-01-31 10:22:03 +03:00
|
|
|
namespace workerinternals {
|
2011-07-17 23:09:13 +04:00
|
|
|
|
2013-03-08 02:27:21 +04:00
|
|
|
nsresult
|
|
|
|
ChannelFromScriptURLMainThread(nsIPrincipal* aPrincipal,
|
|
|
|
nsIURI* aBaseURI,
|
|
|
|
nsIDocument* aParentDoc,
|
2014-12-12 19:06:00 +03:00
|
|
|
nsILoadGroup* aLoadGroup,
|
2013-06-05 18:04:23 +04:00
|
|
|
const nsAString& aScriptURL,
|
2018-01-23 18:38:54 +03:00
|
|
|
const Maybe<ClientInfo>& aClientInfo,
|
2015-06-17 04:21:08 +03:00
|
|
|
nsContentPolicyType aContentPolicyType,
|
2016-04-28 10:44:08 +03:00
|
|
|
bool aDefaultURIEncoding,
|
2013-03-08 02:27:21 +04:00
|
|
|
nsIChannel** aChannel);
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
ChannelFromScriptURLWorkerThread(JSContext* aCx,
|
2018-01-31 10:24:08 +03:00
|
|
|
WorkerPrivate* aParent,
|
2013-06-05 18:04:23 +04:00
|
|
|
const nsAString& aScriptURL,
|
2017-02-07 18:28:38 +03:00
|
|
|
WorkerLoadInfo& aLoadInfo);
|
2013-03-08 02:27:21 +04:00
|
|
|
|
2016-02-29 22:52:42 +03:00
|
|
|
void ReportLoadError(ErrorResult& aRv, nsresult aLoadResult,
|
2016-02-26 23:23:13 +03:00
|
|
|
const nsAString& aScriptURL);
|
2013-03-08 02:27:21 +04:00
|
|
|
|
2018-01-31 10:24:08 +03:00
|
|
|
void LoadMainScript(WorkerPrivate* aWorkerPrivate,
|
2016-02-29 22:52:42 +03:00
|
|
|
const nsAString& aScriptURL,
|
2015-10-15 15:06:55 +03:00
|
|
|
WorkerScriptType aWorkerScriptType,
|
|
|
|
ErrorResult& aRv);
|
2011-07-17 23:09:13 +04:00
|
|
|
|
2018-01-31 10:24:08 +03:00
|
|
|
void Load(WorkerPrivate* aWorkerPrivate,
|
2015-03-31 13:22:40 +03:00
|
|
|
const nsTArray<nsString>& aScriptURLs,
|
|
|
|
WorkerScriptType aWorkerScriptType,
|
2018-01-31 10:22:03 +03:00
|
|
|
ErrorResult& aRv);
|
2011-07-17 23:09:13 +04:00
|
|
|
|
2018-01-31 10:22:03 +03:00
|
|
|
} // namespace workerinternals
|
2011-07-17 23:09:13 +04:00
|
|
|
|
2018-01-31 10:22:03 +03:00
|
|
|
} // dom namespace
|
|
|
|
} // namespace mozilla
|
2011-07-17 23:09:13 +04:00
|
|
|
|
|
|
|
#endif /* mozilla_dom_workers_scriptloader_h__ */
|