Commit 9608115b authored by Nico Weber's avatar Nico Weber Committed by Commit Bot

Run "tools/mac/rewrite_modern_objc.py out/gn ../../base"

Bug: 324079
Change-Id: I1bdfc388266af70ac540e2730ecaf590a422898a
Reviewed-on: https://chromium-review.googlesource.com/c/1296623
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: default avatarRobert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#602045}
parent dd78e74b
......@@ -210,8 +210,7 @@ void SwitchFullScreenModes(FullScreenMode from_mode, FullScreenMode to_mode) {
}
bool SetFileBackupExclusion(const FilePath& file_path) {
NSString* file_path_ns =
[NSString stringWithUTF8String:file_path.value().c_str()];
NSString* file_path_ns = base::mac::FilePathToNSString(file_path);
NSURL* file_url = [NSURL fileURLWithPath:file_path_ns];
// When excludeByPath is true the application must be running with root
......@@ -264,9 +263,7 @@ void AddToLoginItems(bool hide_on_startup) {
BOOL hide = hide_on_startup ? YES : NO;
NSDictionary* properties =
[NSDictionary
dictionaryWithObject:[NSNumber numberWithBool:hide]
forKey:(NSString*)kLSSharedFileListLoginItemHidden];
@{(NSString*)kLSSharedFileListLoginItemHidden : @(hide) };
ScopedCFTypeRef<LSSharedFileListItemRef> new_item;
new_item.reset(LSSharedFileListInsertItemURL(
......
......@@ -105,8 +105,7 @@ TEST_F(MacUtilTest, DISABLED_TestExcludeFileFromBackups) {
// Dump something real into the file.
ASSERT_EQ(static_cast<int>(arraysize(dummy_data)),
WriteFile(dummy_file_path, dummy_data, arraysize(dummy_data)));
NSString* fileURLString =
[NSString stringWithUTF8String:dummy_file_path.value().c_str()];
NSString* fileURLString = base::mac::FilePathToNSString(dummy_file_path);
NSURL* fileURL = [NSURL URLWithString:fileURLString];
// Initial state should be non-excluded.
EXPECT_FALSE(CSBackupIsItemExcluded(base::mac::NSToCFCast(fileURL), NULL));
......
......@@ -44,7 +44,7 @@ struct NumberHolder {
return [[[CountVonCount alloc] init] autorelease];
}
- (id)init {
- (instancetype)init {
++ah_ah_ah;
return [super init];
}
......
......@@ -172,15 +172,14 @@ void PlatformThread::SetCurrentThreadPriority(ThreadPriority priority) {
break;
}
[[[NSThread currentThread] threadDictionary]
setObject:@(static_cast<int>(priority))
forKey:kThreadPriorityKey];
[[NSThread currentThread] threadDictionary][kThreadPriorityKey] =
@(static_cast<int>(priority));
}
// static
ThreadPriority PlatformThread::GetCurrentThreadPriority() {
NSNumber* priority = base::mac::ObjCCast<NSNumber>([[[NSThread currentThread]
threadDictionary] objectForKey:kThreadPriorityKey]);
NSNumber* priority = base::mac::ObjCCast<NSNumber>(
[[NSThread currentThread] threadDictionary][kThreadPriorityKey]);
if (!priority)
return ThreadPriority::NORMAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment