dom/workers/ScriptLoader.h

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

Integrate suggestion from review to improve consistency with existing code.

     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__ */

mercurial