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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 m_context.Reset(); | 142 m_context.Reset(); |
143 | 143 |
144 //m_isolate->Exit(); | 144 //m_isolate->Exit(); |
145 m_isolate->Dispose(); | 145 m_isolate->Dispose(); |
146 } | 146 } |
147 | 147 |
148 FX_BOOL CJS_Runtime::InitJSObjects() | 148 FX_BOOL CJS_Runtime::InitJSObjects() |
149 { | 149 { |
150 v8::Isolate::Scope isolate_scope(GetIsolate()); | 150 v8::Isolate::Scope isolate_scope(GetIsolate()); |
151 v8::HandleScope handle_scope(GetIsolate()); | 151 v8::HandleScope handle_scope(GetIsolate()); |
152 » v8::Handle<v8::Context> context = v8::Context::New(GetIsolate()); | 152 » v8::Local<v8::Context> context = v8::Context::New(GetIsolate()); |
153 v8::Context::Scope context_scope(context); | 153 v8::Context::Scope context_scope(context); |
154 //0 - 8 | 154 //0 - 8 |
155 if (CJS_Border::Init(*this, JS_STATIC) < 0) return FALSE; | 155 if (CJS_Border::Init(*this, JS_STATIC) < 0) return FALSE; |
156 if (CJS_Display::Init(*this, JS_STATIC) < 0) return FALSE; | 156 if (CJS_Display::Init(*this, JS_STATIC) < 0) return FALSE; |
157 if (CJS_Font::Init(*this, JS_STATIC) < 0) return FALSE; | 157 if (CJS_Font::Init(*this, JS_STATIC) < 0) return FALSE; |
158 if (CJS_Highlight::Init(*this, JS_STATIC) < 0) return FALSE; | 158 if (CJS_Highlight::Init(*this, JS_STATIC) < 0) return FALSE; |
159 if (CJS_Position::Init(*this, JS_STATIC) < 0) return FALSE; | 159 if (CJS_Position::Init(*this, JS_STATIC) < 0) return FALSE; |
160 if (CJS_ScaleHow::Init(*this, JS_STATIC) < 0) return FALSE; | 160 if (CJS_ScaleHow::Init(*this, JS_STATIC) < 0) return FALSE; |
161 if (CJS_ScaleWhen::Init(*this, JS_STATIC) < 0) return FALSE; | 161 if (CJS_ScaleWhen::Init(*this, JS_STATIC) < 0) return FALSE; |
162 if (CJS_Style::Init(*this, JS_STATIC) < 0) return FALSE; | 162 if (CJS_Style::Init(*this, JS_STATIC) < 0) return FALSE; |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 | 321 |
322 while (p) | 322 while (p) |
323 { | 323 { |
324 CJS_FieldEvent* pOld = p; | 324 CJS_FieldEvent* pOld = p; |
325 p = pOld->pNext; | 325 p = pOld->pNext; |
326 | 326 |
327 delete pOld; | 327 delete pOld; |
328 } | 328 } |
329 } | 329 } |
330 | 330 |
331 v8::Handle<v8::Context>»CJS_Runtime::NewJSContext() | 331 v8::Local<v8::Context>» CJS_Runtime::NewJSContext() |
332 { | 332 { |
333 return v8::Local<v8::Context>::New(m_isolate, m_context); | 333 return v8::Local<v8::Context>::New(m_isolate, m_context); |
334 } | 334 } |
335 | 335 |
336 CFX_WideString ChangeObjName(const CFX_WideString& str) | 336 CFX_WideString ChangeObjName(const CFX_WideString& str) |
337 { | 337 { |
338 CFX_WideString sRet = str; | 338 CFX_WideString sRet = str; |
339 sRet.Replace(L"_", L"."); | 339 sRet.Replace(L"_", L"."); |
340 return sRet; | 340 return sRet; |
341 } | 341 } |
OLD | NEW |