refactor: use gin_helper::Dictionary::ValueOrDefault() (#46982)

* refactor: use ValueOrDefault() in electron_api_web_contents.cc

* refactor: use ValueOrDefault() in electron_api_url_loader.cc

* refactor: use ValueOrDefault() in electron_download_manager_delegate.cc

* refactor: use ValueOrDefault() in electron_touch_bar.mm

* refactor: use ValueOrDefault() in electron_url_loader_factory.cc

* refactor: use ValueOrDefault() in electron_browser_context.cc

* refactor: use ValueOrDefault() in electron_touch_bar.mm

* refactor: use ValueOrDefault() in blink_converter.cc

* feat: add ValueOrDefault() to PersistentDictionary

* empty commit

* refactor: use ValueOrDefault() in blink_converter.cc

* refactor: inline the rectangle base::Value::Dict

* refactor: remove has_scroll temporary

---------

Co-authored-by: Deepak Mohan <hop2deep@gmail.com>
This commit is contained in:
Charles Kerr
2025-05-08 14:17:22 -05:00
committed by GitHub
parent aea7b4ae8c
commit 2cbd968da5
8 changed files with 76 additions and 114 deletions

View File

@@ -124,8 +124,8 @@ network::mojom::URLResponseHeadPtr ToResponseHead(
return head;
}
int status_code = net::HTTP_OK;
dict.Get("statusCode", &status_code);
const int status_code =
dict.ValueOrDefault("statusCode", static_cast<int>(net::HTTP_OK));
head->headers = base::MakeRefCounted<net::HttpResponseHeaders>(
absl::StrFormat("HTTP/1.1 %d %s", status_code,
net::GetHttpReasonPhrase(