1 // Copyright 2015 PDFium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 6 7 #include "fxjs/cjs_runtimestub.h" 8 9 #include "fxjs/cjs_event_context_stub.h" 10 #include "third_party/base/ptr_util.h" 11 CJS_RuntimeStub(CPDFSDK_FormFillEnvironment * pFormFillEnv)12CJS_RuntimeStub::CJS_RuntimeStub(CPDFSDK_FormFillEnvironment* pFormFillEnv) 13 : m_pFormFillEnv(pFormFillEnv) {} 14 15 CJS_RuntimeStub::~CJS_RuntimeStub() = default; 16 NewEventContext()17IJS_EventContext* CJS_RuntimeStub::NewEventContext() { 18 if (!m_pContext) 19 m_pContext = pdfium::MakeUnique<CJS_EventContextStub>(); 20 return m_pContext.get(); 21 } 22 ReleaseEventContext(IJS_EventContext * pContext)23void CJS_RuntimeStub::ReleaseEventContext(IJS_EventContext* pContext) {} 24 GetFormFillEnv() const25CPDFSDK_FormFillEnvironment* CJS_RuntimeStub::GetFormFillEnv() const { 26 return m_pFormFillEnv.Get(); 27 } 28 AsCJSRuntime()29CJS_Runtime* CJS_RuntimeStub::AsCJSRuntime() { 30 return nullptr; 31 } 32 ExecuteScript(const WideString & script)33Optional<IJS_Runtime::JS_Error> CJS_RuntimeStub::ExecuteScript( 34 const WideString& script) { 35 return pdfium::nullopt; 36 } 37