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

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

Issue 1342403005: Merge to XFA: Don't pass null isolates to FXJS_ when we have a real isolate. (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/include/jsapi/fxjs_v8.h ('k') | fpdfsdk/src/javascript/Field.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 1449 matching lines...) Expand 10 before | Expand all | Expand 10 after
1460 1460
1461 for (int i = 0; i < iIconTreeLength; i++) { 1461 for (int i = 0; i < iIconTreeLength; i++) {
1462 pIconElement = (*m_pIconTree)[i]; 1462 pIconElement = (*m_pIconTree)[i];
1463 1463
1464 v8::Local<v8::Object> pObj = FXJS_NewFxDynamicObj( 1464 v8::Local<v8::Object> pObj = FXJS_NewFxDynamicObj(
1465 pRuntime->GetIsolate(), pContext, 1465 pRuntime->GetIsolate(), pContext,
1466 FXJS_GetObjDefnID(pRuntime->GetIsolate(), L"Icon")); 1466 FXJS_GetObjDefnID(pRuntime->GetIsolate(), L"Icon"));
1467 if (pObj.IsEmpty()) 1467 if (pObj.IsEmpty())
1468 return FALSE; 1468 return FALSE;
1469 1469
1470 CJS_Icon* pJS_Icon = (CJS_Icon*)FXJS_GetPrivate(pObj); 1470 CJS_Icon* pJS_Icon = (CJS_Icon*)FXJS_GetPrivate(m_isolate, pObj);
1471 if (!pJS_Icon) 1471 if (!pJS_Icon)
1472 return FALSE; 1472 return FALSE;
1473 1473
1474 Icon* pIcon = (Icon*)pJS_Icon->GetEmbedObject(); 1474 Icon* pIcon = (Icon*)pJS_Icon->GetEmbedObject();
1475 if (!pIcon) 1475 if (!pIcon)
1476 return FALSE; 1476 return FALSE;
1477 1477
1478 pIcon->SetStream(pIconElement->IconStream->GetStream()); 1478 pIcon->SetStream(pIconElement->IconStream->GetStream());
1479 pIcon->SetIconName(pIconElement->IconName); 1479 pIcon->SetIconName(pIconElement->IconName);
1480 Icons.SetElement(i, CJS_Value(m_isolate, pJS_Icon)); 1480 Icons.SetElement(i, CJS_Value(m_isolate, pJS_Icon));
(...skipping 23 matching lines...) Expand all
1504 for (int i = 0; i < iIconCounts; i++) { 1504 for (int i = 0; i < iIconCounts; i++) {
1505 if ((*m_pIconTree)[i]->IconName == swIconName) { 1505 if ((*m_pIconTree)[i]->IconName == swIconName) {
1506 Icon* pRetIcon = (*m_pIconTree)[i]->IconStream; 1506 Icon* pRetIcon = (*m_pIconTree)[i]->IconStream;
1507 1507
1508 v8::Local<v8::Object> pObj = FXJS_NewFxDynamicObj( 1508 v8::Local<v8::Object> pObj = FXJS_NewFxDynamicObj(
1509 pRuntime->GetIsolate(), pContext, 1509 pRuntime->GetIsolate(), pContext,
1510 FXJS_GetObjDefnID(pRuntime->GetIsolate(), L"Icon")); 1510 FXJS_GetObjDefnID(pRuntime->GetIsolate(), L"Icon"));
1511 if (pObj.IsEmpty()) 1511 if (pObj.IsEmpty())
1512 return FALSE; 1512 return FALSE;
1513 1513
1514 CJS_Icon* pJS_Icon = (CJS_Icon*)FXJS_GetPrivate(pObj); 1514 CJS_Icon* pJS_Icon = (CJS_Icon*)FXJS_GetPrivate(m_isolate, pObj);
1515 if (!pJS_Icon) 1515 if (!pJS_Icon)
1516 return FALSE; 1516 return FALSE;
1517 1517
1518 Icon* pIcon = (Icon*)pJS_Icon->GetEmbedObject(); 1518 Icon* pIcon = (Icon*)pJS_Icon->GetEmbedObject();
1519 if (!pIcon) 1519 if (!pIcon)
1520 return FALSE; 1520 return FALSE;
1521 1521
1522 pIcon->SetIconName(swIconName); 1522 pIcon->SetIconName(swIconName);
1523 pIcon->SetStream(pRetIcon->GetStream()); 1523 pIcon->SetStream(pRetIcon->GetStream());
1524 vRet = pJS_Icon; 1524 vRet = pJS_Icon;
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
1929 CFX_DWordArray DelArray; 1929 CFX_DWordArray DelArray;
1930 1930
1931 for (int j = DelArray.GetSize() - 1; j >= 0; j--) { 1931 for (int j = DelArray.GetSize() - 1; j >= 0; j--) {
1932 m_DelayData.RemoveAt(DelArray[j]); 1932 m_DelayData.RemoveAt(DelArray[j]);
1933 } 1933 }
1934 } 1934 }
1935 1935
1936 CJS_Document* Document::GetCJSDoc() const { 1936 CJS_Document* Document::GetCJSDoc() const {
1937 return static_cast<CJS_Document*>(m_pJSObject); 1937 return static_cast<CJS_Document*>(m_pJSObject);
1938 } 1938 }
OLDNEW
« no previous file with comments | « fpdfsdk/include/jsapi/fxjs_v8.h ('k') | fpdfsdk/src/javascript/Field.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698