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

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

Issue 1350703003: Don't pass null isolates to FXJS_ when we have a real isolate. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
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
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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 v8::Local<v8::Context>::New(m_isolate, m_context); 177 v8::Local<v8::Context>::New(m_isolate, m_context);
178 v8::Context::Scope context_scope(context); 178 v8::Context::Scope context_scope(context);
179 179
180 m_pDocument = pReaderDoc; 180 m_pDocument = pReaderDoc;
181 if (pReaderDoc) { 181 if (pReaderDoc) {
182 v8::Local<v8::Object> pThis = FXJS_GetThisObj(GetIsolate()); 182 v8::Local<v8::Object> pThis = FXJS_GetThisObj(GetIsolate());
183 if (!pThis.IsEmpty()) { 183 if (!pThis.IsEmpty()) {
184 if (FXJS_GetObjDefnID(pThis) == 184 if (FXJS_GetObjDefnID(pThis) ==
185 FXJS_GetObjDefnID(GetIsolate(), L"Document")) { 185 FXJS_GetObjDefnID(GetIsolate(), L"Document")) {
186 if (CJS_Document* pJSDocument = 186 if (CJS_Document* pJSDocument =
187 (CJS_Document*)FXJS_GetPrivate(pThis)) { 187 (CJS_Document*)FXJS_GetPrivate(GetIsolate(), pThis)) {
188 if (Document* pDocument = (Document*)pJSDocument->GetEmbedObject()) 188 if (Document* pDocument = (Document*)pJSDocument->GetEmbedObject())
189 pDocument->AttachDoc(pReaderDoc); 189 pDocument->AttachDoc(pReaderDoc);
190 } 190 }
191 } 191 }
192 } 192 }
193 } 193 }
194 } 194 }
195 } 195 }
196 196
197 FX_BOOL CJS_Runtime::AddEventToLoop(const CFX_WideString& sTargetName, 197 FX_BOOL CJS_Runtime::AddEventToLoop(const CFX_WideString& sTargetName,
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 267
268 v8::Local<v8::Context> CJS_Runtime::NewJSContext() { 268 v8::Local<v8::Context> CJS_Runtime::NewJSContext() {
269 return v8::Local<v8::Context>::New(m_isolate, m_context); 269 return v8::Local<v8::Context>::New(m_isolate, m_context);
270 } 270 }
271 271
272 CFX_WideString ChangeObjName(const CFX_WideString& str) { 272 CFX_WideString ChangeObjName(const CFX_WideString& str) {
273 CFX_WideString sRet = str; 273 CFX_WideString sRet = str;
274 sRet.Replace(L"_", L"."); 274 sRet.Replace(L"_", L".");
275 return sRet; 275 return sRet;
276 } 276 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698