#include "components/safe_browsing/content/renderer/renderer_url_loader_throttle.h"
#include "base/check_op.h"
#include "base/functional/bind.h"
#include "base/metrics/histogram_functions.h"
#include "base/strings/strcat.h"
#include "base/trace_event/trace_event.h"
#include "components/safe_browsing/core/common/features.h"
#include "components/safe_browsing/core/common/safebrowsing_constants.h"
#include "components/safe_browsing/core/common/utils.h"
#include "content/public/common/url_constants.h"
#include "net/base/net_errors.h"
#include "net/url_request/redirect_info.h"
#include "services/network/public/cpp/resource_request.h"
#include "services/network/public/mojom/fetch_api.mojom.h"
#include "services/network/public/mojom/url_response_head.mojom.h"
#if BUILDFLAG(ENABLE_EXTENSIONS)
#include "extensions/common/constants.h"
#endif
namespace safe_browsing {
namespace {
bool KnownSafeUrl(const GURL& url) { … }
}
RendererURLLoaderThrottle::RendererURLLoaderThrottle(
mojom::SafeBrowsing* safe_browsing,
base::optional_ref<const blink::LocalFrameToken> local_frame_token)
: … { … }
#if BUILDFLAG(ENABLE_EXTENSIONS)
RendererURLLoaderThrottle::RendererURLLoaderThrottle(
mojom::SafeBrowsing* safe_browsing,
base::optional_ref<const blink::LocalFrameToken> local_frame_token,
mojom::ExtensionWebRequestReporter* extension_web_request_reporter)
: … { … }
#endif
RendererURLLoaderThrottle::~RendererURLLoaderThrottle() { … }
void RendererURLLoaderThrottle::DetachFromCurrentSequence() { … }
void RendererURLLoaderThrottle::WillStartRequest(
network::ResourceRequest* request,
bool* defer) { … }
void RendererURLLoaderThrottle::WillRedirectRequest(
net::RedirectInfo* redirect_info,
const network::mojom::URLResponseHead& ,
bool* ,
std::vector<std::string>* ,
net::HttpRequestHeaders* ,
net::HttpRequestHeaders* ) { … }
void RendererURLLoaderThrottle::WillProcessResponse(
const GURL& response_url,
network::mojom::URLResponseHead* response_head,
bool* defer) { … }
const char* RendererURLLoaderThrottle::NameForLoggingWillProcessResponse() { … }
void RendererURLLoaderThrottle::OnCheckUrlResult(
bool proceed,
bool showed_interstitial) { … }
void RendererURLLoaderThrottle::OnMojoDisconnect() { … }
#if BUILDFLAG(ENABLE_EXTENSIONS)
void RendererURLLoaderThrottle::
BindExtensionWebRequestReporterPipeIfDetached() { … }
void RendererURLLoaderThrottle::MaybeSendExtensionWebRequestData(
network::ResourceRequest* request) { … }
#endif
}