mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Update to Chromium version 100.0.4896.0 (#972766)
This commit is contained in:
@@ -7,7 +7,6 @@
|
||||
#define CEF_LIBCEF_COMMON_ALLOY_ALLOY_CONTENT_CLIENT_H_
|
||||
#pragma once
|
||||
|
||||
#include "base/compiler_specific.h"
|
||||
#include "content/public/common/content_client.h"
|
||||
#include "content/public/common/pepper_plugin_info.h"
|
||||
|
||||
|
@@ -15,7 +15,6 @@
|
||||
#include "libcef/common/resource_bundle_delegate.h"
|
||||
#include "libcef/common/task_runner_manager.h"
|
||||
|
||||
#include "base/compiler_specific.h"
|
||||
#include "content/public/app/content_main_delegate.h"
|
||||
|
||||
namespace base {
|
||||
|
@@ -124,10 +124,4 @@ const char kFrameworkDirPath[] = "framework-dir-path";
|
||||
const char kMainBundlePath[] = "main-bundle-path";
|
||||
#endif
|
||||
|
||||
#if !BUILDFLAG(IS_WIN)
|
||||
// Renderer process that runs the non-PPAPI PDF plugin.
|
||||
// This is defined in content/public/common/content_switches.h for Windows.
|
||||
const char kPdfRenderer[] = "pdf-renderer";
|
||||
#endif
|
||||
|
||||
} // namespace switches
|
||||
|
@@ -57,10 +57,6 @@ extern const char kFrameworkDirPath[];
|
||||
extern const char kMainBundlePath[];
|
||||
#endif
|
||||
|
||||
#if !BUILDFLAG(IS_WIN)
|
||||
extern const char kPdfRenderer[];
|
||||
#endif
|
||||
|
||||
} // namespace switches
|
||||
|
||||
#endif // CEF_LIBCEF_COMMON_CEF_SWITCHES_H_
|
||||
|
@@ -8,9 +8,6 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
// Include this first to avoid compiler errors.
|
||||
#include "base/compiler_specific.h"
|
||||
|
||||
#include "include/cef_version.h"
|
||||
|
||||
#include "base/strings/string_piece_forward.h"
|
||||
|
@@ -6,7 +6,6 @@
|
||||
#ifndef CEF_LIBCEF_COMMON_EXTENSIONS_EXTENSIONS_CLIENT_H_
|
||||
#define CEF_LIBCEF_COMMON_EXTENSIONS_EXTENSIONS_CLIENT_H_
|
||||
|
||||
#include "base/compiler_specific.h"
|
||||
#include "chrome/common/extensions/permissions/chrome_permission_message_provider.h"
|
||||
#include "extensions/common/extensions_client.h"
|
||||
#include "url/gurl.h"
|
||||
|
@@ -34,7 +34,7 @@ class CefProcessMessageImpl : public CefProcessMessage {
|
||||
// a copy if the argument list is already owned by something else.
|
||||
// TODO: Pass by reference instead of ownership if/when Mojo adds support
|
||||
// for that.
|
||||
base::ListValue TakeArgumentList() WARN_UNUSED_RESULT;
|
||||
[[nodiscard]] base::ListValue TakeArgumentList();
|
||||
|
||||
// CefProcessMessage methods.
|
||||
bool IsValid() override;
|
||||
|
@@ -8,6 +8,7 @@
|
||||
#include "base/bind.h"
|
||||
#include "base/location.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/time/time.h"
|
||||
|
||||
bool CefCurrentlyOn(CefThreadId threadId) {
|
||||
scoped_refptr<base::SequencedTaskRunner> task_runner =
|
||||
|
@@ -321,7 +321,7 @@ class CefValueBase : public CefType, public CefValueController::Object {
|
||||
// Detaches the underlying value and returns a pointer to it. If this is an
|
||||
// owner and a |new_controller| value is specified any existing references
|
||||
// will be passed to the new controller.
|
||||
ValueType* Detach(CefValueController* new_controller) WARN_UNUSED_RESULT {
|
||||
[[nodiscard]] ValueType* Detach(CefValueController* new_controller) {
|
||||
CEF_VALUE_VERIFY_RETURN(false, nullptr);
|
||||
|
||||
if (new_controller && !reference()) {
|
||||
|
@@ -1109,7 +1109,7 @@ CefRefPtr<CefListValue> CefListValueImpl::Copy() {
|
||||
bool CefListValueImpl::SetSize(size_t size) {
|
||||
CEF_VALUE_VERIFY_RETURN(true, false);
|
||||
|
||||
size_t current_size = const_value().GetList().size();
|
||||
size_t current_size = const_value().GetListDeprecated().size();
|
||||
if (size < current_size) {
|
||||
// Clean up any values above the requested size.
|
||||
for (size_t i = current_size - 1; i >= size; --i)
|
||||
@@ -1118,7 +1118,7 @@ bool CefListValueImpl::SetSize(size_t size) {
|
||||
// Expand the list size.
|
||||
// TODO: This approach seems inefficient. See https://crbug.com/1187066#c17
|
||||
// for background.
|
||||
auto list = mutable_value()->GetList();
|
||||
auto list = mutable_value()->GetListDeprecated();
|
||||
while (list.size() < size)
|
||||
mutable_value()->Append(base::Value());
|
||||
}
|
||||
@@ -1127,7 +1127,7 @@ bool CefListValueImpl::SetSize(size_t size) {
|
||||
|
||||
size_t CefListValueImpl::GetSize() {
|
||||
CEF_VALUE_VERIFY_RETURN(false, 0);
|
||||
return const_value().GetList().size();
|
||||
return const_value().GetListDeprecated().size();
|
||||
}
|
||||
|
||||
bool CefListValueImpl::Clear() {
|
||||
@@ -1148,9 +1148,10 @@ bool CefListValueImpl::Remove(size_t index) {
|
||||
CefValueType CefListValueImpl::GetType(size_t index) {
|
||||
CEF_VALUE_VERIFY_RETURN(false, VTYPE_INVALID);
|
||||
|
||||
const base::Value* out_value = nullptr;
|
||||
if (const_value().Get(index, &out_value)) {
|
||||
switch (out_value->type()) {
|
||||
const auto& list = const_value().GetListDeprecated();
|
||||
if (index < list.size()) {
|
||||
const base::Value& value = list[index];
|
||||
switch (value.type()) {
|
||||
case base::Value::Type::NONE:
|
||||
return VTYPE_NULL;
|
||||
case base::Value::Type::BOOLEAN:
|
||||
@@ -1176,10 +1177,11 @@ CefValueType CefListValueImpl::GetType(size_t index) {
|
||||
CefRefPtr<CefValue> CefListValueImpl::GetValue(size_t index) {
|
||||
CEF_VALUE_VERIFY_RETURN(false, nullptr);
|
||||
|
||||
const base::Value* out_value = nullptr;
|
||||
if (const_value().Get(index, &out_value)) {
|
||||
const auto& list = const_value().GetListDeprecated();
|
||||
if (index < list.size()) {
|
||||
const base::Value& value = list[index];
|
||||
return CefValueImpl::GetOrCreateRefOrCopy(
|
||||
const_cast<base::Value*>(out_value),
|
||||
const_cast<base::Value*>(&value),
|
||||
const_cast<base::ListValue*>(&const_value()), read_only(),
|
||||
controller());
|
||||
}
|
||||
@@ -1190,11 +1192,13 @@ CefRefPtr<CefValue> CefListValueImpl::GetValue(size_t index) {
|
||||
bool CefListValueImpl::GetBool(size_t index) {
|
||||
CEF_VALUE_VERIFY_RETURN(false, false);
|
||||
|
||||
const base::Value* out_value = nullptr;
|
||||
bool ret_value = false;
|
||||
|
||||
if (const_value().Get(index, &out_value) && out_value->is_bool()) {
|
||||
ret_value = out_value->GetBool();
|
||||
const auto& list = const_value().GetListDeprecated();
|
||||
if (index < list.size()) {
|
||||
const base::Value& value = list[index];
|
||||
if (value.is_bool()) {
|
||||
ret_value = value.GetBool();
|
||||
}
|
||||
}
|
||||
|
||||
return ret_value;
|
||||
@@ -1203,11 +1207,13 @@ bool CefListValueImpl::GetBool(size_t index) {
|
||||
int CefListValueImpl::GetInt(size_t index) {
|
||||
CEF_VALUE_VERIFY_RETURN(false, 0);
|
||||
|
||||
const base::Value* out_value = nullptr;
|
||||
int ret_value = 0;
|
||||
|
||||
if (const_value().Get(index, &out_value) && out_value->is_int()) {
|
||||
ret_value = out_value->GetInt();
|
||||
const auto& list = const_value().GetListDeprecated();
|
||||
if (index < list.size()) {
|
||||
const base::Value& value = list[index];
|
||||
if (value.is_int()) {
|
||||
ret_value = value.GetInt();
|
||||
}
|
||||
}
|
||||
|
||||
return ret_value;
|
||||
@@ -1216,11 +1222,13 @@ int CefListValueImpl::GetInt(size_t index) {
|
||||
double CefListValueImpl::GetDouble(size_t index) {
|
||||
CEF_VALUE_VERIFY_RETURN(false, 0);
|
||||
|
||||
const base::Value* out_value = nullptr;
|
||||
double ret_value = 0;
|
||||
|
||||
if (const_value().Get(index, &out_value) && out_value->is_double()) {
|
||||
ret_value = out_value->GetDouble();
|
||||
const auto& list = const_value().GetListDeprecated();
|
||||
if (index < list.size()) {
|
||||
const base::Value& value = list[index];
|
||||
if (value.is_double()) {
|
||||
ret_value = value.GetDouble();
|
||||
}
|
||||
}
|
||||
|
||||
return ret_value;
|
||||
@@ -1229,11 +1237,13 @@ double CefListValueImpl::GetDouble(size_t index) {
|
||||
CefString CefListValueImpl::GetString(size_t index) {
|
||||
CEF_VALUE_VERIFY_RETURN(false, CefString());
|
||||
|
||||
const base::Value* out_value = nullptr;
|
||||
std::string ret_value;
|
||||
|
||||
if (const_value().Get(index, &out_value) && out_value->is_string()) {
|
||||
ret_value = out_value->GetString();
|
||||
const auto& list = const_value().GetListDeprecated();
|
||||
if (index < list.size()) {
|
||||
const base::Value& value = list[index];
|
||||
if (value.is_string()) {
|
||||
ret_value = value.GetString();
|
||||
}
|
||||
}
|
||||
|
||||
return ret_value;
|
||||
@@ -1242,13 +1252,15 @@ CefString CefListValueImpl::GetString(size_t index) {
|
||||
CefRefPtr<CefBinaryValue> CefListValueImpl::GetBinary(size_t index) {
|
||||
CEF_VALUE_VERIFY_RETURN(false, nullptr);
|
||||
|
||||
const base::Value* out_value = nullptr;
|
||||
|
||||
if (const_value().Get(index, &out_value) && out_value->is_blob()) {
|
||||
base::Value* binary_value = const_cast<base::Value*>(out_value);
|
||||
return CefBinaryValueImpl::GetOrCreateRef(
|
||||
binary_value, const_cast<base::ListValue*>(&const_value()),
|
||||
controller());
|
||||
const auto& list = const_value().GetListDeprecated();
|
||||
if (index < list.size()) {
|
||||
const base::Value& value = list[index];
|
||||
if (value.is_blob()) {
|
||||
base::Value* binary_value = const_cast<base::Value*>(&value);
|
||||
return CefBinaryValueImpl::GetOrCreateRef(
|
||||
binary_value, const_cast<base::ListValue*>(&const_value()),
|
||||
controller());
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
@@ -1257,14 +1269,16 @@ CefRefPtr<CefBinaryValue> CefListValueImpl::GetBinary(size_t index) {
|
||||
CefRefPtr<CefDictionaryValue> CefListValueImpl::GetDictionary(size_t index) {
|
||||
CEF_VALUE_VERIFY_RETURN(false, nullptr);
|
||||
|
||||
const base::Value* out_value = nullptr;
|
||||
|
||||
if (const_value().Get(index, &out_value) && out_value->is_dict()) {
|
||||
base::DictionaryValue* dict_value = static_cast<base::DictionaryValue*>(
|
||||
const_cast<base::Value*>(out_value));
|
||||
return CefDictionaryValueImpl::GetOrCreateRef(
|
||||
dict_value, const_cast<base::ListValue*>(&const_value()), read_only(),
|
||||
controller());
|
||||
const auto& list = const_value().GetListDeprecated();
|
||||
if (index < list.size()) {
|
||||
const base::Value& value = list[index];
|
||||
if (value.is_dict()) {
|
||||
base::DictionaryValue* dict_value =
|
||||
static_cast<base::DictionaryValue*>(const_cast<base::Value*>(&value));
|
||||
return CefDictionaryValueImpl::GetOrCreateRef(
|
||||
dict_value, const_cast<base::ListValue*>(&const_value()), read_only(),
|
||||
controller());
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
@@ -1273,14 +1287,16 @@ CefRefPtr<CefDictionaryValue> CefListValueImpl::GetDictionary(size_t index) {
|
||||
CefRefPtr<CefListValue> CefListValueImpl::GetList(size_t index) {
|
||||
CEF_VALUE_VERIFY_RETURN(false, nullptr);
|
||||
|
||||
const base::Value* out_value = nullptr;
|
||||
|
||||
if (const_value().Get(index, &out_value) && out_value->is_list()) {
|
||||
base::ListValue* list_value =
|
||||
static_cast<base::ListValue*>(const_cast<base::Value*>(out_value));
|
||||
return CefListValueImpl::GetOrCreateRef(
|
||||
list_value, const_cast<base::ListValue*>(&const_value()), read_only(),
|
||||
controller());
|
||||
const auto& list = const_value().GetListDeprecated();
|
||||
if (index < list.size()) {
|
||||
const base::Value& value = list[index];
|
||||
if (value.is_list()) {
|
||||
base::ListValue* list_value =
|
||||
static_cast<base::ListValue*>(const_cast<base::Value*>(&value));
|
||||
return CefListValueImpl::GetOrCreateRef(
|
||||
list_value, const_cast<base::ListValue*>(&const_value()), read_only(),
|
||||
controller());
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
@@ -1362,29 +1378,27 @@ bool CefListValueImpl::SetList(size_t index, CefRefPtr<CefListValue> value) {
|
||||
}
|
||||
|
||||
bool CefListValueImpl::RemoveInternal(size_t index) {
|
||||
auto list = mutable_value()->GetList();
|
||||
auto list = mutable_value()->GetListDeprecated();
|
||||
if (index >= list.size())
|
||||
return false;
|
||||
|
||||
// The std::move() call below which removes the Value from the list will
|
||||
// return a new Value object with the moved contents of the Value that exists
|
||||
// in the implementation std::vector. Consequently we use Get() to retrieve
|
||||
// the actual Value pointer as it current exists first, for later comparison
|
||||
// purposes.
|
||||
const base::Value* actual_value = nullptr;
|
||||
if (!const_value().Get(index, &actual_value) || !actual_value)
|
||||
return false;
|
||||
// in the implementation std::vector. Consequently we use operator[] to
|
||||
// retrieve the actual Value pointer as it current exists first, for later
|
||||
// comparison purposes.
|
||||
const base::Value& actual_value = list[index];
|
||||
|
||||
// |actual_value| is no longer valid after this call.
|
||||
auto out_value = std::move(list[index]);
|
||||
mutable_value()->EraseListIter(list.begin() + index);
|
||||
|
||||
// Remove the value.
|
||||
controller()->Remove(const_cast<base::Value*>(actual_value), true);
|
||||
controller()->Remove(const_cast<base::Value*>(&actual_value), true);
|
||||
|
||||
// Only list and dictionary types may have dependencies.
|
||||
if (out_value.is_list() || out_value.is_dict()) {
|
||||
controller()->RemoveDependencies(const_cast<base::Value*>(actual_value));
|
||||
controller()->RemoveDependencies(const_cast<base::Value*>(&actual_value));
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -1393,7 +1407,7 @@ bool CefListValueImpl::RemoveInternal(size_t index) {
|
||||
base::Value* CefListValueImpl::SetInternal(size_t index, base::Value* value) {
|
||||
DCHECK(value);
|
||||
|
||||
auto list = mutable_value()->GetList();
|
||||
auto list = mutable_value()->GetListDeprecated();
|
||||
if (RemoveInternal(index)) {
|
||||
CHECK_LE(index, list.size());
|
||||
mutable_value()->Insert(list.begin() + index, std::move(*value));
|
||||
@@ -1410,17 +1424,15 @@ base::Value* CefListValueImpl::SetInternal(size_t index, base::Value* value) {
|
||||
|
||||
// base::Value now uses move semantics which means that Insert()/Set() will
|
||||
// move the contents of the passed-in base::Value instead of keeping the same
|
||||
// object. Consequently we use Get() to retrieve the actual base::Value
|
||||
// object. Consequently we use operator[] to retrieve the actual base::Value
|
||||
// pointer as it exists in the std::vector.
|
||||
const base::Value* actual_value = nullptr;
|
||||
const_value().Get(index, &actual_value);
|
||||
DCHECK(actual_value);
|
||||
const base::Value& actual_value = list[index];
|
||||
|
||||
// |value| will have been deleted at this point. Update the controller to
|
||||
// reference |actual_value| instead.
|
||||
controller()->Swap(value, const_cast<base::Value*>(actual_value));
|
||||
controller()->Swap(value, const_cast<base::Value*>(&actual_value));
|
||||
|
||||
return const_cast<base::Value*>(actual_value);
|
||||
return const_cast<base::Value*>(&actual_value);
|
||||
}
|
||||
|
||||
CefListValueImpl::CefListValueImpl(base::ListValue* value,
|
||||
|
@@ -148,12 +148,12 @@ class CefBinaryValueImpl : public CefValueBase<CefBinaryValue, base::Value> {
|
||||
CefBinaryValueImpl& operator=(const CefBinaryValueImpl&) = delete;
|
||||
|
||||
// Return a copy of the value.
|
||||
base::Value* CopyValue() WARN_UNUSED_RESULT;
|
||||
[[nodiscard]] base::Value* CopyValue();
|
||||
|
||||
// If this value is a reference then return a copy. Otherwise, detach and
|
||||
// transfer ownership of the value.
|
||||
base::Value* CopyOrDetachValue(CefValueController* new_controller)
|
||||
WARN_UNUSED_RESULT;
|
||||
[[nodiscard]] base::Value* CopyOrDetachValue(
|
||||
CefValueController* new_controller);
|
||||
|
||||
bool IsSameValue(const base::Value* that);
|
||||
bool IsEqualValue(const base::Value* that);
|
||||
@@ -205,12 +205,12 @@ class CefDictionaryValueImpl
|
||||
CefDictionaryValueImpl& operator=(const CefDictionaryValueImpl&) = delete;
|
||||
|
||||
// Return a copy of the value.
|
||||
base::DictionaryValue* CopyValue() WARN_UNUSED_RESULT;
|
||||
[[nodiscard]] base::DictionaryValue* CopyValue();
|
||||
|
||||
// If this value is a reference then return a copy. Otherwise, detach and
|
||||
// transfer ownership of the value.
|
||||
base::DictionaryValue* CopyOrDetachValue(CefValueController* new_controller)
|
||||
WARN_UNUSED_RESULT;
|
||||
[[nodiscard]] base::DictionaryValue* CopyOrDetachValue(
|
||||
CefValueController* new_controller);
|
||||
|
||||
bool IsSameValue(const base::DictionaryValue* that);
|
||||
bool IsEqualValue(const base::DictionaryValue* that);
|
||||
@@ -285,12 +285,12 @@ class CefListValueImpl : public CefValueBase<CefListValue, base::ListValue> {
|
||||
CefListValueImpl& operator=(const CefListValueImpl&) = delete;
|
||||
|
||||
// Return a copy of the value.
|
||||
base::ListValue* CopyValue() WARN_UNUSED_RESULT;
|
||||
[[nodiscard]] base::ListValue* CopyValue();
|
||||
|
||||
// If this value is a reference then return a copy. Otherwise, detach and
|
||||
// transfer ownership of the value.
|
||||
base::ListValue* CopyOrDetachValue(CefValueController* new_controller)
|
||||
WARN_UNUSED_RESULT;
|
||||
[[nodiscard]] base::ListValue* CopyOrDetachValue(
|
||||
CefValueController* new_controller);
|
||||
|
||||
bool IsSameValue(const base::ListValue* that);
|
||||
bool IsEqualValue(const base::ListValue* that);
|
||||
|
Reference in New Issue
Block a user