0

[Safe Browsing] Move SafeBrowsingNetworkContext from core/ to content/

This CL moves safe_browsing_network_context.*, which depends on
//content/public, from its current architecturally-incorrect
//components/safe_browsing/core/browser location to
//components/safe_browsing/content/browser.

Bug: 1216341
Change-Id: Ife36d8be51d17d226dd90f8bf3a7f3984bffa75d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2944928
Auto-Submit: Colin Blundell <blundell@chromium.org>
Commit-Queue: Mugdha Lakhani <nator@chromium.org>
Reviewed-by: Mugdha Lakhani <nator@chromium.org>
Reviewed-by: Xinghui Lu <xinghuilu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#890685}
This commit is contained in:
Colin Blundell
2021-06-09 10:11:18 +00:00
committed by Chromium LUCI CQ
parent d0ba4e7fad
commit 3cacd06c63
14 changed files with 11 additions and 36 deletions

@ -242,7 +242,6 @@ source_set("browser") {
"//components/safe_browsing/core:features",
"//components/safe_browsing/core:ping_manager",
"//components/safe_browsing/core/browser",
"//components/safe_browsing/core/browser:network_context",
"//components/safe_browsing/core/common",
"//components/safe_browsing/core/db:database_manager",
"//components/safe_browsing/core/db:safebrowsing_proto",

@ -17,7 +17,7 @@
#include "base/command_line.h"
#include "base/path_service.h"
#include "components/safe_browsing/content/browser/base_ui_manager.h"
#include "components/safe_browsing/core/browser/safe_browsing_network_context.h"
#include "components/safe_browsing/content/browser/safe_browsing_network_context.h"
#include "components/safe_browsing/core/common/safebrowsing_constants.h"
#include "components/safe_browsing/core/db/v4_protocol_manager_util.h"
#include "components/safe_browsing/core/ping_manager.h"

@ -169,7 +169,6 @@ static_library("safe_browsing") {
"//components/safe_browsing/core:file_type_policies",
"//components/safe_browsing/core:verdict_cache_manager",
"//components/safe_browsing/core/browser",
"//components/safe_browsing/core/browser:network_context",
"//components/safe_browsing/core/browser/download:download_stats",
"//components/safe_browsing/core/browser/sync",
"//components/safe_browsing/core/common",
@ -434,7 +433,6 @@ source_set("test_support") {
"//components/enterprise/common/proto:connectors_proto",
"//components/safe_browsing:buildflags",
"//components/safe_browsing/content/browser:safe_browsing_service",
"//components/safe_browsing/core/browser:network_context",
"//components/safe_browsing/core/db:database_manager",
"//components/safe_browsing/core/db:test_database_manager",
"//components/safe_browsing/core/db:v4_protocol_manager_util",

@ -41,9 +41,9 @@
#include "components/prefs/pref_service.h"
#include "components/safe_browsing/buildflags.h"
#include "components/safe_browsing/content/browser/client_side_phishing_model.h"
#include "components/safe_browsing/content/browser/safe_browsing_network_context.h"
#include "components/safe_browsing/content/triggers/trigger_manager.h"
#include "components/safe_browsing/content/web_ui/safe_browsing_ui.h"
#include "components/safe_browsing/core/browser/safe_browsing_network_context.h"
#include "components/safe_browsing/core/common/safebrowsing_constants.h"
#include "components/safe_browsing/core/db/database_manager.h"
#include "components/safe_browsing/core/features.h"

@ -20,7 +20,7 @@
#include "chrome/common/chrome_switches.h"
#include "components/keyed_service/core/service_access_type.h"
#include "components/safe_browsing/buildflags.h"
#include "components/safe_browsing/core/browser/safe_browsing_network_context.h"
#include "components/safe_browsing/content/browser/safe_browsing_network_context.h"
#include "components/safe_browsing/core/db/v4_local_database_manager.h"
#include "components/safe_browsing/core/features.h"
#include "content/public/browser/browser_thread.h"

@ -34,6 +34,8 @@ source_set("browser") {
"mojo_safe_browsing_impl.h",
"safe_browsing_controller_client.cc",
"safe_browsing_controller_client.h",
"safe_browsing_network_context.cc",
"safe_browsing_network_context.h",
"threat_details.cc",
"threat_details.h",
"threat_details_cache.cc",
@ -56,10 +58,10 @@ source_set("browser") {
"//components/safe_browsing/core:realtimeapi_proto",
"//components/safe_browsing/core:verdict_cache_manager",
"//components/safe_browsing/core/browser",
"//components/safe_browsing/core/browser:network_context",
"//components/safe_browsing/core/browser:referrer_chain_provider",
"//components/safe_browsing/core/common:common",
"//components/safe_browsing/core/common:safe_browsing_prefs",
"//components/safe_browsing/core/common:thread_utils",
"//components/safe_browsing/core/db:database_manager",
"//components/safe_browsing/core/realtime:policy_engine",
"//components/safe_browsing/core/realtime:url_lookup_service_base",

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/safe_browsing/core/browser/safe_browsing_network_context.h"
#include "components/safe_browsing/content/browser/safe_browsing_network_context.h"
#include <memory>
#include <utility>

@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_SAFE_BROWSING_CORE_BROWSER_SAFE_BROWSING_NETWORK_CONTEXT_H_
#define COMPONENTS_SAFE_BROWSING_CORE_BROWSER_SAFE_BROWSING_NETWORK_CONTEXT_H_
#ifndef COMPONENTS_SAFE_BROWSING_CONTENT_BROWSER_SAFE_BROWSING_NETWORK_CONTEXT_H_
#define COMPONENTS_SAFE_BROWSING_CONTENT_BROWSER_SAFE_BROWSING_NETWORK_CONTEXT_H_
#include "base/callback.h"
#include "base/files/file_path.h"
@ -53,4 +53,4 @@ class SafeBrowsingNetworkContext {
} // namespace safe_browsing
#endif // COMPONENTS_SAFE_BROWSING_CORE_BROWSER_SAFE_BROWSING_NETWORK_CONTEXT_H_
#endif // COMPONENTS_SAFE_BROWSING_CONTENT_BROWSER_SAFE_BROWSING_NETWORK_CONTEXT_H_

@ -21,7 +21,6 @@ static_library("web_ui") {
"//components/safe_browsing/core:csd_proto",
"//components/safe_browsing/core:features",
"//components/safe_browsing/core:realtimeapi_proto",
"//components/safe_browsing/core/browser:network_context",
"//components/safe_browsing/core/browser:referrer_chain_provider",
"//components/safe_browsing/core/common:safe_browsing_prefs",
"//components/safe_browsing/core/db:v4_local_database_manager",

@ -9,7 +9,6 @@
#include "base/macros.h"
#include "components/safe_browsing/buildflags.h"
#include "components/safe_browsing/content/browser/safe_browsing_service_interface.h"
#include "components/safe_browsing/core/browser/safe_browsing_network_context.h"
#include "components/safe_browsing/core/proto/csd.pb.h"
#include "components/safe_browsing/core/proto/realtimeapi.pb.h"
#include "components/safe_browsing/core/proto/webui.pb.h"

@ -34,24 +34,6 @@ source_set("browser") {
}
}
# TODO(crbug.com/1028755): Remove this condition once there are no longer any
# dependencies on content/.
if (!is_ios) {
source_set("network_context") {
sources = [
"safe_browsing_network_context.cc",
"safe_browsing_network_context.h",
]
deps = [
"//components/safe_browsing/core/common:common",
"//components/safe_browsing/core/common:thread_utils",
"//content/public/browser:browser",
"//net:extras",
]
}
}
source_set("safe_browsing_url_checker_unittest") {
testonly = true
sources = [ "safe_browsing_url_checker_impl_unittest.cc" ]

@ -2,9 +2,6 @@ include_rules = [
"+components/history/core/browser",
"+components/safe_browsing/core/proto/csd.pb.h",
"+components/sessions/core/session_id.h",
# TODO(crbug.com/1216341): Eliminate the need for these.
"!content/public/browser/network_context_client_base.h",
"!content/public/browser/network_service_instance.h",
"+ipc/ipc_message.h",
"+net/cookies",
"+net/extras",

@ -706,7 +706,6 @@ source_set("weblayer_lib_base") {
"//components/safe_browsing/core:ping_manager",
"//components/safe_browsing/core:verdict_cache_manager",
"//components/safe_browsing/core/browser",
"//components/safe_browsing/core/browser:network_context",
"//components/safe_browsing/core/browser:token_fetcher",
"//components/safe_browsing/core/common",
"//components/safe_browsing/core/db:allowlist_checker_client",

@ -13,7 +13,7 @@
#include "components/safe_browsing/android/safe_browsing_api_handler_bridge.h"
#include "components/safe_browsing/content/browser/browser_url_loader_throttle.h"
#include "components/safe_browsing/content/browser/mojo_safe_browsing_impl.h"
#include "components/safe_browsing/core/browser/safe_browsing_network_context.h"
#include "components/safe_browsing/content/browser/safe_browsing_network_context.h"
#include "components/safe_browsing/core/common/safe_browsing_prefs.h"
#include "components/safe_browsing/core/realtime/url_lookup_service.h"
#include "content/public/browser/browser_context.h"