feat: session.resolveHost (#37690)
* feat: session.resolveHost Expose Chromium's host resolution API through the Session object. * Update shell/browser/api/electron_api_session.cc Co-authored-by: Jeremy Rose <nornagon@nornagon.net> * address feedback * fix tests * address feedback * Add options * Update shell/browser/api/electron_api_session.cc Co-authored-by: Cheng Zhao <github@zcbenz.com> * Update shell/browser/net/resolve_host_function.cc Co-authored-by: Cheng Zhao <github@zcbenz.com> * lint * return object * add missing file * fix crash * handle scope * links --------- Co-authored-by: Fedor Indutny <indutny@signal.org> Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com> Co-authored-by: Jeremy Rose <nornagon@nornagon.net> Co-authored-by: Cheng Zhao <github@zcbenz.com>
This commit is contained in:
parent
db27b9f433
commit
6bfef67aae
13 changed files with 477 additions and 0 deletions
|
@ -13,6 +13,7 @@
|
|||
#include "electron/buildflags/buildflags.h"
|
||||
#include "gin/handle.h"
|
||||
#include "gin/wrappable.h"
|
||||
#include "services/network/public/mojom/host_resolver.mojom.h"
|
||||
#include "services/network/public/mojom/ssl_config.mojom.h"
|
||||
#include "shell/browser/event_emitter_mixin.h"
|
||||
#include "shell/browser/net/resolve_proxy_helper.h"
|
||||
|
@ -96,6 +97,9 @@ class Session : public gin::Wrappable<Session>,
|
|||
const char* GetTypeName() override;
|
||||
|
||||
// Methods.
|
||||
v8::Local<v8::Promise> ResolveHost(
|
||||
std::string host,
|
||||
absl::optional<network::mojom::ResolveHostParametersPtr> params);
|
||||
v8::Local<v8::Promise> ResolveProxy(gin::Arguments* args);
|
||||
v8::Local<v8::Promise> GetCacheSize();
|
||||
v8::Local<v8::Promise> ClearCache();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue