2014-04-03 15:58:00 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/* vim: set ts=8 sts=4 et sw=4 tw=99: */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
2012-05-21 15:12:37 +04:00
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2001-03-14 05:41:55 +03:00
|
|
|
|
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "mozIJSSubScriptLoader.h"
|
2013-09-10 01:14:10 +04:00
|
|
|
|
|
|
|
class nsIPrincipal;
|
|
|
|
class nsIURI;
|
2013-11-05 19:35:41 +04:00
|
|
|
class LoadSubScriptOptions;
|
2001-03-14 05:41:55 +03:00
|
|
|
|
2011-10-14 21:52:48 +04:00
|
|
|
#define MOZ_JSSUBSCRIPTLOADER_CID \
|
|
|
|
{ /* 829814d6-1dd2-11b2-8e08-82fa0a339b00 */ \
|
|
|
|
0x929814d6, \
|
|
|
|
0x1dd2, \
|
|
|
|
0x11b2, \
|
|
|
|
{0x8e, 0x08, 0x82, 0xfa, 0x0a, 0x33, 0x9b, 0x00} \
|
2001-03-14 05:41:55 +03:00
|
|
|
}
|
|
|
|
|
2011-07-10 07:21:16 +04:00
|
|
|
class nsIIOService;
|
|
|
|
|
2001-03-14 05:41:55 +03:00
|
|
|
class mozJSSubScriptLoader : public mozIJSSubScriptLoader
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
mozJSSubScriptLoader();
|
|
|
|
|
|
|
|
// all the interface method declarations...
|
2014-01-16 20:49:26 +04:00
|
|
|
NS_DECL_ISUPPORTS
|
2001-03-14 05:41:55 +03:00
|
|
|
NS_DECL_MOZIJSSUBSCRIPTLOADER
|
|
|
|
|
|
|
|
private:
|
2014-06-23 22:49:08 +04:00
|
|
|
virtual ~mozJSSubScriptLoader();
|
|
|
|
|
2015-03-29 01:22:11 +03:00
|
|
|
nsresult ReadScript(nsIURI* uri, JSContext* cx, JSObject* target_obj,
|
|
|
|
const nsAString& charset, const char* uriStr,
|
|
|
|
nsIIOService* serv, nsIPrincipal* principal,
|
2014-06-12 04:38:22 +04:00
|
|
|
bool reuseGlobal, JS::MutableHandleScript script,
|
|
|
|
JS::MutableHandleFunction function);
|
2011-07-10 07:21:16 +04:00
|
|
|
|
2015-05-21 08:14:49 +03:00
|
|
|
nsresult ReadScriptAsync(nsIURI* uri, JSObject* target_obj,
|
|
|
|
const nsAString& charset,
|
|
|
|
nsIIOService* serv, bool reuseGlobal,
|
|
|
|
bool cache, JS::MutableHandleValue retval);
|
|
|
|
|
2015-03-29 01:22:11 +03:00
|
|
|
nsresult DoLoadSubScriptWithOptions(const nsAString& url,
|
|
|
|
LoadSubScriptOptions& options,
|
|
|
|
JSContext* cx,
|
2014-01-09 21:39:36 +04:00
|
|
|
JS::MutableHandle<JS::Value> retval);
|
2013-11-05 19:35:41 +04:00
|
|
|
|
2001-03-14 05:41:55 +03:00
|
|
|
nsCOMPtr<nsIPrincipal> mSystemPrincipal;
|
|
|
|
};
|