diff options
Diffstat (limited to 'fxjs/cfx_globaldata.h')
-rw-r--r-- | fxjs/cfx_globaldata.h | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/fxjs/cfx_globaldata.h b/fxjs/cfx_globaldata.h index 421a3b488..6b9426593 100644 --- a/fxjs/cfx_globaldata.h +++ b/fxjs/cfx_globaldata.h @@ -1,4 +1,4 @@ -// Copyright 2014 PDFium Authors. All rights reserved. +// Copyright 2014 The PDFium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -10,22 +10,20 @@ #include <memory> #include <vector> -#include "core/fxcrt/cfx_binarybuf.h" +#include "core/fxcrt/binary_buffer.h" #include "core/fxcrt/unowned_ptr.h" #include "fxjs/cfx_keyvalue.h" -#include "third_party/base/optional.h" +#include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/base/span.h" -class CPDFSDK_FormFillEnvironment; - class CFX_GlobalData { public: class Delegate { public: - virtual ~Delegate() {} + virtual ~Delegate() = default; virtual bool StoreBuffer(pdfium::span<const uint8_t> pBuffer) = 0; - virtual Optional<pdfium::span<uint8_t>> LoadBuffer() = 0; + virtual absl::optional<pdfium::span<uint8_t>> LoadBuffer() = 0; virtual void BufferDone() = 0; }; @@ -35,7 +33,7 @@ class CFX_GlobalData { ~Element(); CFX_KeyValue data; - bool bPersistent; + bool bPersistent = false; }; static CFX_GlobalData* GetRetainedInstance(Delegate* pDelegate); @@ -66,16 +64,8 @@ class CFX_GlobalData { bool LoadGlobalPersistentVariables(); bool LoadGlobalPersistentVariablesFromBuffer(pdfium::span<uint8_t> buffer); bool SaveGlobalPersisitentVariables(); - iterator FindGlobalVariable(const ByteString& sPropname); - void LoadFileBuffer(const wchar_t* sFilePath, - uint8_t*& pBuffer, - int32_t& nLength); - void WriteFileBuffer(const wchar_t* sFilePath, - const char* pBuffer, - int32_t nLength); - size_t m_RefCount = 0; UnownedPtr<Delegate> const m_pDelegate; std::vector<std::unique_ptr<Element>> m_arrayGlobalData; |