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

Side by Side Diff: fpdfsdk/src/javascript/JS_Context.cpp

Issue 1334833003: Merge to XFA: Remove some abstractions in fxjs_v8.h. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « fpdfsdk/src/javascript/Field.cpp ('k') | fpdfsdk/src/javascript/JS_EventHandler.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "../../include/javascript/IJavaScript.h" 7 #include "../../include/javascript/IJavaScript.h"
8 #include "../../include/javascript/JS_Context.h" 8 #include "../../include/javascript/JS_Context.h"
9 #include "../../include/javascript/JS_EventHandler.h" 9 #include "../../include/javascript/JS_EventHandler.h"
10 #include "../../include/javascript/JS_Runtime.h" 10 #include "../../include/javascript/JS_Runtime.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 ASSERT(m_pEventHandler->IsValid()); 49 ASSERT(m_pEventHandler->IsValid());
50 if (!m_pRuntime->AddEventToLoop(m_pEventHandler->TargetName(), 50 if (!m_pRuntime->AddEventToLoop(m_pEventHandler->TargetName(),
51 m_pEventHandler->EventType())) { 51 m_pEventHandler->EventType())) {
52 info = JSGetStringFromID(this, IDS_STRING_JSEVENT); 52 info = JSGetStringFromID(this, IDS_STRING_JSEVENT);
53 return FALSE; 53 return FALSE;
54 } 54 }
55 55
56 FXJSErr error = {NULL, NULL, 0}; 56 FXJSErr error = {NULL, NULL, 0};
57 int nRet = 0; 57 int nRet = 0;
58 if (script.GetLength() > 0) { 58 if (script.GetLength() > 0) {
59 nRet = JS_Execute(*m_pRuntime, this, script.c_str(), script.GetLength(), 59 nRet = JS_Execute(m_pRuntime->GetIsolate(), this, script.c_str(),
60 &error); 60 script.GetLength(), &error);
61 } 61 }
62 62
63 if (nRet < 0) { 63 if (nRet < 0) {
64 CFX_WideString sLine; 64 CFX_WideString sLine;
65 sLine.Format(L"[ Line: %05d { %s } ] : %s", error.linnum - 1, error.srcline, 65 sLine.Format(L"[ Line: %05d { %s } ] : %s", error.linnum - 1, error.srcline,
66 error.message); 66 error.message);
67 info += sLine; 67 info += sLine;
68 } else { 68 } else {
69 info = JSGetStringFromID(this, IDS_STRING_RUN); 69 info = JSGetStringFromID(this, IDS_STRING_RUN);
70 } 70 }
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 } 280 }
281 281
282 void CJS_Context::OnBatchExec(CPDFSDK_Document* pTarget) { 282 void CJS_Context::OnBatchExec(CPDFSDK_Document* pTarget) {
283 m_pEventHandler->OnBatchExec(pTarget); 283 m_pEventHandler->OnBatchExec(pTarget);
284 } 284 }
285 285
286 void CJS_Context::OnMenu_Exec(CPDFSDK_Document* pTarget, 286 void CJS_Context::OnMenu_Exec(CPDFSDK_Document* pTarget,
287 const CFX_WideString& strTargetName) { 287 const CFX_WideString& strTargetName) {
288 m_pEventHandler->OnMenu_Exec(pTarget, strTargetName); 288 m_pEventHandler->OnMenu_Exec(pTarget, strTargetName);
289 } 289 }
OLDNEW
« no previous file with comments | « fpdfsdk/src/javascript/Field.cpp ('k') | fpdfsdk/src/javascript/JS_EventHandler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698