0

Move chrome/browser/request_header_integrity to chrome/common/request_header_integrity

This allows the Request Header Integrity URL throttle to be used in
//chrome/renderer/url_loader_throttle_provider_impl.cc

Bug: 417984354
Change-Id: I9a5bb661894cc727e9a8672599ac7604e4f046b2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6576706
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Robert Liao <robliao@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1464240}
This commit is contained in:
Robert Liao
2025-05-22 11:07:17 -07:00
committed by Chromium LUCI CQ
parent ec6906a03a
commit 0972a4770f
14 changed files with 33 additions and 31 deletions

8
.gitmodules vendored

@ -714,10 +714,6 @@
path = chrome/browser/platform_experience/win
url = https://chrome-internal.googlesource.com/chrome/browser/platform_experience/win
gclient-condition = checkout_src_internal
[submodule "chrome/browser/request_header_integrity/internal"]
path = chrome/browser/request_header_integrity/internal
url = https://chrome-internal.googlesource.com/chrome/browser/request_header_integrity/internal
gclient-condition = checkout_src_internal
[submodule "chrome/browser/resources/downloads/internal"]
path = chrome/browser/resources/downloads/internal
url = https://chrome-internal.googlesource.com/chrome/browser/resources/downloads_internal
@ -730,6 +726,10 @@
path = chrome/browser/spellchecker/internal
url = https://chrome-internal.googlesource.com/chrome/spellchecker/internal
gclient-condition = checkout_src_internal
[submodule "chrome/common/request_header_integrity/internal"]
path = chrome/common/request_header_integrity/internal
url = https://chrome-internal.googlesource.com/chrome/browser/request_header_integrity/internal
gclient-condition = checkout_src_internal
[submodule "chrome/elevation_service/internal"]
path = chrome/elevation_service/internal
url = https://chrome-internal.googlesource.com/chrome/elevation_service/internal

12
DEPS

