| OLD | NEW |
| 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 #include "base/debug_util.h" | 7 #include "base/debug_util.h" |
| 8 | 8 |
| 9 #import <Foundation/Foundation.h> | 9 #import <Foundation/Foundation.h> |
| 10 #import <ApplicationServices/ApplicationServices.h> | 10 #import <ApplicationServices/ApplicationServices.h> |
| 11 extern "C" { | 11 extern "C" { |
| 12 #include <sandbox.h> | 12 #include <sandbox.h> |
| 13 } | 13 } |
| 14 | 14 |
| 15 #include "base/sys_info.h" | 15 #include "base/sys_info.h" |
| 16 #include "chrome/common/chrome_switches.h" | 16 #include "chrome/common/chrome_switches.h" |
| 17 #include "third_party/WebKit/WebKit/mac/WebCoreSupport/WebSystemInterface.h" | 17 #include "third_party/WebKit/WebKit/mac/WebCoreSupport/WebSystemInterface.h" |
| 18 | 18 |
| 19 RendererMainPlatformDelegate::RendererMainPlatformDelegate( | 19 RendererMainPlatformDelegate::RendererMainPlatformDelegate( |
| 20 const MainFunctionParams& parameters) | 20 const MainFunctionParams& parameters) |
| 21 : parameters_(parameters) { | 21 : parameters_(parameters) { |
| 22 } | 22 } |
| 23 | 23 |
| 24 RendererMainPlatformDelegate::~RendererMainPlatformDelegate() { | 24 RendererMainPlatformDelegate::~RendererMainPlatformDelegate() { |
| 25 } | 25 } |
| 26 | 26 |
| 27 // TODO(mac-port): Any code needed to initialize a process for |
| 28 // purposes of running a renderer needs to also be reflected in |
| 29 // chrome_dll_main.cc for --single-process support. |
| 27 void RendererMainPlatformDelegate::PlatformInitialize() { | 30 void RendererMainPlatformDelegate::PlatformInitialize() { |
| 28 // Load WebKit system interfaces. | 31 // Load WebKit system interfaces. |
| 29 InitWebCoreSystemInterface(); | 32 InitWebCoreSystemInterface(); |
| 30 | 33 |
| 31 // Warmup CG - without these calls these two functions won't work in the | 34 // Warmup CG - without these calls these two functions won't work in the |
| 32 // sandbox. | 35 // sandbox. |
| 33 CGColorSpaceRef rgb_colorspace = | 36 CGColorSpaceRef rgb_colorspace = |
| 34 CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB); | 37 CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB); |
| 35 | 38 |
| 36 // Allocate a 1 byte image. | 39 // Allocate a 1 byte image. |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 if (error == -1) { | 91 if (error == -1) { |
| 89 LOG(ERROR) << "Failed to Initialize Sandbox: " << error_buff; | 92 LOG(ERROR) << "Failed to Initialize Sandbox: " << error_buff; |
| 90 } | 93 } |
| 91 sandbox_free_error(error_buff); | 94 sandbox_free_error(error_buff); |
| 92 return success; | 95 return success; |
| 93 } | 96 } |
| 94 | 97 |
| 95 void RendererMainPlatformDelegate::RunSandboxTests() { | 98 void RendererMainPlatformDelegate::RunSandboxTests() { |
| 96 // TODO(port): Run sandbox unit test here. | 99 // TODO(port): Run sandbox unit test here. |
| 97 } | 100 } |
| OLD | NEW |