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

Unified Diff: chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm

Issue 2695923008: Add a temporary crash key to debug nib loading issues. (Closed)
Patch Set: More accurate comment. Created 3 years, 10 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
« no previous file with comments | « no previous file | chrome/common/crash_keys.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..5e8cbc2b398ae59edb79f5fb52c247d509dd8a62 100644
--- a/chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm
+++ b/chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm
@@ -4,8 +4,10 @@
#import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h"
+#include <sys/stat.h>
#include <algorithm>
+#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 +54,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 +255,25 @@ class NotificationBridge : public AppMenuIconController::Delegate {
}
- (void)viewDidLoad {
+ // Temporary: collect information about a potentially missing or inaccessible
+ // nib (https://crbug.com/685985)
+ NSString* nibPath = [self.nibBundle pathForResource:@"Toolbar" ofType:@"nib"];
+ struct stat sb;
+ int nibErrno = 0;
+ if (stat(nibPath.fileSystemRepresentation, &sb) != 0) {
+ nibErrno = errno;
+ }
+ NSString* closestPath = nibPath;
+ while (closestPath && stat(closestPath.fileSystemRepresentation, &sb) != 0) {
+ closestPath = [closestPath stringByDeletingLastPathComponent];
+ }
+ base::debug::ScopedCrashKey nibCrashKey {
+ crash_keys::mac::kToolbarNibInfo,
+ [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_) {
« no previous file with comments | « no previous file | chrome/common/crash_keys.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698