dom/workers/ScriptLoader.h

branch
TOR_BUG_3246
changeset 7
129ffea94266
equal deleted inserted replaced
-1:000000000000 0:681ab02f3419
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/. */
5
6 #ifndef mozilla_dom_workers_scriptloader_h__
7 #define mozilla_dom_workers_scriptloader_h__
8
9 #include "Workers.h"
10
11 class nsIPrincipal;
12 class nsIURI;
13 class nsIDocument;
14 class nsString;
15 class nsIChannel;
16
17 namespace mozilla {
18
19 class ErrorResult;
20
21 namespace dom {
22
23 template <typename T>
24 class Sequence;
25
26 } // namespace dom
27 } // namespace mozilla
28
29 BEGIN_WORKERS_NAMESPACE
30
31 namespace scriptloader {
32
33 nsresult
34 ChannelFromScriptURLMainThread(nsIPrincipal* aPrincipal,
35 nsIURI* aBaseURI,
36 nsIDocument* aParentDoc,
37 const nsAString& aScriptURL,
38 nsIChannel** aChannel);
39
40 nsresult
41 ChannelFromScriptURLWorkerThread(JSContext* aCx,
42 WorkerPrivate* aParent,
43 const nsAString& aScriptURL,
44 nsIChannel** aChannel);
45
46 void ReportLoadError(JSContext* aCx, const nsAString& aURL,
47 nsresult aLoadResult, bool aIsMainThread);
48
49 bool LoadWorkerScript(JSContext* aCx);
50
51 void Load(JSContext* aCx,
52 WorkerPrivate* aWorkerPrivate,
53 const mozilla::dom::Sequence<nsString>& aScriptURLs,
54 mozilla::ErrorResult& aRv);
55
56 } // namespace scriptloader
57
58 END_WORKERS_NAMESPACE
59
60 #endif /* mozilla_dom_workers_scriptloader_h__ */

mercurial