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

Side by Side Diff: content/renderer/renderer_main.cc

Issue 7144007: Improve and unify Mac OS X run-time version checks (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 6 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 unified diff | Download patch | Annotate | Revision Log
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 #if defined(OS_MACOSX) 5 #if defined(OS_MACOSX)
6 #include <signal.h> 6 #include <signal.h>
7 #include <unistd.h> 7 #include <unistd.h>
8 #endif // OS_MACOSX 8 #endif // OS_MACOSX
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 17 matching lines...) Expand all
28 #include "content/common/hi_res_timer_manager.h" 28 #include "content/common/hi_res_timer_manager.h"
29 #include "content/common/pepper_plugin_registry.h" 29 #include "content/common/pepper_plugin_registry.h"
30 #include "content/renderer/render_process_impl.h" 30 #include "content/renderer/render_process_impl.h"
31 #include "content/renderer/render_thread.h" 31 #include "content/renderer/render_thread.h"
32 #include "content/renderer/renderer_main_platform_delegate.h" 32 #include "content/renderer/renderer_main_platform_delegate.h"
33 #include "ui/base/ui_base_switches.h" 33 #include "ui/base/ui_base_switches.h"
34 34
35 #if defined(OS_MACOSX) 35 #if defined(OS_MACOSX)
36 #include <Carbon/Carbon.h> // TISCreateInputSourceList 36 #include <Carbon/Carbon.h> // TISCreateInputSourceList
37 37
38 #include "base/sys_info.h" 38 #include "base/mac/mac_util.h"
39 #include "third_party/mach_override/mach_override.h" 39 #include "third_party/mach_override/mach_override.h"
40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" 40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
41 #endif // OS_MACOSX 41 #endif // OS_MACOSX
42 42
43 #if defined(OS_MACOSX) 43 #if defined(OS_MACOSX)
44 namespace { 44 namespace {
45 45
46 CFArrayRef ChromeTISCreateInputSourceList( 46 CFArrayRef ChromeTISCreateInputSourceList(
47 CFDictionaryRef properties, 47 CFDictionaryRef properties,
48 Boolean includeAllInstalled) { 48 Boolean includeAllInstalled) {
49 CFTypeRef values[] = { CFSTR("") }; 49 CFTypeRef values[] = { CFSTR("") };
50 return CFArrayCreate( 50 return CFArrayCreate(
51 kCFAllocatorDefault, values, arraysize(values), &kCFTypeArrayCallBacks); 51 kCFAllocatorDefault, values, arraysize(values), &kCFTypeArrayCallBacks);
52 } 52 }
53 53
54 void InstallFrameworkHacks() { 54 void InstallFrameworkHacks() {
55 int32 os_major, os_minor, os_bugfix;
56 base::SysInfo::OperatingSystemVersionNumbers(
57 &os_major, &os_minor, &os_bugfix);
58
59 // See http://crbug.com/31225 55 // See http://crbug.com/31225
60 // TODO: Don't do this on newer OS X revisions that have a fix for 56 // TODO: Don't do this on newer OS X revisions that have a fix for
61 // http://openradar.appspot.com/radar?id=1156410 57 // http://openradar.appspot.com/radar?id=1156410
62 if (os_major == 10 && os_minor >= 6) { 58 if (base::mac::IsOSSnowLeopardOrLater()) {
63 // Chinese Handwriting was introduced in 10.6. Since doing this override 59 // Chinese Handwriting was introduced in 10.6. Since doing this override
64 // regresses page cycler memory usage on 10.5, don't do the unnecessary 60 // regresses page cycler memory usage on 10.5, don't do the unnecessary
65 // override there. 61 // override there.
66 mach_error_t err = mach_override_ptr( 62 mach_error_t err = mach_override_ptr(
67 (void*)&TISCreateInputSourceList, 63 (void*)&TISCreateInputSourceList,
68 (void*)&ChromeTISCreateInputSourceList, 64 (void*)&ChromeTISCreateInputSourceList,
69 NULL); 65 NULL);
70 CHECK_EQ(err_none, err); 66 CHECK_EQ(err_none, err);
71 } 67 }
72 } 68 }
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 pool->Recycle(); 229 pool->Recycle();
234 TRACE_EVENT_BEGIN_ETW("RendererMain.START_MSG_LOOP", 0, 0); 230 TRACE_EVENT_BEGIN_ETW("RendererMain.START_MSG_LOOP", 0, 0);
235 MessageLoop::current()->Run(); 231 MessageLoop::current()->Run();
236 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0); 232 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0);
237 } 233 }
238 } 234 }
239 platform.PlatformUninitialize(); 235 platform.PlatformUninitialize();
240 TRACE_EVENT_END_ETW("RendererMain", 0, ""); 236 TRACE_EVENT_END_ETW("RendererMain", 0, "");
241 return 0; 237 return 0;
242 } 238 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698