Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/mac/foundation_util.h" | 5 #include "base/mac/foundation_util.h" |
| 6 | 6 |
| 7 #include <stdlib.h> | 7 #include <stdlib.h> |
| 8 #include <string.h> | 8 #include <string.h> |
| 9 | 9 |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 39 NULL, NULL, NULL)) != noErr) { | 39 NULL, NULL, NULL)) != noErr) { |
| 40 OSSTATUS_DLOG(ERROR, fsErr) << "FSGetCatalogInfo failed"; | 40 OSSTATUS_DLOG(ERROR, fsErr) << "FSGetCatalogInfo failed"; |
| 41 return false; | 41 return false; |
| 42 } | 42 } |
| 43 | 43 |
| 44 return info.nodeFlags & kFSNodeIsDirectoryMask; | 44 return info.nodeFlags & kFSNodeIsDirectoryMask; |
| 45 } | 45 } |
| 46 | 46 |
| 47 bool AmIBundled() { | 47 bool AmIBundled() { |
| 48 // If the return value is not cached, this function will return different | 48 // If the return value is not cached, this function will return different |
| 49 // values depending on when it's called. This confuses some client code, see | 49 // values depending on when its called. This confuses some client code, see |
|
gavinp
2012/03/30 01:16:30
The original is correct here.
| |
| 50 // http://crbug.com/63183 . | 50 // http://crbug.com/63183 . |
| 51 static bool result = UncachedAmIBundled(); | 51 static bool result = UncachedAmIBundled(); |
| 52 DCHECK_EQ(result, UncachedAmIBundled()) | 52 DCHECK_EQ(result, UncachedAmIBundled()) |
| 53 << "The return value of AmIBundled() changed. This will confuse tests. " | 53 << "The return value of AmIBundled() changed. This will confuse tests. " |
| 54 << "Call SetAmIBundled() override manually if your test binary " | 54 << "Call SetAmIBundled() override manually if your test binary " |
| 55 << "delay-loads the framework."; | 55 << "delay-loads the framework."; |
| 56 return result; | 56 return result; |
| 57 } | 57 } |
| 58 | 58 |
| 59 void SetOverrideAmIBundled(bool value) { | 59 void SetOverrideAmIBundled(bool value) { |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 356 CFDictionaryGetValue(user_info.get(), kCFErrorDescriptionKey)); | 356 CFDictionaryGetValue(user_info.get(), kCFErrorDescriptionKey)); |
| 357 } | 357 } |
| 358 o << "Code: " << CFErrorGetCode(err) | 358 o << "Code: " << CFErrorGetCode(err) |
| 359 << " Domain: " << CFErrorGetDomain(err) | 359 << " Domain: " << CFErrorGetDomain(err) |
| 360 << " Desc: " << desc.get(); | 360 << " Desc: " << desc.get(); |
| 361 if(errorDesc) { | 361 if(errorDesc) { |
| 362 o << "(" << errorDesc << ")"; | 362 o << "(" << errorDesc << ")"; |
| 363 } | 363 } |
| 364 return o; | 364 return o; |
| 365 } | 365 } |
| OLD | NEW |