| 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 "content/renderer/renderer_main_platform_delegate.h" | 5 #include "content/renderer/renderer_main_platform_delegate.h" |
| 6 | 6 |
| 7 #include <Carbon/Carbon.h> | 7 #include <Carbon/Carbon.h> |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 #include <objc/runtime.h> | 9 #include <objc/runtime.h> |
| 10 #include <stdint.h> | 10 #include <stdint.h> |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 RendererMainPlatformDelegate::RendererMainPlatformDelegate( | 109 RendererMainPlatformDelegate::RendererMainPlatformDelegate( |
| 110 const MainFunctionParams& parameters) {} | 110 const MainFunctionParams& parameters) {} |
| 111 | 111 |
| 112 RendererMainPlatformDelegate::~RendererMainPlatformDelegate() { | 112 RendererMainPlatformDelegate::~RendererMainPlatformDelegate() { |
| 113 } | 113 } |
| 114 | 114 |
| 115 // TODO(mac-port): Any code needed to initialize a process for purposes of | 115 // TODO(mac-port): Any code needed to initialize a process for purposes of |
| 116 // running a renderer needs to also be reflected in chrome_main.cc for | 116 // running a renderer needs to also be reflected in chrome_main.cc for |
| 117 // --single-process support. | 117 // --single-process support. |
| 118 void RendererMainPlatformDelegate::PlatformInitialize() { | 118 void RendererMainPlatformDelegate::PlatformInitialize() { |
| 119 if (base::mac::IsOSYosemiteOrLater()) { | 119 if (base::mac::IsAtLeastOS10_10()) { |
| 120 // This is needed by the NSAnimations run for the scrollbars. If we switch | 120 // This is needed by the NSAnimations run for the scrollbars. If we switch |
| 121 // from native scrollers to drawing them in some other way, this warmup can | 121 // from native scrollers to drawing them in some other way, this warmup can |
| 122 // be removed <http://crbug.com/306348>. | 122 // be removed <http://crbug.com/306348>. |
| 123 [NSScreen screens]; | 123 [NSScreen screens]; |
| 124 } | 124 } |
| 125 | 125 |
| 126 if (![NSThread isMultiThreaded]) { | 126 if (![NSThread isMultiThreaded]) { |
| 127 NSString* string = @""; | 127 NSString* string = @""; |
| 128 [NSThread detachNewThreadSelector:@selector(length) | 128 [NSThread detachNewThreadSelector:@selector(length) |
| 129 toTarget:string | 129 toTarget:string |
| (...skipping 11 matching lines...) Expand all Loading... |
| 141 // The sandbox is now engaged. Make sure that the renderer has not connected | 141 // The sandbox is now engaged. Make sure that the renderer has not connected |
| 142 // itself to Cocoa. | 142 // itself to Cocoa. |
| 143 CHECK(NSApp == nil); | 143 CHECK(NSApp == nil); |
| 144 | 144 |
| 145 DisconnectCFNotificationCenter(); | 145 DisconnectCFNotificationCenter(); |
| 146 | 146 |
| 147 return sandbox_initialized; | 147 return sandbox_initialized; |
| 148 } | 148 } |
| 149 | 149 |
| 150 } // namespace content | 150 } // namespace content |
| OLD | NEW |