mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Update source files for bracket style
This commit is contained in:
@ -13,19 +13,23 @@ namespace {
|
||||
|
||||
int GetJSONReaderOptions(cef_json_parser_options_t options) {
|
||||
int op = base::JSON_PARSE_RFC;
|
||||
if (options & JSON_PARSER_ALLOW_TRAILING_COMMAS)
|
||||
if (options & JSON_PARSER_ALLOW_TRAILING_COMMAS) {
|
||||
op |= base::JSON_ALLOW_TRAILING_COMMAS;
|
||||
}
|
||||
return op;
|
||||
}
|
||||
|
||||
int GetJSONWriterOptions(cef_json_writer_options_t options) {
|
||||
int op = 0;
|
||||
if (options & JSON_WRITER_OMIT_BINARY_VALUES)
|
||||
if (options & JSON_WRITER_OMIT_BINARY_VALUES) {
|
||||
op |= base::JSONWriter::OPTIONS_OMIT_BINARY_VALUES;
|
||||
if (options & JSON_WRITER_OMIT_DOUBLE_TYPE_PRESERVATION)
|
||||
}
|
||||
if (options & JSON_WRITER_OMIT_DOUBLE_TYPE_PRESERVATION) {
|
||||
op |= base::JSONWriter::OPTIONS_OMIT_DOUBLE_TYPE_PRESERVATION;
|
||||
if (options & JSON_WRITER_PRETTY_PRINT)
|
||||
}
|
||||
if (options & JSON_WRITER_PRETTY_PRINT) {
|
||||
op |= base::JSONWriter::OPTIONS_PRETTY_PRINT;
|
||||
}
|
||||
return op;
|
||||
}
|
||||
|
||||
@ -40,8 +44,9 @@ CefRefPtr<CefValue> CefParseJSON(const CefString& json_string,
|
||||
CefRefPtr<CefValue> CefParseJSON(const void* json,
|
||||
size_t json_size,
|
||||
cef_json_parser_options_t options) {
|
||||
if (!json || json_size == 0)
|
||||
if (!json || json_size == 0) {
|
||||
return nullptr;
|
||||
}
|
||||
absl::optional<base::Value> parse_result = base::JSONReader::Read(
|
||||
base::StringPiece(static_cast<const char*>(json), json_size),
|
||||
GetJSONReaderOptions(options));
|
||||
@ -73,8 +78,9 @@ CefRefPtr<CefValue> CefParseJSONAndReturnError(
|
||||
|
||||
CefString CefWriteJSON(CefRefPtr<CefValue> node,
|
||||
cef_json_writer_options_t options) {
|
||||
if (!node.get() || !node->IsValid())
|
||||
if (!node.get() || !node->IsValid()) {
|
||||
return CefString();
|
||||
}
|
||||
|
||||
CefValueImpl* impl = static_cast<CefValueImpl*>(node.get());
|
||||
CefValueImpl::ScopedLockedValue scoped_value(impl);
|
||||
|
Reference in New Issue
Block a user