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

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

Issue 1138823004: Replace v8::Handle with v8::Local and v8::Persistent with v8::Global (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 7 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/JS_Value.cpp ('k') | fpdfsdk/src/javascript/global.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/JavaScript.h" 7 #include "../../include/javascript/JavaScript.h"
8 #include "../../include/javascript/IJavaScript.h" 8 #include "../../include/javascript/IJavaScript.h"
9 #include "../../include/javascript/JS_Define.h" 9 #include "../../include/javascript/JS_Define.h"
10 #include "../../include/javascript/JS_Object.h" 10 #include "../../include/javascript/JS_Object.h"
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 int iType = 0; 320 int iType = 0;
321 321
322 v8::Isolate* isolate = GetIsolate(cc); 322 v8::Isolate* isolate = GetIsolate(cc);
323 323
324 if (iSize == 1) 324 if (iSize == 1)
325 { 325 {
326 if (params[0].GetType() == VT_object) 326 if (params[0].GetType() == VT_object)
327 { 327 {
328 JSObject pObj = params[0].ToV8Object(); 328 JSObject pObj = params[0].ToV8Object();
329 { 329 {
330 » » » » v8::Handle<v8::Value> pValue = JS_GetObjectEleme nt(isolate, pObj, L"cMsg"); 330 » » » » v8::Local<v8::Value> pValue = JS_GetObjectElemen t(isolate, pObj, L"cMsg");
331 swMsg = CJS_Value(isolate, pValue, VT_unknown).T oCFXWideString(); 331 swMsg = CJS_Value(isolate, pValue, VT_unknown).T oCFXWideString();
332 332
333 pValue = JS_GetObjectElement(isolate, pObj, L"cT itle"); 333 pValue = JS_GetObjectElement(isolate, pObj, L"cT itle");
334 swTitle = CJS_Value(isolate, pValue, VT_unknown) .ToCFXWideString(); 334 swTitle = CJS_Value(isolate, pValue, VT_unknown) .ToCFXWideString();
335 335
336 pValue = JS_GetObjectElement(isolate, pObj, L"nI con"); 336 pValue = JS_GetObjectElement(isolate, pObj, L"nI con");
337 iIcon = CJS_Value(isolate, pValue, VT_unknown).T oInt(); 337 iIcon = CJS_Value(isolate, pValue, VT_unknown).T oInt();
338 338
339 pValue = JS_GetObjectElement(isolate, pObj, L"nT ype"); 339 pValue = JS_GetObjectElement(isolate, pObj, L"nT ype");
340 iType = CJS_Value(isolate, pValue, VT_unknown).T oInt(); 340 iType = CJS_Value(isolate, pValue, VT_unknown).T oInt();
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 CFX_WideString cSubject = L""; 708 CFX_WideString cSubject = L"";
709 CFX_WideString cMsg = L""; 709 CFX_WideString cMsg = L"";
710 710
711 if (params.size() < 1) 711 if (params.size() < 1)
712 return FALSE; 712 return FALSE;
713 713
714 if (params[0].GetType() == VT_object) 714 if (params[0].GetType() == VT_object)
715 { 715 {
716 JSObject pObj = params[0].ToV8Object(); 716 JSObject pObj = params[0].ToV8Object();
717 717
718 » » v8::Handle<v8::Value> pValue = JS_GetObjectElement(isolate, pObj , L"bUI"); 718 » » v8::Local<v8::Value> pValue = JS_GetObjectElement(isolate, pObj, L"bUI");
719 bUI = CJS_Value(isolate, pValue, GET_VALUE_TYPE(pValue)).ToBool( ); 719 bUI = CJS_Value(isolate, pValue, GET_VALUE_TYPE(pValue)).ToBool( );
720 720
721 pValue = JS_GetObjectElement(isolate, pObj, L"cTo"); 721 pValue = JS_GetObjectElement(isolate, pObj, L"cTo");
722 cTo = CJS_Value(isolate, pValue, GET_VALUE_TYPE(pValue)).ToCFXWi deString(); 722 cTo = CJS_Value(isolate, pValue, GET_VALUE_TYPE(pValue)).ToCFXWi deString();
723 723
724 pValue = JS_GetObjectElement(isolate, pObj, L"cCc"); 724 pValue = JS_GetObjectElement(isolate, pObj, L"cCc");
725 cCc = CJS_Value(isolate, pValue, GET_VALUE_TYPE(pValue)).ToCFXWi deString(); 725 cCc = CJS_Value(isolate, pValue, GET_VALUE_TYPE(pValue)).ToCFXWi deString();
726 726
727 pValue = JS_GetObjectElement(isolate, pObj, L"cBcc"); 727 pValue = JS_GetObjectElement(isolate, pObj, L"cBcc");
728 cBcc = CJS_Value(isolate, pValue, GET_VALUE_TYPE(pValue)).ToCFXW ideString(); 728 cBcc = CJS_Value(isolate, pValue, GET_VALUE_TYPE(pValue)).ToCFXW ideString();
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
842 CFX_WideString swTitle = L"PDF"; 842 CFX_WideString swTitle = L"PDF";
843 CFX_WideString swDefault = L""; 843 CFX_WideString swDefault = L"";
844 bool bPassWord = false; 844 bool bPassWord = false;
845 845
846 v8::Isolate* isolate = GetIsolate(cc); 846 v8::Isolate* isolate = GetIsolate(cc);
847 847
848 int iLength = params.size(); 848 int iLength = params.size();
849 if (iLength > 0 && params[0].GetType() == VT_object) 849 if (iLength > 0 && params[0].GetType() == VT_object)
850 { 850 {
851 JSObject pObj = params[0].ToV8Object(); 851 JSObject pObj = params[0].ToV8Object();
852 » » v8::Handle<v8::Value> pValue = JS_GetObjectElement(isolate,pObj, L"cQuestion"); 852 » » v8::Local<v8::Value> pValue = JS_GetObjectElement(isolate,pObj,L "cQuestion");
853 swQuestion = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).To CFXWideString(); 853 swQuestion = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).To CFXWideString();
854 854
855 pValue = JS_GetObjectElement(isolate,pObj,L"cTitle"); 855 pValue = JS_GetObjectElement(isolate,pObj,L"cTitle");
856 swTitle = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).ToCFX WideString(); 856 swTitle = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).ToCFX WideString();
857 857
858 pValue = JS_GetObjectElement(isolate,pObj,L"cDefault"); 858 pValue = JS_GetObjectElement(isolate,pObj,L"cDefault");
859 swDefault = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).ToC FXWideString(); 859 swDefault = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).ToC FXWideString();
860 860
861 pValue = JS_GetObjectElement(isolate,pObj,L"cLabel"); 861 pValue = JS_GetObjectElement(isolate,pObj,L"cLabel");
862 swLabel = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).ToCFX WideString(); 862 swLabel = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).ToCFX WideString();
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
918 918
919 FX_BOOL app::media(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) 919 FX_BOOL app::media(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
920 { 920 {
921 return FALSE; 921 return FALSE;
922 } 922 }
923 923
924 FX_BOOL app::execDialog(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Val ue& vRet, CFX_WideString& sError) 924 FX_BOOL app::execDialog(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Val ue& vRet, CFX_WideString& sError)
925 { 925 {
926 return TRUE; 926 return TRUE;
927 } 927 }
OLDNEW
« no previous file with comments | « fpdfsdk/src/javascript/JS_Value.cpp ('k') | fpdfsdk/src/javascript/global.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698