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-11-20 02:18:21 +03:00
|
|
|
#include "mozilla/dom/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;
|
2019-01-02 16:05:23 +03:00
|
|
|
|
2014-12-12 19:06:00 +03:00
|
|
|
class nsILoadGroup;
|
2013-03-08 02:27:21 +04:00
|
|
|
class nsIChannel;
|
2019-03-08 12:04:11 +03:00
|
|
|
class nsICookieSettings;
|
2013-03-08 02:27:21 +04:00
|
|
|
|
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;
|
2019-05-02 21:34:27 +03:00
|
|
|
class SerializedStackHolder;
|
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(
|
2019-01-02 16:05:23 +03:00
|
|
|
nsIPrincipal* aPrincipal, Document* aParentDoc, nsILoadGroup* aLoadGroup,
|
2018-01-23 18:38:54 +03:00
|
|
|
nsIURI* aScriptURL, const Maybe<ClientInfo>& aClientInfo,
|
2019-03-08 12:04:11 +03:00
|
|
|
nsContentPolicyType aContentPolicyType, nsICookieSettings* aCookieSettings,
|
|
|
|
nsIChannel** aChannel);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2013-03-08 02:27:21 +04:00
|
|
|
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
|
|
|
|
2019-05-02 21:34:27 +03:00
|
|
|
void LoadMainScript(WorkerPrivate* aWorkerPrivate,
|
|
|
|
UniquePtr<SerializedStackHolder> aOriginStack,
|
|
|
|
const nsAString& aScriptURL,
|
2015-10-15 15:06:55 +03:00
|
|
|
WorkerScriptType aWorkerScriptType, ErrorResult& aRv);
|
2011-07-17 23:09:13 +04:00
|
|
|
|
2019-05-02 21:34:27 +03:00
|
|
|
void Load(WorkerPrivate* aWorkerPrivate,
|
|
|
|
UniquePtr<SerializedStackHolder> aOriginStack,
|
|
|
|
const nsTArray<nsString>& aScriptURLs,
|
2015-03-31 13:22:40 +03:00
|
|
|
WorkerScriptType aWorkerScriptType, 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
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
2011-07-17 23:09:13 +04:00
|
|
|
|
|
|
|
#endif /* mozilla_dom_workers_scriptloader_h__ */
|