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

Side by Side Diff: xfa/fxjse/class.cpp

Issue 2014213002: Replace FXJSE_HCLASS with CFXJSE_Class* (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@fxjse_hcontext
Patch Set: Created 4 years, 6 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 "xfa/fxjse/class.h" 7 #include "xfa/fxjse/class.h"
8 8
9 #include "xfa/fxjse/cfxjse_arguments.h" 9 #include "xfa/fxjse/cfxjse_arguments.h"
10 #include "xfa/fxjse/context.h" 10 #include "xfa/fxjse/context.h"
11 #include "xfa/fxjse/scope_inline.h" 11 #include "xfa/fxjse/scope_inline.h"
12 #include "xfa/fxjse/util_inline.h" 12 #include "xfa/fxjse/util_inline.h"
13 #include "xfa/fxjse/value.h" 13 #include "xfa/fxjse/value.h"
14 14
15 static void FXJSE_V8ConstructorCallback_Wrapper( 15 static void FXJSE_V8ConstructorCallback_Wrapper(
16 const v8::FunctionCallbackInfo<v8::Value>& info); 16 const v8::FunctionCallbackInfo<v8::Value>& info);
17 static void FXJSE_V8FunctionCallback_Wrapper( 17 static void FXJSE_V8FunctionCallback_Wrapper(
18 const v8::FunctionCallbackInfo<v8::Value>& info); 18 const v8::FunctionCallbackInfo<v8::Value>& info);
19 static void FXJSE_V8GetterCallback_Wrapper( 19 static void FXJSE_V8GetterCallback_Wrapper(
20 v8::Local<v8::String> property, 20 v8::Local<v8::String> property,
21 const v8::PropertyCallbackInfo<v8::Value>& info); 21 const v8::PropertyCallbackInfo<v8::Value>& info);
22 static void FXJSE_V8SetterCallback_Wrapper( 22 static void FXJSE_V8SetterCallback_Wrapper(
23 v8::Local<v8::String> property, 23 v8::Local<v8::String> property,
24 v8::Local<v8::Value> value, 24 v8::Local<v8::Value> value,
25 const v8::PropertyCallbackInfo<void>& info); 25 const v8::PropertyCallbackInfo<void>& info);
26 26
27 FXJSE_HCLASS FXJSE_DefineClass(CFXJSE_Context* pContext, 27 CFXJSE_Class* FXJSE_DefineClass(CFXJSE_Context* pContext,
28 const FXJSE_CLASS* lpClass) { 28 const FXJSE_CLASS* lpClass) {
29 ASSERT(pContext); 29 ASSERT(pContext);
30 return reinterpret_cast<FXJSE_HCLASS>( 30 return CFXJSE_Class::Create(pContext, lpClass, FALSE);
31 CFXJSE_Class::Create(pContext, lpClass, FALSE));
32 } 31 }
33 32
34 static void FXJSE_V8FunctionCallback_Wrapper( 33 static void FXJSE_V8FunctionCallback_Wrapper(
35 const v8::FunctionCallbackInfo<v8::Value>& info) { 34 const v8::FunctionCallbackInfo<v8::Value>& info) {
36 const FXJSE_FUNCTION* lpFunctionInfo = 35 const FXJSE_FUNCTION* lpFunctionInfo =
37 static_cast<FXJSE_FUNCTION*>(info.Data().As<v8::External>()->Value()); 36 static_cast<FXJSE_FUNCTION*>(info.Data().As<v8::External>()->Value());
38 if (!lpFunctionInfo) { 37 if (!lpFunctionInfo) {
39 return; 38 return;
40 } 39 }
41 CFX_ByteStringC szFunctionName(lpFunctionInfo->name); 40 CFX_ByteStringC szFunctionName(lpFunctionInfo->name);
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 } 306 }
308 307
309 CFXJSE_Class* CFXJSE_Class::GetClassFromContext(CFXJSE_Context* pContext, 308 CFXJSE_Class* CFXJSE_Class::GetClassFromContext(CFXJSE_Context* pContext,
310 const CFX_ByteStringC& szName) { 309 const CFX_ByteStringC& szName) {
311 for (const auto& pClass : pContext->m_rgClasses) { 310 for (const auto& pClass : pContext->m_rgClasses) {
312 if (pClass->m_szClassName == szName) 311 if (pClass->m_szClassName == szName)
313 return pClass.get(); 312 return pClass.get();
314 } 313 }
315 return nullptr; 314 return nullptr;
316 } 315 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698