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__
27 } // namespace mozilla
29 BEGIN_WORKERS_NAMESPACE
31 namespace scriptloader
{
34 ChannelFromScriptURLMainThread(nsIPrincipal
* aPrincipal
,
36 nsIDocument
* aParentDoc
,
37 const nsAString
& aScriptURL
,
38 nsIChannel
** aChannel
);
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
60 #endif /* mozilla_dom_workers_scriptloader_h__ */