0

Move backup_util and bundle_locations to base/apple

Bug: 1444927
Change-Id: I1249c06632a27e7c2f403d543f04a815f08bdb00
Include-Ci-Only-Tests: true
Validate-Test-Flakiness: skip
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4525355
Commit-Queue: Avi Drissman <avi@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Owners-Override: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1143395}
This commit is contained in:
Avi Drissman
2023-05-12 18:05:44 +00:00
committed by Chromium LUCI CQ
parent c306ea8ec8
commit d4f0708352
107 changed files with 319 additions and 316 deletions
base
chrome
components
autofill
component_updater
crash
cronet
favicon
history
optimization_guide
password_manager
safe_browsing
core
translate
content
google_apis
gpu
command_buffer
config
ios
remoting/host
services/service_manager/public/cpp/service_executable
sql
ui

@@ -2075,14 +2075,14 @@ component("base") {
if (is_apple) { if (is_apple) {
allow_circular_includes_from = [ ":base_arc" ] allow_circular_includes_from = [ ":base_arc" ]
sources += [ sources += [
"apple/backup_util.h",
"apple/backup_util.mm",
"apple/bridging.h", "apple/bridging.h",
"apple/bundle_locations.h",
"apple/bundle_locations.mm",
"file_version_info_mac.h", "file_version_info_mac.h",
"file_version_info_mac.mm", "file_version_info_mac.mm",
"files/file_util_mac.mm", "files/file_util_mac.mm",
"mac/backup_util.h",
"mac/backup_util.mm",
"mac/bundle_locations.h",
"mac/bundle_locations.mm",
"mac/call_with_eh_frame.cc", "mac/call_with_eh_frame.cc",
"mac/call_with_eh_frame.h", "mac/call_with_eh_frame.h",
"mac/call_with_eh_frame_asm.S", "mac/call_with_eh_frame_asm.S",
@@ -3593,8 +3593,8 @@ test("base_unittests") {
sources += [ sources += [
"allocator/partition_allocator/shim/allocator_interception_mac_unittest.mm", "allocator/partition_allocator/shim/allocator_interception_mac_unittest.mm",
"allocator/partition_allocator/shim/malloc_zone_functions_mac_unittest.cc", "allocator/partition_allocator/shim/malloc_zone_functions_mac_unittest.cc",
"apple/backup_util_unittest.mm",
"enterprise_util_mac_unittest.mm", "enterprise_util_mac_unittest.mm",
"mac/backup_util_unittest.mm",
"mac/bind_objc_block_unittest.mm", "mac/bind_objc_block_unittest.mm",
"mac/call_with_eh_frame_unittest.mm", "mac/call_with_eh_frame_unittest.mm",
"mac/dispatch_source_mach_unittest.cc", "mac/dispatch_source_mach_unittest.cc",
@@ -3756,7 +3756,7 @@ test("base_unittests") {
sources += [ sources += [
# Pull in specific Mac files for iOS. # Pull in specific Mac files for iOS.
"mac/backup_util_unittest.mm", "apple/backup_util_unittest.mm",
"mac/bind_objc_block_unittest.mm", "mac/bind_objc_block_unittest.mm",
"mac/foundation_util_unittest.mm", "mac/foundation_util_unittest.mm",
"mac/scoped_nsobject_unittest.mm", "mac/scoped_nsobject_unittest.mm",

@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef BASE_MAC_BACKUP_UTIL_H_ #ifndef BASE_APPLE_BACKUP_UTIL_H_
#define BASE_MAC_BACKUP_UTIL_H_ #define BASE_APPLE_BACKUP_UTIL_H_
#include "base/base_export.h" #include "base/base_export.h"
@@ -11,7 +11,7 @@ namespace base {
class FilePath; class FilePath;
} }
namespace base::mac { namespace base::apple {
// Returns true if the file or directory at `file_path` is excluded from // Returns true if the file or directory at `file_path` is excluded from
// OS-managed backups. // OS-managed backups.
@@ -26,6 +26,6 @@ BASE_EXPORT bool SetBackupExclusion(const FilePath& file_path);
// occurs. // occurs.
BASE_EXPORT bool ClearBackupExclusion(const FilePath& file_path); BASE_EXPORT bool ClearBackupExclusion(const FilePath& file_path);
} // namespace base::mac } // namespace base::apple
#endif // BASE_MAC_BACKUP_UTIL_H_ #endif // BASE_APPLE_BACKUP_UTIL_H_

@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "base/mac/backup_util.h" #include "base/apple/backup_util.h"
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
@@ -12,13 +12,13 @@
#include "base/strings/sys_string_conversions.h" #include "base/strings/sys_string_conversions.h"
#include "base/threading/scoped_blocking_call.h" #include "base/threading/scoped_blocking_call.h"
namespace base::mac { namespace base::apple {
bool GetBackupExclusion(const FilePath& file_path) { bool GetBackupExclusion(const FilePath& file_path) {
base::ScopedBlockingCall scoped_blocking_call(FROM_HERE, base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
base::BlockingType::MAY_BLOCK); base::BlockingType::MAY_BLOCK);
NSURL* file_url = FilePathToNSURL(file_path); NSURL* file_url = mac::FilePathToNSURL(file_path);
DCHECK([file_url checkPromisedItemIsReachableAndReturnError:nil]); DCHECK([file_url checkPromisedItemIsReachableAndReturnError:nil]);
NSError* error = nil; NSError* error = nil;
@@ -40,7 +40,7 @@ bool SetBackupState(const FilePath& file_path, bool excluded) {
base::ScopedBlockingCall scoped_blocking_call(FROM_HERE, base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
base::BlockingType::MAY_BLOCK); base::BlockingType::MAY_BLOCK);
NSURL* file_url = FilePathToNSURL(file_path); NSURL* file_url = mac::FilePathToNSURL(file_path);
DCHECK([file_url checkPromisedItemIsReachableAndReturnError:nil]); DCHECK([file_url checkPromisedItemIsReachableAndReturnError:nil]);
NSError* error = nil; NSError* error = nil;
@@ -61,4 +61,4 @@ bool ClearBackupExclusion(const FilePath& file_path) {
return SetBackupState(file_path, false); return SetBackupState(file_path, false);
} }
} // namespace base::mac } // namespace base::apple

@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "base/mac/backup_util.h" #include "base/apple/backup_util.h"
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
@@ -17,7 +17,7 @@
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h" #include "testing/platform_test.h"
namespace base::mac { namespace base::apple {
namespace { namespace {
@@ -45,7 +45,7 @@ TEST_F(BackupUtilTest, TestExcludeFileFromBackups_NotByPath) {
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
FilePath excluded_file_path = temp_dir_.GetPath().Append("excluded"); FilePath excluded_file_path = temp_dir_.GetPath().Append("excluded");
base::ScopedCFTypeRef<CFURLRef> excluded_url = base::ScopedCFTypeRef<CFURLRef> excluded_url =
base::mac::FilePathToCFURL(excluded_file_path); mac::FilePathToCFURL(excluded_file_path);
constexpr char placeholder_data[] = "All your base are belong to us!"; constexpr char placeholder_data[] = "All your base are belong to us!";
ASSERT_EQ(checked_cast<int>(std::size(placeholder_data)), ASSERT_EQ(checked_cast<int>(std::size(placeholder_data)),
@@ -67,4 +67,4 @@ TEST_F(BackupUtilTest, TestExcludeFileFromBackups_NotByPath) {
} // namespace } // namespace
} // namespace base::mac } // namespace base::apple

@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef BASE_MAC_BUNDLE_LOCATIONS_H_ #ifndef BASE_APPLE_BUNDLE_LOCATIONS_H_
#define BASE_MAC_BUNDLE_LOCATIONS_H_ #define BASE_APPLE_BUNDLE_LOCATIONS_H_
#include "base/base_export.h" #include "base/base_export.h"
#include "base/files/file_path.h" #include "base/files/file_path.h"
@@ -16,7 +16,7 @@ namespace base {
class FilePath; class FilePath;
} }
namespace base::mac { namespace base::apple {
// This file provides several functions to explicitly request the various // This file provides several functions to explicitly request the various
// component bundles of Chrome. Please use these methods rather than calling // component bundles of Chrome. Please use these methods rather than calling
@@ -63,6 +63,6 @@ BASE_EXPORT void SetOverrideOuterBundle(NSBundle* bundle);
BASE_EXPORT void SetOverrideFrameworkBundle(NSBundle* bundle); BASE_EXPORT void SetOverrideFrameworkBundle(NSBundle* bundle);
#endif // __OBJC__ #endif // __OBJC__
} // namespace base::mac } // namespace base::apple
#endif // BASE_MAC_BUNDLE_LOCATIONS_H_ #endif // BASE_APPLE_BUNDLE_LOCATIONS_H_

@@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "base/mac/bundle_locations.h" #include "base/apple/bundle_locations.h"
#include "base/check.h" #include "base/check.h"
#include "base/mac/foundation_util.h" #include "base/mac/foundation_util.h"
#include "base/strings/sys_string_conversions.h" #include "base/strings/sys_string_conversions.h"
namespace base::mac { namespace base::apple {
// NSBundle isn't threadsafe, all functions in this file must be called on the // NSBundle isn't threadsafe, all functions in this file must be called on the
// main thread. // main thread.
@@ -24,12 +24,13 @@ NSURL* MainBundleURL() {
} }
FilePath MainBundlePath() { FilePath MainBundlePath() {
return NSStringToFilePath(MainBundle().bundlePath); return mac::NSStringToFilePath(MainBundle().bundlePath);
} }
NSBundle* OuterBundle() { NSBundle* OuterBundle() {
if (g_override_outer_bundle) if (g_override_outer_bundle) {
return g_override_outer_bundle; return g_override_outer_bundle;
}
return NSBundle.mainBundle; return NSBundle.mainBundle;
} }
@@ -38,17 +39,18 @@ NSURL* OuterBundleURL() {
} }
FilePath OuterBundlePath() { FilePath OuterBundlePath() {
return NSStringToFilePath(OuterBundle().bundlePath); return mac::NSStringToFilePath(OuterBundle().bundlePath);
} }
NSBundle* FrameworkBundle() { NSBundle* FrameworkBundle() {
if (g_override_framework_bundle) if (g_override_framework_bundle) {
return g_override_framework_bundle; return g_override_framework_bundle;
}
return NSBundle.mainBundle; return NSBundle.mainBundle;
} }
FilePath FrameworkBundlePath() { FilePath FrameworkBundlePath() {
return NSStringToFilePath(FrameworkBundle().bundlePath); return mac::NSStringToFilePath(FrameworkBundle().bundlePath);
} }
static void AssignOverrideBundle(NSBundle* new_bundle, static void AssignOverrideBundle(NSBundle* new_bundle,
@@ -63,7 +65,7 @@ static void AssignOverridePath(const FilePath& file_path,
NSBundle** override_bundle) { NSBundle** override_bundle) {
NSBundle* new_bundle = nil; NSBundle* new_bundle = nil;
if (!file_path.empty()) { if (!file_path.empty()) {
new_bundle = [NSBundle bundleWithURL:base::mac::FilePathToNSURL(file_path)]; new_bundle = [NSBundle bundleWithURL:mac::FilePathToNSURL(file_path)];
CHECK(new_bundle) << "Failed to load the bundle at " << file_path.value(); CHECK(new_bundle) << "Failed to load the bundle at " << file_path.value();
} }
AssignOverrideBundle(new_bundle, override_bundle); AssignOverrideBundle(new_bundle, override_bundle);
@@ -85,4 +87,4 @@ void SetOverrideFrameworkBundlePath(const FilePath& file_path) {
AssignOverridePath(file_path, &g_override_framework_bundle); AssignOverridePath(file_path, &g_override_framework_bundle);
} }
} // namespace base::mac } // namespace base::apple

@@ -10,11 +10,11 @@
#include <mach-o/dyld.h> #include <mach-o/dyld.h>
#include <stdint.h> #include <stdint.h>
#include "base/apple/bundle_locations.h"
#include "base/base_paths.h" #include "base/base_paths.h"
#include "base/check_op.h" #include "base/check_op.h"
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/files/file_util.h" #include "base/files/file_util.h"
#include "base/mac/bundle_locations.h"
#include "base/mac/foundation_util.h" #include "base/mac/foundation_util.h"
#include "base/notreached.h" #include "base/notreached.h"
#include "base/path_service.h" #include "base/path_service.h"
@@ -123,11 +123,11 @@ bool PathProviderMac(int key, base::FilePath* result) {
return PathService::Get(base::DIR_MODULE, result); return PathService::Get(base::DIR_MODULE, result);
} }
#if BUILDFLAG(IS_IOS_MACCATALYST) #if BUILDFLAG(IS_IOS_MACCATALYST)
*result = base::mac::MainBundlePath() *result = base::apple::MainBundlePath()
.Append(FILE_PATH_LITERAL("Contents")) .Append(FILE_PATH_LITERAL("Contents"))
.Append(FILE_PATH_LITERAL("Resources")); .Append(FILE_PATH_LITERAL("Resources"));
#else #else
*result = base::mac::FrameworkBundlePath().Append( *result = base::apple::FrameworkBundlePath().Append(
FILE_PATH_LITERAL("Resources")); FILE_PATH_LITERAL("Resources"));
#endif // BUILDFLAG(IS_IOS_MACCATALYST) #endif // BUILDFLAG(IS_IOS_MACCATALYST)
return true; return true;

@@ -6,8 +6,8 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#include "base/apple/bundle_locations.h"
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/mac/bundle_locations.h"
#include "base/mac/foundation_util.h" #include "base/mac/foundation_util.h"
#include "base/strings/sys_string_conversions.h" #include "base/strings/sys_string_conversions.h"
#include "build/build_config.h" #include "build/build_config.h"
@@ -21,7 +21,7 @@ FileVersionInfoMac::~FileVersionInfoMac() {}
// static // static
std::unique_ptr<FileVersionInfo> std::unique_ptr<FileVersionInfo>
FileVersionInfo::CreateFileVersionInfoForCurrentModule() { FileVersionInfo::CreateFileVersionInfoForCurrentModule() {
return CreateFileVersionInfo(base::mac::FrameworkBundlePath()); return CreateFileVersionInfo(base::apple::FrameworkBundlePath());
} }
// static // static

@@ -10,8 +10,8 @@
#include <string> #include <string>
#include "base/apple/bundle_locations.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/mac/bundle_locations.h"
#include "base/mac/foundation_util.h" #include "base/mac/foundation_util.h"
#include "base/mac/mac_logging.h" #include "base/mac/mac_logging.h"
#include "base/mac/scoped_authorizationref.h" #include "base/mac/scoped_authorizationref.h"
@@ -60,8 +60,8 @@ ScopedAuthorizationRef GetAuthorizationRightsWithPrompt(
// product_logo_32.png is used instead of app.icns because Authorization // product_logo_32.png is used instead of app.icns because Authorization
// Services can't deal with .icns files. // Services can't deal with .icns files.
NSString* icon_path = NSString* icon_path =
[base::mac::FrameworkBundle() pathForResource:@"product_logo_32" [base::apple::FrameworkBundle() pathForResource:@"product_logo_32"
ofType:@"png"]; ofType:@"png"];
const char* icon_path_c = [icon_path fileSystemRepresentation]; const char* icon_path_c = [icon_path fileSystemRepresentation];
size_t icon_path_length = icon_path_c ? strlen(icon_path_c) : 0; size_t icon_path_length = icon_path_c ? strlen(icon_path_c) : 0;

@@ -10,9 +10,9 @@
#include <vector> #include <vector>
#include "base/apple/bundle_locations.h"
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/mac/bundle_locations.h"
#include "base/mac/mac_logging.h" #include "base/mac/mac_logging.h"
#include "base/notreached.h" #include "base/notreached.h"
#include "base/numerics/checked_math.h" #include "base/numerics/checked_math.h"
@@ -55,7 +55,7 @@ bool UncachedAmIBundled() {
return g_override_am_i_bundled_value; return g_override_am_i_bundled_value;
// Yes, this is cheap. // Yes, this is cheap.
return [[base::mac::OuterBundle() bundlePath] hasSuffix:@".app"]; return [[base::apple::OuterBundle() bundlePath] hasSuffix:@".app"];
#endif #endif
} }
@@ -94,12 +94,12 @@ bool IsBackgroundOnlyProcess() {
// This function really does want to examine NSBundle's idea of the main // This function really does want to examine NSBundle's idea of the main
// bundle dictionary. It needs to look at the actual running .app's // bundle dictionary. It needs to look at the actual running .app's
// Info.plist to access its LSUIElement property. // Info.plist to access its LSUIElement property.
NSDictionary* info_dictionary = [base::mac::MainBundle() infoDictionary]; NSDictionary* info_dictionary = [base::apple::MainBundle() infoDictionary];
return [info_dictionary[@"LSUIElement"] boolValue] != NO; return [info_dictionary[@"LSUIElement"] boolValue] != NO;
} }
FilePath PathForFrameworkBundleResource(const char* resource_name) { FilePath PathForFrameworkBundleResource(const char* resource_name) {
NSBundle* bundle = base::mac::FrameworkBundle(); NSBundle* bundle = base::apple::FrameworkBundle();
NSURL* resource_url = [bundle URLForResource:@(resource_name) NSURL* resource_url = [bundle URLForResource:@(resource_name)
withExtension:nil]; withExtension:nil];
return NSURLToFilePath(resource_url); return NSURLToFilePath(resource_url);

@@ -15,9 +15,9 @@
#include <sys/utsname.h> #include <sys/utsname.h>
#include <sys/xattr.h> #include <sys/xattr.h>
#include "base/apple/bundle_locations.h"
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/mac/bundle_locations.h"
#include "base/mac/foundation_util.h" #include "base/mac/foundation_util.h"
#include "base/mac/mac_logging.h" #include "base/mac/mac_logging.h"
#include "base/mac/scoped_aedesc.h" #include "base/mac/scoped_aedesc.h"
@@ -96,7 +96,7 @@ class LoginItemsFileList {
} }
ScopedCFTypeRef<LSSharedFileListItemRef> GetLoginItemForMainApp() { ScopedCFTypeRef<LSSharedFileListItemRef> GetLoginItemForMainApp() {
NSURL* url = [NSURL fileURLWithPath:[base::mac::MainBundle() bundlePath]]; NSURL* url = [NSURL fileURLWithPath:[base::apple::MainBundle() bundlePath]];
return GetLoginItemForApp(url); return GetLoginItemForApp(url);
} }

@@ -13,10 +13,10 @@ class FilePath;
// |user_data_dir| parameter. If no policy is set the parameter is not changed. // |user_data_dir| parameter. If no policy is set the parameter is not changed.
void CheckUserDataDirPolicy(base::FilePath* user_data_dir); void CheckUserDataDirPolicy(base::FilePath* user_data_dir);
// Sets the app bundle (base::mac::FrameworkBundle()) to the framework's bundle, // Sets the app bundle (base::apple::FrameworkBundle()) to the framework's
// and sets the base bundle ID (base::mac::BaseBundleID()) to the proper value // bundle, and sets the base bundle ID (base::mac::BaseBundleID()) to the proper
// based on the running application. The base bundle ID is the outer browser // value based on the running application. The base bundle ID is the outer
// application's bundle ID even when running in a non-browser (helper) // browser application's bundle ID even when running in a non-browser (helper)
// process. // process.
void SetUpBundleOverrides(); void SetUpBundleOverrides();

@@ -8,9 +8,9 @@
#include <string> #include <string>
#import "base/apple/bundle_locations.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/files/file_path.h" #include "base/files/file_path.h"
#import "base/mac/bundle_locations.h"
#import "base/mac/foundation_util.h" #import "base/mac/foundation_util.h"
#include "base/path_service.h" #include "base/path_service.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
@@ -22,7 +22,8 @@
void SetUpBundleOverrides() { void SetUpBundleOverrides() {
@autoreleasepool { @autoreleasepool {
base::mac::SetOverrideFrameworkBundlePath(chrome::GetFrameworkBundlePath()); base::apple::SetOverrideFrameworkBundlePath(
chrome::GetFrameworkBundlePath());
NSBundle* base_bundle = chrome::OuterAppBundle(); NSBundle* base_bundle = chrome::OuterAppBundle();
base::mac::SetBaseBundleID([[base_bundle bundleIdentifier] UTF8String]); base::mac::SetBaseBundleID([[base_bundle bundleIdentifier] UTF8String]);

@@ -9,12 +9,12 @@
#include <utility> #include <utility>
#include "base/apple/bundle_locations.h"
#include "base/base_switches.h" #include "base/base_switches.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/files/file_util.h" #include "base/files/file_util.h"
#include "base/functional/bind.h" #include "base/functional/bind.h"
#include "base/hash/md5.h" #include "base/hash/md5.h"
#include "base/mac/bundle_locations.h"
#include "base/mac/foundation_util.h" #include "base/mac/foundation_util.h"
#include "base/mac/launch_application.h" #include "base/mac/launch_application.h"
#include "base/mac/mac_util.h" #include "base/mac/mac_util.h"
@@ -215,7 +215,7 @@ bool AppShimController::FindOrLaunchChrome() {
} }
// Otherwise, launch Chrome. // Otherwise, launch Chrome.
base::FilePath chrome_bundle_path = base::mac::OuterBundlePath(); base::FilePath chrome_bundle_path = base::apple::OuterBundlePath();
LOG(INFO) << "Launching " << chrome_bundle_path.value(); LOG(INFO) << "Launching " << chrome_bundle_path.value();
base::CommandLine browser_command_line(base::CommandLine::NO_PROGRAM); base::CommandLine browser_command_line(base::CommandLine::NO_PROGRAM);
browser_command_line.AppendSwitchPath(switches::kUserDataDir, browser_command_line.AppendSwitchPath(switches::kUserDataDir,
@@ -280,7 +280,7 @@ AppShimController::FindChromeFromSingletonLock(
// Check the process' bundle id. As above, the specified pid could have been // Check the process' bundle id. As above, the specified pid could have been
// reused by some other process. // reused by some other process.
NSString* expected_bundle_id = [base::mac::OuterBundle() bundleIdentifier]; NSString* expected_bundle_id = [base::apple::OuterBundle() bundleIdentifier];
NSString* lock_bundle_id = [process_from_lock bundleIdentifier]; NSString* lock_bundle_id = [process_from_lock bundleIdentifier];
if (![expected_bundle_id isEqualToString:lock_bundle_id]) { if (![expected_bundle_id isEqualToString:lock_bundle_id]) {
LOG(WARNING) << "Singleton lock pid " << pid LOG(WARNING) << "Singleton lock pid " << pid

@@ -11,6 +11,7 @@
#include <vector> #include <vector>
#include "base/allocator/early_zone_registration_mac.h" #include "base/allocator/early_zone_registration_mac.h"
#include "base/apple/bundle_locations.h"
#include "base/at_exit.h" #include "base/at_exit.h"
#include "base/base_switches.h" #include "base/base_switches.h"
#include "base/check.h" #include "base/check.h"
@@ -19,7 +20,6 @@
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/files/file_util.h" #include "base/files/file_util.h"
#include "base/functional/bind.h" #include "base/functional/bind.h"
#include "base/mac/bundle_locations.h"
#include "base/mac/mac_logging.h" #include "base/mac/mac_logging.h"
#include "base/message_loop/message_pump_type.h" #include "base/message_loop/message_pump_type.h"
#include "base/run_loop.h" #include "base/run_loop.h"
@@ -80,9 +80,9 @@ int APP_SHIM_ENTRY_POINT_NAME(const app_mode::ChromeAppModeInfo* info) {
chrome::RegisterPathProvider(); chrome::RegisterPathProvider();
// Set bundle paths. This loads the bundles. // Set bundle paths. This loads the bundles.
base::mac::SetOverrideOuterBundlePath( base::apple::SetOverrideOuterBundlePath(
base::FilePath(info->chrome_outer_bundle_path)); base::FilePath(info->chrome_outer_bundle_path));
base::mac::SetOverrideFrameworkBundlePath( base::apple::SetOverrideFrameworkBundlePath(
base::FilePath(info->chrome_framework_path)); base::FilePath(info->chrome_framework_path));
// Note that `info->user_data_dir` for shims contains the app data path, // Note that `info->user_data_dir` for shims contains the app data path,
@@ -96,12 +96,12 @@ int APP_SHIM_ENTRY_POINT_NAME(const app_mode::ChromeAppModeInfo* info) {
// Calculate the preferred locale used by Chrome. We can't use // Calculate the preferred locale used by Chrome. We can't use
// l10n_util::OverrideLocaleWithCocoaLocale() because it calls // l10n_util::OverrideLocaleWithCocoaLocale() because it calls
// [base::mac::OuterBundle() preferredLocalizations] which gets // [base::apple::OuterBundle() preferredLocalizations] which gets
// localizations from the bundle of the running app (i.e. it is equivalent // localizations from the bundle of the running app (i.e. it is equivalent
// to [[NSBundle mainBundle] preferredLocalizations]) instead of the target // to [[NSBundle mainBundle] preferredLocalizations]) instead of the target
// bundle. // bundle.
NSArray* preferred_languages = [NSLocale preferredLanguages]; NSArray* preferred_languages = [NSLocale preferredLanguages];
NSArray* supported_languages = [base::mac::OuterBundle() localizations]; NSArray* supported_languages = [base::apple::OuterBundle() localizations];
std::string preferred_localization; std::string preferred_localization;
for (NSString* language in preferred_languages) { for (NSString* language in preferred_languages) {
// We must convert the "-" separator to "_" to be compatible with // We must convert the "-" separator to "_" to be compatible with

@@ -11,6 +11,7 @@
#include <utility> #include <utility>
#include "apps/app_lifetime_monitor_factory.h" #include "apps/app_lifetime_monitor_factory.h"
#include "base/apple/bundle_locations.h"
#include "base/barrier_closure.h" #include "base/barrier_closure.h"
#include "base/debug/dump_without_crashing.h" #include "base/debug/dump_without_crashing.h"
#include "base/feature_list.h" #include "base/feature_list.h"
@@ -20,7 +21,6 @@
#include "base/functional/callback_helpers.h" #include "base/functional/callback_helpers.h"
#include "base/hash/sha1.h" #include "base/hash/sha1.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/mac/bundle_locations.h"
#include "base/mac/foundation_util.h" #include "base/mac/foundation_util.h"
#include "base/mac/mac_logging.h" #include "base/mac/mac_logging.h"
#include "base/memory/raw_ptr.h" #include "base/memory/raw_ptr.h"
@@ -110,7 +110,7 @@ CreateAppShimRequirement() {
// validating. We are only interested in discovering if the framework bundle // validating. We are only interested in discovering if the framework bundle
// is code-signed, and if so what the designated requirement is. // is code-signed, and if so what the designated requirement is.
base::ScopedCFTypeRef<CFURLRef> framework_url = base::ScopedCFTypeRef<CFURLRef> framework_url =
base::mac::FilePathToCFURL(base::mac::FrameworkBundlePath()); base::mac::FilePathToCFURL(base::apple::FrameworkBundlePath());
base::ScopedCFTypeRef<SecStaticCodeRef> framework_code; base::ScopedCFTypeRef<SecStaticCodeRef> framework_code;
OSStatus status = SecStaticCodeCreateWithPath( OSStatus status = SecStaticCodeCreateWithPath(
framework_url, kSecCSDefaultFlags, framework_code.InitializeInto()); framework_url, kSecCSDefaultFlags, framework_code.InitializeInto());

@@ -6,10 +6,10 @@
#import <Cocoa/Cocoa.h> #import <Cocoa/Cocoa.h>
#include "base/apple/bundle_locations.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/feature_list.h" #include "base/feature_list.h"
#include "base/functional/bind.h" #include "base/functional/bind.h"
#include "base/mac/bundle_locations.h"
#import "base/mac/foundation_util.h" #import "base/mac/foundation_util.h"
#include "base/mac/mac_util.h" #include "base/mac/mac_util.h"
#include "base/mac/scoped_nsobject.h" #include "base/mac/scoped_nsobject.h"

@@ -23,7 +23,7 @@
#include "third_party/sqlite/sqlite3.h" #include "third_party/sqlite/sqlite3.h"
#if BUILDFLAG(IS_MAC) #if BUILDFLAG(IS_MAC)
#include "base/mac/backup_util.h" #include "base/apple/backup_util.h"
#endif #endif
namespace extensions { namespace extensions {
@@ -87,7 +87,7 @@ void ActivityDatabase::Init(const base::FilePath& db_name) {
#if BUILDFLAG(IS_MAC) #if BUILDFLAG(IS_MAC)
// Exclude the database from backups. // Exclude the database from backups.
base::mac::SetBackupExclusion(db_name); base::apple::SetBackupExclusion(db_name);
#endif #endif
if (!delegate_->InitDatabase(&db_)) if (!delegate_->InitDatabase(&db_))

@@ -11,8 +11,8 @@
#include <tuple> #include <tuple>
#include "base/apple/bundle_locations.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/mac/bundle_locations.h"
#include "base/mac/foundation_util.h" #include "base/mac/foundation_util.h"
#include "base/mac/launchd.h" #include "base/mac/launchd.h"
#include "base/mac/scoped_cftyperef.h" #include "base/mac/scoped_cftyperef.h"
@@ -190,7 +190,7 @@ ChromeInDockStatus ChromeIsInTheDock() {
return ChromeInDockFailure; return ChromeInDockFailure;
} }
NSString* launch_path = [base::mac::OuterBundle() bundlePath]; NSString* launch_path = [base::apple::OuterBundle() bundlePath];
return [PersistentAppPaths(persistent_apps) containsObject:launch_path] return [PersistentAppPaths(persistent_apps) containsObject:launch_path]
? ChromeInDockTrue ? ChromeInDockTrue

@@ -19,12 +19,12 @@
#include <algorithm> #include <algorithm>
#include "base/apple/bundle_locations.h"
#include "base/auto_reset.h" #include "base/auto_reset.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/mac/authorization_util.h" #include "base/mac/authorization_util.h"
#include "base/mac/bundle_locations.h"
#include "base/mac/foundation_util.h" #include "base/mac/foundation_util.h"
#include "base/mac/mac_logging.h" #include "base/mac/mac_logging.h"
#include "base/mac/mac_util.h" #include "base/mac/mac_util.h"
@@ -437,7 +437,7 @@ void ShowErrorDialog() {
DiskImageStatus IsAppRunningFromReadOnlyDiskImage( DiskImageStatus IsAppRunningFromReadOnlyDiskImage(
std::string* dmg_bsd_device_name) { std::string* dmg_bsd_device_name) {
return IsPathOnReadOnlyDiskImage( return IsPathOnReadOnlyDiskImage(
base::mac::OuterBundle().bundlePath.fileSystemRepresentation, base::apple::OuterBundle().bundlePath.fileSystemRepresentation,
dmg_bsd_device_name); dmg_bsd_device_name);
} }
@@ -469,7 +469,7 @@ bool MaybeInstallFromDiskImage() {
return false; return false;
} }
NSString* source_path = base::mac::OuterBundle().bundlePath; NSString* source_path = base::apple::OuterBundle().bundlePath;
NSString* application_name = source_path.lastPathComponent; NSString* application_name = source_path.lastPathComponent;
NSString* target_path = NSString* target_path =
[application_directory stringByAppendingPathComponent:application_name]; [application_directory stringByAppendingPathComponent:application_name];
@@ -481,8 +481,8 @@ bool MaybeInstallFromDiskImage() {
} }
NSURL* installer_url = NSURL* installer_url =
[base::mac::FrameworkBundle() URLForResource:@"install" [base::apple::FrameworkBundle() URLForResource:@"install"
withExtension:@"sh"]; withExtension:@"sh"];
if (!installer_url) { if (!installer_url) {
VLOG(1) << "Could not locate install.sh"; VLOG(1) << "Could not locate install.sh";
return false; return false;

@@ -12,12 +12,12 @@
#include <vector> #include <vector>
#include "base/apple/bridging.h" #include "base/apple/bridging.h"
#include "base/apple/bundle_locations.h"
#include "base/file_version_info.h" #include "base/file_version_info.h"
#include "base/functional/bind.h" #include "base/functional/bind.h"
#include "base/location.h" #include "base/location.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/mac/authorization_util.h" #include "base/mac/authorization_util.h"
#include "base/mac/bundle_locations.h"
#include "base/mac/foundation_util.h" #include "base/mac/foundation_util.h"
#include "base/mac/mac_logging.h" #include "base/mac/mac_logging.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
@@ -277,12 +277,12 @@ NSString* const kVersionKey = @"KSVersion";
} }
- (NSDictionary*)infoDictionary { - (NSDictionary*)infoDictionary {
// Use base::mac::OuterBundle() to get the Chrome app's own bundle identifier // Use base::apple::OuterBundle() to get the Chrome app's own bundle
// and path, not the framework's. For auto-update, the application is // identifier and path, not the framework's. For auto-update, the application
// what's significant here: it's used to locate the outermost part of the // is what's significant here: it's used to locate the outermost part of the
// application for the existence checker and other operations that need to // application for the existence checker and other operations that need to
// see the entire application bundle. // see the entire application bundle.
return base::mac::OuterBundle().infoDictionary; return base::apple::OuterBundle().infoDictionary;
} }
- (NSString*)productID { - (NSString*)productID {
@@ -302,7 +302,7 @@ NSString* const kVersionKey = @"KSVersion";
} }
- (void)loadParameters { - (void)loadParameters {
NSBundle* appBundle = base::mac::OuterBundle(); NSBundle* appBundle = base::apple::OuterBundle();
NSDictionary* infoDictionary = self.infoDictionary; NSDictionary* infoDictionary = self.infoDictionary;
NSString* productID = NSString* productID =
@@ -437,8 +437,8 @@ NSString* const kVersionKey = @"KSVersion";
} }
// Load the KeystoneRegistration framework bundle if present. It lives // Load the KeystoneRegistration framework bundle if present. It lives
// inside the framework, so use base::mac::FrameworkBundle(); // inside the framework, so use base::apple::FrameworkBundle();
NSString* ksrPath = [base::mac::FrameworkBundle().privateFrameworksPath NSString* ksrPath = [base::apple::FrameworkBundle().privateFrameworksPath
stringByAppendingPathComponent:@"KeystoneRegistration.framework"]; stringByAppendingPathComponent:@"KeystoneRegistration.framework"];
NSBundle* ksrBundle = [NSBundle bundleWithPath:ksrPath]; NSBundle* ksrBundle = [NSBundle bundleWithPath:ksrPath];
[ksrBundle load]; [ksrBundle load];
@@ -883,8 +883,8 @@ NSString* const kVersionKey = @"KSVersion";
// authenticating, may actually result in different ownership being applied // authenticating, may actually result in different ownership being applied
// to files and directories. // to files and directories.
NSFileManager* fileManager = NSFileManager.defaultManager; NSFileManager* fileManager = NSFileManager.defaultManager;
NSString* executablePath = base::mac::OuterBundle().executablePath; NSString* executablePath = base::apple::OuterBundle().executablePath;
NSString* frameworkPath = base::mac::FrameworkBundle().bundlePath; NSString* frameworkPath = base::apple::FrameworkBundle().bundlePath;
return ![fileManager isWritableFileAtPath:_appPath] || return ![fileManager isWritableFileAtPath:_appPath] ||
![fileManager isWritableFileAtPath:executablePath] || ![fileManager isWritableFileAtPath:executablePath] ||
![fileManager isWritableFileAtPath:frameworkPath]; ![fileManager isWritableFileAtPath:frameworkPath];
@@ -961,10 +961,9 @@ NSString* const kVersionKey = @"KSVersion";
// preflight now does, and then the preflight script can be removed instead. // preflight now does, and then the preflight script can be removed instead.
// However, preflight operation (and promotion) should only be asynchronous if // However, preflight operation (and promotion) should only be asynchronous if
// the synchronous parameter is NO. // the synchronous parameter is NO.
NSString* preflightPath = NSString* preflightPath = [base::apple::FrameworkBundle()
[base::mac::FrameworkBundle() pathForResource:@"keystone_promote_preflight"
pathForResource:@"keystone_promote_preflight" ofType:@"sh"];
ofType:@"sh"];
const char* preflightPathC = preflightPath.fileSystemRepresentation; const char* preflightPathC = preflightPath.fileSystemRepresentation;
// This is typically a once per machine operation, so it is not worth caching // This is typically a once per machine operation, so it is not worth caching
@@ -1076,7 +1075,7 @@ NSString* const kVersionKey = @"KSVersion";
// thread to run the tool. // thread to run the tool.
DCHECK(NSThread.isMainThread); DCHECK(NSThread.isMainThread);
NSString* toolPath = [base::mac::FrameworkBundle() NSString* toolPath = [base::apple::FrameworkBundle()
pathForResource:@"keystone_promote_postflight" pathForResource:@"keystone_promote_postflight"
ofType:@"sh"]; ofType:@"sh"];

@@ -18,11 +18,11 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "base/apple/bundle_locations.h"
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/files/file_util.h" #include "base/files/file_util.h"
#include "base/files/scoped_file.h" #include "base/files/scoped_file.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/mac/bundle_locations.h"
#include "base/mac/launch_application.h" #include "base/mac/launch_application.h"
#include "base/mac/mac_logging.h" #include "base/mac/mac_logging.h"
#include "base/mac/scoped_nsobject.h" #include "base/mac/scoped_nsobject.h"
@@ -116,7 +116,7 @@ bool RelaunchAppWithHelper(const std::string& helper,
// The first item of `args` is the path to the executable, but launch APIs // The first item of `args` is the path to the executable, but launch APIs
// require the path to the bundle. Rather than try to derive the bundle path // require the path to the bundle. Rather than try to derive the bundle path
// from the executable path, substitute in the bundle path. // from the executable path, substitute in the bundle path.
relaunch_args.push_back(base::mac::OuterBundlePath().value()); relaunch_args.push_back(base::apple::OuterBundlePath().value());
for (size_t i = 1; i < args.size(); ++i) { for (size_t i = 1; i < args.size(); ++i) {
// Strip any PSN arguments, as they apply to a specific process. // Strip any PSN arguments, as they apply to a specific process.
if (args[i].compare(0, strlen(kPSNArg), kPSNArg) != 0 && if (args[i].compare(0, strlen(kPSNArg), kPSNArg) != 0 &&

@@ -8,8 +8,8 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#include <Security/Authorization.h> #include <Security/Authorization.h>
#include "base/apple/bundle_locations.h"
#include "base/mac/authorization_util.h" #include "base/mac/authorization_util.h"
#include "base/mac/bundle_locations.h"
#include "base/mac/foundation_util.h" #include "base/mac/foundation_util.h"
#include "base/mac/mac_logging.h" #include "base/mac/mac_logging.h"
#include "base/mac/scoped_authorizationref.h" #include "base/mac/scoped_authorizationref.h"
@@ -24,7 +24,7 @@ NSString* UserAuthenticationRightName() {
// The authentication right name is of the form // The authentication right name is of the form
// `org.chromium.Chromium.access-passwords` or // `org.chromium.Chromium.access-passwords` or
// `com.google.Chrome.access-passwords`. // `com.google.Chrome.access-passwords`.
return [[base::mac::MainBundle() bundleIdentifier] return [[base::apple::MainBundle() bundleIdentifier]
stringByAppendingString:@".access-passwords"]; stringByAppendingString:@".access-passwords"];
} }

@@ -9,9 +9,9 @@
#include <memory> #include <memory>
#include <utility> #include <utility>
#include "base/apple/bundle_locations.h"
#include "base/files/file_util.h" #include "base/files/file_util.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/mac/bundle_locations.h"
#include "chrome/browser/safe_browsing/incident_reporting/binary_integrity_incident.h" #include "chrome/browser/safe_browsing/incident_reporting/binary_integrity_incident.h"
#include "chrome/browser/safe_browsing/incident_reporting/incident_receiver.h" #include "chrome/browser/safe_browsing/incident_reporting/incident_receiver.h"
#include "chrome/browser/safe_browsing/signature_evaluator_mac.h" #include "chrome/browser/safe_browsing/signature_evaluator_mac.h"
@@ -113,9 +113,9 @@ std::vector<PathAndRequirement> GetCriticalPathsAndRequirements() {
// clang-format on // clang-format on
critical_binaries.push_back( critical_binaries.push_back(
PathAndRequirement(base::mac::OuterBundlePath(), requirement)); PathAndRequirement(base::apple::OuterBundlePath(), requirement));
critical_binaries.push_back( critical_binaries.push_back(
PathAndRequirement(base::mac::FrameworkBundlePath(), requirement)); PathAndRequirement(base::apple::FrameworkBundlePath(), requirement));
return critical_binaries; return critical_binaries;
} }

@@ -9,10 +9,10 @@
#include <memory> #include <memory>
#include "base/apple/bundle_locations.h"
#include "base/files/file.h" #include "base/files/file.h"
#include "base/files/file_util.h" #include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h" #include "base/files/scoped_temp_dir.h"
#include "base/mac/bundle_locations.h"
#include "base/mac/foundation_util.h" #include "base/mac/foundation_util.h"
#include "base/mac/scoped_cftyperef.h" #include "base/mac/scoped_cftyperef.h"
#include "base/path_service.h" #include "base/path_service.h"
@@ -87,9 +87,9 @@ TEST_F(BinaryIntegrityAnalyzerMacTest, GetCriticalPathsAndRequirements) {
"certificate leaf[field.1.2.840.113635.100.6.1.13] and " "certificate leaf[field.1.2.840.113635.100.6.1.13] and "
"certificate leaf[subject.OU] = EQHXZ8M8AV"; "certificate leaf[subject.OU] = EQHXZ8M8AV";
paths_and_requirements_expected.push_back( paths_and_requirements_expected.push_back(
PathAndRequirement(base::mac::OuterBundlePath(), expected_req)); PathAndRequirement(base::apple::OuterBundlePath(), expected_req));
paths_and_requirements_expected.push_back( paths_and_requirements_expected.push_back(
PathAndRequirement(base::mac::FrameworkBundlePath(), expected_req)); PathAndRequirement(base::apple::FrameworkBundlePath(), expected_req));
std::vector<PathAndRequirement> paths_and_requirements = std::vector<PathAndRequirement> paths_and_requirements =
GetCriticalPathsAndRequirements(); GetCriticalPathsAndRequirements();

@@ -7,7 +7,7 @@
#include <AppKit/AppKit.h> #include <AppKit/AppKit.h>
#include <UniformTypeIdentifiers/UniformTypeIdentifiers.h> #include <UniformTypeIdentifiers/UniformTypeIdentifiers.h>
#include "base/mac/bundle_locations.h" #include "base/apple/bundle_locations.h"
#include "base/mac/foundation_util.h" #include "base/mac/foundation_util.h"
#include "base/mac/mac_util.h" #include "base/mac/mac_util.h"
#include "base/mac/scoped_cftyperef.h" #include "base/mac/scoped_cftyperef.h"
@@ -43,7 +43,7 @@ bool SetAsDefaultBrowser() {
if (@available(macOS 12, *)) { if (@available(macOS 12, *)) {
// We really do want the outer bundle here, not the main bundle since // We really do want the outer bundle here, not the main bundle since
// setting a shortcut to Chrome as the default browser doesn't make sense. // setting a shortcut to Chrome as the default browser doesn't make sense.
NSURL* app_bundle = base::mac::OuterBundleURL(); NSURL* app_bundle = base::apple::OuterBundleURL();
if (!app_bundle) { if (!app_bundle) {
return false; return false;
} }
@@ -67,7 +67,7 @@ bool SetAsDefaultBrowser() {
// We really do want the outer bundle here, not the main bundle since // We really do want the outer bundle here, not the main bundle since
// setting a shortcut to Chrome as the default browser doesn't make sense. // setting a shortcut to Chrome as the default browser doesn't make sense.
CFStringRef identifier = CFStringRef identifier =
base::mac::NSToCFCast(base::mac::OuterBundle().bundleIdentifier); base::mac::NSToCFCast(base::apple::OuterBundle().bundleIdentifier);
if (!identifier) { if (!identifier) {
return false; return false;
} }
@@ -116,7 +116,7 @@ bool SetAsDefaultClientForScheme(const std::string& scheme) {
if (@available(macOS 12, *)) { if (@available(macOS 12, *)) {
// We really do want the main bundle here since it makes sense to set an // We really do want the main bundle here since it makes sense to set an
// app shortcut as a default scheme handler. // app shortcut as a default scheme handler.
NSURL* app_bundle = base::mac::MainBundleURL(); NSURL* app_bundle = base::apple::MainBundleURL();
if (!app_bundle) { if (!app_bundle) {
return false; return false;
} }
@@ -134,7 +134,7 @@ bool SetAsDefaultClientForScheme(const std::string& scheme) {
} else { } else {
// We really do want the main bundle here since it makes sense to set an // We really do want the main bundle here since it makes sense to set an
// app shortcut as a default scheme handler. // app shortcut as a default scheme handler.
NSString* identifier = base::mac::MainBundle().bundleIdentifier; NSString* identifier = base::apple::MainBundle().bundleIdentifier;
if (!identifier) { if (!identifier) {
return false; return false;
} }
@@ -208,7 +208,7 @@ bool CanApplicationHandleURL(const base::FilePath& app_path, const GURL& url) {
DefaultWebClientState GetDefaultBrowser() { DefaultWebClientState GetDefaultBrowser() {
// We really do want the outer bundle here, since this we want to know the // We really do want the outer bundle here, since this we want to know the
// status of the main Chrome bundle and not a shortcut. // status of the main Chrome bundle and not a shortcut.
NSString* my_identifier = base::mac::OuterBundle().bundleIdentifier; NSString* my_identifier = base::apple::OuterBundle().bundleIdentifier;
if (!my_identifier) { if (!my_identifier) {
return UNKNOWN_DEFAULT; return UNKNOWN_DEFAULT;
} }
@@ -257,7 +257,7 @@ DefaultWebClientState IsDefaultClientForScheme(const std::string& scheme) {
// We really do want the main bundle here since it makes sense to set an // We really do want the main bundle here since it makes sense to set an
// app shortcut as a default scheme handler. // app shortcut as a default scheme handler.
NSString* my_identifier = base::mac::MainBundle().bundleIdentifier; NSString* my_identifier = base::apple::MainBundle().bundleIdentifier;
if (!my_identifier) { if (!my_identifier) {
return UNKNOWN_DEFAULT; return UNKNOWN_DEFAULT;
} }

@@ -6,8 +6,8 @@
#include <stdint.h> #include <stdint.h>
#include "base/apple/bundle_locations.h"
#include "base/check_op.h" #include "base/check_op.h"
#include "base/mac/bundle_locations.h"
#include "base/mac/scoped_nsobject.h" #include "base/mac/scoped_nsobject.h"
#include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread.h"
#include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h"
@@ -63,7 +63,7 @@ constexpr int64_t kUpdateFrequencyMs = 200;
- (void)drawRect:(NSRect)dirtyRect { - (void)drawRect:(NSRect)dirtyRect {
// Not -[NSApplication applicationIconImage]; that fails to return a pasted // Not -[NSApplication applicationIconImage]; that fails to return a pasted
// custom icon. // custom icon.
NSString* appPath = [base::mac::MainBundle() bundlePath]; NSString* appPath = [base::apple::MainBundle() bundlePath];
NSImage* appIcon = [[NSWorkspace sharedWorkspace] iconForFile:appPath]; NSImage* appIcon = [[NSWorkspace sharedWorkspace] iconForFile:appPath];
[appIcon drawInRect:[self bounds] [appIcon drawInRect:[self bounds]
fromRect:NSZeroRect fromRect:NSZeroRect

@@ -4,10 +4,10 @@
#import "chrome/browser/ui/cocoa/first_run_dialog_cocoa.h" #import "chrome/browser/ui/cocoa/first_run_dialog_cocoa.h"
#include "base/apple/bundle_locations.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "base/functional/bind.h" #include "base/functional/bind.h"
#include "base/mac/bundle_locations.h"
#import "base/mac/scoped_nsobject.h" #import "base/mac/scoped_nsobject.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/run_loop.h" #include "base/run_loop.h"

@@ -9,8 +9,8 @@
#include <algorithm> #include <algorithm>
#include <vector> #include <vector>
#include "base/apple/bundle_locations.h"
#include "base/feature_list.h" #include "base/feature_list.h"
#include "base/mac/bundle_locations.h"
#include "base/strings/sys_string_conversions.h" #include "base/strings/sys_string_conversions.h"
#include "build/buildflag.h" #include "build/buildflag.h"
#include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process.h"

@@ -4,7 +4,7 @@
#import "chrome/browser/ui/cocoa/test/cocoa_test_helper.h" #import "chrome/browser/ui/cocoa/test/cocoa_test_helper.h"
#include "base/mac/bundle_locations.h" #include "base/apple/bundle_locations.h"
#include "base/path_service.h" #include "base/path_service.h"
#include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_constants.h"
@@ -23,5 +23,5 @@ void CocoaTest::BootstrapCocoa() {
base::FilePath path; base::FilePath path;
base::PathService::Get(base::DIR_EXE, &path); base::PathService::Get(base::DIR_EXE, &path);
path = path.Append(chrome::kFrameworkName); path = path.Append(chrome::kFrameworkName);
base::mac::SetOverrideFrameworkBundlePath(path); base::apple::SetOverrideFrameworkBundlePath(path);
} }

@@ -6,7 +6,7 @@
#include <string> #include <string>
#include "base/mac/bundle_locations.h" #include "base/apple/bundle_locations.h"
#include "base/mac/foundation_util.h" #include "base/mac/foundation_util.h"
#include "base/strings/strcat.h" #include "base/strings/strcat.h"
#include "chrome/browser/google/google_brand.h" #include "chrome/browser/google/google_brand.h"
@@ -19,7 +19,7 @@ namespace {
std::string GetTag() { std::string GetTag() {
std::string contents; std::string contents;
base::ReadFileToString( base::ReadFileToString(
base::mac::OuterBundlePath().Append(".want_full_installer"), &contents); base::apple::OuterBundlePath().Append(".want_full_installer"), &contents);
return base::StrCat( return base::StrCat(
{chrome::GetChannelName(chrome::WithExtendedStable(true)), {chrome::GetChannelName(chrome::WithExtendedStable(true)),
contents == version_info::GetVersionNumber() ? "-full" : ""}); contents == version_info::GetVersionNumber() ? "-full" : ""});
@@ -37,6 +37,6 @@ updater::RegistrationRequest BrowserUpdaterClient::GetRegistrationRequest() {
google_brand::GetBrand(&req.brand_code); google_brand::GetBrand(&req.brand_code);
req.version = base::Version(version_info::GetVersionNumber()); req.version = base::Version(version_info::GetVersionNumber());
req.ap = GetTag(); req.ap = GetTag();
req.existence_checker_path = base::mac::OuterBundlePath(); req.existence_checker_path = base::apple::OuterBundlePath();
return req; return req;
} }

@@ -12,6 +12,7 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <unistd.h> #include <unistd.h>
#include "base/apple/bundle_locations.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/files/file_enumerator.h" #include "base/files/file_enumerator.h"
#include "base/files/file_path.h" #include "base/files/file_path.h"
@@ -20,7 +21,6 @@
#include "base/functional/callback.h" #include "base/functional/callback.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/mac/authorization_util.h" #include "base/mac/authorization_util.h"
#include "base/mac/bundle_locations.h"
#include "base/mac/foundation_util.h" #include "base/mac/foundation_util.h"
#include "base/mac/scoped_authorizationref.h" #include "base/mac/scoped_authorizationref.h"
#include "base/memory/scoped_refptr.h" #include "base/memory/scoped_refptr.h"
@@ -54,7 +54,7 @@ base::FilePath GetUpdaterExecutablePath() {
} }
bool BundleOwnedByUser(uid_t user_uid) { bool BundleOwnedByUser(uid_t user_uid) {
const base::FilePath path = base::mac::OuterBundlePath(); const base::FilePath path = base::apple::OuterBundlePath();
base::stat_wrapper_t stat_info = {}; base::stat_wrapper_t stat_info = {};
if (base::File::Lstat(path.value().c_str(), &stat_info) != 0) { if (base::File::Lstat(path.value().c_str(), &stat_info) != 0) {
VPLOG(2) << "Failed to get information on path " << path.value(); VPLOG(2) << "Failed to get information on path " << path.value();
@@ -169,7 +169,7 @@ void InstallUpdaterAndRegisterBrowser(base::OnceClosure complete) {
// BRANDING.app/Contents/Frameworks/BRANDING.framework/Versions/V/ // BRANDING.app/Contents/Frameworks/BRANDING.framework/Versions/V/
// Helpers/Updater.app/Contents/MacOS/Updater // Helpers/Updater.app/Contents/MacOS/Updater
const base::FilePath updater_executable_path = const base::FilePath updater_executable_path =
base::mac::FrameworkBundlePath() base::apple::FrameworkBundlePath()
.Append(FILE_PATH_LITERAL("Helpers")) .Append(FILE_PATH_LITERAL("Helpers"))
.Append(GetUpdaterExecutablePath()); .Append(GetUpdaterExecutablePath());
@@ -199,7 +199,7 @@ void InstallUpdaterAndRegisterBrowser(base::OnceClosure complete) {
} // namespace } // namespace
std::string CurrentlyInstalledVersion() { std::string CurrentlyInstalledVersion() {
base::FilePath outer_bundle = base::mac::OuterBundlePath(); base::FilePath outer_bundle = base::apple::OuterBundlePath();
base::FilePath plist_path = base::FilePath plist_path =
outer_bundle.Append("Contents").Append("Info.plist"); outer_bundle.Append("Contents").Append("Info.plist");
NSDictionary* info_plist = [NSDictionary NSDictionary* info_plist = [NSDictionary

@@ -6,10 +6,10 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#include "base/apple/bundle_locations.h"
#include "base/functional/bind.h" #include "base/functional/bind.h"
#include "base/functional/callback.h" #include "base/functional/callback.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/mac/bundle_locations.h"
#include "base/mac/foundation_util.h" #include "base/mac/foundation_util.h"
#include "base/mac/scoped_nsobject.h" #include "base/mac/scoped_nsobject.h"
#include "base/memory/scoped_refptr.h" #include "base/memory/scoped_refptr.h"
@@ -70,7 +70,7 @@ void BrowserUpdaterHelperClientMac::SetupSystemUpdater(
[[xpc_connection_ remoteObjectProxyWithErrorHandler:errorHandler] [[xpc_connection_ remoteObjectProxyWithErrorHandler:errorHandler]
setupSystemUpdaterWithBrowserPath:base::mac::FilePathToNSString( setupSystemUpdaterWithBrowserPath:base::mac::FilePathToNSString(
base::mac::OuterBundlePath()) base::apple::OuterBundlePath())
reply:reply]; reply:reply];
} }

@@ -22,14 +22,14 @@
#include "chrome/browser/upgrade_detector/installed_version_monitor.h" #include "chrome/browser/upgrade_detector/installed_version_monitor.h"
#if BUILDFLAG(IS_MAC) #if BUILDFLAG(IS_MAC)
#include "base/mac/bundle_locations.h" #include "base/apple/bundle_locations.h"
#endif #endif
namespace { namespace {
base::FilePath GetDefaultMonitorLocation() { base::FilePath GetDefaultMonitorLocation() {
#if BUILDFLAG(IS_MAC) #if BUILDFLAG(IS_MAC)
return base::mac::OuterBundlePath(); return base::apple::OuterBundlePath();
#else #else
return base::PathService::CheckedGet(base::DIR_EXE); return base::PathService::CheckedGet(base::DIR_EXE);
#endif #endif

@@ -13,6 +13,7 @@
#include <string> #include <string>
#include <utility> #include <utility>
#include "base/apple/bundle_locations.h"
#include "base/base_switches.h" #include "base/base_switches.h"
#include "base/check_is_test.h" #include "base/check_is_test.h"
#include "base/command_line.h" #include "base/command_line.h"
@@ -25,7 +26,6 @@
#include "base/functional/callback.h" #include "base/functional/callback.h"
#include "base/functional/callback_helpers.h" #include "base/functional/callback_helpers.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/mac/bundle_locations.h"
#include "base/mac/foundation_util.h" #include "base/mac/foundation_util.h"
#import "base/mac/launch_application.h" #import "base/mac/launch_application.h"
#include "base/mac/mac_util.h" #include "base/mac/mac_util.h"
@@ -382,15 +382,15 @@ base::CommandLine BuildCommandLineForShimLaunch() {
app_mode::kLaunchedByChromeProcessId, app_mode::kLaunchedByChromeProcessId,
base::NumberToString(base::GetCurrentProcId())); base::NumberToString(base::GetCurrentProcId()));
command_line.AppendSwitchPath(app_mode::kLaunchedByChromeBundlePath, command_line.AppendSwitchPath(app_mode::kLaunchedByChromeBundlePath,
base::mac::MainBundlePath()); base::apple::MainBundlePath());
// When running unbundled (e.g, when running browser_tests), the path // When running unbundled (e.g, when running browser_tests), the path
// returned by base::mac::FrameworkBundlePath will not include the version. // returned by base::apple::FrameworkBundlePath will not include the version.
// Manually append it. // Manually append it.
// https://crbug.com/1286681 // https://crbug.com/1286681
const base::FilePath framework_bundle_path = const base::FilePath framework_bundle_path =
base::mac::AmIBundled() ? base::mac::FrameworkBundlePath() base::mac::AmIBundled() ? base::apple::FrameworkBundlePath()
: base::mac::FrameworkBundlePath() : base::apple::FrameworkBundlePath()
.Append("Versions") .Append("Versions")
.Append(version_info::GetVersionNumber()); .Append(version_info::GetVersionNumber());
command_line.AppendSwitchPath(app_mode::kLaunchedByChromeFrameworkBundlePath, command_line.AppendSwitchPath(app_mode::kLaunchedByChromeFrameworkBundlePath,
@@ -1129,7 +1129,8 @@ bool WebAppShortcutCreator::BuildShortcut(
return false; return false;
} }
const base::FilePath framework_bundle_path = base::mac::FrameworkBundlePath(); const base::FilePath framework_bundle_path =
base::apple::FrameworkBundlePath();
const base::FilePath executable_path = const base::FilePath executable_path =
framework_bundle_path.Append("Helpers").Append("app_mode_loader"); framework_bundle_path.Append("Helpers").Append("app_mode_loader");

@@ -8,8 +8,8 @@
#include <tuple> #include <tuple>
#include "base/apple/bundle_locations.h"
#include "base/check.h" #include "base/check.h"
#include "base/mac/bundle_locations.h"
#include "base/no_destructor.h" #include "base/no_destructor.h"
#include "base/strings/sys_string_conversions.h" #include "base/strings/sys_string_conversions.h"
#include "build/branding_buildflags.h" #include "build/branding_buildflags.h"
@@ -68,7 +68,7 @@ ChannelState ParseChannelId(NSString* channel) {
ChannelState DetermineChannelState() { ChannelState DetermineChannelState() {
// Use the main Chrome application bundle and not the framework bundle. // Use the main Chrome application bundle and not the framework bundle.
// Keystone keys don't live in the framework. // Keystone keys don't live in the framework.
NSBundle* bundle = base::mac::OuterBundle(); NSBundle* bundle = base::apple::OuterBundle();
if (![bundle objectForInfoDictionaryKey:@"KSProductID"]) { if (![bundle objectForInfoDictionaryKey:@"KSProductID"]) {
// This build is not Keystone-enabled; it can't have a channel. // This build is not Keystone-enabled; it can't have a channel.
@@ -103,7 +103,7 @@ bool SideBySideCapable() {
static const bool capable = [] { static const bool capable = [] {
// Use the main Chrome application bundle and not the framework bundle. // Use the main Chrome application bundle and not the framework bundle.
// Keystone keys don't live in the framework. // Keystone keys don't live in the framework.
NSBundle* bundle = base::mac::OuterBundle(); NSBundle* bundle = base::apple::OuterBundle();
if (![bundle objectForInfoDictionaryKey:@"KSProductID"]) { if (![bundle objectForInfoDictionaryKey:@"KSProductID"]) {
// This build is not Keystone-enabled, and without a channel assume it is // This build is not Keystone-enabled, and without a channel assume it is
// side-by-side capable. // side-by-side capable.

@@ -29,7 +29,7 @@
#endif #endif
#if BUILDFLAG(IS_MAC) #if BUILDFLAG(IS_MAC)
#include "base/mac/bundle_locations.h" #include "base/apple/bundle_locations.h"
#include "base/mac/foundation_util.h" #include "base/mac/foundation_util.h"
#endif #endif
@@ -236,7 +236,7 @@ bool PathProvider(int key, base::FilePath* result) {
#endif #endif
case chrome::DIR_RESOURCES: case chrome::DIR_RESOURCES:
#if BUILDFLAG(IS_MAC) #if BUILDFLAG(IS_MAC)
cur = base::mac::FrameworkBundlePath(); cur = base::apple::FrameworkBundlePath();
cur = cur.Append(FILE_PATH_LITERAL("Resources")); cur = cur.Append(FILE_PATH_LITERAL("Resources"));
#else #else
if (!base::PathService::Get(base::DIR_ASSETS, &cur)) if (!base::PathService::Get(base::DIR_ASSETS, &cur))
@@ -337,7 +337,7 @@ bool PathProvider(int key, base::FilePath* result) {
case chrome::FILE_RESOURCES_PACK: // Falls through. case chrome::FILE_RESOURCES_PACK: // Falls through.
case chrome::FILE_DEV_UI_RESOURCES_PACK: case chrome::FILE_DEV_UI_RESOURCES_PACK:
#if BUILDFLAG(IS_MAC) #if BUILDFLAG(IS_MAC)
cur = base::mac::FrameworkBundlePath(); cur = base::apple::FrameworkBundlePath();
cur = cur.Append(FILE_PATH_LITERAL("Resources")) cur = cur.Append(FILE_PATH_LITERAL("Resources"))
.Append(FILE_PATH_LITERAL("resources.pak")); .Append(FILE_PATH_LITERAL("resources.pak"));
#elif BUILDFLAG(IS_ANDROID) #elif BUILDFLAG(IS_ANDROID)
@@ -475,7 +475,7 @@ bool PathProvider(int key, base::FilePath* result) {
return false; return false;
#else #else
#if BUILDFLAG(IS_MAC) #if BUILDFLAG(IS_MAC)
cur = base::mac::FrameworkBundlePath(); cur = base::apple::FrameworkBundlePath();
cur = cur.Append(FILE_PATH_LITERAL("Default Apps")); cur = cur.Append(FILE_PATH_LITERAL("Default Apps"));
#else #else
if (!base::PathService::Get(base::DIR_MODULE, &cur)) if (!base::PathService::Get(base::DIR_MODULE, &cur))

@@ -84,7 +84,7 @@ std::string ProductDirName() {
// in the main app's bundle because it will be set differently on the canary // in the main app's bundle because it will be set differently on the canary
// channel, and the autoupdate system dictates that there can be no // channel, and the autoupdate system dictates that there can be no
// differences between channels within the versioned directory. This would // differences between channels within the versioned directory. This would
// normally use base::mac::FrameworkBundle(), but that references the // normally use base::apple::FrameworkBundle(), but that references the
// framework bundle within the versioned directory. Ordinarily, the profile // framework bundle within the versioned directory. Ordinarily, the profile
// should not be accessed from non-browser processes, but those processes do // should not be accessed from non-browser processes, but those processes do
// attempt to get the profile directory, so direct them to look in the outer // attempt to get the profile directory, so direct them to look in the outer

@@ -16,7 +16,7 @@
#include "chrome/common/chrome_version.h" #include "chrome/common/chrome_version.h"
#if BUILDFLAG(IS_MAC) #if BUILDFLAG(IS_MAC)
#include "base/mac/bundle_locations.h" #include "base/apple/bundle_locations.h"
#endif #endif
#if BUILDFLAG(GOOGLE_CHROME_BRANDING) #if BUILDFLAG(GOOGLE_CHROME_BRANDING)
@@ -75,7 +75,7 @@ void AddCdmHostFilePaths(
#elif BUILDFLAG(IS_MAC) #elif BUILDFLAG(IS_MAC)
base::FilePath framework_dir = base::mac::FrameworkBundlePath(); base::FilePath framework_dir = base::apple::FrameworkBundlePath();
base::FilePath chrome_framework_path = base::FilePath chrome_framework_path =
framework_dir.Append(chrome::kFrameworkExecutableName); framework_dir.Append(chrome::kFrameworkExecutableName);
// The signature file lives inside // The signature file lives inside

@@ -9,8 +9,8 @@
#include <utility> #include <utility>
#include <vector> #include <vector>
#include "base/apple/bundle_locations.h"
#include "base/barrier_closure.h" #include "base/barrier_closure.h"
#include "base/mac/bundle_locations.h"
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/strings/sys_string_conversions.h" #include "base/strings/sys_string_conversions.h"
#include "base/test/bind.h" #include "base/test/bind.h"

@@ -8,7 +8,7 @@
#include <utility> #include <utility>
#include <vector> #include <vector>
#include "base/mac/bundle_locations.h" #include "base/apple/bundle_locations.h"
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/strings/sys_string_conversions.h" #include "base/strings/sys_string_conversions.h"
#include "base/test/bind.h" #include "base/test/bind.h"
@@ -488,7 +488,7 @@ TEST_F(MacNotificationServiceUNTest, LogsMetricsForAlerts) {
if (@available(macOS 10.14, *)) { if (@available(macOS 10.14, *)) {
base::HistogramTester histogram_tester; base::HistogramTester histogram_tester;
id mainBundleMock = id mainBundleMock =
[OCMockObject partialMockForObject:base::mac::MainBundle()]; [OCMockObject partialMockForObject:base::apple::MainBundle()];
// Mock the alert style to "alert" and verify we log the correct metrics. // Mock the alert style to "alert" and verify we log the correct metrics.
[[[mainBundleMock stub] [[[mainBundleMock stub]
@@ -513,7 +513,7 @@ TEST_F(MacNotificationServiceUNTest, LogsMetricsForBanners) {
if (@available(macOS 10.14, *)) { if (@available(macOS 10.14, *)) {
base::HistogramTester histogram_tester; base::HistogramTester histogram_tester;
id mainBundleMock = id mainBundleMock =
[OCMockObject partialMockForObject:base::mac::MainBundle()]; [OCMockObject partialMockForObject:base::apple::MainBundle()];
// Mock the alert style to "banner" and verify we log the correct metrics. // Mock the alert style to "banner" and verify we log the correct metrics.
[[[mainBundleMock stub] [[[mainBundleMock stub]

@@ -6,7 +6,7 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#include "base/mac/bundle_locations.h" #include "base/apple/bundle_locations.h"
#include "base/metrics/histogram_functions.h" #include "base/metrics/histogram_functions.h"
#include "base/strings/strcat.h" #include "base/strings/strcat.h"
@@ -17,7 +17,7 @@
namespace mac_notifications { namespace mac_notifications {
bool IsAppBundleAlertStyle() { bool IsAppBundleAlertStyle() {
NSDictionary* infoDictionary = [base::mac::MainBundle() infoDictionary]; NSDictionary* infoDictionary = [base::apple::MainBundle() infoDictionary];
NSString* alertStyle = infoDictionary[@"NSUserNotificationAlertStyle"]; NSString* alertStyle = infoDictionary[@"NSUserNotificationAlertStyle"];
return [alertStyle isEqualToString:@"alert"]; return [alertStyle isEqualToString:@"alert"];
} }

@@ -45,7 +45,7 @@
#include "ui/base/test/ui_controls.h" #include "ui/base/test/ui_controls.h"
#if BUILDFLAG(IS_MAC) #if BUILDFLAG(IS_MAC)
#include "base/mac/bundle_locations.h" #include "base/apple/bundle_locations.h"
#include "chrome/browser/chrome_browser_application_mac.h" #include "chrome/browser/chrome_browser_application_mac.h"
#endif // BUILDFLAG(IS_MAC) #endif // BUILDFLAG(IS_MAC)
@@ -254,7 +254,7 @@ int LaunchChromeTests(size_t parallel_jobs,
base::FilePath path; base::FilePath path;
CHECK(base::PathService::Get(base::DIR_EXE, &path)); CHECK(base::PathService::Get(base::DIR_EXE, &path));
path = path.Append(chrome::kFrameworkName); path = path.Append(chrome::kFrameworkName);
base::mac::SetOverrideFrameworkBundlePath(path); base::apple::SetOverrideFrameworkBundlePath(path);
#endif #endif
#if BUILDFLAG(IS_WIN) #if BUILDFLAG(IS_WIN)

@@ -40,7 +40,7 @@
#endif // BUILDFLAG(IS_CHROMEOS_LACROS) #endif // BUILDFLAG(IS_CHROMEOS_LACROS)
#if BUILDFLAG(IS_MAC) #if BUILDFLAG(IS_MAC)
#include "base/mac/bundle_locations.h" #include "base/apple/bundle_locations.h"
#include "base/mac/scoped_nsautorelease_pool.h" #include "base/mac/scoped_nsautorelease_pool.h"
#include "chrome/browser/chrome_browser_application_mac.h" #include "chrome/browser/chrome_browser_application_mac.h"
#endif #endif
@@ -107,7 +107,7 @@ void ChromeTestSuite::Initialize() {
base::FilePath path; base::FilePath path;
base::PathService::Get(base::DIR_EXE, &path); base::PathService::Get(base::DIR_EXE, &path);
path = path.Append(chrome::kFrameworkName); path = path.Append(chrome::kFrameworkName);
base::mac::SetOverrideFrameworkBundlePath(path); base::apple::SetOverrideFrameworkBundlePath(path);
#endif #endif
#if BUILDFLAG(IS_CHROMEOS_LACROS) #if BUILDFLAG(IS_CHROMEOS_LACROS)
@@ -132,7 +132,7 @@ void ChromeTestSuite::Initialize() {
void ChromeTestSuite::Shutdown() { void ChromeTestSuite::Shutdown() {
#if BUILDFLAG(IS_MAC) #if BUILDFLAG(IS_MAC)
base::mac::SetOverrideFrameworkBundlePath({}); base::apple::SetOverrideFrameworkBundlePath({});
#endif #endif
content::ContentTestSuiteBase::Shutdown(); content::ContentTestSuiteBase::Shutdown();

@@ -7,13 +7,13 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "base/apple/bundle_locations.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/files/file.h" #include "base/files/file.h"
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/files/file_util.h" #include "base/files/file_util.h"
#include "base/functional/callback.h" #include "base/functional/callback.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/mac/bundle_locations.h"
#include "base/mac/foundation_util.h" #include "base/mac/foundation_util.h"
#include "base/process/launch.h" #include "base/process/launch.h"
#include "base/process/process.h" #include "base/process/process.h"
@@ -114,7 +114,7 @@ bool CopyKeystoneBundle(UpdaterScope scope) {
// The Keystone Bundle is in // The Keystone Bundle is in
// GoogleUpdater.app/Contents/Helpers/GoogleSoftwareUpdate.bundle. // GoogleUpdater.app/Contents/Helpers/GoogleSoftwareUpdate.bundle.
base::FilePath keystone_bundle_path = base::FilePath keystone_bundle_path =
base::mac::OuterBundlePath() base::apple::OuterBundlePath()
.Append(FILE_PATH_LITERAL("Contents")) .Append(FILE_PATH_LITERAL("Contents"))
.Append(FILE_PATH_LITERAL("Helpers")) .Append(FILE_PATH_LITERAL("Helpers"))
.Append(FILE_PATH_LITERAL(KEYSTONE_NAME ".bundle")); .Append(FILE_PATH_LITERAL(KEYSTONE_NAME ".bundle"));

@@ -9,13 +9,13 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <unistd.h> #include <unistd.h>
#include "base/apple/bundle_locations.h"
#include "base/at_exit.h" #include "base/at_exit.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/debug/dump_without_crashing.h" #include "base/debug/dump_without_crashing.h"
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/files/file_util.h" #include "base/files/file_util.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/mac/bundle_locations.h"
#include "base/mac/foundation_util.h" #include "base/mac/foundation_util.h"
#include "base/path_service.h" #include "base/path_service.h"
#include "base/process/launch.h" #include "base/process/launch.h"
@@ -86,7 +86,7 @@ bool CopyBundle(UpdaterScope scope) {
} }
} }
if (!CopyDir(base::mac::OuterBundlePath(), *versioned_install_dir, if (!CopyDir(base::apple::OuterBundlePath(), *versioned_install_dir,
scope == UpdaterScope::kSystem)) { scope == UpdaterScope::kSystem)) {
LOG(ERROR) << "Copying app to '" << versioned_install_dir->value().c_str() LOG(ERROR) << "Copying app to '" << versioned_install_dir->value().c_str()
<< "' failed"; << "' failed";

@@ -4,7 +4,7 @@
#import "components/autofill/ios/browser/autofill_agent.h" #import "components/autofill/ios/browser/autofill_agent.h"
#include "base/mac/bundle_locations.h" #include "base/apple/bundle_locations.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#import "base/test/ios/wait_util.h" #import "base/test/ios/wait_util.h"

@@ -40,7 +40,7 @@
#include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/abseil-cpp/absl/types/optional.h"
#if BUILDFLAG(IS_APPLE) #if BUILDFLAG(IS_APPLE)
#include "base/mac/backup_util.h" #include "base/apple/backup_util.h"
#endif #endif
namespace component_updater { namespace component_updater {
@@ -173,7 +173,7 @@ Result ComponentInstaller::InstallHelper(const base::FilePath& unpack_path,
#if BUILDFLAG(IS_APPLE) #if BUILDFLAG(IS_APPLE)
// Since components can be large and can be re-downloaded when needed, they // Since components can be large and can be re-downloaded when needed, they
// are excluded from backups. // are excluded from backups.
base::mac::SetBackupExclusion(local_install_path); base::apple::SetBackupExclusion(local_install_path);
#endif #endif
const Result result = const Result result =

@@ -7,7 +7,7 @@
#include <vector> #include <vector>
#include "base/apple/bridging.h" #include "base/apple/bridging.h"
#include "base/mac/bundle_locations.h" #include "base/apple/bundle_locations.h"
#include "base/mac/foundation_util.h" #include "base/mac/foundation_util.h"
#include "base/strings/sys_string_conversions.h" #include "base/strings/sys_string_conversions.h"
#include "build/branding_buildflags.h" #include "build/branding_buildflags.h"
@@ -32,7 +32,7 @@ const std::map<std::string, std::string>& GetProcessSimpleAnnotations() {
static std::map<std::string, std::string> annotations = []() -> auto { static std::map<std::string, std::string> annotations = []() -> auto {
std::map<std::string, std::string> process_annotations; std::map<std::string, std::string> process_annotations;
@autoreleasepool { @autoreleasepool {
NSBundle* outer_bundle = base::mac::OuterBundle(); NSBundle* outer_bundle = base::apple::OuterBundle();
#if BUILDFLAG(GOOGLE_CHROME_BRANDING) #if BUILDFLAG(GOOGLE_CHROME_BRANDING)
process_annotations["prod"] = "Chrome_iOS"; process_annotations["prod"] = "Chrome_iOS";
#else #else
@@ -56,7 +56,7 @@ const std::map<std::string, std::string>& GetProcessSimpleAnnotations() {
channel = @"developer"; channel = @"developer";
process_annotations["channel"] = base::SysNSStringToUTF8(channel); process_annotations["channel"] = base::SysNSStringToUTF8(channel);
NSString* version = NSString* version =
base::mac::ObjCCast<NSString>([base::mac::FrameworkBundle() base::mac::ObjCCast<NSString>([base::apple::FrameworkBundle()
objectForInfoDictionaryKey:@"CFBundleVersion"]); objectForInfoDictionaryKey:@"CFBundleVersion"]);
process_annotations["ver"] = base::SysNSStringToUTF8(version); process_annotations["ver"] = base::SysNSStringToUTF8(version);
process_annotations["plat"] = std::string("iOS"); process_annotations["plat"] = std::string("iOS");

@@ -13,9 +13,9 @@
#include <vector> #include <vector>
#include "base/apple/bridging.h" #include "base/apple/bridging.h"
#include "base/apple/bundle_locations.h"
#include "base/check.h" #include "base/check.h"
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/mac/bundle_locations.h"
#include "base/mac/foundation_util.h" #include "base/mac/foundation_util.h"
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "base/strings/string_piece.h" #include "base/strings/string_piece.h"
@@ -42,7 +42,7 @@ std::map<std::string, std::string> GetProcessSimpleAnnotations() {
static std::map<std::string, std::string> annotations = []() -> auto { static std::map<std::string, std::string> annotations = []() -> auto {
std::map<std::string, std::string> process_annotations; std::map<std::string, std::string> process_annotations;
@autoreleasepool { @autoreleasepool {
NSBundle* outer_bundle = base::mac::OuterBundle(); NSBundle* outer_bundle = base::apple::OuterBundle();
#if BUILDFLAG(GOOGLE_CHROME_BRANDING) #if BUILDFLAG(GOOGLE_CHROME_BRANDING)
process_annotations["prod"] = "Chrome_Mac"; process_annotations["prod"] = "Chrome_Mac";
#else #else
@@ -83,7 +83,7 @@ std::map<std::string, std::string> GetProcessSimpleAnnotations() {
} }
NSString* version = NSString* version =
base::mac::ObjCCast<NSString>([base::mac::FrameworkBundle() base::mac::ObjCCast<NSString>([base::apple::FrameworkBundle()
objectForInfoDictionaryKey:@"CFBundleShortVersionString"]); objectForInfoDictionaryKey:@"CFBundleShortVersionString"]);
process_annotations["ver"] = base::SysNSStringToUTF8(version); process_annotations["ver"] = base::SysNSStringToUTF8(version);
@@ -147,7 +147,7 @@ bool PlatformCrashpadInitialization(
if (initial_client) { if (initial_client) {
@autoreleasepool { @autoreleasepool {
base::FilePath framework_bundle_path = base::mac::FrameworkBundlePath(); base::FilePath framework_bundle_path = base::apple::FrameworkBundlePath();
base::FilePath handler_path = base::FilePath handler_path =
framework_bundle_path.Append("Helpers").Append( framework_bundle_path.Append("Helpers").Append(
"chrome_crashpad_handler"); "chrome_crashpad_handler");

@@ -7,9 +7,9 @@
#include <memory> #include <memory>
#include <vector> #include <vector>
#include "base/apple/bundle_locations.h"
#include "base/lazy_instance.h" #include "base/lazy_instance.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/mac/bundle_locations.h"
#include "base/strings/sys_string_conversions.h" #include "base/strings/sys_string_conversions.h"
#include "base/synchronization/lock.h" #include "base/synchronization/lock.h"
#import "base/task/single_thread_task_runner.h" #import "base/task/single_thread_task_runner.h"

@@ -32,7 +32,7 @@
#include "url/origin.h" #include "url/origin.h"
#if BUILDFLAG(IS_APPLE) #if BUILDFLAG(IS_APPLE)
#include "base/mac/backup_util.h" #include "base/apple/backup_util.h"
#endif #endif
namespace favicon { namespace favicon {
@@ -1049,7 +1049,7 @@ sql::InitStatus FaviconDatabase::InitImpl(const base::FilePath& db_name) {
#if BUILDFLAG(IS_APPLE) #if BUILDFLAG(IS_APPLE)
// Exclude the favicons file from backups. // Exclude the favicons file from backups.
base::mac::SetBackupExclusion(db_name); base::apple::SetBackupExclusion(db_name);
#endif #endif
// thumbnails table has been obsolete for a long time, remove any detritus. // thumbnails table has been obsolete for a long time, remove any detritus.

@@ -29,7 +29,7 @@
#include "sql/transaction.h" #include "sql/transaction.h"
#if BUILDFLAG(IS_APPLE) #if BUILDFLAG(IS_APPLE)
#include "base/mac/backup_util.h" #include "base/apple/backup_util.h"
#endif #endif
namespace history { namespace history {
@@ -117,7 +117,7 @@ sql::InitStatus HistoryDatabase::Init(const base::FilePath& history_name) {
#if BUILDFLAG(IS_APPLE) #if BUILDFLAG(IS_APPLE)
// Exclude the history file from backups. // Exclude the history file from backups.
base::mac::SetBackupExclusion(history_name); base::apple::SetBackupExclusion(history_name);
#endif #endif
// Prime the cache. // Prime the cache.

@@ -16,7 +16,7 @@
#include "components/optimization_guide/proto/page_entities_model_metadata.pb.h" #include "components/optimization_guide/proto/page_entities_model_metadata.pb.h"
#if BUILDFLAG(IS_MAC) #if BUILDFLAG(IS_MAC)
#include "base/mac/bundle_locations.h" #include "base/apple/bundle_locations.h"
#include "base/mac/foundation_util.h" #include "base/mac/foundation_util.h"
#endif #endif
@@ -87,7 +87,7 @@ EntityAnnotatorNativeLibrary::Create(bool should_provide_filter_path) {
#if !BUILDFLAG(IS_ANDROID) #if !BUILDFLAG(IS_ANDROID)
#if BUILDFLAG(IS_MAC) #if BUILDFLAG(IS_MAC)
if (base::mac::AmIBundled()) { if (base::mac::AmIBundled()) {
base_dir = base::mac::FrameworkBundlePath().Append("Libraries"); base_dir = base::apple::FrameworkBundlePath().Append("Libraries");
} else { } else {
#endif // BUILDFLAG(IS_MAC) #endif // BUILDFLAG(IS_MAC)
if (!base::PathService::Get(base::DIR_MODULE, &base_dir)) { if (!base::PathService::Get(base::DIR_MODULE, &base_dir)) {

@@ -6,7 +6,7 @@
#include <stddef.h> #include <stddef.h>
#include "base/mac/bundle_locations.h" #include "base/apple/bundle_locations.h"
#include "base/strings/sys_string_conversions.h" #include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/test/ios/wait_util.h" #include "base/test/ios/wait_util.h"

@@ -21,7 +21,7 @@
#include "components/safe_browsing/core/common/proto/webui.pb.h" #include "components/safe_browsing/core/common/proto/webui.pb.h"
#if BUILDFLAG(IS_APPLE) #if BUILDFLAG(IS_APPLE)
#include "base/mac/backup_util.h" #include "base/apple/backup_util.h"
#endif #endif
using base::TimeTicks; using base::TimeTicks;
@@ -111,7 +111,7 @@ void V4Database::CreateOnTaskRunner(
} }
#if BUILDFLAG(IS_APPLE) #if BUILDFLAG(IS_APPLE)
base::mac::SetBackupExclusion(base_path); base::apple::SetBackupExclusion(base_path);
#endif #endif
std::unique_ptr<StoreMap> store_map = std::make_unique<StoreMap>(); std::unique_ptr<StoreMap> store_map = std::make_unique<StoreMap>();

@@ -6,9 +6,9 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#include "base/apple/bundle_locations.h"
#include "base/check.h" #include "base/check.h"
#import "base/logging.h" #import "base/logging.h"
#include "base/mac/bundle_locations.h"
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
#import "base/strings/sys_string_conversions.h" #import "base/strings/sys_string_conversions.h"
#import "base/strings/utf_string_conversions.h" #import "base/strings/utf_string_conversions.h"
@@ -25,8 +25,8 @@ namespace {
NSString* GetPageScript(NSString* script_file_name) { NSString* GetPageScript(NSString* script_file_name) {
DCHECK(script_file_name); DCHECK(script_file_name);
NSString* path = NSString* path =
[base::mac::FrameworkBundle() pathForResource:script_file_name [base::apple::FrameworkBundle() pathForResource:script_file_name
ofType:@"js"]; ofType:@"js"];
DCHECK(path) << "Script file not found: " DCHECK(path) << "Script file not found: "
<< base::SysNSStringToUTF8(script_file_name) << ".js"; << base::SysNSStringToUTF8(script_file_name) << ".js";
NSError* error = nil; NSError* error = nil;

@@ -6,11 +6,11 @@
#include <unistd.h> #include <unistd.h>
#include "base/apple/bundle_locations.h"
#include "base/check.h" #include "base/check.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/feature_list.h" #include "base/feature_list.h"
#include "base/files/file_util.h" #include "base/files/file_util.h"
#include "base/mac/bundle_locations.h"
#include "base/mac/foundation_util.h" #include "base/mac/foundation_util.h"
#include "base/mac/mac_util.h" #include "base/mac/mac_util.h"
#include "base/no_destructor.h" #include "base/no_destructor.h"
@@ -104,11 +104,11 @@ void SetupCommonSandboxParameters(
sandbox::policy::kParamDisableSandboxDenialLogging, !enable_logging)); sandbox::policy::kParamDisableSandboxDenialLogging, !enable_logging));
std::string bundle_path = std::string bundle_path =
sandbox::policy::GetCanonicalPath(base::mac::MainBundlePath()).value(); sandbox::policy::GetCanonicalPath(base::apple::MainBundlePath()).value();
CHECK(compiler->SetParameter(sandbox::policy::kParamBundlePath, bundle_path)); CHECK(compiler->SetParameter(sandbox::policy::kParamBundlePath, bundle_path));
std::string bundle_id = base::mac::BaseBundleID(); std::string bundle_id = base::mac::BaseBundleID();
DCHECK(!bundle_id.empty()) << "base::mac::OuterBundle is unset"; DCHECK(!bundle_id.empty()) << "base::apple::OuterBundle is unset";
CHECK(compiler->SetParameter(sandbox::policy::kParamBundleId, bundle_id)); CHECK(compiler->SetParameter(sandbox::policy::kParamBundleId, bundle_id));
CHECK(compiler->SetParameter(sandbox::policy::kParamBrowserPid, CHECK(compiler->SetParameter(sandbox::policy::kParamBrowserPid,
@@ -124,7 +124,7 @@ void SetupCommonSandboxParameters(
#if defined(COMPONENT_BUILD) #if defined(COMPONENT_BUILD)
// For component builds, allow access to one directory level higher, where // For component builds, allow access to one directory level higher, where
// the dylibs live. // the dylibs live.
base::FilePath component_path = base::mac::MainBundlePath().Append(".."); base::FilePath component_path = base::apple::MainBundlePath().Append("..");
std::string component_path_canonical = std::string component_path_canonical =
sandbox::policy::GetCanonicalPath(component_path).value(); sandbox::policy::GetCanonicalPath(component_path).value();
CHECK(compiler->SetParameter(sandbox::policy::kParamComponentPath, CHECK(compiler->SetParameter(sandbox::policy::kParamComponentPath,
@@ -182,7 +182,7 @@ void SetupPPAPISandboxParameters(
SetupCommonSandboxParameters(compiler, command_line); SetupCommonSandboxParameters(compiler, command_line);
base::FilePath bundle_path = base::FilePath bundle_path =
sandbox::policy::GetCanonicalPath(base::mac::MainBundlePath()); sandbox::policy::GetCanonicalPath(base::apple::MainBundlePath());
const std::string param_base_name = "PPAPI_PATH_"; const std::string param_base_name = "PPAPI_PATH_";
int index = 0; int index = 0;

@@ -9,7 +9,7 @@
#include "build/build_config.h" #include "build/build_config.h"
#if BUILDFLAG(IS_MAC) #if BUILDFLAG(IS_MAC)
#include "base/mac/bundle_locations.h" #include "base/apple/bundle_locations.h"
#endif #endif
namespace content { namespace content {

@@ -13,9 +13,9 @@
#include <sys/types.h> #include <sys/types.h>
#include <unistd.h> #include <unistd.h>
#include "base/apple/bundle_locations.h"
#include "base/files/file_util.h" #include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h" #include "base/files/scoped_temp_dir.h"
#include "base/mac/bundle_locations.h"
#include "base/mac/mac_util.h" #include "base/mac/mac_util.h"
#include "base/process/kill.h" #include "base/process/kill.h"
#include "base/system/sys_info.h" #include "base/system/sys_info.h"
@@ -57,7 +57,7 @@ void SetParametersForTest(sandbox::SandboxCompiler* compiler,
base::NumberToString(os_version))); base::NumberToString(os_version)));
std::string bundle_path = std::string bundle_path =
sandbox::policy::GetCanonicalPath(base::mac::MainBundlePath()).value(); sandbox::policy::GetCanonicalPath(base::apple::MainBundlePath()).value();
CHECK(compiler->SetParameter(sandbox::policy::kParamBundlePath, bundle_path)); CHECK(compiler->SetParameter(sandbox::policy::kParamBundlePath, bundle_path));
CHECK(compiler->SetParameter(sandbox::policy::kParamBundleId, CHECK(compiler->SetParameter(sandbox::policy::kParamBundleId,
@@ -139,7 +139,7 @@ MULTIPROCESS_TEST_MAIN(SandboxProfileProcess) {
CHECK_NE(BOOTSTRAP_SUCCESS, status); CHECK_NE(BOOTSTRAP_SUCCESS, status);
// Read bundle contents. // Read bundle contents.
base::FilePath bundle_path = base::mac::MainBundlePath(); base::FilePath bundle_path = base::apple::MainBundlePath();
struct stat st; struct stat st;
CHECK_NE(-1, stat(bundle_path.value().c_str(), &st)); CHECK_NE(-1, stat(bundle_path.value().c_str(), &st));

@@ -9,10 +9,10 @@ namespace base {
class FilePath; class FilePath;
} }
// Sets up base::mac::FrameworkBundle. // Sets up base::apple::FrameworkBundle.
void OverrideFrameworkBundlePath(); void OverrideFrameworkBundlePath();
// Set up base::mac::OuterBundle. // Set up base::apple::OuterBundle.
void OverrideOuterBundlePath(); void OverrideOuterBundlePath();
// Sets up the CHILD_PROCESS_EXE path to properly point to the helper app. // Sets up the CHILD_PROCESS_EXE path to properly point to the helper app.

@@ -4,8 +4,8 @@
#include "content/shell/app/paths_mac.h" #include "content/shell/app/paths_mac.h"
#include "base/apple/bundle_locations.h"
#include "base/base_paths.h" #include "base/base_paths.h"
#include "base/mac/bundle_locations.h"
#include "base/mac/foundation_util.h" #include "base/mac/foundation_util.h"
#include "base/path_service.h" #include "base/path_service.h"
#include "content/public/common/content_paths.h" #include "content/public/common/content_paths.h"
@@ -52,17 +52,17 @@ void OverrideFrameworkBundlePath() {
base::FilePath helper_path = base::FilePath helper_path =
GetFrameworksPath().Append("Content Shell Framework.framework"); GetFrameworksPath().Append("Content Shell Framework.framework");
base::mac::SetOverrideFrameworkBundlePath(helper_path); base::apple::SetOverrideFrameworkBundlePath(helper_path);
} }
void OverrideOuterBundlePath() { void OverrideOuterBundlePath() {
base::FilePath path = GetContentsPath().DirName(); base::FilePath path = GetContentsPath().DirName();
base::mac::SetOverrideOuterBundlePath(path); base::apple::SetOverrideOuterBundlePath(path);
} }
void OverrideChildProcessPath() { void OverrideChildProcessPath() {
base::FilePath helper_path = base::mac::FrameworkBundlePath() base::FilePath helper_path = base::apple::FrameworkBundlePath()
.Append("Helpers") .Append("Helpers")
.Append("Content Shell Helper.app") .Append("Content Shell Helper.app")
.Append("Contents") .Append("Contents")
@@ -85,8 +85,8 @@ void OverrideSourceRootPath() {
base::FilePath GetResourcesPakFilePath() { base::FilePath GetResourcesPakFilePath() {
NSString* pak_path = NSString* pak_path =
[base::mac::FrameworkBundle() pathForResource:@"content_shell" [base::apple::FrameworkBundle() pathForResource:@"content_shell"
ofType:@"pak"]; ofType:@"pak"];
return base::FilePath([pak_path fileSystemRepresentation]); return base::FilePath([pak_path fileSystemRepresentation]);
} }

@@ -6,10 +6,10 @@
#include <unistd.h> #include <unistd.h>
#include "base/apple/bundle_locations.h"
#include "base/check.h" #include "base/check.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/mac/bundle_locations.h"
#include "base/mac/foundation_util.h" #include "base/mac/foundation_util.h"
#include "base/strings/sys_string_conversions.h" #include "base/strings/sys_string_conversions.h"
#include "content/public/common/content_switches.h" #include "content/public/common/content_switches.h"
@@ -62,7 +62,7 @@ void EnsureCorrectResolutionSettings() {
} }
void OverrideBundleID() { void OverrideBundleID() {
NSBundle* bundle = base::mac::OuterBundle(); NSBundle* bundle = base::apple::OuterBundle();
base::mac::SetBaseBundleID( base::mac::SetBaseBundleID(
base::SysNSStringToUTF8([bundle bundleIdentifier]).c_str()); base::SysNSStringToUTF8([bundle bundleIdentifier]).c_str());
} }

@@ -6,7 +6,7 @@
#import <Cocoa/Cocoa.h> #import <Cocoa/Cocoa.h>
#include "base/mac/bundle_locations.h" #include "base/apple/bundle_locations.h"
#if !defined(__has_feature) || !__has_feature(objc_arc) #if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support." #error "This file requires ARC support."

@@ -19,7 +19,7 @@
#include "ui/display/display.h" #include "ui/display/display.h"
#if BUILDFLAG(IS_MAC) #if BUILDFLAG(IS_MAC)
#include "base/mac/bundle_locations.h" #include "base/apple/bundle_locations.h"
#include "base/mac/foundation_util.h" #include "base/mac/foundation_util.h"
#endif #endif
@@ -113,7 +113,7 @@ static base::FilePath GetBuildDirectory() {
if (base::mac::AmIBundled()) { if (base::mac::AmIBundled()) {
// If this is a bundled Content Shell.app, go up one from the outer bundle // If this is a bundled Content Shell.app, go up one from the outer bundle
// directory. // directory.
return base::mac::OuterBundlePath().DirName(); return base::apple::OuterBundlePath().DirName();
} }
#endif #endif

@@ -6,7 +6,7 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#include "base/mac/bundle_locations.h" #include "base/apple/bundle_locations.h"
#include "base/mac/foundation_util.h" #include "base/mac/foundation_util.h"
#include "base/strings/sys_string_conversions.h" #include "base/strings/sys_string_conversions.h"
@@ -19,7 +19,7 @@ namespace google_apis {
std::string GetAPIKeyFromInfoPlist(const std::string& key_name) { std::string GetAPIKeyFromInfoPlist(const std::string& key_name) {
NSString* keyName = base::SysUTF8ToNSString(key_name); NSString* keyName = base::SysUTF8ToNSString(key_name);
NSString* keyValue = base::mac::ObjCCast<NSString>( NSString* keyValue = base::mac::ObjCCast<NSString>(
[base::mac::FrameworkBundle() objectForInfoDictionaryKey:keyName]); [base::apple::FrameworkBundle() objectForInfoDictionaryKey:keyName]);
return base::SysNSStringToUTF8(keyValue); return base::SysNSStringToUTF8(keyValue);
} }

@@ -12,7 +12,7 @@
#include "google_apis/google_api_keys_unittest.h" #include "google_apis/google_api_keys_unittest.h"
#include "base/mac/bundle_locations.h" #include "base/apple/bundle_locations.h"
#include "build/branding_buildflags.h" #include "build/branding_buildflags.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "google_apis/gaia/gaia_switches.h" #include "google_apis/gaia/gaia_switches.h"
@@ -89,13 +89,13 @@ TEST_F(GoogleAPIKeysTest, OverrideSomeKeysUsingInfoPlist) {
[[[mock_bundle stub] andReturn:@"plist-ID_MAIN"] [[[mock_bundle stub] andReturn:@"plist-ID_MAIN"]
objectForInfoDictionaryKey:@"GOOGLE_CLIENT_ID_MAIN"]; objectForInfoDictionaryKey:@"GOOGLE_CLIENT_ID_MAIN"];
[[[mock_bundle stub] andReturn:nil] objectForInfoDictionaryKey:[OCMArg any]]; [[[mock_bundle stub] andReturn:nil] objectForInfoDictionaryKey:[OCMArg any]];
base::mac::SetOverrideFrameworkBundle(mock_bundle); base::apple::SetOverrideFrameworkBundle(mock_bundle);
EXPECT_TRUE(testcase::HasAPIKeyConfigured()); EXPECT_TRUE(testcase::HasAPIKeyConfigured());
EXPECT_TRUE(testcase::HasOAuthClientConfigured()); EXPECT_TRUE(testcase::HasOAuthClientConfigured());
// Once the keys have been configured, the bundle isn't used anymore. // Once the keys have been configured, the bundle isn't used anymore.
base::mac::SetOverrideFrameworkBundle(nil); base::apple::SetOverrideFrameworkBundle(nil);
std::string api_key = testcase::g_api_key_cache.Get().api_key(); std::string api_key = testcase::g_api_key_cache.Get().api_key();
std::string id_main = std::string id_main =

@@ -13,7 +13,7 @@
#include "gpu/config/gpu_preferences.h" #include "gpu/config/gpu_preferences.h"
#if BUILDFLAG(IS_MAC) #if BUILDFLAG(IS_MAC)
#include "base/mac/bundle_locations.h" #include "base/apple/bundle_locations.h"
#include "base/mac/foundation_util.h" #include "base/mac/foundation_util.h"
#endif #endif
@@ -27,7 +27,7 @@ std::unique_ptr<DawnInstance> DawnInstance::Create(
base::FilePath module_path; base::FilePath module_path;
#if BUILDFLAG(IS_MAC) #if BUILDFLAG(IS_MAC)
if (base::mac::AmIBundled()) { if (base::mac::AmIBundled()) {
dawn_search_path = base::mac::FrameworkBundlePath() dawn_search_path = base::apple::FrameworkBundlePath()
.Append("Libraries") .Append("Libraries")
.AsEndingWithSeparator() .AsEndingWithSeparator()
.MaybeAsASCII(); .MaybeAsASCII();

@@ -42,7 +42,7 @@
#include "ui/gl/init/gl_factory.h" #include "ui/gl/init/gl_factory.h"
#if BUILDFLAG(IS_MAC) #if BUILDFLAG(IS_MAC)
#include "base/mac/bundle_locations.h" #include "base/apple/bundle_locations.h"
#include "base/mac/foundation_util.h" #include "base/mac/foundation_util.h"
#endif #endif
@@ -654,7 +654,7 @@ void CollectDawnInfo(const gpu::GpuPreferences& gpu_preferences,
base::FilePath module_path; base::FilePath module_path;
#if BUILDFLAG(IS_MAC) #if BUILDFLAG(IS_MAC)
if (base::mac::AmIBundled()) { if (base::mac::AmIBundled()) {
dawn_search_path = base::mac::FrameworkBundlePath() dawn_search_path = base::apple::FrameworkBundlePath()
.Append("Libraries") .Append("Libraries")
.AsEndingWithSeparator() .AsEndingWithSeparator()
.MaybeAsASCII(); .MaybeAsASCII();

@@ -4,12 +4,12 @@
#import "ios/chrome/app/dump_documents_statistics.h" #import "ios/chrome/app/dump_documents_statistics.h"
#import "base/apple/backup_util.h"
#import "base/files/file.h" #import "base/files/file.h"
#import "base/files/file_enumerator.h" #import "base/files/file_enumerator.h"
#import "base/files/file_path.h" #import "base/files/file_path.h"
#import "base/files/file_util.h" #import "base/files/file_util.h"
#import "base/json/json_writer.h" #import "base/json/json_writer.h"
#import "base/mac/backup_util.h"
#import "base/mac/foundation_util.h" #import "base/mac/foundation_util.h"
#import "base/strings/stringprintf.h" #import "base/strings/stringprintf.h"
#import "base/strings/sys_string_conversions.h" #import "base/strings/sys_string_conversions.h"
@@ -70,7 +70,7 @@ base::Value::Dict CollectFileStatistics(base::FilePath root) {
statistics.Set("created", TimeToLocalString(info.creation_time)); statistics.Set("created", TimeToLocalString(info.creation_time));
statistics.Set("modified", TimeToLocalString(info.last_modified)); statistics.Set("modified", TimeToLocalString(info.last_modified));
statistics.Set("excludedFromBackups", base::mac::GetBackupExclusion(root)); statistics.Set("excludedFromBackups", base::apple::GetBackupExclusion(root));
return statistics; return statistics;
} }

@@ -6,10 +6,10 @@
#import <memory> #import <memory>
#import "base/apple/bundle_locations.h"
#import "base/feature_list.h" #import "base/feature_list.h"
#import "base/functional/callback.h" #import "base/functional/callback.h"
#import "base/ios/ios_util.h" #import "base/ios/ios_util.h"
#import "base/mac/bundle_locations.h"
#import "base/mac/foundation_util.h" #import "base/mac/foundation_util.h"
#import "base/metrics/histogram_functions.h" #import "base/metrics/histogram_functions.h"
#import "base/metrics/histogram_macros.h" #import "base/metrics/histogram_macros.h"
@@ -424,7 +424,7 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData(
- (void)startUpBrowserBackgroundInitialization { - (void)startUpBrowserBackgroundInitialization {
DCHECK(self.appState.initStage > InitStageSafeMode); DCHECK(self.appState.initStage > InitStageSafeMode);
NSBundle* baseBundle = base::mac::OuterBundle(); NSBundle* baseBundle = base::apple::OuterBundle();
base::mac::SetBaseBundleID( base::mac::SetBaseBundleID(
base::SysNSStringToUTF8([baseBundle bundleIdentifier]).c_str()); base::SysNSStringToUTF8([baseBundle bundleIdentifier]).c_str());
@@ -433,7 +433,7 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData(
[RegisterExperimentalSettings [RegisterExperimentalSettings
registerExperimentalSettingsWithUserDefaults:[NSUserDefaults registerExperimentalSettingsWithUserDefaults:[NSUserDefaults
standardUserDefaults] standardUserDefaults]
bundle:base::mac:: bundle:base::apple::
FrameworkBundle()]; FrameworkBundle()];
// Register all clients before calling any web code. // Register all clients before calling any web code.

@@ -6,8 +6,8 @@
#import <ostream> #import <ostream>
#import "base/apple/bundle_locations.h"
#import "base/check.h" #import "base/check.h"
#import "base/mac/bundle_locations.h"
#import "base/notreached.h" #import "base/notreached.h"
#import "base/strings/sys_string_conversions.h" #import "base/strings/sys_string_conversions.h"

@@ -6,10 +6,10 @@
#import <utility> #import <utility>
#import "base/apple/backup_util.h"
#import "base/check.h" #import "base/check.h"
#import "base/files/file_path.h" #import "base/files/file_path.h"
#import "base/files/file_util.h" #import "base/files/file_util.h"
#import "base/mac/backup_util.h"
#import "base/task/sequenced_task_runner.h" #import "base/task/sequenced_task_runner.h"
#import "base/threading/thread_restrictions.h" #import "base/threading/thread_restrictions.h"
#import "components/bookmarks/browser/bookmark_model.h" #import "components/bookmarks/browser/bookmark_model.h"
@@ -67,7 +67,7 @@ bool EnsureBrowserStateDirectoriesCreated(const base::FilePath& path,
// stash state directory cannot easily be done at that point. // stash state directory cannot easily be done at that point.
if (!base::PathExists(otr_path) && !base::CreateDirectory(otr_path)) if (!base::PathExists(otr_path) && !base::CreateDirectory(otr_path))
return false; return false;
base::mac::SetBackupExclusion(otr_path); base::apple::SetBackupExclusion(otr_path);
if (!base::PathExists(cache_path) && !base::CreateDirectory(cache_path)) if (!base::PathExists(cache_path) && !base::CreateDirectory(cache_path))
return false; return false;
return true; return true;

@@ -6,12 +6,12 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import "base/apple/backup_util.h"
#import "base/base64url.h" #import "base/base64url.h"
#import "base/files/file_util.h" #import "base/files/file_util.h"
#import "base/files/important_file_writer.h" #import "base/files/important_file_writer.h"
#import "base/hash/sha1.h" #import "base/hash/sha1.h"
#import "base/ios/device_util.h" #import "base/ios/device_util.h"
#import "base/mac/backup_util.h"
#import "base/mac/foundation_util.h" #import "base/mac/foundation_util.h"
#import "base/path_service.h" #import "base/path_service.h"
#import "base/strings/string_util.h" #import "base/strings/string_util.h"
@@ -65,7 +65,7 @@ bool StoreDMTokenInDirAppDataDir(const std::string& token,
return false; return false;
} }
base::mac::SetBackupExclusion(token_file_path); base::apple::SetBackupExclusion(token_file_path);
return true; return true;
} }

@@ -6,7 +6,7 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import "base/mac/backup_util.h" #import "base/apple/backup_util.h"
#import "base/mac/foundation_util.h" #import "base/mac/foundation_util.h"
#import "base/metrics/histogram_functions.h" #import "base/metrics/histogram_functions.h"
#import "base/path_service.h" #import "base/path_service.h"
@@ -167,12 +167,12 @@ void PolicyWatcherBrowserAgent::UpdateAppContainerBackupExclusion() {
if (backup_allowed) { if (backup_allowed) {
base::ThreadPool::PostTask( base::ThreadPool::PostTask(
FROM_HERE, {base::MayBlock(), base::TaskPriority::USER_VISIBLE}, FROM_HERE, {base::MayBlock(), base::TaskPriority::USER_VISIBLE},
base::BindOnce(base::IgnoreResult(&base::mac::ClearBackupExclusion), base::BindOnce(base::IgnoreResult(&base::apple::ClearBackupExclusion),
std::move(storage_dir))); std::move(storage_dir)));
} else { } else {
base::ThreadPool::PostTask( base::ThreadPool::PostTask(
FROM_HERE, {base::MayBlock(), base::TaskPriority::USER_VISIBLE}, FROM_HERE, {base::MayBlock(), base::TaskPriority::USER_VISIBLE},
base::BindOnce(base::IgnoreResult(&base::mac::SetBackupExclusion), base::BindOnce(base::IgnoreResult(&base::apple::SetBackupExclusion),
std::move(storage_dir))); std::move(storage_dir)));
} }
} }

@@ -4,7 +4,7 @@
#import "ios/chrome/browser/policy/policy_watcher_browser_agent.h" #import "ios/chrome/browser/policy/policy_watcher_browser_agent.h"
#import "base/mac/backup_util.h" #import "base/apple/backup_util.h"
#import "base/mac/foundation_util.h" #import "base/mac/foundation_util.h"
#import "base/path_service.h" #import "base/path_service.h"
#import "base/test/ios/wait_util.h" #import "base/test/ios/wait_util.h"
@@ -482,19 +482,19 @@ TEST_F(PolicyWatcherBrowserAgentTest, BackupPreventionChanged) {
base::FilePath storage_dir = base::mac::GetUserLibraryPath(); base::FilePath storage_dir = base::mac::GetUserLibraryPath();
// Ensure that backups are allowed initially. // Ensure that backups are allowed initially.
ASSERT_TRUE(base::mac::ClearBackupExclusion(storage_dir)); ASSERT_TRUE(base::apple::ClearBackupExclusion(storage_dir));
// Disallow backups. // Disallow backups.
browser_->GetBrowserState()->GetPrefs()->SetBoolean( browser_->GetBrowserState()->GetPrefs()->SetBoolean(
prefs::kAllowChromeDataInBackups, false); prefs::kAllowChromeDataInBackups, false);
task_environment_.RunUntilIdle(); task_environment_.RunUntilIdle();
EXPECT_TRUE(base::mac::GetBackupExclusion(storage_dir)); EXPECT_TRUE(base::apple::GetBackupExclusion(storage_dir));
// Allow backups. // Allow backups.
browser_->GetBrowserState()->GetPrefs()->SetBoolean( browser_->GetBrowserState()->GetPrefs()->SetBoolean(
prefs::kAllowChromeDataInBackups, true); prefs::kAllowChromeDataInBackups, true);
task_environment_.RunUntilIdle(); task_environment_.RunUntilIdle();
EXPECT_FALSE(base::mac::GetBackupExclusion(storage_dir)); EXPECT_FALSE(base::apple::GetBackupExclusion(storage_dir));
} }
// Tests that disabling the backup-allowed preference marks the app container // Tests that disabling the backup-allowed preference marks the app container
@@ -503,7 +503,7 @@ TEST_F(PolicyWatcherBrowserAgentTest, BackupDisallowedAtColdStart) {
base::FilePath storage_dir = base::mac::GetUserLibraryPath(); base::FilePath storage_dir = base::mac::GetUserLibraryPath();
// Ensure that backups are allowed initially. // Ensure that backups are allowed initially.
ASSERT_TRUE(base::mac::ClearBackupExclusion(storage_dir)); ASSERT_TRUE(base::apple::ClearBackupExclusion(storage_dir));
// Disallow backups // Disallow backups
browser_->GetBrowserState()->GetPrefs()->SetBoolean( browser_->GetBrowserState()->GetPrefs()->SetBoolean(
@@ -512,7 +512,7 @@ TEST_F(PolicyWatcherBrowserAgentTest, BackupDisallowedAtColdStart) {
id mockHandler = OCMProtocolMock(@protocol(PolicyChangeCommands)); id mockHandler = OCMProtocolMock(@protocol(PolicyChangeCommands));
agent_->Initialize(mockHandler); agent_->Initialize(mockHandler);
task_environment_.RunUntilIdle(); task_environment_.RunUntilIdle();
EXPECT_TRUE(base::mac::GetBackupExclusion(storage_dir)); EXPECT_TRUE(base::apple::GetBackupExclusion(storage_dir));
} }
// Tests that enabling the backup-allowed preference marks the app container // Tests that enabling the backup-allowed preference marks the app container
@@ -521,7 +521,7 @@ TEST_F(PolicyWatcherBrowserAgentTest, BackupAllowedAtColdStart) {
base::FilePath storage_dir = base::mac::GetUserLibraryPath(); base::FilePath storage_dir = base::mac::GetUserLibraryPath();
// Ensure that backups are disallowed initially. // Ensure that backups are disallowed initially.
ASSERT_TRUE(base::mac::SetBackupExclusion(storage_dir)); ASSERT_TRUE(base::apple::SetBackupExclusion(storage_dir));
// Allow backups // Allow backups
browser_->GetBrowserState()->GetPrefs()->SetBoolean( browser_->GetBrowserState()->GetPrefs()->SetBoolean(
@@ -530,5 +530,5 @@ TEST_F(PolicyWatcherBrowserAgentTest, BackupAllowedAtColdStart) {
id mockHandler = OCMProtocolMock(@protocol(PolicyChangeCommands)); id mockHandler = OCMProtocolMock(@protocol(PolicyChangeCommands));
agent_->Initialize(mockHandler); agent_->Initialize(mockHandler);
task_environment_.RunUntilIdle(); task_environment_.RunUntilIdle();
EXPECT_FALSE(base::mac::GetBackupExclusion(storage_dir)); EXPECT_FALSE(base::apple::GetBackupExclusion(storage_dir));
} }

@@ -4,7 +4,7 @@
#import "ios/chrome/browser/policy/reporting/browser_report_generator_ios.h" #import "ios/chrome/browser/policy/reporting/browser_report_generator_ios.h"
#import "base/mac/bundle_locations.h" #import "base/apple/bundle_locations.h"
#import "base/mac/foundation_util.h" #import "base/mac/foundation_util.h"
#import "base/strings/sys_string_conversions.h" #import "base/strings/sys_string_conversions.h"
#import "components/policy/proto/device_management_backend.pb.h" #import "components/policy/proto/device_management_backend.pb.h"
@@ -26,7 +26,7 @@ BrowserReportGeneratorIOS::BrowserReportGeneratorIOS() = default;
BrowserReportGeneratorIOS::~BrowserReportGeneratorIOS() = default; BrowserReportGeneratorIOS::~BrowserReportGeneratorIOS() = default;
std::string BrowserReportGeneratorIOS::GetExecutablePath() { std::string BrowserReportGeneratorIOS::GetExecutablePath() {
NSBundle* baseBundle = base::mac::OuterBundle(); NSBundle* baseBundle = base::apple::OuterBundle();
return base::SysNSStringToUTF8([baseBundle bundleIdentifier]); return base::SysNSStringToUTF8([baseBundle bundleIdentifier]);
} }

@@ -4,7 +4,7 @@
#import "ios/chrome/browser/shared/ui/util/terms_util.h" #import "ios/chrome/browser/shared/ui/util/terms_util.h"
#import "base/mac/bundle_locations.h" #import "base/apple/bundle_locations.h"
#import "base/mac/foundation_util.h" #import "base/mac/foundation_util.h"
#import "base/strings/sys_string_conversions.h" #import "base/strings/sys_string_conversions.h"
#import "ios/chrome/browser/shared/model/application_context/application_context.h" #import "ios/chrome/browser/shared/model/application_context/application_context.h"
@@ -32,7 +32,7 @@ std::string FindFileInResource(const std::string& base_name,
const std::string& language, const std::string& language,
const std::string& ext) { const std::string& ext) {
std::string resource_file(base_name + "_" + language); std::string resource_file(base_name + "_" + language);
BOOL exists = [base::mac::FrameworkBundle() BOOL exists = [base::apple::FrameworkBundle()
URLForResource:base::SysUTF8ToNSString(resource_file) URLForResource:base::SysUTF8ToNSString(resource_file)
withExtension:base::SysUTF8ToNSString(ext)] != nil; withExtension:base::SysUTF8ToNSString(ext)] != nil;
return exists ? resource_file + "." + ext : std::string(); return exists ? resource_file + "." + ext : std::string();

@@ -9,6 +9,7 @@
#import <set> #import <set>
#import "base/apple/backup_util.h"
#import "base/base_paths.h" #import "base/base_paths.h"
#import "base/containers/contains.h" #import "base/containers/contains.h"
#import "base/files/file_enumerator.h" #import "base/files/file_enumerator.h"
@@ -17,7 +18,6 @@
#import "base/functional/bind.h" #import "base/functional/bind.h"
#import "base/ios/crb_protocol_observers.h" #import "base/ios/crb_protocol_observers.h"
#import "base/logging.h" #import "base/logging.h"
#import "base/mac/backup_util.h"
#import "base/metrics/histogram_functions.h" #import "base/metrics/histogram_functions.h"
#import "base/path_service.h" #import "base/path_service.h"
#import "base/sequence_checker.h" #import "base/sequence_checker.h"
@@ -219,7 +219,7 @@ void ConvertAndSaveGreyImage(NSString* snapshot_id,
base::FilePath image_path = ImagePath(snapshot_id, IMAGE_TYPE_GREYSCALE, base::FilePath image_path = ImagePath(snapshot_id, IMAGE_TYPE_GREYSCALE,
image_scale, cache_directory); image_scale, cache_directory);
WriteImageToDisk(grey_image, image_path); WriteImageToDisk(grey_image, image_path);
base::mac::SetBackupExclusion(image_path); base::apple::SetBackupExclusion(image_path);
} }
void DeleteImageWithSnapshotID(const base::FilePath& cache_directory, void DeleteImageWithSnapshotID(const base::FilePath& cache_directory,

@@ -6,7 +6,7 @@
#import "ios/chrome/browser/ui/browser_view/browser_view_controller+delegates.h" #import "ios/chrome/browser/ui/browser_view/browser_view_controller+delegates.h"
#import "ios/chrome/browser/ui/browser_view/browser_view_controller+private.h" #import "ios/chrome/browser/ui/browser_view/browser_view_controller+private.h"
#import "base/mac/bundle_locations.h" #import "base/apple/bundle_locations.h"
#import "base/mac/foundation_util.h" #import "base/mac/foundation_util.h"
#import "base/strings/sys_string_conversions.h" #import "base/strings/sys_string_conversions.h"
#import "base/task/sequenced_task_runner.h" #import "base/task/sequenced_task_runner.h"
@@ -424,7 +424,7 @@ enum HeaderBehaviour {
(KeyCommandsProvider*)keyCommandsProvider (KeyCommandsProvider*)keyCommandsProvider
dependencies:(BrowserViewControllerDependencies) dependencies:(BrowserViewControllerDependencies)
dependencies { dependencies {
self = [super initWithNibName:nil bundle:base::mac::FrameworkBundle()]; self = [super initWithNibName:nil bundle:base::apple::FrameworkBundle()];
if (self) { if (self) {
_browserContainerViewController = browserContainerViewController; _browserContainerViewController = browserContainerViewController;
_keyCommandsProvider = keyCommandsProvider; _keyCommandsProvider = keyCommandsProvider;
@@ -1304,7 +1304,7 @@ enum HeaderBehaviour {
self.hideStatusBar = YES; self.hideStatusBar = YES;
// Load view from Launch Screen and add it to window. // Load view from Launch Screen and add it to window.
NSBundle* mainBundle = base::mac::FrameworkBundle(); NSBundle* mainBundle = base::apple::FrameworkBundle();
NSArray* topObjects = [mainBundle loadNibNamed:@"LaunchScreen" NSArray* topObjects = [mainBundle loadNibNamed:@"LaunchScreen"
owner:self owner:self
options:nil]; options:nil];

@@ -4,9 +4,9 @@
#import "ios/chrome/browser/ui/find_bar/find_bar_controller_ios.h" #import "ios/chrome/browser/ui/find_bar/find_bar_controller_ios.h"
#import "base/apple/bundle_locations.h"
#import "base/format_macros.h" #import "base/format_macros.h"
#import "base/i18n/rtl.h" #import "base/i18n/rtl.h"
#import "base/mac/bundle_locations.h"
#import "base/mac/foundation_util.h" #import "base/mac/foundation_util.h"
#import "base/strings/sys_string_conversions.h" #import "base/strings/sys_string_conversions.h"
#import "components/strings/grit/components_strings.h" #import "components/strings/grit/components_strings.h"

@@ -6,7 +6,7 @@
#import <WebKit/WebKit.h> #import <WebKit/WebKit.h>
#import "base/mac/bundle_locations.h" #import "base/apple/bundle_locations.h"
#import "base/strings/sys_string_conversions.h" #import "base/strings/sys_string_conversions.h"
#import "components/strings/grit/components_strings.h" #import "components/strings/grit/components_strings.h"
#import "ios/chrome/browser/shared/coordinator/alert/alert_coordinator.h" #import "ios/chrome/browser/shared/coordinator/alert/alert_coordinator.h"

@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/main/incognito_blocker_scene_agent.h" #import "ios/chrome/browser/ui/main/incognito_blocker_scene_agent.h"
#import "base/apple/bundle_locations.h"
#import "base/ios/ios_util.h" #import "base/ios/ios_util.h"
#import "base/mac/bundle_locations.h"
#import "base/mac/foundation_util.h" #import "base/mac/foundation_util.h"
#if !defined(__has_feature) || !__has_feature(objc_arc) #if !defined(__has_feature) || !__has_feature(objc_arc)
@@ -104,7 +104,7 @@
} }
- (UIViewController*)loadLaunchScreenControllerFromBundle { - (UIViewController*)loadLaunchScreenControllerFromBundle {
NSBundle* mainBundle = base::mac::FrameworkBundle(); NSBundle* mainBundle = base::apple::FrameworkBundle();
NSArray* topObjects = [mainBundle loadNibNamed:@"LaunchScreen" NSArray* topObjects = [mainBundle loadNibNamed:@"LaunchScreen"
owner:self owner:self
options:nil]; options:nil];

@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/tab_switcher/tab_grid/tab_grid_coordinator.h" #import "ios/chrome/browser/ui/tab_switcher/tab_grid/tab_grid_coordinator.h"
#import "base/mac/bundle_locations.h" #import "base/apple/bundle_locations.h"
#import "base/mac/foundation_util.h" #import "base/mac/foundation_util.h"
#import "base/metrics/histogram_functions.h" #import "base/metrics/histogram_functions.h"
#import "base/metrics/user_metrics.h" #import "base/metrics/user_metrics.h"

@@ -8,9 +8,9 @@
#import <memory> #import <memory>
#import <vector> #import <vector>
#import "base/apple/bundle_locations.h"
#import "base/i18n/rtl.h" #import "base/i18n/rtl.h"
#import "base/ios/ios_util.h" #import "base/ios/ios_util.h"
#import "base/mac/bundle_locations.h"
#import "base/mac/foundation_util.h" #import "base/mac/foundation_util.h"
#import "base/metrics/histogram_functions.h" #import "base/metrics/histogram_functions.h"
#import "base/metrics/user_metrics.h" #import "base/metrics/user_metrics.h"

@@ -6,7 +6,7 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import "base/mac/bundle_locations.h" #import "base/apple/bundle_locations.h"
#import "base/memory/ref_counted_memory.h" #import "base/memory/ref_counted_memory.h"
#import "base/strings/sys_string_conversions.h" #import "base/strings/sys_string_conversions.h"
#import "ios/chrome/browser/shared/model/browser_state/chrome_browser_state.h" #import "ios/chrome/browser/shared/model/browser_state/chrome_browser_state.h"
@@ -62,7 +62,7 @@ void TermsUIHTMLSource::StartDataRequest(
web::URLDataSourceIOS::GotDataCallback callback) { web::URLDataSourceIOS::GotDataCallback callback) {
NSString* terms_of_service_path = NSString* terms_of_service_path =
base::SysUTF8ToNSString(GetTermsOfServicePath()); base::SysUTF8ToNSString(GetTermsOfServicePath());
NSString* bundle_path = [base::mac::FrameworkBundle() bundlePath]; NSString* bundle_path = [base::apple::FrameworkBundle() bundlePath];
NSString* full_path = NSString* full_path =
[bundle_path stringByAppendingPathComponent:terms_of_service_path]; [bundle_path stringByAppendingPathComponent:terms_of_service_path];
DCHECK(full_path); DCHECK(full_path);

@@ -4,7 +4,7 @@
#import "ios/chrome/browser/ui/whats_new/data_source/whats_new_data_source.h" #import "ios/chrome/browser/ui/whats_new/data_source/whats_new_data_source.h"
#import "base/mac/bundle_locations.h" #import "base/apple/bundle_locations.h"
#import "base/mac/foundation_util.h" #import "base/mac/foundation_util.h"
#import "base/notreached.h" #import "base/notreached.h"
#import "base/strings/string_util.h" #import "base/strings/string_util.h"
@@ -240,7 +240,7 @@ WhatsNewItem* ConstructWhatsNewItem(NSDictionary* entry) {
} }
NSString* WhatsNewFilePath() { NSString* WhatsNewFilePath() {
NSString* bundle_path = [base::mac::FrameworkBundle() bundlePath]; NSString* bundle_path = [base::apple::FrameworkBundle() bundlePath];
NSString* entries_file_path = NSString* entries_file_path =
[bundle_path stringByAppendingPathComponent:kfileName]; [bundle_path stringByAppendingPathComponent:kfileName];
return entries_file_path; return entries_file_path;

@@ -8,7 +8,7 @@
#import <set> #import <set>
#import <utility> #import <utility>
#import "base/mac/bundle_locations.h" #import "base/apple/bundle_locations.h"
#import "base/mac/foundation_util.h" #import "base/mac/foundation_util.h"
#import "base/scoped_observation.h" #import "base/scoped_observation.h"
#import "base/strings/sys_string_conversions.h" #import "base/strings/sys_string_conversions.h"

@@ -6,8 +6,8 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import "base/apple/bundle_locations.h"
#import "base/containers/contains.h" #import "base/containers/contains.h"
#import "base/mac/bundle_locations.h"
#import "base/mac/foundation_util.h" #import "base/mac/foundation_util.h"
#import "base/mac/scoped_cftyperef.h" #import "base/mac/scoped_cftyperef.h"
#import "base/strings/string_split.h" #import "base/strings/string_split.h"

@@ -9,8 +9,8 @@
#import <memory> #import <memory>
#import <utility> #import <utility>
#import "base/apple/bundle_locations.h"
#import "base/format_macros.h" #import "base/format_macros.h"
#import "base/mac/bundle_locations.h"
#import "base/mac/foundation_util.h" #import "base/mac/foundation_util.h"
#import "base/strings/stringprintf.h" #import "base/strings/stringprintf.h"
#import "base/strings/utf_string_conversions.h" #import "base/strings/utf_string_conversions.h"

@@ -4,12 +4,12 @@
#import "ios/chrome/browser/web/chrome_web_client.h" #import "ios/chrome/browser/web/chrome_web_client.h"
#import "base/apple/bundle_locations.h"
#import "base/command_line.h" #import "base/command_line.h"
#import "base/feature_list.h" #import "base/feature_list.h"
#import "base/files/file_util.h" #import "base/files/file_util.h"
#import "base/ios/ios_util.h" #import "base/ios/ios_util.h"
#import "base/ios/ns_error_util.h" #import "base/ios/ns_error_util.h"
#import "base/mac/bundle_locations.h"
#import "base/metrics/histogram_functions.h" #import "base/metrics/histogram_functions.h"
#import "base/no_destructor.h" #import "base/no_destructor.h"
#import "base/strings/stringprintf.h" #import "base/strings/stringprintf.h"

@@ -7,7 +7,7 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import <dispatch/dispatch.h> #import <dispatch/dispatch.h>
#import "base/mac/bundle_locations.h" #import "base/apple/bundle_locations.h"
#import "base/strings/sys_string_conversions.h" #import "base/strings/sys_string_conversions.h"
#import "build/branding_buildflags.h" #import "build/branding_buildflags.h"
#import "components/version_info/version_info.h" #import "components/version_info/version_info.h"
@@ -61,7 +61,7 @@ version_info::Channel GetChannel() {
#if BUILDFLAG(GOOGLE_CHROME_BRANDING) #if BUILDFLAG(GOOGLE_CHROME_BRANDING)
static dispatch_once_t channel_dispatch_token; static dispatch_once_t channel_dispatch_token;
dispatch_once(&channel_dispatch_token, ^{ dispatch_once(&channel_dispatch_token, ^{
NSBundle* bundle = base::mac::OuterBundle(); NSBundle* bundle = base::apple::OuterBundle();
// Only Keystone-enabled build can have a channel. // Only Keystone-enabled build can have a channel.
if (![bundle objectForInfoDictionaryKey:@"KSProductID"]) if (![bundle objectForInfoDictionaryKey:@"KSProductID"])

@@ -4,9 +4,9 @@
#import "ios/web/js_messaging/page_script_util.h" #import "ios/web/js_messaging/page_script_util.h"
#import "base/apple/bundle_locations.h"
#import "base/files/file_path.h" #import "base/files/file_path.h"
#import "base/files/file_util.h" #import "base/files/file_util.h"
#import "base/mac/bundle_locations.h"
#import "base/strings/sys_string_conversions.h" #import "base/strings/sys_string_conversions.h"
#import "ios/web/public/browser_state.h" #import "ios/web/public/browser_state.h"
#import "ios/web/public/web_client.h" #import "ios/web/public/web_client.h"
@@ -20,8 +20,8 @@ namespace web {
NSString* GetPageScript(NSString* script_file_name) { NSString* GetPageScript(NSString* script_file_name) {
DCHECK(script_file_name); DCHECK(script_file_name);
NSString* path = NSString* path =
[base::mac::FrameworkBundle() pathForResource:script_file_name [base::apple::FrameworkBundle() pathForResource:script_file_name
ofType:@"js"]; ofType:@"js"];
DCHECK(path) << "Script file not found: " DCHECK(path) << "Script file not found: "
<< base::SysNSStringToUTF8(script_file_name) << ".js"; << base::SysNSStringToUTF8(script_file_name) << ".js";
NSError* error = nil; NSError* error = nil;

@@ -9,12 +9,12 @@
#import <memory> #import <memory>
#import <utility> #import <utility>
#import "base/apple/bundle_locations.h"
#import "base/debug/dump_without_crashing.h" #import "base/debug/dump_without_crashing.h"
#import "base/functional/bind.h" #import "base/functional/bind.h"
#import "base/functional/callback.h" #import "base/functional/callback.h"
#import "base/ios/ios_util.h" #import "base/ios/ios_util.h"
#import "base/logging.h" #import "base/logging.h"
#import "base/mac/bundle_locations.h"
#import "base/memory/ptr_util.h" #import "base/memory/ptr_util.h"
#import "base/metrics/histogram_macros.h" #import "base/metrics/histogram_macros.h"
#import "base/numerics/checked_math.h" #import "base/numerics/checked_math.h"

@@ -6,8 +6,8 @@
#import <algorithm> #import <algorithm>
#import "base/apple/bundle_locations.h"
#import "base/json/json_writer.h" #import "base/json/json_writer.h"
#import "base/mac/bundle_locations.h"
#import "base/metrics/field_trial_params.h" #import "base/metrics/field_trial_params.h"
#import "base/strings/escape.h" #import "base/strings/escape.h"
#import "base/strings/string_util.h" #import "base/strings/string_util.h"
@@ -79,8 +79,8 @@ bool URLNeedsUserAgentType(const GURL& url) {
GURL GetRestoreSessionBaseUrl() { GURL GetRestoreSessionBaseUrl() {
std::string restore_session_resource_path = base::SysNSStringToUTF8( std::string restore_session_resource_path = base::SysNSStringToUTF8(
[base::mac::FrameworkBundle() pathForResource:@"restore_session" [base::apple::FrameworkBundle() pathForResource:@"restore_session"
ofType:@"html"]); ofType:@"html"]);
GURL::Replacements replacements; GURL::Replacements replacements;
replacements.SetSchemeStr(url::kFileScheme); replacements.SetSchemeStr(url::kFileScheme);
replacements.SetPathStr(restore_session_resource_path); replacements.SetPathStr(restore_session_resource_path);

@@ -6,7 +6,7 @@
#import <WebKit/WebKit.h> #import <WebKit/WebKit.h>
#import "base/mac/bundle_locations.h" #import "base/apple/bundle_locations.h"
#import "base/strings/sys_string_conversions.h" #import "base/strings/sys_string_conversions.h"
#import "base/test/ios/wait_util.h" #import "base/test/ios/wait_util.h"
#import "ios/web/js_messaging/java_script_feature_manager.h" #import "ios/web/js_messaging/java_script_feature_manager.h"

@@ -4,21 +4,21 @@
#import "ios/web_view/internal/web_view_web_client.h" #import "ios/web_view/internal/web_view_web_client.h"
#include <dispatch/dispatch.h> #import <dispatch/dispatch.h>
#include "base/check.h" #import "base/apple/bundle_locations.h"
#include "base/functional/bind.h" #import "base/check.h"
#import "base/functional/bind.h"
#import "base/ios/ns_error_util.h" #import "base/ios/ns_error_util.h"
#include "base/mac/bundle_locations.h" #import "base/strings/sys_string_conversions.h"
#include "base/strings/sys_string_conversions.h" #import "components/autofill/ios/browser/autofill_java_script_feature.h"
#include "components/autofill/ios/browser/autofill_java_script_feature.h"
#import "components/autofill/ios/browser/suggestion_controller_java_script_feature.h" #import "components/autofill/ios/browser/suggestion_controller_java_script_feature.h"
#import "components/autofill/ios/form_util/form_handlers_java_script_feature.h" #import "components/autofill/ios/form_util/form_handlers_java_script_feature.h"
#import "components/language/ios/browser/language_detection_java_script_feature.h" #import "components/language/ios/browser/language_detection_java_script_feature.h"
#import "components/password_manager/ios/password_manager_java_script_feature.h" #import "components/password_manager/ios/password_manager_java_script_feature.h"
#import "components/security_interstitials/core/unsafe_resource.h" #import "components/security_interstitials/core/unsafe_resource.h"
#include "components/ssl_errors/error_info.h" #import "components/ssl_errors/error_info.h"
#include "components/strings/grit/components_strings.h" #import "components/strings/grit/components_strings.h"
#import "components/translate/ios/browser/translate_java_script_feature.h" #import "components/translate/ios/browser/translate_java_script_feature.h"
#import "ios/components/security_interstitials/https_only_mode/feature.h" #import "ios/components/security_interstitials/https_only_mode/feature.h"
#import "ios/components/security_interstitials/ios_security_interstitial_java_script_feature.h" #import "ios/components/security_interstitials/ios_security_interstitial_java_script_feature.h"
@@ -26,28 +26,28 @@
#import "ios/components/security_interstitials/lookalikes/lookalike_url_error.h" #import "ios/components/security_interstitials/lookalikes/lookalike_url_error.h"
#import "ios/components/security_interstitials/safe_browsing/safe_browsing_error.h" #import "ios/components/security_interstitials/safe_browsing/safe_browsing_error.h"
#import "ios/components/security_interstitials/safe_browsing/safe_browsing_unsafe_resource_container.h" #import "ios/components/security_interstitials/safe_browsing/safe_browsing_unsafe_resource_container.h"
#include "ios/components/webui/web_ui_url_constants.h" #import "ios/components/webui/web_ui_url_constants.h"
#include "ios/web/common/user_agent.h" #import "ios/web/common/user_agent.h"
#import "ios/web/public/navigation/navigation_manager.h" #import "ios/web/public/navigation/navigation_manager.h"
#include "ios/web/public/security/ssl_status.h" #import "ios/web/public/security/ssl_status.h"
#include "ios/web/public/thread/web_task_traits.h" #import "ios/web/public/thread/web_task_traits.h"
#include "ios/web/public/thread/web_thread.h" #import "ios/web/public/thread/web_thread.h"
#import "ios/web_view/internal/cwv_lookalike_url_handler_internal.h" #import "ios/web_view/internal/cwv_lookalike_url_handler_internal.h"
#import "ios/web_view/internal/cwv_ssl_error_handler_internal.h" #import "ios/web_view/internal/cwv_ssl_error_handler_internal.h"
#import "ios/web_view/internal/cwv_ssl_status_internal.h" #import "ios/web_view/internal/cwv_ssl_status_internal.h"
#import "ios/web_view/internal/cwv_ssl_util.h" #import "ios/web_view/internal/cwv_ssl_util.h"
#import "ios/web_view/internal/cwv_web_view_internal.h" #import "ios/web_view/internal/cwv_web_view_internal.h"
#import "ios/web_view/internal/safe_browsing/cwv_unsafe_url_handler_internal.h" #import "ios/web_view/internal/safe_browsing/cwv_unsafe_url_handler_internal.h"
#include "ios/web_view/internal/web_view_browser_state.h" #import "ios/web_view/internal/web_view_browser_state.h"
#import "ios/web_view/internal/web_view_early_page_script_provider.h" #import "ios/web_view/internal/web_view_early_page_script_provider.h"
#import "ios/web_view/internal/web_view_message_handler_java_script_feature.h" #import "ios/web_view/internal/web_view_message_handler_java_script_feature.h"
#import "ios/web_view/internal/web_view_web_main_parts.h" #import "ios/web_view/internal/web_view_web_main_parts.h"
#import "ios/web_view/public/cwv_navigation_delegate.h" #import "ios/web_view/public/cwv_navigation_delegate.h"
#import "ios/web_view/public/cwv_web_view.h" #import "ios/web_view/public/cwv_web_view.h"
#import "net/base/mac/url_conversions.h" #import "net/base/mac/url_conversions.h"
#include "net/cert/cert_status_flags.h" #import "net/cert/cert_status_flags.h"
#include "ui/base/l10n/l10n_util.h" #import "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h" #import "ui/base/resource/resource_bundle.h"
#if !defined(__has_feature) || !__has_feature(objc_arc) #if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support." #error "This file requires ARC support."

@@ -4,9 +4,9 @@
#import "ios/web_view/internal/web_view_web_main_delegate.h" #import "ios/web_view/internal/web_view_web_main_delegate.h"
#import "base/apple/bundle_locations.h"
#include "base/base_paths.h" #include "base/base_paths.h"
#include "base/logging.h" #include "base/logging.h"
#import "base/mac/bundle_locations.h"
#include "components/component_updater/component_updater_paths.h" #include "components/component_updater/component_updater_paths.h"
#if !defined(__has_feature) || !__has_feature(objc_arc) #if !defined(__has_feature) || !__has_feature(objc_arc)
@@ -27,7 +27,7 @@ WebViewWebMainDelegate::WebViewWebMainDelegate() {}
WebViewWebMainDelegate::~WebViewWebMainDelegate() = default; WebViewWebMainDelegate::~WebViewWebMainDelegate() = default;
void WebViewWebMainDelegate::BasicStartupComplete() { void WebViewWebMainDelegate::BasicStartupComplete() {
base::mac::SetOverrideFrameworkBundle( base::apple::SetOverrideFrameworkBundle(
[NSBundle bundleForClass:[CWVBundleLocator class]]); [NSBundle bundleForClass:[CWVBundleLocator class]]);
// Sets up logging so logging levels can be controlled. // Sets up logging so logging levels can be controlled.

@@ -6,9 +6,9 @@
#include <dlfcn.h> #include <dlfcn.h>
#include "base/apple/bundle_locations.h"
#include "base/check.h" #include "base/check.h"
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/mac/bundle_locations.h"
#include "ui/base/l10n/l10n_util_mac.h" #include "ui/base/l10n/l10n_util_mac.h"
#include "ui/base/resource/resource_bundle.h" #include "ui/base/resource/resource_bundle.h"
@@ -26,7 +26,7 @@ bool LoadResources(const std::string& pref_locale) {
// DirName() calls strip "Contents/MacOS/<binary>" from the path. // DirName() calls strip "Contents/MacOS/<binary>" from the path.
base::FilePath path = base::FilePath path =
base::FilePath(info.dli_fname).DirName().DirName().DirName(); base::FilePath(info.dli_fname).DirName().DirName().DirName();
base::mac::SetOverrideFrameworkBundlePath(path); base::apple::SetOverrideFrameworkBundlePath(path);
// Override the locale with the value from Cocoa. // Override the locale with the value from Cocoa.
if (pref_locale.empty()) { if (pref_locale.empty()) {

@@ -23,7 +23,7 @@
#include "services/service_manager/public/mojom/service.mojom.h" #include "services/service_manager/public/mojom/service.mojom.h"
#if BUILDFLAG(IS_MAC) #if BUILDFLAG(IS_MAC)
#include "base/mac/bundle_locations.h" #include "base/apple/bundle_locations.h"
#endif #endif
#if BUILDFLAG(IS_WIN) #if BUILDFLAG(IS_WIN)

Some files were not shown because too many files have changed in this diff Show More