|
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
|
2 /* vim: set ts=8 sts=4 et sw=4 tw=99: */ |
|
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 class nsIPrincipal; |
|
11 class nsIURI; |
|
12 class LoadSubScriptOptions; |
|
13 |
|
14 #define MOZ_JSSUBSCRIPTLOADER_CID \ |
|
15 { /* 829814d6-1dd2-11b2-8e08-82fa0a339b00 */ \ |
|
16 0x929814d6, \ |
|
17 0x1dd2, \ |
|
18 0x11b2, \ |
|
19 {0x8e, 0x08, 0x82, 0xfa, 0x0a, 0x33, 0x9b, 0x00} \ |
|
20 } |
|
21 |
|
22 class nsIIOService; |
|
23 |
|
24 class mozJSSubScriptLoader : public mozIJSSubScriptLoader |
|
25 { |
|
26 public: |
|
27 mozJSSubScriptLoader(); |
|
28 virtual ~mozJSSubScriptLoader(); |
|
29 |
|
30 // all the interface method declarations... |
|
31 NS_DECL_ISUPPORTS |
|
32 NS_DECL_MOZIJSSUBSCRIPTLOADER |
|
33 |
|
34 private: |
|
35 nsresult ReadScript(nsIURI *uri, JSContext *cx, JSObject *target_obj, |
|
36 const nsAString &charset, const char *uriStr, |
|
37 nsIIOService *serv, nsIPrincipal *principal, |
|
38 bool reuseGlobal, JS::MutableHandleScript script, |
|
39 JS::MutableHandleFunction function); |
|
40 |
|
41 nsresult DoLoadSubScriptWithOptions(const nsAString &url, |
|
42 LoadSubScriptOptions &options, |
|
43 JSContext *cx, |
|
44 JS::MutableHandle<JS::Value> retval); |
|
45 |
|
46 nsCOMPtr<nsIPrincipal> mSystemPrincipal; |
|
47 }; |