Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef mozilla_dom_workers_scriptloader_h__
7 #define mozilla_dom_workers_scriptloader_h__
9 #include "Workers.h"
11 class nsIPrincipal;
12 class nsIURI;
13 class nsIDocument;
14 class nsString;
15 class nsIChannel;
17 namespace mozilla {
19 class ErrorResult;
21 namespace dom {
23 template <typename T>
24 class Sequence;
26 } // namespace dom
27 } // namespace mozilla
29 BEGIN_WORKERS_NAMESPACE
31 namespace scriptloader {
33 nsresult
34 ChannelFromScriptURLMainThread(nsIPrincipal* aPrincipal,
35 nsIURI* aBaseURI,
36 nsIDocument* aParentDoc,
37 const nsAString& aScriptURL,
38 nsIChannel** aChannel);
40 nsresult
41 ChannelFromScriptURLWorkerThread(JSContext* aCx,
42 WorkerPrivate* aParent,
43 const nsAString& aScriptURL,
44 nsIChannel** aChannel);
46 void ReportLoadError(JSContext* aCx, const nsAString& aURL,
47 nsresult aLoadResult, bool aIsMainThread);
49 bool LoadWorkerScript(JSContext* aCx);
51 void Load(JSContext* aCx,
52 WorkerPrivate* aWorkerPrivate,
53 const mozilla::dom::Sequence<nsString>& aScriptURLs,
54 mozilla::ErrorResult& aRv);
56 } // namespace scriptloader
58 END_WORKERS_NAMESPACE
60 #endif /* mozilla_dom_workers_scriptloader_h__ */