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

Unified Diff: sync/util/get_session_name_mac.mm

Issue 10807052: mac: Remove code that was only needed on 10.5 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: kill workspaceIDCache_ Created 8 years, 5 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 | « net/base/cert_verify_proc_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/util/get_session_name_mac.mm
diff --git a/sync/util/get_session_name_mac.mm b/sync/util/get_session_name_mac.mm
index 629860403bd667df35fab307c4d44eb5725597e2..e7d29c46210d264d867ca4db58e28077292b40db 100644
--- a/sync/util/get_session_name_mac.mm
+++ b/sync/util/get_session_name_mac.mm
@@ -15,36 +15,12 @@
#include "base/sys_info.h"
#include "base/sys_string_conversions.h"
-@interface NSHost(SnowLeopardAPI)
-- (NSString*)localizedName;
-@end
-
namespace syncer {
namespace internal {
std::string GetHardwareModelName() {
NSHost* myHost = [NSHost currentHost];
- if ([myHost respondsToSelector:@selector(localizedName)])
- return base::SysNSStringToUTF8([myHost localizedName]);
-
- // Fallback for 10.5
- scoped_nsobject<NSString> computerName(base::mac::CFToNSCast(
- SCDynamicStoreCopyComputerName(NULL, NULL)));
- if (computerName.get() != NULL)
- return base::SysNSStringToUTF8(computerName.get());
-
- // If all else fails, return to using a slightly nicer version of the
- // hardware model.
- char modelBuffer[256];
- size_t length = sizeof(modelBuffer);
- if (!sysctlbyname("hw.model", modelBuffer, &length, NULL, 0)) {
- for (size_t i = 0; i < length; i++) {
- if (IsAsciiDigit(modelBuffer[i]))
- return std::string(modelBuffer, 0, i);
- }
- return std::string(modelBuffer, 0, length);
- }
- return "Unknown";
+ return base::SysNSStringToUTF8([myHost localizedName]);
}
} // namespace internal
« no previous file with comments | « net/base/cert_verify_proc_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698