From 8853a6040cebb6e58177691be59b01e416b678eb Mon Sep 17 00:00:00 2001 From: mrchaofan Date: Wed, 24 Apr 2024 10:51:22 +0800 Subject: [PATCH] fix: Adjust missplaced comments. --- shell/browser/net/electron_url_loader_factory.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/shell/browser/net/electron_url_loader_factory.cc b/shell/browser/net/electron_url_loader_factory.cc index 94ed878475bb0..3caf1692d849d 100644 --- a/shell/browser/net/electron_url_loader_factory.cc +++ b/shell/browser/net/electron_url_loader_factory.cc @@ -327,10 +327,6 @@ void ElectronURLLoaderFactory::StartLoading( mojo::PendingRemote target_factory, ProtocolType type, gin::Arguments* args) { - // Send network error when there is no argument passed. - // - // Note that we should not throw JS error in the callback no matter what is - // passed, to keep compatibility with old code. v8::Local response; if (!args->GetNext(&response) || response->IsNullOrUndefined() || (response->IsObject() && @@ -340,6 +336,7 @@ void ElectronURLLoaderFactory::StartLoading( ->Length() == 0)) { std::string scheme = request.url.scheme(); if (scheme == "https" || scheme == "http" || scheme == "file") { + // re-send request mojo::Remote target_factory_remote( std::move(target_factory)); // Pass-through to the original factory. @@ -348,6 +345,10 @@ void ElectronURLLoaderFactory::StartLoading( options | kBypassCustomProtocolHandlers, request, std::move(client), traffic_annotation); } else { + // Send network error when there is no argument passed. + // + // Note that we should not throw JS error in the callback no matter what + // is passed, to keep compatibility with old code. OnComplete(std::move(client), request_id, network::URLLoaderCompletionStatus(net::ERR_NOT_IMPLEMENTED)); }