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 "chrome/browser/chrome_browser_main_mac.h" | 5 #include "chrome/browser/chrome_browser_main_mac.h" |
| 6 | 6 |
| 7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
| 8 #include <sys/sysctl.h> | 8 #include <sys/sysctl.h> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 65 FUTURE_CAT_32, // Unexpected, it's unlikely Apple will un-obsolete old CPUs. | 65 FUTURE_CAT_32, // Unexpected, it's unlikely Apple will un-obsolete old CPUs. |
| 66 FUTURE_CAT_64, | 66 FUTURE_CAT_64, |
| 67 | 67 |
| 68 // What if the bitsiness of the CPU can't be determined? | 68 // What if the bitsiness of the CPU can't be determined? |
| 69 SABER_TOOTHED_CAT_DUNNO, | 69 SABER_TOOTHED_CAT_DUNNO, |
| 70 SNOW_LEOPARD_DUNNO, | 70 SNOW_LEOPARD_DUNNO, |
| 71 LION_DUNNO, | 71 LION_DUNNO, |
| 72 MOUNTAIN_LION_DUNNO, | 72 MOUNTAIN_LION_DUNNO, |
| 73 FUTURE_CAT_DUNNO, | 73 FUTURE_CAT_DUNNO, |
| 74 | 74 |
| 75 // Add new constants here. | 75 // Add new constants here. |
|
Mark Mentovai
2013/10/01 16:15:45
Do this?
Avi (use Gerrit)
2013/10/01 17:07:27
How? Does FUTURE_CAT become MAVERICKS? Or does FUT
| |
| 76 | 76 |
| 77 CAT_SIXTY_FOUR_MAX | 77 CAT_SIXTY_FOUR_MAX |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 CatSixtyFour CatSixtyFourValue() { | 80 CatSixtyFour CatSixtyFourValue() { |
| 81 #if defined(ARCH_CPU_64_BITS) | 81 #if defined(ARCH_CPU_64_BITS) |
| 82 // If 64-bit code is running, then it's established that this CPU can run | 82 // If 64-bit code is running, then it's established that this CPU can run |
| 83 // 64-bit code, and no further inquiry is necessary. | 83 // 64-bit code, and no further inquiry is necessary. |
| 84 int cpu64 = 1; | 84 int cpu64 = 1; |
| 85 bool cpu64_known = true; | 85 bool cpu64_known = true; |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 107 SNOW_LEOPARD_DUNNO; | 107 SNOW_LEOPARD_DUNNO; |
| 108 } | 108 } |
| 109 if (base::mac::IsOSLion()) { | 109 if (base::mac::IsOSLion()) { |
| 110 return cpu64_known ? (cpu64 ? LION_64 : LION_32) : | 110 return cpu64_known ? (cpu64 ? LION_64 : LION_32) : |
| 111 LION_DUNNO; | 111 LION_DUNNO; |
| 112 } | 112 } |
| 113 if (base::mac::IsOSMountainLion()) { | 113 if (base::mac::IsOSMountainLion()) { |
| 114 return cpu64_known ? (cpu64 ? MOUNTAIN_LION_64 : MOUNTAIN_LION_32) : | 114 return cpu64_known ? (cpu64 ? MOUNTAIN_LION_64 : MOUNTAIN_LION_32) : |
| 115 MOUNTAIN_LION_DUNNO; | 115 MOUNTAIN_LION_DUNNO; |
| 116 } | 116 } |
| 117 if (base::mac::IsOSLaterThanMountainLion_DontCallThis()) { | 117 if (base::mac::IsOSMavericksOrLater()) { |
| 118 return cpu64_known ? (cpu64 ? FUTURE_CAT_64 : FUTURE_CAT_32) : | 118 return cpu64_known ? (cpu64 ? FUTURE_CAT_64 : FUTURE_CAT_32) : |
| 119 FUTURE_CAT_DUNNO; | 119 FUTURE_CAT_DUNNO; |
| 120 } | 120 } |
| 121 | 121 |
| 122 // If it's not any of the expected OS versions or later than them, it must | 122 // If it's not any of the expected OS versions or later than them, it must |
| 123 // be prehistoric. | 123 // be prehistoric. |
| 124 return cpu64_known ? (cpu64 ? SABER_TOOTHED_CAT_64 : SABER_TOOTHED_CAT_32) : | 124 return cpu64_known ? (cpu64 ? SABER_TOOTHED_CAT_64 : SABER_TOOTHED_CAT_32) : |
| 125 SABER_TOOTHED_CAT_DUNNO; | 125 SABER_TOOTHED_CAT_DUNNO; |
| 126 } | 126 } |
| 127 | 127 |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 260 void ChromeBrowserMainPartsMac::PostProfileInit() { | 260 void ChromeBrowserMainPartsMac::PostProfileInit() { |
| 261 ChromeBrowserMainPartsPosix::PostProfileInit(); | 261 ChromeBrowserMainPartsPosix::PostProfileInit(); |
| 262 g_browser_process->metrics_service()->RecordBreakpadRegistration( | 262 g_browser_process->metrics_service()->RecordBreakpadRegistration( |
| 263 IsCrashReporterEnabled()); | 263 IsCrashReporterEnabled()); |
| 264 } | 264 } |
| 265 | 265 |
| 266 void ChromeBrowserMainPartsMac::DidEndMainMessageLoop() { | 266 void ChromeBrowserMainPartsMac::DidEndMainMessageLoop() { |
| 267 AppController* appController = [NSApp delegate]; | 267 AppController* appController = [NSApp delegate]; |
| 268 [appController didEndMainMessageLoop]; | 268 [appController didEndMainMessageLoop]; |
| 269 } | 269 } |
| OLD | NEW |