diff options
author | stuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-11 15:02:30 +0000 |
---|---|---|
committer | stuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-11 15:02:30 +0000 |
commit | db87d6a207cc9e8a6a52201e0472fe467c990b7b (patch) | |
tree | 43484b08f5c9f2a44c4dfa0a26361f0370d57a8e /base/mac | |
parent | c68cb0ef3433b184cf331e475dfc6d7363cda983 (diff) | |
download | chromium_src-db87d6a207cc9e8a6a52201e0472fe467c990b7b.zip chromium_src-db87d6a207cc9e8a6a52201e0472fe467c990b7b.tar.gz chromium_src-db87d6a207cc9e8a6a52201e0472fe467c990b7b.tar.bz2 |
Get mac_logging and foundation_util working on iOS
BUG=None
TEST=None
Review URL: https://chromiumcodereview.appspot.com/10690133
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146117 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/mac')
-rw-r--r-- | base/mac/foundation_util.h | 1 | ||||
-rw-r--r-- | base/mac/foundation_util.mm | 14 | ||||
-rw-r--r-- | base/mac/mac_logging.cc | 12 | ||||
-rw-r--r-- | base/mac/mac_logging.h | 9 |
4 files changed, 32 insertions, 4 deletions
diff --git a/base/mac/foundation_util.h b/base/mac/foundation_util.h index 0f68760..186659f 100644 --- a/base/mac/foundation_util.h +++ b/base/mac/foundation_util.h @@ -18,6 +18,7 @@ #if defined(__OBJC__) #import <Foundation/Foundation.h> #else // __OBJC__ +#include <CoreFoundation/CoreFoundation.h> class NSBundle; class NSString; #endif // __OBJC__ diff --git a/base/mac/foundation_util.mm b/base/mac/foundation_util.mm index 13c6ee8..7290615 100644 --- a/base/mac/foundation_util.mm +++ b/base/mac/foundation_util.mm @@ -13,10 +13,12 @@ #include "base/mac/mac_logging.h" #include "base/sys_string_conversions.h" +#if !defined(OS_IOS) extern "C" { CFTypeID SecACLGetTypeID(); CFTypeID SecTrustedApplicationGetTypeID(); } // extern "C" +#endif namespace base { namespace mac { @@ -26,6 +28,10 @@ static bool g_override_am_i_bundled_value = false; // Adapted from http://developer.apple.com/carbon/tipsandtricks.html#AmIBundled static bool UncachedAmIBundled() { +#if defined(OS_IOS) + // All apps are bundled on iOS + return true; +#else if (g_override_am_i_bundled) return g_override_am_i_bundled_value; @@ -47,6 +53,7 @@ static bool UncachedAmIBundled() { } return info.nodeFlags & kFSNodeIsDirectoryMask; +#endif } bool AmIBundled() { @@ -62,6 +69,11 @@ bool AmIBundled() { } void SetOverrideAmIBundled(bool value) { +#if defined(OS_IOS) + // It doesn't make sense not to be bundled on iOS. + if (!value) + NOTREACHED(); +#endif g_override_am_i_bundled = true; g_override_am_i_bundled_value = value; } @@ -317,8 +329,10 @@ CF_CAST_DEFN(CFNumber); CF_CAST_DEFN(CFSet); CF_CAST_DEFN(CFString); +#if !defined(OS_IOS) CF_CAST_DEFN(SecACL); CF_CAST_DEFN(SecTrustedApplication); +#endif #undef CF_CAST_DEFN diff --git a/base/mac/mac_logging.cc b/base/mac/mac_logging.cc index 353f092..d58220f 100644 --- a/base/mac/mac_logging.cc +++ b/base/mac/mac_logging.cc @@ -4,10 +4,12 @@ #include "base/mac/mac_logging.h" -#include <CoreServices/CoreServices.h> - #include <iomanip> +#if !defined(OS_IOS) +#include <CoreServices/CoreServices.h> +#endif + namespace logging { OSStatusLogMessage::OSStatusLogMessage(const char* file_path, @@ -19,11 +21,17 @@ OSStatusLogMessage::OSStatusLogMessage(const char* file_path, } OSStatusLogMessage::~OSStatusLogMessage() { +#if defined(OS_IOS) + // TODO(ios): Consider using NSError with NSOSStatusErrorDomain to try to + // get a description of the failure. + stream() << ": " << status_; +#else stream() << ": " << GetMacOSStatusErrorString(status_) << " (" << status_ << ")"; +#endif } } // namespace logging diff --git a/base/mac/mac_logging.h b/base/mac/mac_logging.h index c463a35..7db601c 100644 --- a/base/mac/mac_logging.h +++ b/base/mac/mac_logging.h @@ -6,9 +6,14 @@ #define BASE_MAC_MAC_LOGGING_H_ #pragma once -#include <libkern/OSTypes.h> - #include "base/logging.h" +#include "build/build_config.h" + +#if defined(OS_IOS) +#include <MacTypes.h> +#else +#include <libkern/OSTypes.h> +#endif // Use the OSSTATUS_LOG family to log messages related to errors in Mac OS X // system routines that report status via an OSStatus or OSErr value. It is |