MCPcopy Create free account
hub / github.com/electron/electron / Run

Method Run

shell/browser/net/resolve_host_function.cc:46–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46void ResolveHostFunction::Run() {
47 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
48 DCHECK(!receiver_.is_bound());
49
50 // Start the request.
51 net::HostPortPair host_port_pair(host_, 0);
52 mojo::PendingRemote<network::mojom::ResolveHostClient> resolve_host_client =
53 receiver_.BindNewPipeAndPassRemote();
54 receiver_.set_disconnect_handler(base::BindOnce(
55 &ResolveHostFunction::OnComplete, this, net::ERR_NAME_NOT_RESOLVED,
56 net::ResolveErrorInfo(net::ERR_FAILED),
57 /*resolved_addresses=*/net::AddressList(),
58 /*endpoint_results_with_metadata=*/net::HostResolverEndpointResults()));
59 if (electron::IsUtilityProcess()) {
60 URLLoaderBundle::GetInstance()->GetHostResolver()->ResolveHost(
61 network::mojom::HostResolverHost::NewHostPortPair(
62 std::move(host_port_pair)),
63 net::NetworkAnonymizationKey(), std::move(params_),
64 std::move(resolve_host_client));
65 } else {
66 DCHECK_CURRENTLY_ON(BrowserThread::UI);
67 browser_context_->GetDefaultStoragePartition()
68 ->GetNetworkContext()
69 ->ResolveHost(network::mojom::HostResolverHost::NewHostPortPair(
70 std::move(host_port_pair)),
71 net::NetworkAnonymizationKey(), std::move(params_),
72 std::move(resolve_host_client));
73 }
74}
75
76void ResolveHostFunction::OnComplete(
77 int result,

Callers 15

AvailableMethod · 0.45
InstallMethod · 0.45
GetMediaDeviceIDSaltMethod · 0.45
HandleUserMediaRequestFunction · 0.45
MediaAccessAllowedFunction · 0.45
OnPermissionResponseFunction · 0.45
GetCertDBOnIOThreadMethod · 0.45

Calls 5

ResolveErrorInfoClass · 0.85
AddressListClass · 0.85
IsUtilityProcessFunction · 0.85
ResolveHostMethod · 0.80
GetHostResolverMethod · 0.80

Tested by 12

OnBoundsChangedMethod · 0.36
OnDataReceivedMethod · 0.36
OnCompleteMethod · 0.36
ReattachMethod · 0.36
LoadNetworkResourceMethod · 0.36
SetIsDockedMethod · 0.36
GetPreferencesMethod · 0.36
GetPreferenceMethod · 0.36
GetSyncInformationMethod · 0.36
GetHostConfigMethod · 0.36
RunJavaScriptDialogMethod · 0.36
RunBeforeUnloadDialogMethod · 0.36