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__
|
|
|
|
|
|
|
|
#include "Workers.h"
|
|
|
|
|
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 nsString;
|
|
|
|
class nsIChannel;
|
|
|
|
|
2013-11-05 18:16:26 +04:00
|
|
|
namespace mozilla {
|
|
|
|
|
|
|
|
class ErrorResult;
|
|
|
|
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2011-07-17 23:09:13 +04:00
|
|
|
BEGIN_WORKERS_NAMESPACE
|
|
|
|
|
2015-03-17 13:15:19 +03:00
|
|
|
enum WorkerScriptType {
|
|
|
|
WorkerScript,
|
|
|
|
DebuggerScript
|
|
|
|
};
|
|
|
|
|
2011-07-17 23:09:13 +04:00
|
|
|
namespace scriptloader {
|
|
|
|
|
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,
|
2013-03-08 02:27:21 +04:00
|
|
|
nsIChannel** aChannel);
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
ChannelFromScriptURLWorkerThread(JSContext* aCx,
|
|
|
|
WorkerPrivate* aParent,
|
2013-06-05 18:04:23 +04:00
|
|
|
const nsAString& aScriptURL,
|
2013-03-08 02:27:21 +04:00
|
|
|
nsIChannel** aChannel);
|
|
|
|
|
2013-06-05 18:04:23 +04:00
|
|
|
void ReportLoadError(JSContext* aCx, const nsAString& aURL,
|
2013-03-08 02:27:21 +04:00
|
|
|
nsresult aLoadResult, bool aIsMainThread);
|
|
|
|
|
2015-03-17 13:15:19 +03:00
|
|
|
bool LoadMainScript(JSContext* aCx, const nsAString& aScriptURL,
|
|
|
|
WorkerScriptType aWorkerScriptType);
|
2011-07-17 23:09:13 +04:00
|
|
|
|
2013-11-05 18:16:26 +04:00
|
|
|
void Load(JSContext* aCx,
|
|
|
|
WorkerPrivate* aWorkerPrivate,
|
2015-03-31 13:22:40 +03:00
|
|
|
const nsTArray<nsString>& aScriptURLs,
|
|
|
|
WorkerScriptType aWorkerScriptType,
|
2013-11-05 18:16:26 +04:00
|
|
|
mozilla::ErrorResult& aRv);
|
2011-07-17 23:09:13 +04:00
|
|
|
|
|
|
|
} // namespace scriptloader
|
|
|
|
|
|
|
|
END_WORKERS_NAMESPACE
|
|
|
|
|
|
|
|
#endif /* mozilla_dom_workers_scriptloader_h__ */
|