Skip to content

Commit

Permalink
Move os_crypt into a sync/ subdirectory.
Browse files Browse the repository at this point in the history
This is a prerequisite for landing the new version of OSCrypt
that will support async.

All callers are updated to call into os_crypt/sync.

Future CLs will land new code into os_crypt/async and migrate
callers as necessary.

BUG=1373092

Change-Id: I8a653df11aa9ef9b92f44771adca2944f66fcc43
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4336304
Reviewed-by: Christos Froussios <cfroussios@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Owners-Override: Nasko Oskov <nasko@chromium.org>
Commit-Queue: Will Harris <wfh@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1117278}
  • Loading branch information
Will Harris authored and Chromium LUCI CQ committed Mar 14, 2023
1 parent 4acb564 commit 93d0dcd
Show file tree
Hide file tree
Showing 130 changed files with 208 additions and 203 deletions.
4 changes: 2 additions & 2 deletions chrome/browser/BUILD.gn
Expand Up @@ -22,7 +22,7 @@ import("//components/lens/features.gni")
import("//components/nacl/features.gni")
import("//components/offline_pages/buildflags/features.gni")
import("//components/optimization_guide/features.gni")
import("//components/os_crypt/features.gni")
import("//components/os_crypt/sync/features.gni")
import("//components/services/screen_ai/buildflags/features.gni")
import("//components/signin/features.gni")
import("//components/spellcheck/spellcheck_build_features.gni")
Expand Down Expand Up @@ -2210,7 +2210,7 @@ static_library("browser") {
"//components/optimization_guide/optimization_guide_internals/webui",
"//components/origin_trials:browser",
"//components/origin_trials:common",
"//components/os_crypt",
"//components/os_crypt/sync",
"//components/page_info/core:proto",
"//components/page_load_metrics/browser",
"//components/page_load_metrics/browser/observers/ad_metrics",
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/DEPS
Expand Up @@ -229,7 +229,7 @@ include_rules = [
"+components/optimization_guide",
"+components/optimization_guide/optimization_guide_internals",
"+components/origin_trials",
"+components/os_crypt",
"+components/os_crypt/sync",
"+components/ownership",
"+components/page_info",
"+components/page_load_metrics/browser",
Expand Down
Expand Up @@ -115,7 +115,7 @@
#include "components/omnibox/browser/omnibox_prefs.h"
#include "components/omnibox/browser/zero_suggest_cache_service.h"
#include "components/omnibox/common/omnibox_features.h"
#include "components/os_crypt/os_crypt_mocker.h"
#include "components/os_crypt/sync/os_crypt_mocker.h"
#include "components/password_manager/core/browser/mock_field_info_store.h"
#include "components/password_manager/core/browser/mock_password_store_interface.h"
#include "components/password_manager/core/browser/mock_smart_bubble_stats_store.h"
Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/chrome_browser_main_linux.cc
Expand Up @@ -40,8 +40,8 @@
#include "base/linux_util.h"
#include "chrome/common/chrome_paths_internal.h"
#include "chrome/common/chrome_switches.h"
#include "components/os_crypt/key_storage_config_linux.h"
#include "components/os_crypt/os_crypt.h"
#include "components/os_crypt/sync/key_storage_config_linux.h"
#include "components/os_crypt/sync/os_crypt.h"
#include "content/public/browser/browser_thread.h"
#endif

Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/chrome_browser_main_mac.mm
Expand Up @@ -38,7 +38,7 @@
#include "chrome/common/pref_names.h"
#include "chrome/grit/chromium_strings.h"
#include "components/metrics/metrics_service.h"
#include "components/os_crypt/os_crypt.h"
#include "components/os_crypt/sync/os_crypt.h"
#include "components/version_info/channel.h"
#include "content/public/common/main_function_params.h"
#include "content/public/common/result_codes.h"
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/chrome_browser_main_win.cc
Expand Up @@ -95,7 +95,7 @@
#include "components/crash/core/app/crash_export_thunks.h"
#include "components/crash/core/app/dump_hung_process_with_ptype.h"
#include "components/crash/core/common/crash_key.h"
#include "components/os_crypt/os_crypt.h"
#include "components/os_crypt/sync/os_crypt.h"
#include "components/policy/core/common/management/management_service.h"
#include "components/prefs/pref_service.h"
#include "components/version_info/channel.h"
Expand Down
Expand Up @@ -9,7 +9,7 @@
#include "base/base64.h"
#include "base/functional/bind.h"
#include "chrome/common/pref_names.h"
#include "components/os_crypt/os_crypt.h"
#include "components/os_crypt/sync/os_crypt.h"
#include "components/policy/core/common/policy_pref_names.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/pref_service.h"
Expand Down
Expand Up @@ -9,8 +9,8 @@
#include "chrome/common/pref_names.h"
#include "chrome/test/base/scoped_testing_local_state.h"
#include "chrome/test/base/testing_browser_process.h"
#include "components/os_crypt/os_crypt.h"
#include "components/os_crypt/os_crypt_mocker.h"
#include "components/os_crypt/sync/os_crypt.h"
#include "components/os_crypt/sync/os_crypt_mocker.h"
#include "components/policy/core/common/policy_pref_names.h"
#include "testing/gtest/include/gtest/gtest.h"

Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/net/system_network_context_manager.cc
Expand Up @@ -42,7 +42,7 @@
#include "components/net_log/net_export_file_writer.h"
#include "components/net_log/net_log_proxy_source.h"
#include "components/network_session_configurator/common/network_features.h"
#include "components/os_crypt/os_crypt.h"
#include "components/os_crypt/sync/os_crypt.h"
#include "components/policy/core/common/policy_namespace.h"
#include "components/policy/core/common/policy_service.h"
#include "components/policy/policy_constants.h"
Expand Down
Expand Up @@ -10,7 +10,7 @@
#include "chrome/browser/device_identity/device_oauth2_token_service.h"
#include "chrome/browser/device_identity/device_oauth2_token_service_factory.h"
#include "chrome/browser/device_identity/device_oauth2_token_store_desktop.h"
#include "components/os_crypt/os_crypt_mocker.h"
#include "components/os_crypt/sync/os_crypt_mocker.h"
#include "components/policy/core/common/cloud/mock_cloud_policy_client.h"
#include "components/prefs/testing_pref_service.h"
#include "content/public/test/browser_task_environment.h"
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/prefs/browser_prefs.cc
Expand Up @@ -457,7 +457,7 @@
#endif

#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
#include "components/os_crypt/os_crypt.h"
#include "components/os_crypt/sync/os_crypt.h"
#endif

#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/sync/test/integration/sync_test.cc
Expand Up @@ -68,7 +68,7 @@
#include "components/invalidation/public/invalidation_service.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
#include "components/keyed_service/core/keyed_service.h"
#include "components/os_crypt/os_crypt_mocker.h"
#include "components/os_crypt/sync/os_crypt_mocker.h"
#include "components/prefs/scoped_user_pref_update.h"
#include "components/signin/public/base/consent_level.h"
#include "components/sync/base/command_line_switches.h"
Expand Down
Expand Up @@ -15,7 +15,7 @@
#include "chrome/browser/enterprise/connectors/connectors_prefs.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/base/testing_profile.h"
#include "components/os_crypt/os_crypt_mocker.h"
#include "components/os_crypt/sync/os_crypt_mocker.h"
#include "components/prefs/pref_service.h"
#include "content/public/browser/web_ui.h"
#include "content/public/test/browser_task_environment.h"
Expand Down
10 changes: 5 additions & 5 deletions chrome/test/BUILD.gn
Expand Up @@ -30,7 +30,7 @@ import("//components/lens/features.gni")
import("//components/nacl/features.gni")
import("//components/offline_pages/buildflags/features.gni")
import("//components/optimization_guide/features.gni")
import("//components/os_crypt/features.gni")
import("//components/os_crypt/sync/features.gni")
import("//components/safe_browsing/buildflags.gni")
import("//components/services/screen_ai/buildflags/features.gni")
import("//components/signin/features.gni")
Expand Down Expand Up @@ -322,7 +322,7 @@ static_library("test_support") {
"//components/network_time:network_time_test_support",
"//components/omnibox/browser:test_support",
"//components/optimization_guide/content/browser:test_support",
"//components/os_crypt",
"//components/os_crypt/sync",
"//components/password_manager/core/browser:test_support",
"//components/payments/core:test_support",
"//components/performance_manager/test_support",
Expand Down Expand Up @@ -6095,7 +6095,7 @@ test("unit_tests") {
"//components/optimization_guide/core:bloomfilter",
"//components/optimization_guide/core:test_support",
"//components/origin_trials:browser",
"//components/os_crypt:test_support",
"//components/os_crypt/sync:test_support",
"//components/page_info",
"//components/page_load_metrics/browser",
"//components/page_load_metrics/browser:test_support",
Expand Down Expand Up @@ -9317,7 +9317,7 @@ if (!is_android) {
"//components/nacl/common:buildflags",
"//components/nacl/common:switches",
"//components/omnibox/browser",
"//components/os_crypt:test_support",
"//components/os_crypt/sync:test_support",
"//components/password_manager/core/browser",
"//components/password_manager/core/browser:password_form",
"//components/password_manager/core/browser:test_support",
Expand Down Expand Up @@ -10403,7 +10403,7 @@ source_set("sync_integration_test_support") {
"//components/favicon/core",
"//components/invalidation/impl",
"//components/invalidation/impl:test_support",
"//components/os_crypt:test_support",
"//components/os_crypt/sync:test_support",
"//components/signin/public/identity_manager:test_support",
"//components/sync",
"//components/sync:test_support",
Expand Down
2 changes: 1 addition & 1 deletion chrome/test/DEPS
Expand Up @@ -50,7 +50,7 @@ include_rules = [
"+components/omnibox/browser",
"+components/optimization_guide",
"+components/optimization_guide/content",
"+components/os_crypt",
"+components/os_crypt/sync",
"+components/permissions",
"+components/policy",
"+components/prefs",
Expand Down
2 changes: 1 addition & 1 deletion chrome/test/base/in_process_browser_test.cc
Expand Up @@ -75,7 +75,7 @@
#include "components/embedder_support/switches.h"
#include "components/feature_engagement/public/feature_list.h"
#include "components/google/core/common/google_util.h"
#include "components/os_crypt/os_crypt_mocker.h"
#include "components/os_crypt/sync/os_crypt_mocker.h"
#include "content/public/browser/browser_main_parts.h"
#include "content/public/browser/devtools_agent_host.h"
#include "content/public/common/content_paths.h"
Expand Down
2 changes: 1 addition & 1 deletion chrome/test/base/test_launcher_utils.cc
Expand Up @@ -18,7 +18,7 @@
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/url_constants.h"
#include "components/os_crypt/os_crypt_switches.h"
#include "components/os_crypt/sync/os_crypt_switches.h"
#include "content/public/common/content_switches.h"
#include "ui/display/display_switches.h"

Expand Down
2 changes: 1 addition & 1 deletion components/BUILD.gn
Expand Up @@ -175,7 +175,7 @@ test("components_unittests") {
"//components/open_from_clipboard:unit_tests",
"//components/openscreen_platform:unittests",
"//components/optimization_guide/core:unit_tests",
"//components/os_crypt:unit_tests",
"//components/os_crypt/sync:unit_tests",
"//components/password_manager/core/browser:unit_tests",
"//components/payments/core:unit_tests",
"//components/policy/core/browser:unit_tests",
Expand Down
2 changes: 1 addition & 1 deletion components/autofill/content/browser/BUILD.gn
Expand Up @@ -39,7 +39,7 @@ static_library("browser") {
deps = [
"//base",
"//base:i18n",
"//components/os_crypt",
"//components/os_crypt/sync",
"//components/prefs",
"//components/profile_metrics",
"//components/resources",
Expand Down
2 changes: 1 addition & 1 deletion components/autofill/core/DEPS
@@ -1,5 +1,5 @@
include_rules = [
"+components/os_crypt",
"+components/os_crypt/sync",
"+components/pref_registry",
"+components/unified_consent",
"+components/webauthn/core",
Expand Down
10 changes: 5 additions & 5 deletions components/autofill/core/browser/BUILD.gn
Expand Up @@ -586,7 +586,7 @@ static_library("browser") {
"//components/language/core/browser",
"//components/optimization_guide/core",
"//components/optimization_guide/proto:optimization_guide_proto",
"//components/os_crypt",
"//components/os_crypt/sync",
"//components/policy/core/browser",
"//components/policy/core/common",
"//components/pref_registry",
Expand Down Expand Up @@ -748,8 +748,8 @@ static_library("test_support") {
"//components/autofill/core/common",
"//components/feature_engagement",
"//components/leveldb_proto",
"//components/os_crypt",
"//components/os_crypt:test_support",
"//components/os_crypt/sync",
"//components/os_crypt/sync:test_support",
"//components/pref_registry",
"//components/prefs:test_support",
"//components/signin/public/identity_manager:test_support",
Expand Down Expand Up @@ -1039,8 +1039,8 @@ source_set("unit_tests") {
"//components/leveldb_proto",
"//components/optimization_guide/core",
"//components/optimization_guide/proto:optimization_guide_proto",
"//components/os_crypt",
"//components/os_crypt:test_support",
"//components/os_crypt/sync",
"//components/os_crypt/sync:test_support",
"//components/policy/core/common",
"//components/prefs:test_support",
"//components/resources",
Expand Down
2 changes: 1 addition & 1 deletion components/autofill/core/browser/autofill_test_utils.cc
Expand Up @@ -35,7 +35,7 @@
#include "components/autofill/core/common/form_field_data.h"
#include "components/autofill/core/common/form_field_data_predictions.h"
#include "components/autofill/core/common/unique_ids.h"
#include "components/os_crypt/os_crypt_mocker.h"
#include "components/os_crypt/sync/os_crypt_mocker.h"
#include "components/pref_registry/pref_registry_syncable.h"
#include "components/prefs/pref_service.h"
#include "components/prefs/pref_service_factory.h"
Expand Down
Expand Up @@ -12,7 +12,7 @@
#include "components/autofill/core/browser/webdata/autofill_table.h"
#include "components/autofill/core/browser/webdata/autofill_webdata_service.h"
#include "components/autofill/core/common/autofill_clock.h"
#include "components/os_crypt/os_crypt_mocker.h"
#include "components/os_crypt/sync/os_crypt_mocker.h"
#include "components/prefs/pref_service.h"
#include "components/signin/public/identity_manager/identity_test_environment.h"
#include "components/sync/test/test_sync_service.h"
Expand Down
Expand Up @@ -38,7 +38,7 @@
#include "components/autofill/core/common/autofill_switches.h"
#include "components/autofill/core/common/autofill_util.h"
#include "components/autofill/core/common/form_field_data.h"
#include "components/os_crypt/os_crypt_mocker.h"
#include "components/os_crypt/sync/os_crypt_mocker.h"
#include "components/sync/model/metadata_batch.h"
#include "components/sync/protocol/entity_metadata.pb.h"
#include "components/sync/protocol/model_type_state.pb.h"
Expand Down
Expand Up @@ -29,7 +29,7 @@
#include "components/autofill/core/browser/webdata/autofill_table.h"
#include "components/autofill/core/browser/webdata/mock_autofill_webdata_backend.h"
#include "components/autofill/core/common/autofill_constants.h"
#include "components/os_crypt/os_crypt_mocker.h"
#include "components/os_crypt/sync/os_crypt_mocker.h"
#include "components/sync/base/client_tag_hash.h"
#include "components/sync/engine/data_type_activation_response.h"
#include "components/sync/model/client_tag_based_model_type_processor.h"
Expand Down
Expand Up @@ -4,7 +4,7 @@

#include "components/autofill/core/browser/webdata/system_encryptor.h"

#include "components/os_crypt/os_crypt.h"
#include "components/os_crypt/sync/os_crypt.h"

namespace autofill {

Expand Down
Expand Up @@ -29,7 +29,7 @@
#include "components/autofill/core/browser/webdata/autofill_webdata_service_observer.h"
#include "components/autofill/core/common/autofill_clock.h"
#include "components/autofill/core/common/form_field_data.h"
#include "components/os_crypt/os_crypt_mocker.h"
#include "components/os_crypt/sync/os_crypt_mocker.h"
#include "components/webdata/common/web_data_results.h"
#include "components/webdata/common/web_data_service_base.h"
#include "components/webdata/common/web_data_service_consumer.h"
Expand Down
2 changes: 1 addition & 1 deletion components/cookie_config/BUILD.gn
Expand Up @@ -10,7 +10,7 @@ static_library("cookie_config") {

deps = [
"//base",
"//components/os_crypt",
"//components/os_crypt/sync",
"//net",
"//net:extras",
]
Expand Down
2 changes: 1 addition & 1 deletion components/cookie_config/DEPS
@@ -1,4 +1,4 @@
include_rules = [
"+components/os_crypt",
"+components/os_crypt/sync",
"+net/extras/sqlite",
]
2 changes: 1 addition & 1 deletion components/cookie_config/cookie_store_util.cc
Expand Up @@ -6,7 +6,7 @@

#include "base/lazy_instance.h"
#include "build/build_config.h"
#include "components/os_crypt/os_crypt.h"
#include "components/os_crypt/sync/os_crypt.h"
#include "net/extras/sqlite/cookie_crypto_delegate.h"

namespace cookie_config {
Expand Down
2 changes: 1 addition & 1 deletion components/gcm_driver/BUILD.gn
Expand Up @@ -56,7 +56,7 @@ static_library("gcm_driver") {
"//base:i18n",
"//components/crx_file",
"//components/keyed_service/core",
"//components/os_crypt",
"//components/os_crypt/sync",
"//components/pref_registry",
"//components/prefs",
"//components/signin/public/identity_manager",
Expand Down
2 changes: 1 addition & 1 deletion components/gcm_driver/DEPS
@@ -1,6 +1,6 @@
include_rules = [
"+components/crx_file/id_util.h",
"+components/os_crypt",
"+components/os_crypt/sync",
"+components/keyed_service",
"+components/pref_registry",
"+components/prefs",
Expand Down
2 changes: 1 addition & 1 deletion components/gcm_driver/system_encryptor.cc
Expand Up @@ -4,7 +4,7 @@

#include "components/gcm_driver/system_encryptor.h"

#include "components/os_crypt/os_crypt.h"
#include "components/os_crypt/sync/os_crypt.h"

namespace gcm {

Expand Down
Expand Up @@ -7,7 +7,7 @@ import("//build/config/chromeos/ui_mode.gni")
import("//build/config/features.gni")
import("//build/config/linux/pkg_config.gni")
import("//build/config/ui.gni")
import("//components/os_crypt/features.gni")
import("//components/os_crypt/sync/features.gni")

if (use_gnome_keyring) {
# Gnome-keyring is normally dynamically loaded. The gnome_keyring config
Expand All @@ -31,6 +31,11 @@ if (use_gnome_keyring) {
}
}

# Wrapper component to allow dependencies to depend on //components/os_crypt/sync directly.
group("sync") {
public_deps = [ ":os_crypt" ]
}

component("os_crypt") {
sources = [
"os_crypt.h",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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/os_crypt/key_storage_config_linux.h"
#include "components/os_crypt/sync/key_storage_config_linux.h"

namespace os_crypt {

Expand Down

0 comments on commit 93d0dcd

Please sign in to comment.