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

Side by Side Diff: fpdfsdk/src/javascript/JS_Runtime.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/src/javascript/JS_EventHandler.cpp ('k') | fpdfsdk/src/jsapi/fxjs_v8.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_EventHandler.h" 9 #include "../../include/javascript/JS_EventHandler.h"
10 #include "../../include/javascript/JS_Runtime.h" 10 #include "../../include/javascript/JS_Runtime.h"
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 v8::Local<v8::Context>::New(m_isolate, m_context); 198 v8::Local<v8::Context>::New(m_isolate, m_context);
199 v8::Context::Scope context_scope(context); 199 v8::Context::Scope context_scope(context);
200 200
201 m_pDocument = pReaderDoc; 201 m_pDocument = pReaderDoc;
202 if (pReaderDoc) { 202 if (pReaderDoc) {
203 v8::Local<v8::Object> pThis = FXJS_GetThisObj(GetIsolate()); 203 v8::Local<v8::Object> pThis = FXJS_GetThisObj(GetIsolate());
204 if (!pThis.IsEmpty()) { 204 if (!pThis.IsEmpty()) {
205 if (FXJS_GetObjDefnID(pThis) == 205 if (FXJS_GetObjDefnID(pThis) ==
206 FXJS_GetObjDefnID(GetIsolate(), L"Document")) { 206 FXJS_GetObjDefnID(GetIsolate(), L"Document")) {
207 if (CJS_Document* pJSDocument = 207 if (CJS_Document* pJSDocument =
208 (CJS_Document*)FXJS_GetPrivate(pThis)) { 208 (CJS_Document*)FXJS_GetPrivate(GetIsolate(), pThis)) {
209 if (Document* pDocument = (Document*)pJSDocument->GetEmbedObject()) 209 if (Document* pDocument = (Document*)pJSDocument->GetEmbedObject())
210 pDocument->AttachDoc(pReaderDoc); 210 pDocument->AttachDoc(pReaderDoc);
211 } 211 }
212 } 212 }
213 } 213 }
214 } 214 }
215 } 215 }
216 } 216 }
217 217
218 FX_BOOL CJS_Runtime::AddEventToLoop(const CFX_WideString& sTargetName, 218 FX_BOOL CJS_Runtime::AddEventToLoop(const CFX_WideString& sTargetName,
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 // v8::Local<v8::Context>::New(GetIsolate(), m_context); 337 // v8::Local<v8::Context>::New(GetIsolate(), m_context);
338 v8::Local<v8::Value> propvalue = v8::Local<v8::Value>::New( 338 v8::Local<v8::Value> propvalue = v8::Local<v8::Value>::New(
339 GetIsolate(), ((CFXJSE_Value*)hValue)->DirectGetValue()); 339 GetIsolate(), ((CFXJSE_Value*)hValue)->DirectGetValue());
340 context->Global()->Set( 340 context->Global()->Set(
341 v8::String::NewFromUtf8(pIsolate, name, v8::String::kNormalString, 341 v8::String::NewFromUtf8(pIsolate, name, v8::String::kNormalString,
342 utf8Name.GetLength()), 342 utf8Name.GetLength()),
343 propvalue); 343 propvalue);
344 344
345 return TRUE; 345 return TRUE;
346 } 346 }
OLDNEW
« no previous file with comments | « fpdfsdk/src/javascript/JS_EventHandler.cpp ('k') | fpdfsdk/src/jsapi/fxjs_v8.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698