tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

mozJSSubScriptLoader.h (1827B)


      1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
      3 /* This Source Code Form is subject to the terms of the Mozilla Public
      4 * License, v. 2.0. If a copy of the MPL was not distributed with this
      5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      6 
      7 #include "nsCOMPtr.h"
      8 #include "mozIJSSubScriptLoader.h"
      9 
     10 #include "js/experimental/JSStencil.h"
     11 #include "js/CompileOptions.h"  // JS::ReadOnlyCompileOptions
     12 
     13 class nsIPrincipal;
     14 class nsIURI;
     15 class LoadSubScriptOptions;
     16 
     17 #define MOZ_JSSUBSCRIPTLOADER_CID             \
     18  {/* 829814d6-1dd2-11b2-8e08-82fa0a339b00 */ \
     19   0x929814d6,                                \
     20   0x1dd2,                                    \
     21   0x11b2,                                    \
     22   {0x8e, 0x08, 0x82, 0xfa, 0x0a, 0x33, 0x9b, 0x00}}
     23 
     24 class nsIIOService;
     25 
     26 class mozJSSubScriptLoader : public mozIJSSubScriptLoader {
     27 public:
     28  mozJSSubScriptLoader();
     29 
     30  // all the interface method declarations...
     31  NS_DECL_ISUPPORTS
     32  NS_DECL_MOZIJSSUBSCRIPTLOADER
     33 
     34 private:
     35  virtual ~mozJSSubScriptLoader();
     36 
     37  bool ReadStencil(JS::Stencil** stencilOut, nsIURI* uri, JSContext* cx,
     38                   const JS::ReadOnlyCompileOptions& options,
     39                   nsIIOService* serv, bool useCompilationScope);
     40 
     41  nsresult ReadScriptAsync(nsIURI* uri, JS::HandleObject targetObj,
     42                           JS::HandleObject loadScope, nsIIOService* serv,
     43                           bool wantReturnValue, bool cache,
     44                           JS::MutableHandleValue retval);
     45 
     46  nsresult DoLoadSubScriptWithOptions(const nsAString& url,
     47                                      LoadSubScriptOptions& options,
     48                                      JSContext* cx,
     49                                      JS::MutableHandleValue retval);
     50 };