From e2a774a4b841829ef089d0cbfd15a08895eecf0e Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 8 Mar 2016 15:03:11 -0500 Subject: Remove xfa/src/fxjse/src and move code up a level. This CL removes the xfa/src/fxjse/src and moves all of the .h and .cpp files up to the, previously empty, xfa/src/fxjse directory. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1776643002 . --- xfa/src/fxjse/class.h | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 xfa/src/fxjse/class.h (limited to 'xfa/src/fxjse/class.h') diff --git a/xfa/src/fxjse/class.h b/xfa/src/fxjse/class.h new file mode 100644 index 0000000000..f5738ebcc6 --- /dev/null +++ b/xfa/src/fxjse/class.h @@ -0,0 +1,49 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef XFA_SRC_FXJSE_CLASS_H_ +#define XFA_SRC_FXJSE_CLASS_H_ + +#include "v8/include/v8.h" +#include "xfa/include/fxjse/fxjse.h" + +class CFXJSE_Context; +class CFXJSE_Value; + +class CFXJSE_Class { + protected: + CFXJSE_Class(CFXJSE_Context* lpContext) + : m_lpClassDefinition(nullptr), m_pContext(lpContext) {} + + public: + inline CFXJSE_Context* GetContext() { return m_pContext; } + inline v8::Global& GetTemplate() { return m_hTemplate; } + + public: + static CFXJSE_Class* Create(CFXJSE_Context* pContext, + const FXJSE_CLASS* lpClassDefintion, + FX_BOOL bIsJSGlobal = FALSE); + static CFXJSE_Class* GetClassFromContext(CFXJSE_Context* pContext, + const CFX_ByteStringC& szName); + static void SetUpNamedPropHandler( + v8::Isolate* pIsolate, + v8::Local& hObjectTemplate, + const FXJSE_CLASS* lpClassDefinition); + + protected: + CFX_ByteString m_szClassName; + const FXJSE_CLASS* m_lpClassDefinition; + CFXJSE_Context* m_pContext; + v8::Global m_hTemplate; + friend class CFXJSE_Context; + friend class CFXJSE_Value; +}; +struct CFXJSE_ArgumentsImpl { + const v8::FunctionCallbackInfo* m_pInfo; + CFXJSE_Value* m_pRetValue; +}; + +#endif // XFA_SRC_FXJSE_CLASS_H_ -- cgit v1.2.3