diff options
author | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-19 20:05:50 +0000 |
---|---|---|
committer | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-19 20:05:50 +0000 |
commit | 2b54eeb8250a162d30e65583b4d5b3783a4023c7 (patch) | |
tree | 6c241a001676def81db003645a3e13946e4ec743 | |
parent | b6ecb344dd4f0c57fc50c7e734621fa0f6ce61bf (diff) | |
download | chromium_src-2b54eeb8250a162d30e65583b4d5b3783a4023c7.zip chromium_src-2b54eeb8250a162d30e65583b4d5b3783a4023c7.tar.gz chromium_src-2b54eeb8250a162d30e65583b4d5b3783a4023c7.tar.bz2 |
Provide better diagnostics when launching with a silly executable path.
BUG=24842
TEST=none
Review URL: http://codereview.chromium.org/304004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29442 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | base/mac_util.mm | 7 | ||||
-rw-r--r-- | chrome/common/chrome_paths_mac.mm | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/base/mac_util.mm b/base/mac_util.mm index f31ca42..772fe16b 100644 --- a/base/mac_util.mm +++ b/base/mac_util.mm @@ -77,7 +77,7 @@ void SetOverrideAppBundle(NSBundle* bundle) { void SetOverrideAppBundlePath(const FilePath& file_path) { NSString* path = base::SysUTF8ToNSString(file_path.value()); NSBundle* bundle = [NSBundle bundleWithPath:path]; - DCHECK(bundle) << "failed to load the bundle: " << file_path.value(); + CHECK(bundle) << "Failed to load the bundle at " << file_path.value(); SetOverrideAppBundle(bundle); } @@ -146,7 +146,8 @@ static int g_full_screen_requests = 0; // Add a request for full screen mode. If the menu bar is not currently // hidden, hide it. Must be called on main thread. void RequestFullScreen() { - if (!g_full_screen_requests) + DCHECK_GE(g_full_screen_requests, 0); + if (g_full_screen_requests == 0) SetSystemUIMode(kUIModeAllSuppressed, kUIOptionAutoShowMenuBar); ++g_full_screen_requests; } @@ -154,7 +155,7 @@ void RequestFullScreen() { // Release a request for full screen mode. If there are no other outstanding // requests, show the menu bar. Must be called on main thread. void ReleaseFullScreen() { - DCHECK(g_full_screen_requests > 0); + DCHECK_GT(g_full_screen_requests, 0); --g_full_screen_requests; if (g_full_screen_requests == 0) SetSystemUIMode(kUIModeNormal, 0); diff --git a/chrome/common/chrome_paths_mac.mm b/chrome/common/chrome_paths_mac.mm index 26c2974..3fdcfdf 100644 --- a/chrome/common/chrome_paths_mac.mm +++ b/chrome/common/chrome_paths_mac.mm @@ -73,12 +73,14 @@ FilePath GetVersionedDirectory() { // One step up to MacOS, another to Contents. path = path.DirName().DirName(); + DCHECK_EQ(path.BaseName().value(), "Contents"); if (mac_util::IsBackgroundOnlyProcess()) { // path identifies the helper .app's Contents directory in the browser // .app's versioned directory. Go up two steps to get to the browser // .app's versioned directory. path = path.DirName().DirName(); + DCHECK_EQ(path.BaseName().value(), kChromeVersion); } else { // Go into the versioned directory. path = path.Append("Versions").Append(kChromeVersion); |