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

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

Issue 1250433003: Merge to XFA: Remove dead code found by Scythe. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@xfa
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 | « fpdfsdk/src/formfiller/FFL_FormFiller.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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 void CJS_ArrayBufferAllocator::Free(void* data, size_t length) { 103 void CJS_ArrayBufferAllocator::Free(void* data, size_t length) {
104 free(data); 104 free(data);
105 } 105 }
106 106
107 /* ------------------------------ CJS_Runtime ------------------------------ */ 107 /* ------------------------------ CJS_Runtime ------------------------------ */
108 extern v8::Global<v8::ObjectTemplate>& _getGlobalObjectTemplate(IJS_Runtime* pJS Runtime); 108 extern v8::Global<v8::ObjectTemplate>& _getGlobalObjectTemplate(IJS_Runtime* pJS Runtime);
109 CJS_Runtime::CJS_Runtime(CPDFDoc_Environment* pApp) : 109 CJS_Runtime::CJS_Runtime(CPDFDoc_Environment* pApp) :
110 m_pApp(pApp), 110 m_pApp(pApp),
111 m_pDocument(NULL), 111 m_pDocument(NULL),
112 m_bBlocking(FALSE), 112 m_bBlocking(FALSE),
113 m_bRegistered(FALSE),
114 m_pFieldEventPath(NULL) 113 m_pFieldEventPath(NULL)
115 { 114 {
116 if (CPDFXFA_App::GetInstance()->GetJSERuntime()) { 115 if (CPDFXFA_App::GetInstance()->GetJSERuntime()) {
117 m_isolate = (v8::Isolate*)CPDFXFA_App::GetInstance()->GetJSERunt ime(); 116 m_isolate = (v8::Isolate*)CPDFXFA_App::GetInstance()->GetJSERunt ime();
118 } else { 117 } else {
119 m_pArrayBufferAllocator.reset(new CJS_ArrayBufferAllocator()); 118 m_pArrayBufferAllocator.reset(new CJS_ArrayBufferAllocator());
120 v8::Isolate::CreateParams params; 119 v8::Isolate::CreateParams params;
121 params.array_buffer_allocator = m_pArrayBufferAllocator.get(); 120 params.array_buffer_allocator = m_pArrayBufferAllocator.get();
122 m_isolate = v8::Isolate::New(params); 121 m_isolate = v8::Isolate::New(params);
123 } 122 }
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 v8::Local<v8::Context> context = 392 v8::Local<v8::Context> context =
394 v8::Local<v8::Context>::New(pIsolate, m_context); 393 v8::Local<v8::Context>::New(pIsolate, m_context);
395 v8::Context::Scope context_scope(context); 394 v8::Context::Scope context_scope(context);
396 395
397 //v8::Local<v8::Context> tmpCotext = v8::Local<v8::Context>::New(GetIsol ate(), m_context); 396 //v8::Local<v8::Context> tmpCotext = v8::Local<v8::Context>::New(GetIsol ate(), m_context);
398 v8::Local<v8::Value> propvalue = v8::Local<v8::Value>::New(GetIsolate(), ((CFXJSE_Value*)hValue)->DirectGetValue()); 397 v8::Local<v8::Value> propvalue = v8::Local<v8::Value>::New(GetIsolate(), ((CFXJSE_Value*)hValue)->DirectGetValue());
399 context->Global()->Set(v8::String::NewFromUtf8(pIsolate, name, v8::Strin g::kNormalString, utf8Name.GetLength()), propvalue); 398 context->Global()->Set(v8::String::NewFromUtf8(pIsolate, name, v8::Strin g::kNormalString, utf8Name.GetLength()), propvalue);
400 399
401 return TRUE; 400 return TRUE;
402 } 401 }
OLDNEW
« no previous file with comments | « fpdfsdk/src/formfiller/FFL_FormFiller.cpp ('k') | fpdfsdk/src/jsapi/fxjs_v8.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698