Skip to content

Commit

Permalink
Move foundation_util to base/apple, leave a forwarding header
Browse files Browse the repository at this point in the history
Crashpad is not yet updated for the new location, so leave a
forwarding header to be removed later.

Skipping trybots. This is a Mac change, and it’s passing all
trybots except for android_optional_gpu_tests_rel that is
repeatedly failing on an unrelated issue.

NOTRY=true

Bug: 1444927
Cq-Include-Trybots: luci.chrome.try:mac-chrome
Change-Id: Iad0c903187b0e1e5584c68f2eb00b5b026085596
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4790744
Owners-Override: Avi Drissman <avi@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1185029}
  • Loading branch information
Avi Drissman authored and Chromium LUCI CQ committed Aug 18, 2023
1 parent 273826f commit eac566b
Show file tree
Hide file tree
Showing 811 changed files with 2,751 additions and 2,604 deletions.
4 changes: 2 additions & 2 deletions base/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -1953,6 +1953,8 @@ component("base") {
"apple/call_with_eh_frame_asm.S",
"apple/dispatch_source_mach.cc",
"apple/dispatch_source_mach.h",
"apple/foundation_util.h",
"apple/foundation_util.mm",
"apple/mach_logging.cc",
"apple/mach_logging.h",
"apple/osstatus_logging.h",
Expand All @@ -1975,8 +1977,6 @@ component("base") {
"file_version_info_apple.h",
"file_version_info_apple.mm",
"files/file_util_apple.mm",
"mac/foundation_util.h",
"mac/foundation_util.mm",
"memory/platform_shared_memory_mapper_apple.cc",
"memory/platform_shared_memory_region_apple.cc",
"message_loop/message_pump_apple.h",
Expand Down
6 changes: 6 additions & 0 deletions base/apple/DEPS
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
include_rules = [
# base/apple is a base on which base/mac and base/ios build, so don't allow
# dependencies on them.
"-mac",
"-ios",
]
6 changes: 3 additions & 3 deletions base/apple/backup_util.mm
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

#import <Foundation/Foundation.h>

#include "base/apple/foundation_util.h"
#include "base/files/file_path.h"
#include "base/logging.h"
#include "base/mac/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#include "base/threading/scoped_blocking_call.h"

Expand All @@ -18,7 +18,7 @@ bool GetBackupExclusion(const FilePath& file_path) {
base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
base::BlockingType::MAY_BLOCK);

NSURL* file_url = mac::FilePathToNSURL(file_path);
NSURL* file_url = apple::FilePathToNSURL(file_path);
DCHECK([file_url checkPromisedItemIsReachableAndReturnError:nil]);

NSError* error = nil;
Expand All @@ -40,7 +40,7 @@ bool SetBackupState(const FilePath& file_path, bool excluded) {
base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
base::BlockingType::MAY_BLOCK);

NSURL* file_url = mac::FilePathToNSURL(file_path);
NSURL* file_url = apple::FilePathToNSURL(file_path);
DCHECK([file_url checkPromisedItemIsReachableAndReturnError:nil]);

NSError* error = nil;
Expand Down
4 changes: 2 additions & 2 deletions base/apple/backup_util_unittest.mm
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
#include <stddef.h>
#include <stdint.h>

#include "base/apple/foundation_util.h"
#include "base/apple/scoped_cftyperef.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/mac/foundation_util.h"
#include "base/numerics/safe_conversions.h"
#include "build/build_config.h"
#include "testing/gtest/include/gtest/gtest.h"
Expand Down Expand Up @@ -45,7 +45,7 @@
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
FilePath excluded_file_path = temp_dir_.GetPath().Append("excluded");
base::ScopedCFTypeRef<CFURLRef> excluded_url =
mac::FilePathToCFURL(excluded_file_path);
apple::FilePathToCFURL(excluded_file_path);

constexpr char placeholder_data[] = "All your base are belong to us!";
ASSERT_EQ(checked_cast<int>(std::size(placeholder_data)),
Expand Down
10 changes: 5 additions & 5 deletions base/apple/bundle_locations.mm
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

#include "base/apple/bundle_locations.h"

#include "base/apple/foundation_util.h"
#include "base/check.h"
#include "base/mac/foundation_util.h"
#include "base/strings/sys_string_conversions.h"

namespace base::apple {
Expand All @@ -26,7 +26,7 @@
}

FilePath MainBundlePath() {
return mac::NSStringToFilePath(MainBundle().bundlePath);
return apple::NSStringToFilePath(MainBundle().bundlePath);
}

NSBundle* OuterBundle() {
Expand All @@ -41,7 +41,7 @@ FilePath MainBundlePath() {
}

FilePath OuterBundlePath() {
return mac::NSStringToFilePath(OuterBundle().bundlePath);
return apple::NSStringToFilePath(OuterBundle().bundlePath);
}

NSBundle* FrameworkBundle() {
Expand All @@ -52,7 +52,7 @@ FilePath OuterBundlePath() {
}

FilePath FrameworkBundlePath() {
return mac::NSStringToFilePath(FrameworkBundle().bundlePath);
return apple::NSStringToFilePath(FrameworkBundle().bundlePath);
}

namespace {
Expand All @@ -62,7 +62,7 @@ FilePath FrameworkBundlePath() {
return nil;
}

NSBundle* bundle = [NSBundle bundleWithURL:mac::FilePathToNSURL(file_path)];
NSBundle* bundle = [NSBundle bundleWithURL:apple::FilePathToNSURL(file_path)];
CHECK(bundle) << "Failed to load the bundle at " << file_path.value();

return bundle;
Expand Down
Loading

0 comments on commit eac566b

Please sign in to comment.