#include "components/safe_browsing/content/browser/mojo_safe_browsing_impl.h"
#include <memory>
#include "base/functional/bind.h"
#include "base/supports_user_data.h"
#include "components/safe_browsing/content/browser/web_ui/safe_browsing_ui.h"
#include "components/safe_browsing/core/browser/safe_browsing_url_checker_impl.h"
#include "components/safe_browsing/core/common/features.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/web_contents.h"
#include "mojo/public/cpp/bindings/callback_helpers.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/self_owned_receiver.h"
#include "net/base/load_flags.h"
#include "third_party/blink/public/mojom/loader/resource_load_info.mojom-shared.h"
namespace safe_browsing {
namespace {
content::WebContents* GetWebContentsFromToken(
int render_process_id,
const std::optional<blink::LocalFrameToken>& frame_token) { … }
}
MojoSafeBrowsingImpl::MojoSafeBrowsingImpl(
scoped_refptr<UrlCheckerDelegate> delegate,
int render_process_id,
base::SupportsUserData* user_data)
: … { … }
MojoSafeBrowsingImpl::~MojoSafeBrowsingImpl() { … }
void MojoSafeBrowsingImpl::MaybeCreate(
int render_process_id,
const base::RepeatingCallback<scoped_refptr<UrlCheckerDelegate>()>&
delegate_getter,
mojo::PendingReceiver<mojom::SafeBrowsing> receiver) { … }
void MojoSafeBrowsingImpl::CreateCheckerAndCheck(
const std::optional<blink::LocalFrameToken>& frame_token,
mojo::PendingReceiver<mojom::SafeBrowsingUrlChecker> receiver,
const GURL& url,
const std::string& method,
const net::HttpRequestHeaders& headers,
int32_t load_flags,
bool has_user_gesture,
bool originated_from_service_worker,
CreateCheckerAndCheckCallback callback) { … }
void MojoSafeBrowsingImpl::Clone(
mojo::PendingReceiver<mojom::SafeBrowsing> receiver) { … }
void MojoSafeBrowsingImpl::OnMojoDisconnect() { … }
}