refactor: pass base::Value by value in JS API implementations (#20809)
* refactor: move the arg instead of const reference it * refactor: avoid unnecessary copies of base::Value in arg * refactor: pass-by-value in dict_util * refactor: avoid unnecessary reference
This commit is contained in:
parent
c03ed6d3a1
commit
0ab9cc30d2
26 changed files with 108 additions and 144 deletions
|
@ -1863,12 +1863,11 @@ std::vector<printing::PrinterBasicInfo> WebContents::GetPrinterList() {
|
|||
return printers;
|
||||
}
|
||||
|
||||
v8::Local<v8::Promise> WebContents::PrintToPDF(
|
||||
const base::DictionaryValue& settings) {
|
||||
v8::Local<v8::Promise> WebContents::PrintToPDF(base::DictionaryValue settings) {
|
||||
util::Promise<v8::Local<v8::Value>> promise(isolate());
|
||||
v8::Local<v8::Promise> handle = promise.GetHandle();
|
||||
PrintPreviewMessageHandler::FromWebContents(web_contents())
|
||||
->PrintToPDF(settings, std::move(promise));
|
||||
->PrintToPDF(std::move(settings), std::move(promise));
|
||||
return handle;
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue