OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "chrome/renderer/renderer_main_platform_delegate.h" | |
6 | |
7 #import <Cocoa/Cocoa.h> | |
8 | |
9 #include "base/command_line.h" | |
10 #include "chrome/common/chrome_switches.h" | |
11 #import "content/common/chrome_application_mac.h" | |
12 #include "content/common/sandbox_mac.h" | |
13 #include "third_party/WebKit/Source/WebKit/mac/WebCoreSupport/WebSystemInterface
.h" | |
14 | |
15 RendererMainPlatformDelegate::RendererMainPlatformDelegate( | |
16 const MainFunctionParams& parameters) | |
17 : parameters_(parameters) { | |
18 } | |
19 | |
20 RendererMainPlatformDelegate::~RendererMainPlatformDelegate() { | |
21 } | |
22 | |
23 // TODO(mac-port): Any code needed to initialize a process for purposes of | |
24 // running a renderer needs to also be reflected in chrome_main.cc for | |
25 // --single-process support. | |
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 | |
31 // Load WebKit system interfaces. | |
32 InitWebCoreSystemInterface(); | |
33 | |
34 if (![NSThread isMultiThreaded]) { | |
35 NSString* string = @""; | |
36 [NSThread detachNewThreadSelector:@selector(length) | |
37 toTarget:string | |
38 withObject:nil]; | |
39 } | |
40 } | |
41 | |
42 void RendererMainPlatformDelegate::PlatformUninitialize() { | |
43 } | |
44 | |
45 bool RendererMainPlatformDelegate::InitSandboxTests(bool no_sandbox) { | |
46 return true; | |
47 } | |
48 | |
49 bool RendererMainPlatformDelegate::EnableSandbox() { | |
50 CommandLine* parsed_command_line = CommandLine::ForCurrentProcess(); | |
51 SandboxInitWrapper sandbox_wrapper; | |
52 return sandbox_wrapper.InitializeSandbox(*parsed_command_line, | |
53 switches::kRendererProcess); | |
54 } | |
55 | |
56 void RendererMainPlatformDelegate::RunSandboxTests() { | |
57 // TODO(port): Run sandbox unit test here. | |
58 } | |
OLD | NEW |