From 3dce9b5818576f04ce21cec4b3686eda012e5b65 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 27 Oct 2023 17:02:53 +0200 Subject: BASELINE: Update Chromium to 118.0.5993.24 Change-Id: I8373334b8ea8225ab4d934dc676aabc6a85a7efa --- chromium/base/values.cc | 114 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 86 insertions(+), 28 deletions(-) (limited to 'chromium/base/values.cc') diff --git a/chromium/base/values.cc b/chromium/base/values.cc index 5f68e4a9207..af08d13e841 100644 --- a/chromium/base/values.cc +++ b/chromium/base/values.cc @@ -695,7 +695,7 @@ Value::List* Value::Dict::FindListByDottedPath(StringPiece path) { return v ? v->GetIfList() : nullptr; } -Value* Value::Dict::SetByDottedPath(StringPiece path, Value&& value) { +Value* Value::Dict::SetByDottedPath(StringPiece path, Value&& value) & { DCHECK(!path.empty()); DCHECK(IsStringUTF8AllowingNoncharacters(path)); @@ -723,47 +723,47 @@ Value* Value::Dict::SetByDottedPath(StringPiece path, Value&& value) { } } -Value* Value::Dict::SetByDottedPath(StringPiece path, bool value) { +Value* Value::Dict::SetByDottedPath(StringPiece path, bool value) & { return SetByDottedPath(path, Value(value)); } -Value* Value::Dict::SetByDottedPath(StringPiece path, int value) { +Value* Value::Dict::SetByDottedPath(StringPiece path, int value) & { return SetByDottedPath(path, Value(value)); } -Value* Value::Dict::SetByDottedPath(StringPiece path, double value) { +Value* Value::Dict::SetByDottedPath(StringPiece path, double value) & { return SetByDottedPath(path, Value(value)); } -Value* Value::Dict::SetByDottedPath(StringPiece path, StringPiece value) { +Value* Value::Dict::SetByDottedPath(StringPiece path, StringPiece value) & { return SetByDottedPath(path, Value(value)); } -Value* Value::Dict::SetByDottedPath(StringPiece path, StringPiece16 value) { +Value* Value::Dict::SetByDottedPath(StringPiece path, StringPiece16 value) & { return SetByDottedPath(path, Value(value)); } -Value* Value::Dict::SetByDottedPath(StringPiece path, const char* value) { +Value* Value::Dict::SetByDottedPath(StringPiece path, const char* value) & { return SetByDottedPath(path, Value(value)); } -Value* Value::Dict::SetByDottedPath(StringPiece path, const char16_t* value) { +Value* Value::Dict::SetByDottedPath(StringPiece path, const char16_t* value) & { return SetByDottedPath(path, Value(value)); } -Value* Value::Dict::SetByDottedPath(StringPiece path, std::string&& value) { +Value* Value::Dict::SetByDottedPath(StringPiece path, std::string&& value) & { return SetByDottedPath(path, Value(std::move(value))); } -Value* Value::Dict::SetByDottedPath(StringPiece path, BlobStorage&& value) { +Value* Value::Dict::SetByDottedPath(StringPiece path, BlobStorage&& value) & { return SetByDottedPath(path, Value(std::move(value))); } -Value* Value::Dict::SetByDottedPath(StringPiece path, Dict&& value) { +Value* Value::Dict::SetByDottedPath(StringPiece path, Dict&& value) & { return SetByDottedPath(path, Value(std::move(value))); } -Value* Value::Dict::SetByDottedPath(StringPiece path, List&& value) { +Value* Value::Dict::SetByDottedPath(StringPiece path, List&& value) & { return SetByDottedPath(path, Value(std::move(value))); } @@ -771,6 +771,72 @@ bool Value::Dict::RemoveByDottedPath(StringPiece path) { return ExtractByDottedPath(path).has_value(); } +Value::Dict&& Value::Dict::SetByDottedPath(StringPiece path, Value&& value) && { + SetByDottedPath(path, std::move(value)); + return std::move(*this); +} + +Value::Dict&& Value::Dict::SetByDottedPath(StringPiece path, bool value) && { + SetByDottedPath(path, Value(value)); + return std::move(*this); +} + +Value::Dict&& Value::Dict::SetByDottedPath(StringPiece path, int value) && { + SetByDottedPath(path, Value(value)); + return std::move(*this); +} + +Value::Dict&& Value::Dict::SetByDottedPath(StringPiece path, double value) && { + SetByDottedPath(path, Value(value)); + return std::move(*this); +} + +Value::Dict&& Value::Dict::SetByDottedPath(StringPiece path, + StringPiece value) && { + SetByDottedPath(path, Value(value)); + return std::move(*this); +} + +Value::Dict&& Value::Dict::SetByDottedPath(StringPiece path, + StringPiece16 value) && { + SetByDottedPath(path, Value(value)); + return std::move(*this); +} + +Value::Dict&& Value::Dict::SetByDottedPath(StringPiece path, + const char* value) && { + SetByDottedPath(path, Value(value)); + return std::move(*this); +} + +Value::Dict&& Value::Dict::SetByDottedPath(StringPiece path, + const char16_t* value) && { + SetByDottedPath(path, Value(value)); + return std::move(*this); +} + +Value::Dict&& Value::Dict::SetByDottedPath(StringPiece path, + std::string&& value) && { + SetByDottedPath(path, Value(std::move(value))); + return std::move(*this); +} + +Value::Dict&& Value::Dict::SetByDottedPath(StringPiece path, + BlobStorage&& value) && { + SetByDottedPath(path, Value(std::move(value))); + return std::move(*this); +} + +Value::Dict&& Value::Dict::SetByDottedPath(StringPiece path, Dict&& value) && { + SetByDottedPath(path, Value(std::move(value))); + return std::move(*this); +} + +Value::Dict&& Value::Dict::SetByDottedPath(StringPiece path, List&& value) && { + SetByDottedPath(path, Value(std::move(value))); + return std::move(*this); +} + absl::optional Value::Dict::ExtractByDottedPath(StringPiece path) { DCHECK(!path.empty()); DCHECK(IsStringUTF8AllowingNoncharacters(path)); @@ -909,28 +975,20 @@ Value::List::const_iterator Value::List::cend() const { base::to_address(storage_.cend())); } -// TODO(crbug.com/1446739): Implement reverse iterators in -// CheckedContiguousIterator and use them here. -std::vector::reverse_iterator Value::List::rend() { - return storage_.rend(); +Value::List::reverse_iterator Value::List::rend() { + return reverse_iterator(begin()); } -// TODO(crbug.com/1446739): Implement reverse iterators in -// CheckedContiguousIterator and use them here. -std::vector::const_reverse_iterator Value::List::rend() const { - return storage_.rend(); +Value::List::const_reverse_iterator Value::List::rend() const { + return const_reverse_iterator(begin()); } -// TODO(crbug.com/1446739): Implement reverse iterators in -// CheckedContiguousIterator and use them here. -std::vector::reverse_iterator Value::List::rbegin() { - return storage_.rbegin(); +Value::List::reverse_iterator Value::List::rbegin() { + return reverse_iterator(end()); } -// TODO(crbug.com/1446739): Implement reverse iterators in -// CheckedContiguousIterator and use them here. -std::vector::const_reverse_iterator Value::List::rbegin() const { - return storage_.rbegin(); +Value::List::const_reverse_iterator Value::List::rbegin() const { + return const_reverse_iterator(end()); } const Value& Value::List::front() const { -- cgit v1.2.3