2012-04-03 03:34:16 +02:00
|
|
|
// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights
|
|
|
|
// reserved. Use of this source code is governed by a BSD-style license that
|
|
|
|
// can be found in the LICENSE file.
|
|
|
|
|
|
|
|
#ifndef CEF_LIBCEF_COMMON_VALUES_IMPL_H_
|
|
|
|
#define CEF_LIBCEF_COMMON_VALUES_IMPL_H_
|
|
|
|
#pragma once
|
|
|
|
|
2023-01-30 22:42:40 +01:00
|
|
|
#include <memory>
|
2012-04-03 03:34:16 +02:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "base/threading/platform_thread.h"
|
2017-05-17 11:29:28 +02:00
|
|
|
#include "base/values.h"
|
2024-04-30 17:45:07 +02:00
|
|
|
#include "cef/include/cef_values.h"
|
|
|
|
#include "cef/libcef/common/value_base.h"
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2015-04-15 15:45:30 +02:00
|
|
|
// CefValue implementation
|
|
|
|
class CefValueImpl : public CefValue {
|
|
|
|
public:
|
2017-05-17 11:29:28 +02:00
|
|
|
// Get or create a reference to a complex value or copy a simple value.
|
2015-04-15 15:45:30 +02:00
|
|
|
static CefRefPtr<CefValue> GetOrCreateRefOrCopy(
|
|
|
|
base::Value* value,
|
|
|
|
void* parent_value,
|
|
|
|
bool read_only,
|
|
|
|
CefValueController* controller);
|
|
|
|
|
|
|
|
CefValueImpl();
|
|
|
|
|
|
|
|
// Take ownership of |value|. Do not pass in a value owned by something else
|
|
|
|
// (use GetOrCreateRefOrCopy instead).
|
2023-01-30 22:42:40 +01:00
|
|
|
explicit CefValueImpl(base::Value value);
|
2015-04-15 15:45:30 +02:00
|
|
|
|
|
|
|
// Keep a reference to |value|.
|
|
|
|
explicit CefValueImpl(CefRefPtr<CefBinaryValue> value);
|
|
|
|
explicit CefValueImpl(CefRefPtr<CefDictionaryValue> value);
|
|
|
|
explicit CefValueImpl(CefRefPtr<CefListValue> value);
|
|
|
|
|
2021-12-06 21:40:25 +01:00
|
|
|
CefValueImpl(const CefValueImpl&) = delete;
|
|
|
|
CefValueImpl& operator=(const CefValueImpl&) = delete;
|
|
|
|
|
2015-04-15 15:45:30 +02:00
|
|
|
~CefValueImpl() override;
|
|
|
|
|
|
|
|
// Take ownership of |value|. Do not pass in a value owned by something else
|
|
|
|
// (use GetOrCreateRefOrCopy or Set*() instead).
|
2023-01-30 22:42:40 +01:00
|
|
|
void SetValue(base::Value value);
|
|
|
|
|
|
|
|
// Return a copy of the value.
|
|
|
|
[[nodiscard]] base::Value CopyValue();
|
2015-04-15 15:45:30 +02:00
|
|
|
|
|
|
|
// Copy a simple value or transfer ownership of a complex value. If ownership
|
|
|
|
// of the value is tranferred then this object's internal reference to the
|
2017-04-20 21:28:17 +02:00
|
|
|
// value will be updated and remain valid. base::Value now uses move semantics
|
|
|
|
// so we need to perform the copy and swap in two steps.
|
2023-01-30 22:42:40 +01:00
|
|
|
[[nodiscard]] std::unique_ptr<base::Value> CopyOrDetachValue(
|
|
|
|
CefValueController* new_controller);
|
2017-04-20 21:28:17 +02:00
|
|
|
void SwapValue(base::Value* new_value,
|
|
|
|
void* new_parent_value,
|
|
|
|
CefValueController* new_controller);
|
2015-04-15 15:45:30 +02:00
|
|
|
|
2015-10-03 01:03:16 +02:00
|
|
|
// Returns a reference to the underlying data. Access must be protected by
|
2023-01-30 22:42:40 +01:00
|
|
|
// calling AcquireLock/ReleaseLock (e.g. use ScopedLockedValue).
|
2015-10-03 01:03:16 +02:00
|
|
|
base::Value* GetValueUnsafe() const;
|
|
|
|
|
2015-04-15 15:45:30 +02:00
|
|
|
// CefValue methods.
|
|
|
|
bool IsValid() override;
|
|
|
|
bool IsOwned() override;
|
|
|
|
bool IsReadOnly() override;
|
|
|
|
bool IsSame(CefRefPtr<CefValue> that) override;
|
|
|
|
bool IsEqual(CefRefPtr<CefValue> that) override;
|
|
|
|
CefRefPtr<CefValue> Copy() override;
|
|
|
|
CefValueType GetType() override;
|
|
|
|
bool GetBool() override;
|
|
|
|
int GetInt() override;
|
|
|
|
double GetDouble() override;
|
|
|
|
CefString GetString() override;
|
|
|
|
CefRefPtr<CefBinaryValue> GetBinary() override;
|
|
|
|
CefRefPtr<CefDictionaryValue> GetDictionary() override;
|
|
|
|
CefRefPtr<CefListValue> GetList() override;
|
|
|
|
bool SetNull() override;
|
|
|
|
bool SetBool(bool value) override;
|
|
|
|
bool SetInt(int value) override;
|
|
|
|
bool SetDouble(double value) override;
|
|
|
|
bool SetString(const CefString& value) override;
|
|
|
|
bool SetBinary(CefRefPtr<CefBinaryValue> value) override;
|
|
|
|
bool SetDictionary(CefRefPtr<CefDictionaryValue> value) override;
|
|
|
|
bool SetList(CefRefPtr<CefListValue> value) override;
|
|
|
|
|
2015-04-17 16:19:30 +02:00
|
|
|
// Ensures exclusive access to the underlying data for the life of this scoped
|
|
|
|
// object.
|
|
|
|
class ScopedLockedValue {
|
|
|
|
public:
|
2017-05-17 11:29:28 +02:00
|
|
|
explicit ScopedLockedValue(CefRefPtr<CefValueImpl> impl) : impl_(impl) {
|
2015-04-17 16:19:30 +02:00
|
|
|
impl_->AcquireLock();
|
|
|
|
}
|
2021-12-06 21:40:25 +01:00
|
|
|
|
|
|
|
ScopedLockedValue(const ScopedLockedValue&) = delete;
|
|
|
|
ScopedLockedValue& operator=(const ScopedLockedValue&) = delete;
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
~ScopedLockedValue() { impl_->ReleaseLock(); }
|
2015-04-17 16:19:30 +02:00
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
base::Value* value() const { return impl_->GetValueUnsafe(); }
|
2015-04-17 16:19:30 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
CefRefPtr<CefValueImpl> impl_;
|
|
|
|
};
|
|
|
|
|
2015-04-15 15:45:30 +02:00
|
|
|
private:
|
2024-03-19 22:11:42 +01:00
|
|
|
void SetValueInternal(std::optional<base::Value> value);
|
2015-04-15 15:45:30 +02:00
|
|
|
|
2015-04-17 16:19:30 +02:00
|
|
|
// Returns the controller for the current value, if any.
|
|
|
|
CefValueController* GetValueController() const;
|
|
|
|
|
|
|
|
// Explicitly lock/unlock this object and the underlying data.
|
|
|
|
void AcquireLock();
|
|
|
|
void ReleaseLock();
|
|
|
|
|
2015-04-15 15:45:30 +02:00
|
|
|
// Access to all members must be protected by |lock_|.
|
|
|
|
base::Lock lock_;
|
|
|
|
|
|
|
|
// Simple values only.
|
2016-04-27 22:38:52 +02:00
|
|
|
std::unique_ptr<base::Value> value_;
|
2015-04-15 15:45:30 +02:00
|
|
|
|
|
|
|
// Complex values.
|
|
|
|
CefRefPtr<CefBinaryValue> binary_value_;
|
|
|
|
CefRefPtr<CefDictionaryValue> dictionary_value_;
|
|
|
|
CefRefPtr<CefListValue> list_value_;
|
|
|
|
|
|
|
|
IMPLEMENT_REFCOUNTING(CefValueImpl);
|
|
|
|
};
|
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
// CefBinaryValue implementation
|
2017-05-17 11:29:28 +02:00
|
|
|
class CefBinaryValueImpl : public CefValueBase<CefBinaryValue, base::Value> {
|
2012-04-03 03:34:16 +02:00
|
|
|
public:
|
|
|
|
// Get or create a reference value.
|
|
|
|
static CefRefPtr<CefBinaryValue> GetOrCreateRef(
|
2017-04-20 21:28:17 +02:00
|
|
|
base::Value* value,
|
2012-04-03 03:34:16 +02:00
|
|
|
void* parent_value,
|
|
|
|
CefValueController* controller);
|
|
|
|
|
2023-01-30 22:42:40 +01:00
|
|
|
// Take ownership of |value|. Do not pass in a value owned by something else
|
|
|
|
// (use GetOrCreateRef or constructor variant with |will_delete| argument).
|
|
|
|
explicit CefBinaryValueImpl(base::Value value);
|
|
|
|
|
2015-04-15 15:45:30 +02:00
|
|
|
// Reference an existing value (set |will_delete| to false) or take ownership
|
|
|
|
// of an existing value (set |will_delete| to true). When referencing an
|
2020-01-15 14:36:24 +01:00
|
|
|
// existing value you must explicitly call Detach(nullptr) when |value| is no
|
2015-04-15 15:45:30 +02:00
|
|
|
// longer valid. Use GetOrCreateRef instead of this constructor if |value| is
|
|
|
|
// owned by some other object and you do not plan to explicitly call
|
2020-01-15 14:36:24 +01:00
|
|
|
// Detach(nullptr).
|
2017-05-17 11:29:28 +02:00
|
|
|
CefBinaryValueImpl(base::Value* value, bool will_delete);
|
2015-04-15 15:45:30 +02:00
|
|
|
|
2017-03-03 23:37:23 +01:00
|
|
|
// The data will always be copied.
|
2023-10-05 18:57:01 +02:00
|
|
|
explicit CefBinaryValueImpl(base::span<const uint8_t> value);
|
2012-11-20 21:08:36 +01:00
|
|
|
|
2021-12-06 21:40:25 +01:00
|
|
|
CefBinaryValueImpl(const CefBinaryValueImpl&) = delete;
|
|
|
|
CefBinaryValueImpl& operator=(const CefBinaryValueImpl&) = delete;
|
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
// Return a copy of the value.
|
2023-01-30 22:42:40 +01:00
|
|
|
[[nodiscard]] base::Value CopyValue();
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2015-04-15 15:45:30 +02:00
|
|
|
// If this value is a reference then return a copy. Otherwise, detach and
|
|
|
|
// transfer ownership of the value.
|
2023-01-30 22:42:40 +01:00
|
|
|
[[nodiscard]] std::unique_ptr<base::Value> CopyOrDetachValue(
|
2022-02-21 23:23:40 +01:00
|
|
|
CefValueController* new_controller);
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2017-04-20 21:28:17 +02:00
|
|
|
bool IsSameValue(const base::Value* that);
|
|
|
|
bool IsEqualValue(const base::Value* that);
|
2015-04-15 15:45:30 +02:00
|
|
|
|
2015-04-17 16:19:30 +02:00
|
|
|
// Returns the underlying value. Access must be protected by calling
|
|
|
|
// lock/unlock on the controller.
|
2023-01-30 22:42:40 +01:00
|
|
|
base::Value* GetValueUnsafe() const;
|
2015-04-17 16:19:30 +02:00
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
// CefBinaryValue methods.
|
2014-11-12 20:25:15 +01:00
|
|
|
bool IsValid() override;
|
|
|
|
bool IsOwned() override;
|
2015-04-15 15:45:30 +02:00
|
|
|
bool IsSame(CefRefPtr<CefBinaryValue> that) override;
|
|
|
|
bool IsEqual(CefRefPtr<CefBinaryValue> that) override;
|
2014-11-12 20:25:15 +01:00
|
|
|
CefRefPtr<CefBinaryValue> Copy() override;
|
2023-10-25 20:20:55 +02:00
|
|
|
const void* GetRawData() override;
|
2014-11-12 20:25:15 +01:00
|
|
|
size_t GetSize() override;
|
2017-05-17 11:29:28 +02:00
|
|
|
size_t GetData(void* buffer, size_t buffer_size, size_t data_offset) override;
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
// See the CefValueBase constructor for usage. Binary values are always
|
|
|
|
// read-only.
|
2017-04-20 21:28:17 +02:00
|
|
|
CefBinaryValueImpl(base::Value* value,
|
2012-04-03 03:34:16 +02:00
|
|
|
void* parent_value,
|
|
|
|
ValueMode value_mode,
|
|
|
|
CefValueController* controller);
|
|
|
|
};
|
|
|
|
|
|
|
|
// CefDictionaryValue implementation
|
|
|
|
class CefDictionaryValueImpl
|
2023-01-30 22:42:40 +01:00
|
|
|
: public CefValueBase<CefDictionaryValue, base::Value> {
|
2012-04-03 03:34:16 +02:00
|
|
|
public:
|
|
|
|
// Get or create a reference value.
|
|
|
|
static CefRefPtr<CefDictionaryValue> GetOrCreateRef(
|
2023-01-30 22:42:40 +01:00
|
|
|
base::Value* value,
|
2012-04-03 03:34:16 +02:00
|
|
|
void* parent_value,
|
|
|
|
bool read_only,
|
|
|
|
CefValueController* controller);
|
|
|
|
|
2023-01-30 22:42:40 +01:00
|
|
|
// Take ownership of |value|. Do not pass in a value owned by something else
|
|
|
|
// (use GetOrCreateRef or constructor variant with |will_delete| argument).
|
|
|
|
CefDictionaryValueImpl(base::Value value, bool read_only);
|
|
|
|
CefDictionaryValueImpl(base::Value::Dict value, bool read_only);
|
|
|
|
|
2015-04-15 15:45:30 +02:00
|
|
|
// Reference an existing value (set |will_delete| to false) or take ownership
|
|
|
|
// of an existing value (set |will_delete| to true). When referencing an
|
2020-01-15 14:36:24 +01:00
|
|
|
// existing value you must explicitly call Detach(nullptr) when |value| is no
|
2015-04-15 15:45:30 +02:00
|
|
|
// longer valid. Use GetOrCreateRef instead of this constructor if |value| is
|
|
|
|
// owned by some other object and you do not plan to explicitly call
|
2020-01-15 14:36:24 +01:00
|
|
|
// Detach(nullptr).
|
2023-01-30 22:42:40 +01:00
|
|
|
CefDictionaryValueImpl(base::Value* value, bool will_delete, bool read_only);
|
2012-11-20 21:08:36 +01:00
|
|
|
|
2021-12-06 21:40:25 +01:00
|
|
|
CefDictionaryValueImpl(const CefDictionaryValueImpl&) = delete;
|
|
|
|
CefDictionaryValueImpl& operator=(const CefDictionaryValueImpl&) = delete;
|
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
// Return a copy of the value.
|
2023-01-30 22:42:40 +01:00
|
|
|
[[nodiscard]] base::Value CopyValue();
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2015-04-15 15:45:30 +02:00
|
|
|
// If this value is a reference then return a copy. Otherwise, detach and
|
|
|
|
// transfer ownership of the value.
|
2023-01-30 22:42:40 +01:00
|
|
|
[[nodiscard]] std::unique_ptr<base::Value> CopyOrDetachValue(
|
2022-02-21 23:23:40 +01:00
|
|
|
CefValueController* new_controller);
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2023-01-30 22:42:40 +01:00
|
|
|
bool IsSameValue(const base::Value* that);
|
|
|
|
bool IsEqualValue(const base::Value* that);
|
2015-04-15 15:45:30 +02:00
|
|
|
|
2015-04-17 16:19:30 +02:00
|
|
|
// Returns the underlying value. Access must be protected by calling
|
|
|
|
// lock/unlock on the controller.
|
2023-01-30 22:42:40 +01:00
|
|
|
base::Value* GetValueUnsafe() const;
|
2015-04-17 16:19:30 +02:00
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
// CefDictionaryValue methods.
|
2014-11-12 20:25:15 +01:00
|
|
|
bool IsValid() override;
|
|
|
|
bool IsOwned() override;
|
|
|
|
bool IsReadOnly() override;
|
2015-04-15 15:45:30 +02:00
|
|
|
bool IsSame(CefRefPtr<CefDictionaryValue> that) override;
|
|
|
|
bool IsEqual(CefRefPtr<CefDictionaryValue> that) override;
|
2017-05-17 11:29:28 +02:00
|
|
|
CefRefPtr<CefDictionaryValue> Copy(bool exclude_empty_children) override;
|
2014-11-12 20:25:15 +01:00
|
|
|
size_t GetSize() override;
|
|
|
|
bool Clear() override;
|
|
|
|
bool HasKey(const CefString& key) override;
|
|
|
|
bool GetKeys(KeyList& keys) override;
|
|
|
|
bool Remove(const CefString& key) override;
|
|
|
|
CefValueType GetType(const CefString& key) override;
|
2015-04-15 15:45:30 +02:00
|
|
|
CefRefPtr<CefValue> GetValue(const CefString& key) override;
|
2014-11-12 20:25:15 +01:00
|
|
|
bool GetBool(const CefString& key) override;
|
|
|
|
int GetInt(const CefString& key) override;
|
|
|
|
double GetDouble(const CefString& key) override;
|
|
|
|
CefString GetString(const CefString& key) override;
|
|
|
|
CefRefPtr<CefBinaryValue> GetBinary(const CefString& key) override;
|
2017-05-17 11:29:28 +02:00
|
|
|
CefRefPtr<CefDictionaryValue> GetDictionary(const CefString& key) override;
|
2014-11-12 20:25:15 +01:00
|
|
|
CefRefPtr<CefListValue> GetList(const CefString& key) override;
|
2015-04-15 15:45:30 +02:00
|
|
|
bool SetValue(const CefString& key, CefRefPtr<CefValue> value) override;
|
2014-11-12 20:25:15 +01:00
|
|
|
bool SetNull(const CefString& key) override;
|
|
|
|
bool SetBool(const CefString& key, bool value) override;
|
|
|
|
bool SetInt(const CefString& key, int value) override;
|
|
|
|
bool SetDouble(const CefString& key, double value) override;
|
2017-05-17 11:29:28 +02:00
|
|
|
bool SetString(const CefString& key, const CefString& value) override;
|
2014-11-12 20:25:15 +01:00
|
|
|
bool SetBinary(const CefString& key,
|
2017-05-17 11:29:28 +02:00
|
|
|
CefRefPtr<CefBinaryValue> value) override;
|
2014-11-12 20:25:15 +01:00
|
|
|
bool SetDictionary(const CefString& key,
|
|
|
|
CefRefPtr<CefDictionaryValue> value) override;
|
2017-05-17 11:29:28 +02:00
|
|
|
bool SetList(const CefString& key, CefRefPtr<CefListValue> value) override;
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
// See the CefValueBase constructor for usage.
|
2023-01-30 22:42:40 +01:00
|
|
|
CefDictionaryValueImpl(base::Value* value,
|
2012-04-03 03:34:16 +02:00
|
|
|
void* parent_value,
|
|
|
|
ValueMode value_mode,
|
|
|
|
bool read_only,
|
|
|
|
CefValueController* controller);
|
|
|
|
|
|
|
|
bool RemoveInternal(const CefString& key);
|
2023-01-30 22:42:40 +01:00
|
|
|
base::Value* SetInternal(const CefString& key,
|
|
|
|
std::unique_ptr<base::Value> value);
|
2012-04-03 03:34:16 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
// CefListValue implementation
|
2023-01-30 22:42:40 +01:00
|
|
|
class CefListValueImpl : public CefValueBase<CefListValue, base::Value> {
|
2012-04-03 03:34:16 +02:00
|
|
|
public:
|
|
|
|
// Get or create a reference value.
|
2023-01-30 22:42:40 +01:00
|
|
|
static CefRefPtr<CefListValue> GetOrCreateRef(base::Value* value,
|
2017-05-17 11:29:28 +02:00
|
|
|
void* parent_value,
|
|
|
|
bool read_only,
|
|
|
|
CefValueController* controller);
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2023-01-30 22:42:40 +01:00
|
|
|
// Take ownership of |value|. Do not pass in a value owned by something else
|
|
|
|
// (use GetOrCreateRef or constructor variant with |will_delete| argument).
|
|
|
|
CefListValueImpl(base::Value value, bool read_only);
|
|
|
|
CefListValueImpl(base::Value::List value, bool read_only);
|
|
|
|
|
2015-04-15 15:45:30 +02:00
|
|
|
// Reference an existing value (set |will_delete| to false) or take ownership
|
|
|
|
// of an existing value (set |will_delete| to true). When referencing an
|
2020-01-15 14:36:24 +01:00
|
|
|
// existing value you must explicitly call Detach(nullptr) when |value| is no
|
2015-04-15 15:45:30 +02:00
|
|
|
// longer valid. Use GetOrCreateRef instead of this constructor if |value| is
|
|
|
|
// owned by some other object and you do not plan to explicitly call
|
2020-01-15 14:36:24 +01:00
|
|
|
// Detach(nullptr).
|
2023-01-30 22:42:40 +01:00
|
|
|
CefListValueImpl(base::Value* value, bool will_delete, bool read_only);
|
2012-11-20 21:08:36 +01:00
|
|
|
|
2021-12-06 21:40:25 +01:00
|
|
|
CefListValueImpl(const CefListValueImpl&) = delete;
|
|
|
|
CefListValueImpl& operator=(const CefListValueImpl&) = delete;
|
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
// Return a copy of the value.
|
2023-01-30 22:42:40 +01:00
|
|
|
[[nodiscard]] base::Value CopyValue();
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2015-04-15 15:45:30 +02:00
|
|
|
// If this value is a reference then return a copy. Otherwise, detach and
|
|
|
|
// transfer ownership of the value.
|
2023-01-30 22:42:40 +01:00
|
|
|
[[nodiscard]] std::unique_ptr<base::Value> CopyOrDetachValue(
|
2022-02-21 23:23:40 +01:00
|
|
|
CefValueController* new_controller);
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2023-01-30 22:42:40 +01:00
|
|
|
bool IsSameValue(const base::Value* that);
|
|
|
|
bool IsEqualValue(const base::Value* that);
|
2015-04-15 15:45:30 +02:00
|
|
|
|
2015-04-17 16:19:30 +02:00
|
|
|
// Returns the underlying value. Access must be protected by calling
|
|
|
|
// lock/unlock on the controller.
|
2023-01-30 22:42:40 +01:00
|
|
|
base::Value* GetValueUnsafe() const;
|
2015-04-17 16:19:30 +02:00
|
|
|
|
|
|
|
// CefListValue methods.
|
2014-11-12 20:25:15 +01:00
|
|
|
bool IsValid() override;
|
|
|
|
bool IsOwned() override;
|
|
|
|
bool IsReadOnly() override;
|
2015-04-15 15:45:30 +02:00
|
|
|
bool IsSame(CefRefPtr<CefListValue> that) override;
|
|
|
|
bool IsEqual(CefRefPtr<CefListValue> that) override;
|
2014-11-12 20:25:15 +01:00
|
|
|
CefRefPtr<CefListValue> Copy() override;
|
|
|
|
bool SetSize(size_t size) override;
|
|
|
|
size_t GetSize() override;
|
|
|
|
bool Clear() override;
|
2016-11-04 19:38:59 +01:00
|
|
|
bool Remove(size_t index) override;
|
|
|
|
CefValueType GetType(size_t index) override;
|
|
|
|
CefRefPtr<CefValue> GetValue(size_t index) override;
|
|
|
|
bool GetBool(size_t index) override;
|
|
|
|
int GetInt(size_t index) override;
|
|
|
|
double GetDouble(size_t index) override;
|
|
|
|
CefString GetString(size_t index) override;
|
|
|
|
CefRefPtr<CefBinaryValue> GetBinary(size_t index) override;
|
|
|
|
CefRefPtr<CefDictionaryValue> GetDictionary(size_t index) override;
|
|
|
|
CefRefPtr<CefListValue> GetList(size_t index) override;
|
|
|
|
bool SetValue(size_t index, CefRefPtr<CefValue> value) override;
|
|
|
|
bool SetNull(size_t index) override;
|
|
|
|
bool SetBool(size_t index, bool value) override;
|
|
|
|
bool SetInt(size_t index, int value) override;
|
|
|
|
bool SetDouble(size_t index, double value) override;
|
|
|
|
bool SetString(size_t index, const CefString& value) override;
|
|
|
|
bool SetBinary(size_t index, CefRefPtr<CefBinaryValue> value) override;
|
|
|
|
bool SetDictionary(size_t index,
|
2014-11-12 20:25:15 +01:00
|
|
|
CefRefPtr<CefDictionaryValue> value) override;
|
2016-11-04 19:38:59 +01:00
|
|
|
bool SetList(size_t index, CefRefPtr<CefListValue> value) override;
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
// See the CefValueBase constructor for usage.
|
2023-01-30 22:42:40 +01:00
|
|
|
CefListValueImpl(base::Value* value,
|
2012-04-03 03:34:16 +02:00
|
|
|
void* parent_value,
|
|
|
|
ValueMode value_mode,
|
|
|
|
bool read_only,
|
|
|
|
CefValueController* controller);
|
|
|
|
|
2016-11-04 19:38:59 +01:00
|
|
|
bool RemoveInternal(size_t index);
|
2023-01-30 22:42:40 +01:00
|
|
|
base::Value* SetInternal(size_t index, std::unique_ptr<base::Value> value);
|
2012-04-03 03:34:16 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CEF_LIBCEF_COMMON_VALUES_IMPL_H_
|