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/. */
8 #include "mozIJSSubScriptLoader.h"
10 #include "js/experimental/JSStencil.h"
11 #include "js/CompileOptions.h" // JS::ReadOnlyCompileOptions
15 class LoadSubScriptOptions
;
17 #define MOZ_JSSUBSCRIPTLOADER_CID \
18 { /* 829814d6-1dd2-11b2-8e08-82fa0a339b00 */ \
19 0x929814d6, 0x1dd2, 0x11b2, { \
20 0x8e, 0x08, 0x82, 0xfa, 0x0a, 0x33, 0x9b, 0x00 \
26 class mozJSSubScriptLoader
: public mozIJSSubScriptLoader
{
28 mozJSSubScriptLoader();
30 // all the interface method declarations...
32 NS_DECL_MOZIJSSUBSCRIPTLOADER
35 virtual ~mozJSSubScriptLoader();
37 bool ReadStencil(JS::Stencil
** stencilOut
, nsIURI
* uri
, JSContext
* cx
,
38 const JS::ReadOnlyCompileOptions
& options
,
39 nsIIOService
* serv
, bool useCompilationScope
);
41 nsresult
ReadScriptAsync(nsIURI
* uri
, JS::HandleObject targetObj
,
42 JS::HandleObject loadScope
, nsIIOService
* serv
,
43 bool wantReturnValue
, bool cache
,
44 JS::MutableHandleValue retval
);
46 nsresult
DoLoadSubScriptWithOptions(const nsAString
& url
,
47 LoadSubScriptOptions
& options
,
49 JS::MutableHandleValue retval
);