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

Side by Side Diff: base/mac/mac_util.mm

Issue 8921006: Standardize StringToInt{,64} interface. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix call syntax of StringToInt() in Chrome OS code. Created 9 years 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 unified diff | Download patch
« no previous file with comments | « AUTHORS ('k') | base/string_number_conversions.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/mac_util.h" 5 #include "base/mac/mac_util.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 #include <string.h> 8 #include <string.h>
9 #include <sys/utsname.h> 9 #include <sys/utsname.h>
10 10
11 #include "base/file_path.h" 11 #include "base/file_path.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/mac/foundation_util.h" 13 #include "base/mac/foundation_util.h"
14 #include "base/mac/scoped_cftyperef.h" 14 #include "base/mac/scoped_cftyperef.h"
15 #include "base/memory/scoped_nsobject.h" 15 #include "base/memory/scoped_nsobject.h"
16 #include "base/string_number_conversions.h" 16 #include "base/string_number_conversions.h"
17 #include "base/string_piece.h"
17 #include "base/sys_string_conversions.h" 18 #include "base/sys_string_conversions.h"
18 19
19 namespace base { 20 namespace base {
20 namespace mac { 21 namespace mac {
21 22
22 namespace { 23 namespace {
23 24
24 // The current count of outstanding requests for full screen mode from browser 25 // The current count of outstanding requests for full screen mode from browser
25 // windows, plugins, etc. 26 // windows, plugins, etc.
26 int g_full_screen_requests[kNumFullScreenModes] = { 0, 0, 0}; 27 int g_full_screen_requests[kNumFullScreenModes] = { 0, 0, 0};
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 } 515 }
515 516
516 if (strcmp(uname_info.sysname, "Darwin") != 0) { 517 if (strcmp(uname_info.sysname, "Darwin") != 0) {
517 DLOG(ERROR) << "unexpected uname sysname " << uname_info.sysname; 518 DLOG(ERROR) << "unexpected uname sysname " << uname_info.sysname;
518 return 0; 519 return 0;
519 } 520 }
520 521
521 int darwin_major_version = 0; 522 int darwin_major_version = 0;
522 char* dot = strchr(uname_info.release, '.'); 523 char* dot = strchr(uname_info.release, '.');
523 if (dot) { 524 if (dot) {
524 if (!base::StringToInt(uname_info.release, dot, &darwin_major_version)) { 525 if (!base::StringToInt(base::StringPiece(uname_info.release,
526 dot - uname_info.release),
527 &darwin_major_version)) {
525 dot = NULL; 528 dot = NULL;
526 } 529 }
527 } 530 }
528 531
529 if (!dot) { 532 if (!dot) {
530 DLOG(ERROR) << "could not parse uname release " << uname_info.release; 533 DLOG(ERROR) << "could not parse uname release " << uname_info.release;
531 return 0; 534 return 0;
532 } 535 }
533 536
534 return darwin_major_version; 537 return darwin_major_version;
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
613 #endif 616 #endif
614 617
615 #if !defined(BASE_MAC_MAC_UTIL_H_INLINED_GT_10_7) 618 #if !defined(BASE_MAC_MAC_UTIL_H_INLINED_GT_10_7)
616 bool IsOSLaterThanLion() { 619 bool IsOSLaterThanLion() {
617 return MacOSXMinorVersion() > LION_MINOR_VERSION; 620 return MacOSXMinorVersion() > LION_MINOR_VERSION;
618 } 621 }
619 #endif 622 #endif
620 623
621 } // namespace mac 624 } // namespace mac
622 } // namespace base 625 } // namespace base
OLDNEW
« no previous file with comments | « AUTHORS ('k') | base/string_number_conversions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698