michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* vim: set ts=8 sts=4 et sw=4 tw=99: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsCOMPtr.h" michael@0: #include "mozIJSSubScriptLoader.h" michael@0: michael@0: class nsIPrincipal; michael@0: class nsIURI; michael@0: class LoadSubScriptOptions; michael@0: michael@0: #define MOZ_JSSUBSCRIPTLOADER_CID \ michael@0: { /* 829814d6-1dd2-11b2-8e08-82fa0a339b00 */ \ michael@0: 0x929814d6, \ michael@0: 0x1dd2, \ michael@0: 0x11b2, \ michael@0: {0x8e, 0x08, 0x82, 0xfa, 0x0a, 0x33, 0x9b, 0x00} \ michael@0: } michael@0: michael@0: class nsIIOService; michael@0: michael@0: class mozJSSubScriptLoader : public mozIJSSubScriptLoader michael@0: { michael@0: public: michael@0: mozJSSubScriptLoader(); michael@0: virtual ~mozJSSubScriptLoader(); michael@0: michael@0: // all the interface method declarations... michael@0: NS_DECL_ISUPPORTS michael@0: NS_DECL_MOZIJSSUBSCRIPTLOADER michael@0: michael@0: private: michael@0: nsresult ReadScript(nsIURI *uri, JSContext *cx, JSObject *target_obj, michael@0: const nsAString &charset, const char *uriStr, michael@0: nsIIOService *serv, nsIPrincipal *principal, michael@0: bool reuseGlobal, JS::MutableHandleScript script, michael@0: JS::MutableHandleFunction function); michael@0: michael@0: nsresult DoLoadSubScriptWithOptions(const nsAString &url, michael@0: LoadSubScriptOptions &options, michael@0: JSContext *cx, michael@0: JS::MutableHandle retval); michael@0: michael@0: nsCOMPtr mSystemPrincipal; michael@0: };