// 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" #include "base/debug_util.h" extern "C" { #include } RendererMainPlatformDelegate::RendererMainPlatformDelegate( const MainFunctionParams& parameters) : parameters_(parameters) { } RendererMainPlatformDelegate::~RendererMainPlatformDelegate() { } void RendererMainPlatformDelegate::PlatformInitialize() { } void RendererMainPlatformDelegate::PlatformUninitialize() { } bool RendererMainPlatformDelegate::InitSandboxTests(bool no_sandbox) { return true; } bool RendererMainPlatformDelegate::EnableSandbox() { // This call doesn't work when the sandbox is enabled, the implementation // caches it's return value so we call it here and then future calls will // succeed. DebugUtil::BeingDebugged(); char* error_buff = NULL; int error = sandbox_init(kSBXProfilePureComputation, SANDBOX_NAMED, &error_buff); bool success = (error == 0 && error_buff == NULL); if (error == -1) { LOG(ERROR) << "Failed to Initialize Sandbox: " << error_buff; } sandbox_free_error(error_buff); return success; } void RendererMainPlatformDelegate::RunSandboxTests() { // TODO(port): Run sandbox unit test here. }