refactor: add gin_helper::Dictionary::CreateEmpty() helper (#39547)

This commit is contained in:
Milan Burda 2023-08-21 03:43:41 +02:00 committed by GitHub
parent 9937a2bbe8
commit 09190085c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 66 additions and 64 deletions

View file

@ -50,7 +50,7 @@ struct Converter<network::mojom::HttpRawHeaderPairPtr> {
static v8::Local<v8::Value> ToV8(
v8::Isolate* isolate,
const network::mojom::HttpRawHeaderPairPtr& pair) {
gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate);
auto dict = gin_helper::Dictionary::CreateEmpty(isolate);
dict.Set("key", pair->key);
dict.Set("value", pair->value);
return dict.GetHandle();
@ -709,7 +709,7 @@ void SimpleURLLoaderWrapper::OnResponseStarted(
const network::mojom::URLResponseHead& response_head) {
v8::Isolate* isolate = JavascriptEnvironment::GetIsolate();
v8::HandleScope scope(isolate);
gin::Dictionary dict = gin::Dictionary::CreateEmpty(isolate);
auto dict = gin::Dictionary::CreateEmpty(isolate);
dict.Set("statusCode", response_head.headers->response_code());
dict.Set("statusMessage", response_head.headers->GetStatusText());
dict.Set("httpVersion", response_head.headers->GetHttpVersion());