Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(530)

Unified Diff: fpdfsdk/include/javascript/IJavaScript.h

Issue 1389163007: Pass IJS_Runtime, not IJS_Context, to native object constructors. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: comment Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | fpdfsdk/include/jsapi/fxjs_v8.h » ('j') | fpdfsdk/include/jsapi/fxjs_v8.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/include/javascript/IJavaScript.h
diff --git a/fpdfsdk/include/javascript/IJavaScript.h b/fpdfsdk/include/javascript/IJavaScript.h
index a527d19544182720c77c3c4c5a9e0c419593ecd7..a1b51c979117323c3d0bb06a4331cc741fb7234a 100644
--- a/fpdfsdk/include/javascript/IJavaScript.h
+++ b/fpdfsdk/include/javascript/IJavaScript.h
@@ -16,6 +16,7 @@ class CPDFSDK_Document;
class CPDF_Bookmark;
class CPDF_FormField;
+// Records the details of an event and causes JS execution for it.
Lei Zhang 2015/10/08 23:52:01 causes -> triggers?
Tom Sepez 2015/10/09 00:14:20 Done.
class IJS_Context {
public:
virtual FX_BOOL RunScript(const CFX_WideString& script,
@@ -131,6 +132,7 @@ class IJS_Context {
virtual ~IJS_Context() {}
};
+// Owns the FJXS objects needed to actually execute JS.
class IJS_Runtime {
public:
static IJS_Runtime* Create(CPDFDoc_Environment* pEnv);
@@ -141,6 +143,10 @@ class IJS_Runtime {
virtual IJS_Context* GetCurrentContext() = 0;
virtual void SetReaderDocument(CPDFSDK_Document* pReaderDoc) = 0;
virtual CPDFSDK_Document* GetReaderDocument() = 0;
+ virtual int Execute(IJS_Context* cc,
+ const wchar_t* script,
+ long length,
+ CFX_WideString& info) = 0;
Lei Zhang 2015/10/08 23:52:01 No pass by non-const ref.
Tom Sepez 2015/10/09 00:14:20 Done.
protected:
IJS_Runtime() {}
« no previous file with comments | « no previous file | fpdfsdk/include/jsapi/fxjs_v8.h » ('j') | fpdfsdk/include/jsapi/fxjs_v8.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698