mirror of
https://github.com/electron/electron.git
synced 2026-05-02 03:00:22 -04:00
refactor: migrates util::Promise to gin (#20871)
* refactor: use gin in Promise * refactor: separate Promise impl that returns nothing * refactor: use Promise<void> for promise that returns nothing * fix: methods should be able to run on both browser and renderer process * fix: should not pass base::StringPiece across threads * refactor: no more need to use different ResolvePromise for empty Promise * refactor: move Promise to gin_helper
This commit is contained in:
@@ -9,9 +9,9 @@
|
||||
#include "shell/common/gin_converters/gurl_converter.h"
|
||||
#include "shell/common/gin_helper/dictionary.h"
|
||||
#include "shell/common/gin_helper/error_thrower.h"
|
||||
#include "shell/common/gin_helper/promise.h"
|
||||
#include "shell/common/node_includes.h"
|
||||
#include "shell/common/platform_util.h"
|
||||
#include "shell/common/promise_util.h"
|
||||
|
||||
#if defined(OS_WIN)
|
||||
#include "base/win/scoped_com_initializer.h"
|
||||
@@ -44,7 +44,7 @@ struct Converter<base::win::ShortcutOperation> {
|
||||
|
||||
namespace {
|
||||
|
||||
void OnOpenExternalFinished(electron::util::Promise<void*> promise,
|
||||
void OnOpenExternalFinished(gin_helper::Promise<void> promise,
|
||||
const std::string& error) {
|
||||
if (error.empty())
|
||||
promise.Resolve();
|
||||
@@ -53,7 +53,7 @@ void OnOpenExternalFinished(electron::util::Promise<void*> promise,
|
||||
}
|
||||
|
||||
v8::Local<v8::Promise> OpenExternal(const GURL& url, gin::Arguments* args) {
|
||||
electron::util::Promise<void*> promise(args->isolate());
|
||||
gin_helper::Promise<void> promise(args->isolate());
|
||||
v8::Local<v8::Promise> handle = promise.GetHandle();
|
||||
|
||||
platform_util::OpenExternalOptions options;
|
||||
|
||||
Reference in New Issue
Block a user