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) { ...@@ -210,8 +210,7 @@ void SwitchFullScreenModes(FullScreenMode from_mode, FullScreenMode to_mode) {
} }
bool SetFileBackupExclusion(const FilePath& file_path) { bool SetFileBackupExclusion(const FilePath& file_path) {
NSString* file_path_ns = NSString* file_path_ns = base::mac::FilePathToNSString(file_path);
[NSString stringWithUTF8String:file_path.value().c_str()];
NSURL* file_url = [NSURL fileURLWithPath:file_path_ns]; NSURL* file_url = [NSURL fileURLWithPath:file_path_ns];
// When excludeByPath is true the application must be running with root // When excludeByPath is true the application must be running with root
...@@ -264,9 +263,7 @@ void AddToLoginItems(bool hide_on_startup) { ...@@ -264,9 +263,7 @@ void AddToLoginItems(bool hide_on_startup) {
BOOL hide = hide_on_startup ? YES : NO; BOOL hide = hide_on_startup ? YES : NO;
NSDictionary* properties = NSDictionary* properties =
[NSDictionary @{(NSString*)kLSSharedFileListLoginItemHidden : @(hide) };
dictionaryWithObject:[NSNumber numberWithBool:hide]
forKey:(NSString*)kLSSharedFileListLoginItemHidden];
ScopedCFTypeRef<LSSharedFileListItemRef> new_item; ScopedCFTypeRef<LSSharedFileListItemRef> new_item;
new_item.reset(LSSharedFileListInsertItemURL( new_item.reset(LSSharedFileListInsertItemURL(
......
...@@ -105,8 +105,7 @@ TEST_F(MacUtilTest, DISABLED_TestExcludeFileFromBackups) { ...@@ -105,8 +105,7 @@ TEST_F(MacUtilTest, DISABLED_TestExcludeFileFromBackups) {
// Dump something real into the file. // Dump something real into the file.
ASSERT_EQ(static_cast<int>(arraysize(dummy_data)), ASSERT_EQ(static_cast<int>(arraysize(dummy_data)),
WriteFile(dummy_file_path, dummy_data, arraysize(dummy_data))); WriteFile(dummy_file_path, dummy_data, arraysize(dummy_data)));
NSString* fileURLString = NSString* fileURLString = base::mac::FilePathToNSString(dummy_file_path);
[NSString stringWithUTF8String:dummy_file_path.value().c_str()];
NSURL* fileURL = [NSURL URLWithString:fileURLString]; NSURL* fileURL = [NSURL URLWithString:fileURLString];
// Initial state should be non-excluded. // Initial state should be non-excluded.
EXPECT_FALSE(CSBackupIsItemExcluded(base::mac::NSToCFCast(fileURL), NULL)); EXPECT_FALSE(CSBackupIsItemExcluded(base::mac::NSToCFCast(fileURL), NULL));
......
...@@ -44,7 +44,7 @@ struct NumberHolder { ...@@ -44,7 +44,7 @@ struct NumberHolder {
return [[[CountVonCount alloc] init] autorelease]; return [[[CountVonCount alloc] init] autorelease];
} }
- (id)init { - (instancetype)init {
++ah_ah_ah; ++ah_ah_ah;
return [super init]; return [super init];
} }
......
...@@ -172,15 +172,14 @@ void PlatformThread::SetCurrentThreadPriority(ThreadPriority priority) { ...@@ -172,15 +172,14 @@ void PlatformThread::SetCurrentThreadPriority(ThreadPriority priority) {
break; break;
} }
[[[NSThread currentThread] threadDictionary] [[NSThread currentThread] threadDictionary][kThreadPriorityKey] =
setObject:@(static_cast<int>(priority)) @(static_cast<int>(priority));
forKey:kThreadPriorityKey];
} }
// static // static
ThreadPriority PlatformThread::GetCurrentThreadPriority() { ThreadPriority PlatformThread::GetCurrentThreadPriority() {
NSNumber* priority = base::mac::ObjCCast<NSNumber>([[[NSThread currentThread] NSNumber* priority = base::mac::ObjCCast<NSNumber>(
threadDictionary] objectForKey:kThreadPriorityKey]); [[NSThread currentThread] threadDictionary][kThreadPriorityKey]);
if (!priority) if (!priority)
return ThreadPriority::NORMAL; 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