refactor: use gin_helper::Dictionary::CreateEmpty() helper (#40140)
This commit is contained in:
parent
47beca1d2a
commit
563c370d51
17 changed files with 30 additions and 42 deletions
|
@ -204,8 +204,7 @@ void Clipboard::WriteHTML(const std::u16string& html,
|
|||
v8::Local<v8::Value> Clipboard::ReadBookmark(gin_helper::Arguments* args) {
|
||||
std::u16string title;
|
||||
std::string url;
|
||||
gin_helper::Dictionary dict =
|
||||
gin_helper::Dictionary::CreateEmpty(args->isolate());
|
||||
auto dict = gin_helper::Dictionary::CreateEmpty(args->isolate());
|
||||
ui::Clipboard* clipboard = ui::Clipboard::GetForCurrentThread();
|
||||
clipboard->ReadBookmark(/* data_dst = */ nullptr, &title, &url);
|
||||
dict.Set("title", title);
|
||||
|
|
|
@ -111,7 +111,7 @@ bool WriteShortcutLink(const base::FilePath& shortcut_path,
|
|||
base::win::ShortcutOperation operation =
|
||||
base::win::ShortcutOperation::kCreateAlways;
|
||||
args->GetNext(&operation);
|
||||
gin::Dictionary options = gin::Dictionary::CreateEmpty(args->isolate());
|
||||
auto options = gin::Dictionary::CreateEmpty(args->isolate());
|
||||
if (!args->GetNext(&options)) {
|
||||
args->ThrowError();
|
||||
return false;
|
||||
|
@ -146,7 +146,7 @@ bool WriteShortcutLink(const base::FilePath& shortcut_path,
|
|||
v8::Local<v8::Value> ReadShortcutLink(gin_helper::ErrorThrower thrower,
|
||||
const base::FilePath& path) {
|
||||
using base::win::ShortcutProperties;
|
||||
gin::Dictionary options = gin::Dictionary::CreateEmpty(thrower.isolate());
|
||||
auto options = gin::Dictionary::CreateEmpty(thrower.isolate());
|
||||
electron::ScopedAllowBlockingForElectron allow_blocking;
|
||||
base::win::ScopedCOMInitializer com_initializer;
|
||||
base::win::ShortcutProperties properties;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue