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

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

Issue 1234053003: Plumb in an externally created v8::Isolate (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 5 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 | « no previous file | public/fpdf_formfill.h » ('j') | public/fpdf_formfill.h » ('J')
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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 105
106 /* ------------------------------ CJS_Runtime ------------------------------ */ 106 /* ------------------------------ CJS_Runtime ------------------------------ */
107 107
108 CJS_Runtime::CJS_Runtime(CPDFDoc_Environment * pApp) : 108 CJS_Runtime::CJS_Runtime(CPDFDoc_Environment * pApp) :
109 m_pApp(pApp), 109 m_pApp(pApp),
110 m_pDocument(NULL), 110 m_pDocument(NULL),
111 m_bBlocking(FALSE), 111 m_bBlocking(FALSE),
112 m_bRegistered(FALSE), 112 m_bRegistered(FALSE),
113 m_pFieldEventPath(NULL) 113 m_pFieldEventPath(NULL)
114 { 114 {
115 » m_pArrayBufferAllocator.reset(new CJS_ArrayBufferAllocator()); 115 » if (m_pApp->GetFormFillInfo()->m_pJsPlatform->version == 2) {
Tom Sepez 2015/07/14 16:22:53 I think we want >= 2 for future compatibility. Als
116 » » m_isolate = m_pApp->GetFormFillInfo()->m_pJsPlatform->m_isolate;
117 » } else {
118 » » m_pArrayBufferAllocator.reset(new CJS_ArrayBufferAllocator());
116 119
117 » v8::Isolate::CreateParams params; 120 » » v8::Isolate::CreateParams params;
118 » params.array_buffer_allocator = m_pArrayBufferAllocator.get(); 121 » » params.array_buffer_allocator = m_pArrayBufferAllocator.get();
119 » m_isolate = v8::Isolate::New(params); 122 » » m_isolate = v8::Isolate::New(params);
123 }
120 124
121 InitJSObjects(); 125 InitJSObjects();
122 126
123 CJS_Context * pContext = (CJS_Context*)NewContext(); 127 CJS_Context * pContext = (CJS_Context*)NewContext();
124 JS_InitialRuntime(*this, this, pContext, m_context); 128 JS_InitialRuntime(*this, this, pContext, m_context);
125 ReleaseContext(pContext); 129 ReleaseContext(pContext);
126 } 130 }
127 131
128 CJS_Runtime::~CJS_Runtime() 132 CJS_Runtime::~CJS_Runtime()
129 { 133 {
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 { 336 {
333 return v8::Local<v8::Context>::New(m_isolate, m_context); 337 return v8::Local<v8::Context>::New(m_isolate, m_context);
334 } 338 }
335 339
336 CFX_WideString ChangeObjName(const CFX_WideString& str) 340 CFX_WideString ChangeObjName(const CFX_WideString& str)
337 { 341 {
338 CFX_WideString sRet = str; 342 CFX_WideString sRet = str;
339 sRet.Replace(L"_", L"."); 343 sRet.Replace(L"_", L".");
340 return sRet; 344 return sRet;
341 } 345 }
OLDNEW
« no previous file with comments | « no previous file | public/fpdf_formfill.h » ('j') | public/fpdf_formfill.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698