Index: chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm |
diff --git a/chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm b/chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm |
index 2ab43137c90eec2e8a2a4f3dd3c826f2a42eee9a..0ca5ca8feb798fd732006ce7623c267ea613fbb6 100644 |
--- a/chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm |
+++ b/chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm |
@@ -6,6 +6,7 @@ |
#include <algorithm> |
Robert Sesek
2017/02/16 00:25:16
#include <sys/stat.h>
Sidney San Martín
2017/02/16 02:17:42
Done.
|
+#include "base/debug/crash_logging.h" |
#include "base/mac/bundle_locations.h" |
#include "base/mac/foundation_util.h" |
#include "base/mac/mac_util.h" |
@@ -52,6 +53,7 @@ |
#include "chrome/browser/ui/tabs/tab_strip_model.h" |
#include "chrome/browser/ui/toolbar/app_menu_icon_controller.h" |
#include "chrome/browser/ui/toolbar/app_menu_model.h" |
+#include "chrome/common/crash_keys.h" |
#include "chrome/common/pref_names.h" |
#include "chrome/grit/chromium_strings.h" |
#include "chrome/grit/generated_resources.h" |
@@ -252,6 +254,21 @@ class NotificationBridge : public AppMenuIconController::Delegate { |
} |
- (void)viewDidLoad { |
+ base::debug::ScopedCrashKey nib_crash_key{ |
Robert Sesek
2017/02/16 00:25:16
naming: nibCrashKey
Sidney San Martín
2017/02/16 02:17:42
Done.
|
+ crash_keys::mac::kToolbarNibInfo, [&] { |
+ auto nibPath = |
+ [self.nibBundle pathForResource:@"Toolbar" ofType:@"nib"]; |
+ struct stat sb; |
+ stat(nibPath.UTF8String, &sb); |
Robert Sesek
2017/02/16 00:25:16
fileSystemRepresentation
Sidney San Martín
2017/02/16 02:17:42
Done.
|
+ auto nibErrno = errno; |
Robert Sesek
2017/02/16 00:25:16
errno here may be something unrelated if stat retu
Sidney San Martín
2017/02/16 02:17:42
Done.
|
+ auto closestPath = nibPath; |
+ while (closestPath && stat(closestPath.UTF8String, &sb) != 0) { |
+ closestPath = [closestPath stringByDeletingLastPathComponent]; |
+ } |
+ return [NSString stringWithFormat:@"errno: %d nib: %@ closest: %@", |
+ nibErrno, nibPath, closestPath]; |
+ }().UTF8String}; |
+ |
// When linking and running on 10.10+, both -awakeFromNib and -viewDidLoad may |
// be called, don't initialize twice. |
if (locationBarView_) { |