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

Side by Side Diff: chrome/renderer/renderer_main_platform_delegate_mac.mm

Issue 345051: Cleans up our autorelease handling so that we don't create a layered ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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
« base/message_pump_mac.mm ('K') | « chrome/chrome.gyp ('k') | no next file » | 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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/renderer/renderer_main_platform_delegate.h" 5 #include "chrome/renderer/renderer_main_platform_delegate.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 8
9 #import "base/chrome_application_mac.h"
9 #include "base/command_line.h" 10 #include "base/command_line.h"
10 #include "chrome/common/chrome_switches.h" 11 #include "chrome/common/chrome_switches.h"
11 #include "chrome/common/sandbox_mac.h" 12 #include "chrome/common/sandbox_mac.h"
12 #include "third_party/WebKit/WebKit/mac/WebCoreSupport/WebSystemInterface.h" 13 #include "third_party/WebKit/WebKit/mac/WebCoreSupport/WebSystemInterface.h"
13 14
14 RendererMainPlatformDelegate::RendererMainPlatformDelegate( 15 RendererMainPlatformDelegate::RendererMainPlatformDelegate(
15 const MainFunctionParams& parameters) 16 const MainFunctionParams& parameters)
16 : parameters_(parameters) { 17 : parameters_(parameters) {
17 } 18 }
18 19
19 RendererMainPlatformDelegate::~RendererMainPlatformDelegate() { 20 RendererMainPlatformDelegate::~RendererMainPlatformDelegate() {
20 } 21 }
21 22
22 // TODO(mac-port): Any code needed to initialize a process for 23 // TODO(mac-port): Any code needed to initialize a process for purposes of
23 // purposes of running a renderer needs to also be reflected in 24 // running a renderer needs to also be reflected in chrome_dll_main.cc for
24 // chrome_dll_main.cc for --single-process support. 25 // --single-process support.
25 void RendererMainPlatformDelegate::PlatformInitialize() { 26 void RendererMainPlatformDelegate::PlatformInitialize() {
27 // Initialize NSApplication using the custom subclass. Without this call,
28 // drawing of native UI elements (e.g. buttons) in WebKit will explode.
29 [CrApplication sharedApplication];
30
26 // Load WebKit system interfaces. 31 // Load WebKit system interfaces.
27 InitWebCoreSystemInterface(); 32 InitWebCoreSystemInterface();
28 33
29 if (![NSThread isMultiThreaded]) { 34 if (![NSThread isMultiThreaded]) {
30 NSString* string = @""; 35 NSString* string = @"";
31 [NSThread detachNewThreadSelector:@selector(length) 36 [NSThread detachNewThreadSelector:@selector(length)
32 toTarget:string 37 toTarget:string
33 withObject:nil]; 38 withObject:nil];
34 } 39 }
35
36 // Initialize Cocoa. Without this call, drawing of native UI
37 // elements (e.g. buttons) in WebKit will explode.
38 [NSApplication sharedApplication];
39 } 40 }
40 41
41 void RendererMainPlatformDelegate::PlatformUninitialize() { 42 void RendererMainPlatformDelegate::PlatformUninitialize() {
42 } 43 }
43 44
44 bool RendererMainPlatformDelegate::InitSandboxTests(bool no_sandbox) { 45 bool RendererMainPlatformDelegate::InitSandboxTests(bool no_sandbox) {
45 return true; 46 return true;
46 } 47 }
47 48
48 bool RendererMainPlatformDelegate::EnableSandbox() { 49 bool RendererMainPlatformDelegate::EnableSandbox() {
49 CommandLine* parsed_command_line = CommandLine::ForCurrentProcess(); 50 CommandLine* parsed_command_line = CommandLine::ForCurrentProcess();
50 SandboxInitWrapper sandbox_wrapper; 51 SandboxInitWrapper sandbox_wrapper;
51 return sandbox_wrapper.InitializeSandbox(*parsed_command_line, 52 return sandbox_wrapper.InitializeSandbox(*parsed_command_line,
52 switches::kRendererProcess); 53 switches::kRendererProcess);
53 } 54 }
54 55
55 void RendererMainPlatformDelegate::RunSandboxTests() { 56 void RendererMainPlatformDelegate::RunSandboxTests() {
56 // TODO(port): Run sandbox unit test here. 57 // TODO(port): Run sandbox unit test here.
57 } 58 }
OLDNEW
« base/message_pump_mac.mm ('K') | « chrome/chrome.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698