@ -4491,12 +4491,6 @@ deps = {
'condition': 'checkout_src_internal',
},
'src/chrome/browser/request_header_integrity/internal': {
'url': Var('chrome_git') + '/chrome/browser/request_header_integrity/internal.git' + '@' +
'1592aa7ba598a048f918f54735bcf056556532c3',
'condition': 'checkout_src_internal',
},
'src/chrome/browser/resources/downloads/internal': {
'url': Var('chrome_git') + '/chrome/browser/resources/downloads_internal.git' + '@' +
'4fefb8a24ae6c421f640b9ef028e4b4ca75df729',
@ -4537,6 +4531,12 @@ deps = {
'dep_type': 'cipd',
},
'src/chrome/common/request_header_integrity/internal': {
'url': Var('chrome_git') + '/chrome/browser/request_header_integrity/internal.git' + '@' +
'1592aa7ba598a048f918f54735bcf056556532c3',
'condition': 'checkout_src_internal',
},
'src/chrome/elevation_service/internal': {
'url': Var('chrome_git') + '/chrome/elevation_service/internal.git' + '@' +
'dbffd67b918c1d5b5657e8a4dfd10ee66b57bf48',

@ -13,8 +13,8 @@ import("//build/config/python.gni")
import("//build/config/ui.gni")
import("//chrome/browser/buildflags.gni")
import("//chrome/browser/downgrade/buildflags.gni")
import("//chrome/browser/request_header_integrity/buildflags.gni")
import("//chrome/common/features.gni")
import("//chrome/common/request_header_integrity/buildflags.gni")
import("//chrome/services/speech/buildflags/buildflags.gni")
import("//chromeos/ash/components/assistant/assistant.gni")
import("//components/captive_portal/core/features.gni")
@ -8052,7 +8052,7 @@ static_library("browser") {
}
if (enable_request_header_integrity) {
deps += [ "//chrome/browser/request_header_integrity" ]
deps += [ "//chrome/common/request_header_integrity" ]
}
if (enable_rlz) {
@ -8603,7 +8603,6 @@ static_library("browser_generated_files") {
"//chrome/browser/policy/messaging_layer/proto:log_upload_event_proto",
"//chrome/browser/push_messaging:budget_proto",
"//chrome/browser/regional_capabilities",
"//chrome/browser/request_header_integrity:buildflags",
"//chrome/browser/resource_coordinator:mojo_bindings",
"//chrome/browser/sharing:buildflags",
"//chrome/browser/ui/webui/app_service_internals:mojo_bindings",
@ -8617,6 +8616,7 @@ static_library("browser_generated_files") {
"//chrome/browser/ui/webui/user_education_internals:mojo_bindings",
"//chrome/browser/v8_compile_hints/proto",
"//chrome/browser/web_applications/mojom:mojom_web_apps_enum",
"//chrome/common/request_header_integrity:buildflags",
"//components/data_sharing/data_sharing_internals/webui:mojo_bindings",
"//components/webui/chrome_urls/mojom:mojo_bindings",
]

@ -142,7 +142,6 @@
#include "chrome/browser/profiling_host/chrome_browser_main_extra_parts_profiling.h"
#include "chrome/browser/renderer_host/chrome_navigation_ui_data.h"
#include "chrome/browser/renderer_preferences_util.h"
#include "chrome/browser/request_header_integrity/buildflags.h"
#include "chrome/browser/safe_browsing/url_checker_delegate_impl.h"
#include "chrome/browser/search/search.h"
#include "chrome/browser/search_engines/template_url_service_factory.h"
@ -204,6 +203,7 @@
#include "chrome/common/profiler/process_type.h"
#include "chrome/common/profiler/thread_profiler_configuration.h"
#include "chrome/common/renderer_configuration.mojom.h"
#include "chrome/common/request_header_integrity/buildflags.h"
#include "chrome/common/secure_origin_allowlist.h"
#include "chrome/common/url_constants.h"
#include "chrome/common/webui_url_constants.h"
@ -654,10 +654,6 @@
#include "services/video_effects/public/mojom/video_effects_processor.mojom-forward.h"
#endif // BUILDFLAG(ENABLE_VIDEO_EFFECTS)
#if BUILDFLAG(ENABLE_REQUEST_HEADER_INTEGRITY)
#include "chrome/browser/request_header_integrity/request_header_integrity_url_loader_throttle.h" // nogncheck crbug.com/1125897
#endif
#if BUILDFLAG(SAFE_BROWSING_AVAILABLE)
#include "chrome/browser/enterprise/connectors/connectors_service.h"
#include "chrome/browser/safe_browsing/chrome_enterprise_url_lookup_service_factory.h"
@ -731,6 +727,10 @@
#include "chrome/browser/on_device_translation/pref_names.h"
#endif // BUILDFLAG(ENABLE_ON_DEVICE_TRANSLATION)
#if BUILDFLAG(ENABLE_REQUEST_HEADER_INTEGRITY)
#include "chrome/common/request_header_integrity/request_header_integrity_url_loader_throttle.h" // nogncheck crbug.com/1125897
#endif
#include "base/win/windows_h_disallowed.h"
using blink::mojom::EffectiveConnectionType;

@ -20,6 +20,7 @@ include_rules = [
"+components/dom_distiller/core",
"+components/embedder_support/android/common",
"+components/embedder_support/origin_trials",
"+components/embedder_support/user_agent_utils.h",
"+components/favicon_base",
"+components/gcm_driver",
"+components/google/core/common",
@ -62,6 +63,7 @@ include_rules = [
"+extensions/common",
"+gin/public", # For profiling.cc
"+google_apis/gaia", # For gaia_switches.h
"+google_apis/google_api_keys.h",
"+media",
"+ppapi/c",
"+ppapi/shared_impl",

@ -5,7 +5,7 @@
import("//build/buildflag_header.gni")
import("//build/config/chrome_build.gni")
import("//build/util/process_version.gni")
import("//chrome/browser/request_header_integrity/buildflags.gni")
import("//chrome/common/request_header_integrity/buildflags.gni")
config("header_name_defines") {
defines = []

@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_REQUEST_HEADER_INTEGRITY_BUILD_DERIVIED_VALUES_H_
#define CHROME_BROWSER_REQUEST_HEADER_INTEGRITY_BUILD_DERIVIED_VALUES_H_
#ifndef CHROME_COMMON_REQUEST_HEADER_INTEGRITY_BUILD_DERIVIED_VALUES_H_
#define CHROME_COMMON_REQUEST_HEADER_INTEGRITY_BUILD_DERIVIED_VALUES_H_
#define CHROME_COPYRIGHT "@COPYRIGHT@"
#define LASTCHANGE_YEAR "@LASTCHANGE_YEAR@"
#endif // CHROME_BROWSER_REQUEST_HEADER_INTEGRITY_BUILD_DERIVIED_VALUES_H_
#endif // CHROME_COMMON_REQUEST_HEADER_INTEGRITY_BUILD_DERIVIED_VALUES_H_

@ -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 "chrome/browser/request_header_integrity/request_header_integrity_url_loader_throttle.h"
#include "chrome/common/request_header_integrity/request_header_integrity_url_loader_throttle.h"
#include <string>
@ -12,15 +12,15 @@
#include "base/hash/sha1.h"
#include "base/strings/string_util.h"
#include "build/branding_buildflags.h"
#include "chrome/browser/request_header_integrity/build_derived_values.h"
#include "chrome/common/channel_info.h"
#include "chrome/common/request_header_integrity/build_derived_values.h"
#include "components/embedder_support/user_agent_utils.h"
#include "components/google/core/common/google_util.h"
#include "google_apis/google_api_keys.h"
#include "services/network/public/cpp/resource_request.h"
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
#include "chrome/browser/request_header_integrity/internal/google_header_names.h"
#include "chrome/common/request_header_integrity/internal/google_header_names.h"
#endif
#if !defined(CHANNEL_NAME_HEADER_NAME)

@ -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 CHROME_BROWSER_REQUEST_HEADER_INTEGRITY_REQUEST_HEADER_INTEGRITY_URL_LOADER_THROTTLE_H_
#define CHROME_BROWSER_REQUEST_HEADER_INTEGRITY_REQUEST_HEADER_INTEGRITY_URL_LOADER_THROTTLE_H_
#ifndef CHROME_COMMON_REQUEST_HEADER_INTEGRITY_REQUEST_HEADER_INTEGRITY_URL_LOADER_THROTTLE_H_
#define CHROME_COMMON_REQUEST_HEADER_INTEGRITY_REQUEST_HEADER_INTEGRITY_URL_LOADER_THROTTLE_H_
#include "third_party/blink/public/common/loader/url_loader_throttle.h"
@ -29,4 +29,4 @@ class RequestHeaderIntegrityURLLoaderThrottle
} // namespace request_header_integrity
#endif // CHROME_BROWSER_REQUEST_HEADER_INTEGRITY_REQUEST_HEADER_INTEGRITY_URL_LOADER_THROTTLE_H_
#endif // CHROME_COMMON_REQUEST_HEADER_INTEGRITY_REQUEST_HEADER_INTEGRITY_URL_LOADER_THROTTLE_H_

@ -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 "chrome/browser/request_header_integrity/request_header_integrity_url_loader_throttle.h"
#include "chrome/common/request_header_integrity/request_header_integrity_url_loader_throttle.h"
#include <memory>
#include <optional>
@ -15,7 +15,7 @@
#include "url/gurl.h"
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
#include "chrome/browser/request_header_integrity/internal/google_header_names.h"
#include "chrome/common/request_header_integrity/internal/google_header_names.h"
#include "chrome/test/base/scoped_channel_override.h"
#endif

@ -6673,7 +6673,6 @@ test("unit_tests") {
"//chrome/browser/push_messaging:budget_proto",
"//chrome/browser/reading_list",
"//chrome/browser/regional_capabilities:unit_tests",
"//chrome/browser/request_header_integrity:unit_tests",
"//chrome/browser/safe_browsing:advanced_protection",
"//chrome/browser/safe_browsing:metrics_collector",
"//chrome/browser/safe_browsing:unit_tests",
@ -6723,6 +6722,7 @@ test("unit_tests") {
"//chrome/common/privacy_budget:test_support",
"//chrome/common/privacy_budget:unit_tests",
"//chrome/common/profiler:unit_tests",
"//chrome/common/request_header_integrity:unit_tests",
"//chrome/common/themes:autogenerated_theme_util",
"//chrome/common/themes:unit_tests",
"//chrome/services/file_util:unit_tests",