Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1871)

Unified Diff: chrome/browser/chrome_browser_main_mac.mm

Issue 2116103002: mac: Use instantiateWithOwner: instead of deprecated instantiateNibWithOwner: (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: be more thrifty with newlines Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chrome_browser_main_mac.mm
diff --git a/chrome/browser/chrome_browser_main_mac.mm b/chrome/browser/chrome_browser_main_mac.mm
index 11d7ff43ffe2eca372f1ea0df596b93a7693d278..813ea4da772f0b8aa555c7c3600ffe86d9ad2adf 100644
--- a/chrome/browser/chrome_browser_main_mac.mm
+++ b/chrome/browser/chrome_browser_main_mac.mm
@@ -13,6 +13,7 @@
#import "base/mac/foundation_util.h"
#include "base/mac/mac_util.h"
#include "base/mac/scoped_nsobject.h"
+#include "base/mac/sdk_forward_declarations.h"
#include "base/path_service.h"
#include "base/threading/thread_task_runner_handle.h"
#import "chrome/browser/app_controller_mac.h"
@@ -149,7 +150,10 @@ void ChromeBrowserMainPartsMac::PreMainMessageLoopStart() {
bundle:base::mac::FrameworkBundle()]);
// TODO(viettrungluu): crbug.com/20504 - This currently leaks, so if you
// change this, you'll probably need to change the Valgrind suppression.
- [nib instantiateNibWithOwner:NSApp topLevelObjects:nil];
+ NSArray* top_level_objects = nil;
+ [nib instantiateWithOwner:NSApp topLevelObjects:&top_level_objects];
+ for (NSObject* object : top_level_objects)
Mark Mentovai 2016/07/01 21:50:39 Convenience function to instantiate the nib and re
Nico 2016/07/01 21:53:56 I agree :-) I think it'd be even nicer if the Fil
+ [object retain];
// Make sure the app controller has been created.
DCHECK([NSApp delegate]);

Powered by Google App Engine
This is Rietveld 408576698