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

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

Issue 1332973002: Remove some abstractions in fxjs_v8.h. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Remove implicit cast operator from CJS_Runtime. 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 ASSERT(m_pEventHandler->IsValid()); 48 ASSERT(m_pEventHandler->IsValid());
49 if (!m_pRuntime->AddEventToLoop(m_pEventHandler->TargetName(), 49 if (!m_pRuntime->AddEventToLoop(m_pEventHandler->TargetName(),
50 m_pEventHandler->EventType())) { 50 m_pEventHandler->EventType())) {
51 info = JSGetStringFromID(this, IDS_STRING_JSEVENT); 51 info = JSGetStringFromID(this, IDS_STRING_JSEVENT);
52 return FALSE; 52 return FALSE;
53 } 53 }
54 54
55 FXJSErr error = {NULL, NULL, 0}; 55 FXJSErr error = {NULL, NULL, 0};
56 int nRet = 0; 56 int nRet = 0;
57 if (script.GetLength() > 0) { 57 if (script.GetLength() > 0) {
58 nRet = JS_Execute(*m_pRuntime, this, script.c_str(), script.GetLength(), 58 nRet = JS_Execute(m_pRuntime->GetIsolate(), this, script.c_str(),
59 &error); 59 script.GetLength(), &error);
60 } 60 }
61 61
62 if (nRet < 0) { 62 if (nRet < 0) {
63 CFX_WideString sLine; 63 CFX_WideString sLine;
64 sLine.Format(L"[ Line: %05d { %s } ] : %s", error.linnum - 1, error.srcline, 64 sLine.Format(L"[ Line: %05d { %s } ] : %s", error.linnum - 1, error.srcline,
65 error.message); 65 error.message);
66 info += sLine; 66 info += sLine;
67 } else { 67 } else {
68 info = JSGetStringFromID(this, IDS_STRING_RUN); 68 info = JSGetStringFromID(this, IDS_STRING_RUN);
69 } 69 }
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 } 279 }
280 280
281 void CJS_Context::OnBatchExec(CPDFSDK_Document* pTarget) { 281 void CJS_Context::OnBatchExec(CPDFSDK_Document* pTarget) {
282 m_pEventHandler->OnBatchExec(pTarget); 282 m_pEventHandler->OnBatchExec(pTarget);
283 } 283 }
284 284
285 void CJS_Context::OnMenu_Exec(CPDFSDK_Document* pTarget, 285 void CJS_Context::OnMenu_Exec(CPDFSDK_Document* pTarget,
286 const CFX_WideString& strTargetName) { 286 const CFX_WideString& strTargetName) {
287 m_pEventHandler->OnMenu_Exec(pTarget, strTargetName); 287 m_pEventHandler->OnMenu_Exec(pTarget, strTargetName);
288 } 288 }
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