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

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

Issue 1393833006: Merge to XFA: Allow compiling PDFium without V8. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 2 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 "JS_Runtime.h" 7 #include "JS_Runtime.h"
8 8
9 #include "../../../xfa/src/fxjse/src/value.h" 9 #include "../../../xfa/src/fxjse/src/value.h"
10 #include "../../include/fpdfxfa/fpdfxfa_app.h" 10 #include "../../include/fpdfxfa/fpdfxfa_app.h"
(...skipping 15 matching lines...) Expand all
26 #include "console.h" 26 #include "console.h"
27 #include "event.h" 27 #include "event.h"
28 #include "global.h" 28 #include "global.h"
29 #include "report.h" 29 #include "report.h"
30 #include "util.h" 30 #include "util.h"
31 31
32 /* ------------------------------ CJS_Runtime ------------------------------ */ 32 /* ------------------------------ CJS_Runtime ------------------------------ */
33 v8::Global<v8::ObjectTemplate>& _getGlobalObjectTemplate(v8::Isolate* pIsolate); 33 v8::Global<v8::ObjectTemplate>& _getGlobalObjectTemplate(v8::Isolate* pIsolate);
34 34
35 // static 35 // static
36 void IJS_Runtime::Initialize(unsigned int slot, void* isolate) {
37 FXJS_Initialize(slot, reinterpret_cast<v8::Isolate*>(isolate));
38 }
39
40 // static
36 IJS_Runtime* IJS_Runtime::Create(CPDFDoc_Environment* pEnv) { 41 IJS_Runtime* IJS_Runtime::Create(CPDFDoc_Environment* pEnv) {
37 return new CJS_Runtime(pEnv); 42 return new CJS_Runtime(pEnv);
38 } 43 }
39 44
40 // static 45 // static
41 CJS_Runtime* CJS_Runtime::FromContext(const IJS_Context* cc) { 46 CJS_Runtime* CJS_Runtime::FromContext(const IJS_Context* cc) {
42 const CJS_Context* pContext = static_cast<const CJS_Context*>(cc); 47 const CJS_Context* pContext = static_cast<const CJS_Context*>(cc);
43 return pContext->GetJSRuntime(); 48 return pContext->GetJSRuntime();
44 } 49 }
45 50
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 277
273 void CJS_Runtime::AddObserver(Observer* observer) { 278 void CJS_Runtime::AddObserver(Observer* observer) {
274 ASSERT(m_observers.find(observer) == m_observers.end()); 279 ASSERT(m_observers.find(observer) == m_observers.end());
275 m_observers.insert(observer); 280 m_observers.insert(observer);
276 } 281 }
277 282
278 void CJS_Runtime::RemoveObserver(Observer* observer) { 283 void CJS_Runtime::RemoveObserver(Observer* observer) {
279 ASSERT(m_observers.find(observer) != m_observers.end()); 284 ASSERT(m_observers.find(observer) != m_observers.end());
280 m_observers.erase(observer); 285 m_observers.erase(observer);
281 } 286 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698