OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |