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

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: Nits, no pass-by-non-const-ref 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/src/fsdk_actionhandler.cpp » ('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..b103703a1b75ed218b393d7a072e75154af777f7 100644
--- a/fpdfsdk/include/javascript/IJavaScript.h
+++ b/fpdfsdk/include/javascript/IJavaScript.h
@@ -16,10 +16,11 @@ class CPDFSDK_Document;
class CPDF_Bookmark;
class CPDF_FormField;
+// Records the details of an event and triggers JS execution for it.
class IJS_Context {
public:
virtual FX_BOOL RunScript(const CFX_WideString& script,
- CFX_WideString& info) = 0;
+ CFX_WideString* info) = 0;
virtual void OnApp_Init() = 0;
@@ -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,9 @@ 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,
+ CFX_WideString* info) = 0;
protected:
IJS_Runtime() {}
« no previous file with comments | « no previous file | fpdfsdk/include/jsapi/fxjs_v8.h » ('j') | fpdfsdk/src/fsdk_actionhandler.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698