// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/renderer/renderer_main_platform_delegate.h" #import #import "base/chrome_application_mac.h" #include "base/command_line.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/sandbox_mac.h" #include "third_party/WebKit/WebKit/mac/WebCoreSupport/WebSystemInterface.h" RendererMainPlatformDelegate::RendererMainPlatformDelegate( const MainFunctionParams& parameters) : parameters_(parameters) { } RendererMainPlatformDelegate::~RendererMainPlatformDelegate() { } // TODO(mac-port): Any code needed to initialize a process for purposes of // running a renderer needs to also be reflected in chrome_dll_main.cc for // --single-process support. void RendererMainPlatformDelegate::PlatformInitialize() { // Initialize NSApplication using the custom subclass. Without this call, // drawing of native UI elements (e.g. buttons) in WebKit will explode. [CrApplication sharedApplication]; // Load WebKit system interfaces. InitWebCoreSystemInterface(); if (![NSThread isMultiThreaded]) { NSString* string = @""; [NSThread detachNewThreadSelector:@selector(length) toTarget:string withObject:nil]; } } void RendererMainPlatformDelegate::PlatformUninitialize() { } bool RendererMainPlatformDelegate::InitSandboxTests(bool no_sandbox) { return true; } bool RendererMainPlatformDelegate::EnableSandbox() { CommandLine* parsed_command_line = CommandLine::ForCurrentProcess(); SandboxInitWrapper sandbox_wrapper; return sandbox_wrapper.InitializeSandbox(*parsed_command_line, switches::kRendererProcess); } void RendererMainPlatformDelegate::RunSandboxTests() { // TODO(port): Run sandbox unit test here. }