dom/workers/ScriptLoader.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/workers/ScriptLoader.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,60 @@
     1.4 +/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#ifndef mozilla_dom_workers_scriptloader_h__
    1.10 +#define mozilla_dom_workers_scriptloader_h__
    1.11 +
    1.12 +#include "Workers.h"
    1.13 +
    1.14 +class nsIPrincipal;
    1.15 +class nsIURI;
    1.16 +class nsIDocument;
    1.17 +class nsString;
    1.18 +class nsIChannel;
    1.19 +
    1.20 +namespace mozilla {
    1.21 +
    1.22 +class ErrorResult;
    1.23 +
    1.24 +namespace dom {
    1.25 +
    1.26 +template <typename T>
    1.27 +class Sequence;
    1.28 +
    1.29 +} // namespace dom
    1.30 +} // namespace mozilla
    1.31 +
    1.32 +BEGIN_WORKERS_NAMESPACE
    1.33 +
    1.34 +namespace scriptloader {
    1.35 +
    1.36 +nsresult
    1.37 +ChannelFromScriptURLMainThread(nsIPrincipal* aPrincipal,
    1.38 +                               nsIURI* aBaseURI,
    1.39 +                               nsIDocument* aParentDoc,
    1.40 +                               const nsAString& aScriptURL,
    1.41 +                               nsIChannel** aChannel);
    1.42 +
    1.43 +nsresult
    1.44 +ChannelFromScriptURLWorkerThread(JSContext* aCx,
    1.45 +                                 WorkerPrivate* aParent,
    1.46 +                                 const nsAString& aScriptURL,
    1.47 +                                 nsIChannel** aChannel);
    1.48 +
    1.49 +void ReportLoadError(JSContext* aCx, const nsAString& aURL,
    1.50 +                     nsresult aLoadResult, bool aIsMainThread);
    1.51 +
    1.52 +bool LoadWorkerScript(JSContext* aCx);
    1.53 +
    1.54 +void Load(JSContext* aCx,
    1.55 +          WorkerPrivate* aWorkerPrivate,
    1.56 +          const mozilla::dom::Sequence<nsString>& aScriptURLs,
    1.57 +          mozilla::ErrorResult& aRv);
    1.58 +
    1.59 +} // namespace scriptloader
    1.60 +
    1.61 +END_WORKERS_NAMESPACE
    1.62 +
    1.63 +#endif /* mozilla_dom_workers_scriptloader_h__ */

mercurial