Skip to content

Commit

Permalink
[//components/safe_browsing] Move ping_manager* into core/browser
Browse files Browse the repository at this point in the history
This code is browser-side code, and so it belongs in
//components/safe_browsing/core/browser/.

Bug: 1216341
Change-Id: I75b83589b8423a8d17c08f53ef374ef394e927e3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2989009
Commit-Queue: Colin Blundell <blundell@chromium.org>
Reviewed-by: Bo <boliu@chromium.org>
Reviewed-by: Nicolas Ouellet-Payeur <nicolaso@chromium.org>
Reviewed-by: Xinghui Lu <xinghuilu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#897701}
  • Loading branch information
colinblundell authored and Chromium LUCI CQ committed Jul 1, 2021
1 parent 0c2a9e8 commit 1387ac5
Show file tree
Hide file tree
Showing 17 changed files with 35 additions and 48 deletions.
1 change: 0 additions & 1 deletion android_webview/browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@ source_set("browser") {
"//components/safe_browsing/content/browser/triggers",
"//components/safe_browsing/content/browser/web_ui",
"//components/safe_browsing/content/common:interfaces",
"//components/safe_browsing/core:ping_manager",
"//components/safe_browsing/core/browser",
"//components/safe_browsing/core/browser/db:database_manager",
"//components/safe_browsing/core/browser/db:safebrowsing_proto",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
#include "components/safe_browsing/content/browser/base_ui_manager.h"
#include "components/safe_browsing/content/browser/safe_browsing_network_context.h"
#include "components/safe_browsing/core/browser/db/v4_protocol_manager_util.h"
#include "components/safe_browsing/core/browser/ping_manager.h"
#include "components/safe_browsing/core/common/safebrowsing_constants.h"
#include "components/safe_browsing/core/ping_manager.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/navigation_controller.h"
Expand Down
1 change: 0 additions & 1 deletion chrome/browser/safe_browsing/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ static_library("safe_browsing") {
"//components/safe_browsing/content/browser:client_side_detection",
"//components/safe_browsing/content/browser/triggers:suspicious_site_trigger",
"//components/safe_browsing/content/browser/web_ui",
"//components/safe_browsing/core:ping_manager",
"//components/safe_browsing/core/browser",
"//components/safe_browsing/core/browser:referrer_chain_provider",
"//components/safe_browsing/core/browser/db:database_manager",
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/safe_browsing/safe_browsing_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@
#include "components/safe_browsing/content/browser/triggers/trigger_manager.h"
#include "components/safe_browsing/content/browser/web_ui/safe_browsing_ui.h"
#include "components/safe_browsing/core/browser/db/database_manager.h"
#include "components/safe_browsing/core/browser/ping_manager.h"
#include "components/safe_browsing/core/browser/realtime/policy_engine.h"
#include "components/safe_browsing/core/browser/referrer_chain_provider.h"
#include "components/safe_browsing/core/common/features.h"
#include "components/safe_browsing/core/common/safebrowsing_constants.h"
#include "components/safe_browsing/core/file_type_policies.h"
#include "components/safe_browsing/core/ping_manager.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
#include "components/prefs/pref_service.h"
#include "components/safe_browsing/content/browser/web_ui/safe_browsing_ui.h"
#include "components/safe_browsing/core/browser/db/database_manager.h"
#include "components/safe_browsing/core/browser/ping_manager.h"
#include "components/safe_browsing/core/common/features.h"
#include "components/safe_browsing/core/common/safe_browsing_prefs.h"
#include "components/safe_browsing/core/ping_manager.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/download_item_utils.h"
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/safe_browsing/ui_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
#include "components/no_state_prefetch/browser/no_state_prefetch_contents.h"
#include "components/prefs/pref_service.h"
#include "components/safe_browsing/content/browser/threat_details.h"
#include "components/safe_browsing/core/browser/ping_manager.h"
#include "components/safe_browsing/core/common/features.h"
#include "components/safe_browsing/core/common/safe_browsing_prefs.h"
#include "components/safe_browsing/core/ping_manager.h"
#include "components/security_interstitials/content/security_interstitial_tab_helper.h"
#include "components/security_interstitials/content/unsafe_resource_util.h"
#include "components/security_interstitials/core/unsafe_resource.h"
Expand Down
2 changes: 1 addition & 1 deletion components/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -502,8 +502,8 @@ test("components_unittests") {
if (safe_browsing_mode == 1) {
deps += [
"//components/safe_browsing/content/renderer:websocket_sb_handshake_throttle_unittest",
"//components/safe_browsing/core:ping_manager_unittest",
"//components/safe_browsing/core:verdict_cache_manager_unittest",
"//components/safe_browsing/core/browser:ping_manager_unittest",
"//components/safe_browsing/core/browser:safe_browsing_url_checker_unittest",
"//components/safe_browsing/core/browser/db:unit_tests_local_db",
"//components/safe_browsing/core/browser/db:v4_test_util",
Expand Down
1 change: 0 additions & 1 deletion components/safe_browsing/content/browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ source_set("browser") {
"//components/safe_browsing/content/browser/web_ui:web_ui",
"//components/safe_browsing/content/common",
"//components/safe_browsing/content/common:interfaces",
"//components/safe_browsing/core:ping_manager",
"//components/safe_browsing/core:verdict_cache_manager",
"//components/safe_browsing/core/browser",
"//components/safe_browsing/core/browser:referrer_chain_provider",
Expand Down
31 changes: 0 additions & 31 deletions components/safe_browsing/core/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,6 @@

import("//components/safe_browsing/buildflags.gni")

static_library("ping_manager") {
sources = [
"ping_manager.cc",
"ping_manager.h",
]

public_deps = [ "//google_apis:google_apis" ]

deps = [
"//base:base",
"//components/safe_browsing/core/browser/db:hit_report",
"//components/safe_browsing/core/browser/db:util",
"//net:net",
"//services/network/public/cpp",
]
}

source_set("ping_manager_unittest") {
testonly = true
sources = [ "ping_manager_unittest.cc" ]

deps = [
":ping_manager",
"//base:base",
"//components/safe_browsing/core/browser/db:v4_test_util",
"//net:net",
"//net:test_support",
"//testing/gtest",
]
}

source_set("verdict_cache_manager") {
sources = [
"verdict_cache_manager.cc",
Expand Down
22 changes: 22 additions & 0 deletions components/safe_browsing/core/browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,47 @@ import("//build/config/features.gni")

source_set("browser") {
sources = [
"ping_manager.cc",
"ping_manager.h",
"safe_browsing_url_checker_impl.cc",
"safe_browsing_url_checker_impl.h",
"url_checker_delegate.h",
]

public_deps = [ "//google_apis:google_apis" ]

deps = [
"//base",
"//components/safe_browsing/core/browser/db:database_manager",
"//components/safe_browsing/core/browser/db:hit_report",
"//components/safe_browsing/core/browser/db:util",
"//components/safe_browsing/core/browser/realtime:policy_engine",
"//components/safe_browsing/core/browser/realtime:url_lookup_service_base",
"//components/safe_browsing/core/common:common",
"//components/safe_browsing/core/common/proto:csd_proto",
"//components/safe_browsing/core/common/proto:realtimeapi_proto",
"//components/security_interstitials/core:unsafe_resource",
"//net",
"//net:extras",
"//services/network/public/cpp",
"//services/network/public/mojom",
]
}

source_set("ping_manager_unittest") {
testonly = true
sources = [ "ping_manager_unittest.cc" ]

deps = [
":browser",
"//base:base",
"//components/safe_browsing/core/browser/db:v4_test_util",
"//net:net",
"//net:test_support",
"//testing/gtest",
]
}

source_set("safe_browsing_url_checker_unittest") {
testonly = true
sources = [ "safe_browsing_url_checker_impl_unittest.cc" ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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/ping_manager.h"
#include "components/safe_browsing/core/browser/ping_manager.h"

#include <utility>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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_PING_MANAGER_H_
#define COMPONENTS_SAFE_BROWSING_CORE_PING_MANAGER_H_
#ifndef COMPONENTS_SAFE_BROWSING_CORE_BROWSER_PING_MANAGER_H_
#define COMPONENTS_SAFE_BROWSING_CORE_BROWSER_PING_MANAGER_H_

// A class that reports basic safebrowsing statistics to Google's SafeBrowsing
// servers.
Expand Down Expand Up @@ -82,4 +82,4 @@ class PingManager {

} // namespace safe_browsing

#endif // COMPONENTS_SAFE_BROWSING_CORE_PING_MANAGER_H_
#endif // COMPONENTS_SAFE_BROWSING_CORE_BROWSER_PING_MANAGER_H_
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// found in the LICENSE file.
//

#include "components/safe_browsing/core/ping_manager.h"
#include "components/safe_browsing/core/browser/ping_manager.h"
#include "base/base64.h"
#include "base/run_loop.h"
#include "base/strings/stringprintf.h"
Expand Down
2 changes: 1 addition & 1 deletion components/safe_browsing/ios/browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ source_set("allow_list") {
source_set("unit_tests") {
testonly = true
deps = [
"//components/safe_browsing/core:ping_manager_unittest",
"//components/safe_browsing/core:verdict_cache_manager_unittest",
"//components/safe_browsing/core/browser",
"//components/safe_browsing/core/browser:ping_manager_unittest",
"//components/safe_browsing/core/browser:safe_browsing_url_checker_unittest",
"//components/safe_browsing/core/browser/db:unit_tests_local_db",
"//components/safe_browsing/core/browser/realtime:unit_tests",
Expand Down
2 changes: 1 addition & 1 deletion tools/traffic_annotation/summary/annotations.xml
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ Refer to README.md for content description and update process.
<item id="safe_browsing_chunk_backup_request" added_in_milestone="62" hash_code="79957943" type="0" deprecated="2018-08-14" content_hash_code="133850277" file_path=""/>
<item id="safe_browsing_client_side_malware_detector" added_in_milestone="62" hash_code="102935425" type="0" deprecated="2019-12-07" content_hash_code="79591279" file_path=""/>
<item id="safe_browsing_client_side_phishing_detector" added_in_milestone="62" hash_code="1313982" type="0" content_hash_code="50199143" os_list="linux,windows" file_path="components/safe_browsing/content/browser/client_side_detection_service.cc"/>
<item id="safe_browsing_extended_reporting" added_in_milestone="62" hash_code="42848942" type="0" content_hash_code="81193513" os_list="linux,windows" file_path="components/safe_browsing/core/ping_manager.cc"/>
<item id="safe_browsing_extended_reporting" added_in_milestone="62" hash_code="42848942" type="0" content_hash_code="81193513" os_list="linux,windows" file_path="components/safe_browsing/core/browser/ping_manager.cc"/>
<item id="safe_browsing_feedback" added_in_milestone="62" hash_code="44583821" type="0" content_hash_code="27116846" os_list="linux,windows" file_path="chrome/browser/safe_browsing/download_protection/download_feedback.cc"/>
<item id="safe_browsing_get_full_hash" added_in_milestone="62" hash_code="68745894" type="0" deprecated="2018-08-14" content_hash_code="21739198" file_path=""/>
<item id="safe_browsing_incident" added_in_milestone="62" hash_code="124950347" type="0" content_hash_code="7306531" os_list="linux,windows" file_path="chrome/browser/safe_browsing/incident_reporting/incident_report_uploader_impl.cc"/>
Expand Down
1 change: 0 additions & 1 deletion weblayer/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,6 @@ source_set("weblayer_lib_base") {
"//components/safe_browsing/android:safe_browsing_api_handler",
"//components/safe_browsing/content/browser",
"//components/safe_browsing/content/browser:client_side_model_loader",
"//components/safe_browsing/core:ping_manager",
"//components/safe_browsing/core:verdict_cache_manager",
"//components/safe_browsing/core/browser",
"//components/safe_browsing/core/browser:token_fetcher",
Expand Down
2 changes: 1 addition & 1 deletion weblayer/browser/safe_browsing/safe_browsing_ui_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "weblayer/browser/safe_browsing/safe_browsing_ui_manager.h"

#include "components/safe_browsing/core/ping_manager.h"
#include "components/safe_browsing/core/browser/ping_manager.h"
#include "content/public/browser/browser_thread.h"
#include "weblayer/browser/safe_browsing/safe_browsing_blocking_page.h"
#include "weblayer/browser/safe_browsing/safe_browsing_service.h"
Expand Down

0 comments on commit 1387ac5

Please sign in to comment.