Skip to content

Commit

Permalink
refactor: add gin_helper::Dictionary::CreateEmpty() helper (electron#…
Browse files Browse the repository at this point in the history
  • Loading branch information
miniak authored Aug 21, 2023
1 parent 9937a2b commit 0919008
Show file tree
Hide file tree
Showing 29 changed files with 66 additions and 64 deletions.
2 changes: 1 addition & 1 deletion shell/app/node_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ int NodeMain(int argc, char* argv[]) {
process.SetMethod("crash", &ElectronBindings::Crash);

// Setup process.crashReporter in child node processes
gin_helper::Dictionary reporter = gin::Dictionary::CreateEmpty(isolate);
auto reporter = gin_helper::Dictionary::CreateEmpty(isolate);
reporter.SetMethod("getParameters", &GetParameters);
#if IS_MAS_BUILD()
reporter.SetMethod("addExtraParameter", &SetCrashKeyStub);
Expand Down
16 changes: 8 additions & 8 deletions shell/browser/api/electron_api_app.cc
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ struct Converter<JumpListItem> {

static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
const JumpListItem& val) {
gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate);
auto dict = gin_helper::Dictionary::CreateEmpty(isolate);
dict.Set("type", val.type);

switch (val.type) {
Expand Down Expand Up @@ -338,7 +338,7 @@ struct Converter<Browser::LaunchItem> {

static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
Browser::LaunchItem val) {
gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate);
auto dict = gin_helper::Dictionary::CreateEmpty(isolate);
dict.Set("name", val.name);
dict.Set("path", val.path);
dict.Set("args", val.args);
Expand Down Expand Up @@ -371,7 +371,7 @@ struct Converter<Browser::LoginItemSettings> {

static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
Browser::LoginItemSettings val) {
gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate);
auto dict = gin_helper::Dictionary::CreateEmpty(isolate);
dict.Set("openAtLogin", val.open_at_login);
dict.Set("openAsHidden", val.open_as_hidden);
dict.Set("restoreState", val.restore_state);
Expand Down Expand Up @@ -1263,7 +1263,7 @@ v8::Local<v8::Value> App::GetJumpListSettings() {
}

v8::Isolate* isolate = JavascriptEnvironment::GetIsolate();
gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate);
auto dict = gin_helper::Dictionary::CreateEmpty(isolate);
dict.Set("minItems", min_items);
dict.Set("removedItems", gin::ConvertToV8(isolate, removed_items));
return dict.GetHandle();
Expand Down Expand Up @@ -1344,8 +1344,8 @@ std::vector<gin_helper::Dictionary> App::GetAppMetrics(v8::Isolate* isolate) {
int processor_count = base::SysInfo::NumberOfProcessors();

for (const auto& process_metric : app_metrics_) {
gin_helper::Dictionary pid_dict = gin::Dictionary::CreateEmpty(isolate);
gin_helper::Dictionary cpu_dict = gin::Dictionary::CreateEmpty(isolate);
auto pid_dict = gin_helper::Dictionary::CreateEmpty(isolate);
auto cpu_dict = gin_helper::Dictionary::CreateEmpty(isolate);

pid_dict.SetHidden("simple", true);
cpu_dict.SetHidden("simple", true);
Expand Down Expand Up @@ -1382,7 +1382,7 @@ std::vector<gin_helper::Dictionary> App::GetAppMetrics(v8::Isolate* isolate) {
#if !BUILDFLAG(IS_LINUX)
auto memory_info = process_metric.second->GetMemoryInfo();

gin_helper::Dictionary memory_dict = gin::Dictionary::CreateEmpty(isolate);
auto memory_dict = gin_helper::Dictionary::CreateEmpty(isolate);
memory_dict.SetHidden("simple", true);
memory_dict.Set("workingSetSize",
static_cast<double>(memory_info.working_set_size >> 10));
Expand Down Expand Up @@ -1534,7 +1534,7 @@ v8::Local<v8::Value> App::GetDockAPI(v8::Isolate* isolate) {
// Initialize the Dock API, the methods are bound to "dock" which exists
// for the lifetime of "app"
auto browser = base::Unretained(Browser::Get());
gin_helper::Dictionary dock_obj = gin::Dictionary::CreateEmpty(isolate);
auto dock_obj = gin_helper::Dictionary::CreateEmpty(isolate);
dock_obj.SetMethod("bounce", &DockBounce);
dock_obj.SetMethod(
"cancelBounce",
Expand Down
2 changes: 1 addition & 1 deletion shell/browser/api/electron_api_base_window.cc
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ void BaseWindow::OnWindowWillResize(const gfx::Rect& new_bounds,
bool* prevent_default) {
v8::Isolate* isolate = JavascriptEnvironment::GetIsolate();
v8::HandleScope handle_scope(isolate);
gin_helper::Dictionary info = gin::Dictionary::CreateEmpty(isolate);
auto info = gin::Dictionary::CreateEmpty(isolate);
info.Set("edge", edge);

if (Emit("will-resize", new_bounds, info)) {
Expand Down
3 changes: 1 addition & 2 deletions shell/browser/api/electron_api_browser_window.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ BrowserWindow::BrowserWindow(gin::Arguments* args,
: BaseWindow(args->isolate(), options) {
// Use options.webPreferences in WebContents.
v8::Isolate* isolate = args->isolate();
gin_helper::Dictionary web_preferences =
gin::Dictionary::CreateEmpty(isolate);
auto web_preferences = gin_helper::Dictionary::CreateEmpty(isolate);
options.Get(options::kWebPreferences, &web_preferences);

bool transparent = false;
Expand Down
2 changes: 1 addition & 1 deletion shell/browser/api/electron_api_desktop_capturer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ struct Converter<electron::api::DesktopCapturer::Source> {
static v8::Local<v8::Value> ToV8(
v8::Isolate* isolate,
const electron::api::DesktopCapturer::Source& source) {
gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate);
auto dict = gin_helper::Dictionary::CreateEmpty(isolate);
content::DesktopMediaID id = source.media_list_source.id;
dict.Set("name", base::UTF16ToUTF8(source.media_list_source.name));
dict.Set("id", id.ToString());
Expand Down
2 changes: 1 addition & 1 deletion shell/browser/api/electron_api_dialog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ void ResolvePromiseObject(gin_helper::Promise<gin_helper::Dictionary> promise,
bool checkbox_checked) {
v8::Isolate* isolate = promise.isolate();
v8::HandleScope handle_scope(isolate);
gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate);
auto dict = gin_helper::Dictionary::CreateEmpty(isolate);

dict.Set("response", result);
dict.Set("checkboxChecked", checkbox_checked);
Expand Down
12 changes: 6 additions & 6 deletions shell/browser/api/electron_api_in_app_purchase.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ struct Converter<in_app_purchase::PaymentDiscount> {
static v8::Local<v8::Value> ToV8(
v8::Isolate* isolate,
const in_app_purchase::PaymentDiscount& paymentDiscount) {
gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate);
auto dict = gin_helper::Dictionary::CreateEmpty(isolate);
dict.SetHidden("simple", true);
dict.Set("identifier", paymentDiscount.identifier);
dict.Set("keyIdentifier", paymentDiscount.keyIdentifier);
Expand All @@ -35,7 +35,7 @@ template <>
struct Converter<in_app_purchase::Payment> {
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
const in_app_purchase::Payment& payment) {
gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate);
auto dict = gin_helper::Dictionary::CreateEmpty(isolate);
dict.SetHidden("simple", true);
dict.Set("productIdentifier", payment.productIdentifier);
dict.Set("quantity", payment.quantity);
Expand All @@ -51,7 +51,7 @@ template <>
struct Converter<in_app_purchase::Transaction> {
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
const in_app_purchase::Transaction& val) {
gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate);
auto dict = gin_helper::Dictionary::CreateEmpty(isolate);
dict.SetHidden("simple", true);
dict.Set("transactionIdentifier", val.transactionIdentifier);
dict.Set("transactionDate", val.transactionDate);
Expand All @@ -71,7 +71,7 @@ struct Converter<in_app_purchase::ProductSubscriptionPeriod> {
v8::Isolate* isolate,
const in_app_purchase::ProductSubscriptionPeriod&
productSubscriptionPeriod) {
gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate);
auto dict = gin_helper::Dictionary::CreateEmpty(isolate);
dict.SetHidden("simple", true);
dict.Set("numberOfUnits", productSubscriptionPeriod.numberOfUnits);
dict.Set("unit", productSubscriptionPeriod.unit);
Expand All @@ -84,7 +84,7 @@ struct Converter<in_app_purchase::ProductDiscount> {
static v8::Local<v8::Value> ToV8(
v8::Isolate* isolate,
const in_app_purchase::ProductDiscount& productDiscount) {
gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate);
auto dict = gin_helper::Dictionary::CreateEmpty(isolate);
dict.SetHidden("simple", true);
dict.Set("identifier", productDiscount.identifier);
dict.Set("type", productDiscount.type);
Expand All @@ -104,7 +104,7 @@ template <>
struct Converter<in_app_purchase::Product> {
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
const in_app_purchase::Product& val) {
gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate);
auto dict = gin_helper::Dictionary::CreateEmpty(isolate);
dict.SetHidden("simple", true);
dict.Set("productIdentifier", val.productIdentifier);
dict.Set("localizedDescription", val.localizedDescription);
Expand Down
2 changes: 1 addition & 1 deletion shell/browser/api/electron_api_notification.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ struct Converter<electron::NotificationAction> {

static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
electron::NotificationAction val) {
gin::Dictionary dict = gin::Dictionary::CreateEmpty(isolate);
auto dict = gin::Dictionary::CreateEmpty(isolate);
dict.Set("text", val.text);
dict.Set("type", val.type);
return ConvertToV8(isolate, dict);
Expand Down
2 changes: 1 addition & 1 deletion shell/browser/api/electron_api_printing.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ template <>
struct Converter<printing::PrinterBasicInfo> {
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
const printing::PrinterBasicInfo& val) {
gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate);
auto dict = gin_helper::Dictionary::CreateEmpty(isolate);
dict.Set("name", val.printer_name);
dict.Set("displayName", val.display_name);
dict.Set("description", val.printer_description);
Expand Down
2 changes: 1 addition & 1 deletion shell/browser/api/electron_api_system_preferences.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ SystemPreferences::~SystemPreferences() = default;

v8::Local<v8::Value> SystemPreferences::GetAnimationSettings(
v8::Isolate* isolate) {
gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate);
auto dict = gin_helper::Dictionary::CreateEmpty(isolate);
dict.SetHidden("simple", true);
dict.Set("shouldRenderRichAnimation",
gfx::Animation::ShouldRenderRichAnimation());
Expand Down
4 changes: 2 additions & 2 deletions shell/browser/api/electron_api_url_loader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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());
Expand Down
2 changes: 1 addition & 1 deletion shell/browser/api/electron_api_web_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1504,7 +1504,7 @@ void WebContents::FindReply(content::WebContents* web_contents,

v8::Isolate* isolate = JavascriptEnvironment::GetIsolate();
v8::HandleScope handle_scope(isolate);
gin_helper::Dictionary result = gin::Dictionary::CreateEmpty(isolate);
auto result = gin_helper::Dictionary::CreateEmpty(isolate);
result.Set("requestId", request_id);
result.Set("matches", number_of_matches);
result.Set("selectionArea", selection_rect);
Expand Down
2 changes: 1 addition & 1 deletion shell/browser/browser_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ bool CheckLoginItemStatus(bool* is_hidden) {
const GURL& url) {
gin_helper::Promise<gin_helper::Dictionary> promise(isolate);
v8::Local<v8::Promise> handle = promise.GetHandle();
gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate);
auto dict = gin_helper::Dictionary::CreateEmpty(isolate);

NSString* ns_app_path = GetAppPathForProtocol(url);

Expand Down
5 changes: 2 additions & 3 deletions shell/browser/browser_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ void OnIconDataAvailable(const base::FilePath& app_path,
gfx::Image icon) {
if (!icon.IsEmpty()) {
v8::HandleScope scope(promise.isolate());
gin_helper::Dictionary dict =
gin::Dictionary::CreateEmpty(promise.isolate());
auto dict = gin_helper::Dictionary::CreateEmpty(promise.isolate());

dict.Set("path", app_path);
dict.Set("name", app_display_name);
Expand Down Expand Up @@ -270,7 +269,7 @@ void GetFileIcon(const base::FilePath& path,
gfx::Image* icon =
icon_manager->LookupIconFromFilepath(normalized_path, icon_size, 1.0f);
if (icon) {
gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate);
auto dict = gin_helper::Dictionary::CreateEmpty(isolate);
dict.Set("icon", *icon);
dict.Set("name", app_display_name);
dict.Set("path", normalized_path);
Expand Down
2 changes: 1 addition & 1 deletion shell/browser/lib/bluetooth_chooser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ struct Converter<electron::BluetoothChooser::DeviceInfo> {
static v8::Local<v8::Value> ToV8(
v8::Isolate* isolate,
const electron::BluetoothChooser::DeviceInfo& val) {
gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate);
auto dict = gin_helper::Dictionary::CreateEmpty(isolate);
dict.Set("deviceName", val.device_name);
dict.Set("deviceId", val.device_id);
return gin::ConvertToV8(isolate, dict);
Expand Down
2 changes: 1 addition & 1 deletion shell/browser/serial/serial_chooser_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ struct Converter<device::mojom::SerialPortInfoPtr> {
static v8::Local<v8::Value> ToV8(
v8::Isolate* isolate,
const device::mojom::SerialPortInfoPtr& port) {
gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate);
auto dict = gin_helper::Dictionary::CreateEmpty(isolate);
dict.Set("portId", port->token.ToString());
dict.Set("portName", port->path.BaseName().LossyDisplayName());
if (port->display_name && !port->display_name->empty()) {
Expand Down
2 changes: 1 addition & 1 deletion shell/common/api/electron_api_asar.cc
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ static void SplitPath(const v8::FunctionCallbackInfo<v8::Value>& args) {
return;
}

gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate);
auto dict = gin_helper::Dictionary::CreateEmpty(isolate);
base::FilePath asar_path, file_path;
if (asar::GetAsarArchivePath(path, &asar_path, &file_path, true)) {
dict.Set("isAsar", true);
Expand Down
2 changes: 1 addition & 1 deletion shell/common/api/electron_api_native_image.cc
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ void Initialize(v8::Local<v8::Object> exports,
void* priv) {
v8::Isolate* isolate = context->GetIsolate();
gin_helper::Dictionary dict(isolate, exports);
gin_helper::Dictionary native_image = gin::Dictionary::CreateEmpty(isolate);
auto native_image = gin_helper::Dictionary::CreateEmpty(isolate);
dict.Set("nativeImage", native_image);

native_image.SetMethod("createEmpty", &NativeImage::CreateEmpty);
Expand Down
12 changes: 6 additions & 6 deletions shell/common/api/electron_bindings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ v8::Local<v8::Value> ElectronBindings::GetHeapStatistics(v8::Isolate* isolate) {
v8::HeapStatistics v8_heap_stats;
isolate->GetHeapStatistics(&v8_heap_stats);

gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate);
auto dict = gin_helper::Dictionary::CreateEmpty(isolate);
dict.SetHidden("simple", true);
dict.Set("totalHeapSize",
static_cast<double>(v8_heap_stats.total_heap_size() >> 10));
Expand Down Expand Up @@ -184,7 +184,7 @@ v8::Local<v8::Value> ElectronBindings::GetSystemMemoryInfo(
return v8::Undefined(isolate);
}

gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate);
auto dict = gin_helper::Dictionary::CreateEmpty(isolate);
dict.SetHidden("simple", true);
dict.Set("total", mem_info.total);

Expand Down Expand Up @@ -235,7 +235,7 @@ v8::Local<v8::Value> ElectronBindings::GetBlinkMemoryInfo(
auto allocated = blink::ProcessHeap::TotalAllocatedObjectSize();
auto total = blink::ProcessHeap::TotalAllocatedSpace();

gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate);
auto dict = gin_helper::Dictionary::CreateEmpty(isolate);
dict.SetHidden("simple", true);
dict.Set("allocated", static_cast<double>(allocated >> 10));
dict.Set("total", static_cast<double>(total >> 10));
Expand Down Expand Up @@ -266,7 +266,7 @@ void ElectronBindings::DidReceiveMemoryDump(
for (const memory_instrumentation::GlobalMemoryDump::ProcessDump& dump :
global_dump->process_dumps()) {
if (target_pid == dump.pid()) {
gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate);
auto dict = gin_helper::Dictionary::CreateEmpty(isolate);
const auto& osdump = dump.os_dump();
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)
dict.Set("residentSet", osdump.resident_set_kb);
Expand All @@ -288,7 +288,7 @@ void ElectronBindings::DidReceiveMemoryDump(
v8::Local<v8::Value> ElectronBindings::GetCPUUsage(
base::ProcessMetrics* metrics,
v8::Isolate* isolate) {
gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate);
auto dict = gin_helper::Dictionary::CreateEmpty(isolate);
dict.SetHidden("simple", true);
int processor_count = base::SysInfo::NumberOfProcessors();
dict.Set("percentCPUUsage",
Expand All @@ -309,7 +309,7 @@ v8::Local<v8::Value> ElectronBindings::GetCPUUsage(
v8::Local<v8::Value> ElectronBindings::GetIOCounters(v8::Isolate* isolate) {
auto metrics = base::ProcessMetrics::CreateCurrentProcessMetrics();
base::IoCounters io_counters;
gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate);
auto dict = gin_helper::Dictionary::CreateEmpty(isolate);
dict.SetHidden("simple", true);

if (metrics->GetIOCounters(&io_counters)) {
Expand Down
12 changes: 6 additions & 6 deletions shell/common/gin_converters/blink_converter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ int GetKeyLocationCode(const blink::WebInputEvent& key) {
v8::Local<v8::Value> Converter<blink::WebKeyboardEvent>::ToV8(
v8::Isolate* isolate,
const blink::WebKeyboardEvent& in) {
gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate);
auto dict = gin_helper::Dictionary::CreateEmpty(isolate);

dict.Set("type", in.GetType());
dict.Set("key", ui::KeycodeConverter::DomKeyToKeyString(in.dom_key));
Expand Down Expand Up @@ -468,7 +468,7 @@ Converter<blink::mojom::ContextMenuDataInputFieldType>::ToV8(
}

v8::Local<v8::Value> EditFlagsToV8(v8::Isolate* isolate, int editFlags) {
gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate);
auto dict = gin_helper::Dictionary::CreateEmpty(isolate);
dict.Set("canUndo",
!!(editFlags & blink::ContextMenuDataEditFlags::kCanUndo));
dict.Set("canRedo",
Expand Down Expand Up @@ -497,7 +497,7 @@ v8::Local<v8::Value> EditFlagsToV8(v8::Isolate* isolate, int editFlags) {
}

v8::Local<v8::Value> MediaFlagsToV8(v8::Isolate* isolate, int mediaFlags) {
gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate);
auto dict = gin_helper::Dictionary::CreateEmpty(isolate);
dict.Set("inError", !!(mediaFlags & blink::ContextMenuData::kMediaInError));
dict.Set("isPaused", !!(mediaFlags & blink::ContextMenuData::kMediaPaused));
dict.Set("isMuted", !!(mediaFlags & blink::ContextMenuData::kMediaMuted));
Expand All @@ -522,7 +522,7 @@ v8::Local<v8::Value> MediaFlagsToV8(v8::Isolate* isolate, int mediaFlags) {
v8::Local<v8::Value> Converter<blink::WebCacheResourceTypeStat>::ToV8(
v8::Isolate* isolate,
const blink::WebCacheResourceTypeStat& stat) {
gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate);
auto dict = gin_helper::Dictionary::CreateEmpty(isolate);
dict.Set("count", static_cast<uint32_t>(stat.count));
dict.Set("size", static_cast<double>(stat.size));
dict.Set("liveSize", static_cast<double>(stat.decoded_size));
Expand All @@ -532,7 +532,7 @@ v8::Local<v8::Value> Converter<blink::WebCacheResourceTypeStat>::ToV8(
v8::Local<v8::Value> Converter<blink::WebCacheResourceTypeStats>::ToV8(
v8::Isolate* isolate,
const blink::WebCacheResourceTypeStats& stats) {
gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate);
auto dict = gin_helper::Dictionary::CreateEmpty(isolate);
dict.Set("images", stats.images);
dict.Set("scripts", stats.scripts);
dict.Set("cssStyleSheets", stats.css_style_sheets);
Expand Down Expand Up @@ -565,7 +565,7 @@ bool Converter<network::mojom::ReferrerPolicy>::FromV8(
v8::Local<v8::Value> Converter<blink::mojom::Referrer>::ToV8(
v8::Isolate* isolate,
const blink::mojom::Referrer& val) {
gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate);
auto dict = gin_helper::Dictionary::CreateEmpty(isolate);
dict.Set("url", ConvertToV8(isolate, val.url));
dict.Set("policy", ConvertToV8(isolate, val.policy));
return gin::ConvertToV8(isolate, dict);
Expand Down
Loading

0 comments on commit 0919008

Please sign in to comment.