Commit b79c2124 authored by rohitrao@chromium.org's avatar rohitrao@chromium.org

[Mac] Add diagnostic logging to AmIBundled() to help with bot failures.

This change should be reverted as soon as we figure out what's going wrong.

BUG=52918
TEST=None
Review URL: http://codereview.chromium.org/3197012

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57088 0039d316-1c4b-4281-b951-d872f2087c98
parent 09ea24c7
...@@ -71,16 +71,29 @@ bool AmIBundled() { ...@@ -71,16 +71,29 @@ bool AmIBundled() {
ProcessSerialNumber psn = {0, kCurrentProcess}; ProcessSerialNumber psn = {0, kCurrentProcess};
FSRef fsref; FSRef fsref;
if (GetProcessBundleLocation(&psn, &fsref) != noErr) if (GetProcessBundleLocation(&psn, &fsref) != noErr) {
LOG(ERROR) << "GetProcessBundleLocation failed, returning false";
return false; return false;
}
FSCatalogInfo info; FSCatalogInfo info;
HFSUniStr255 hfsname;
if (FSGetCatalogInfo(&fsref, kFSCatInfoNodeFlags, &info, if (FSGetCatalogInfo(&fsref, kFSCatInfoNodeFlags, &info,
NULL, NULL, NULL) != noErr) { &hfsname, NULL, NULL) != noErr) {
LOG(ERROR) << "FSGetCatalogInfo failed, returning false";
return false; return false;
} }
return info.nodeFlags & kFSNodeIsDirectoryMask; scoped_cftyperef<CFStringRef> cfname(
CFStringCreateWithCharacters(kCFAllocatorDefault,
hfsname.unicode,
hfsname.length));
std::string filename = base::SysCFStringRefToUTF8(cfname);
bool bundled = info.nodeFlags & kFSNodeIsDirectoryMask;
LOG(ERROR) << "AmIBundled() filename is: " << filename
<< ", returning " << (bundled ? "true" : "false");
return bundled;
} }
bool IsBackgroundOnlyProcess() { bool IsBackgroundOnlyProcess() {
......
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