| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CHROME_RENDERER_RENDERER_MAIN_PLATFORM_DELEGATE_H_ | 5 #ifndef CHROME_RENDERER_RENDERER_MAIN_PLATFORM_DELEGATE_H_ |
| 6 #define CHROME_RENDERER_RENDERER_MAIN_PLATFORM_DELEGATE_H_ | 6 #define CHROME_RENDERER_RENDERER_MAIN_PLATFORM_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 | 9 |
| 10 #if defined(OS_WIN) | 10 #if defined(OS_WIN) |
| 11 #include <windows.h> | 11 #include <windows.h> |
| 12 #endif | 12 #endif |
| 13 | 13 |
| 14 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
| 15 #include "content/common/content_export.h" | 15 #include "content/common/content_export.h" |
| 16 #include "content/public/common/main_function_params.h" | 16 #include "content/public/common/main_function_params.h" |
| 17 | 17 |
| 18 #ifdef __OBJC__ | 18 #ifdef __OBJC__ |
| 19 @class NSBundle; | 19 @class NSBundle; |
| 20 #else | 20 #else |
| 21 class NSBundle; | 21 class NSBundle; |
| 22 #endif // __OBJC__ | 22 #endif // __OBJC__ |
| 23 | 23 |
| 24 namespace content { |
| 25 |
| 24 class CONTENT_EXPORT RendererMainPlatformDelegate { | 26 class CONTENT_EXPORT RendererMainPlatformDelegate { |
| 25 public: | 27 public: |
| 26 explicit RendererMainPlatformDelegate( | 28 explicit RendererMainPlatformDelegate( |
| 27 const content::MainFunctionParams& parameters); | 29 const MainFunctionParams& parameters); |
| 28 ~RendererMainPlatformDelegate(); | 30 ~RendererMainPlatformDelegate(); |
| 29 | 31 |
| 30 // Called first thing and last thing in the process' lifecycle, i.e. before | 32 // Called first thing and last thing in the process' lifecycle, i.e. before |
| 31 // the sandbox is enabled. | 33 // the sandbox is enabled. |
| 32 void PlatformInitialize(); | 34 void PlatformInitialize(); |
| 33 void PlatformUninitialize(); | 35 void PlatformUninitialize(); |
| 34 | 36 |
| 35 // Gives us an opportunity to initialize state used for tests before enabling | 37 // Gives us an opportunity to initialize state used for tests before enabling |
| 36 // the sandbox. | 38 // the sandbox. |
| 37 bool InitSandboxTests(bool no_sandbox); | 39 bool InitSandboxTests(bool no_sandbox); |
| 38 | 40 |
| 39 // Initiate Lockdown, returns true on success. | 41 // Initiate Lockdown, returns true on success. |
| 40 bool EnableSandbox(); | 42 bool EnableSandbox(); |
| 41 | 43 |
| 42 // Runs Sandbox tests. | 44 // Runs Sandbox tests. |
| 43 void RunSandboxTests(); | 45 void RunSandboxTests(); |
| 44 | 46 |
| 45 private: | 47 private: |
| 46 const content::MainFunctionParams& parameters_; | 48 const MainFunctionParams& parameters_; |
| 47 #if defined(OS_WIN) | 49 #if defined(OS_WIN) |
| 48 HMODULE sandbox_test_module_; | 50 HMODULE sandbox_test_module_; |
| 49 #elif defined(OS_MACOSX) | 51 #elif defined(OS_MACOSX) |
| 50 NSBundle* sandbox_tests_bundle_; | 52 NSBundle* sandbox_tests_bundle_; |
| 51 #endif | 53 #endif |
| 52 | 54 |
| 53 DISALLOW_COPY_AND_ASSIGN(RendererMainPlatformDelegate); | 55 DISALLOW_COPY_AND_ASSIGN(RendererMainPlatformDelegate); |
| 54 }; | 56 }; |
| 55 | 57 |
| 58 } // namespace content |
| 59 |
| 56 #endif // CHROME_RENDERER_RENDERER_MAIN_PLATFORM_DELEGATE_H_ | 60 #endif // CHROME_RENDERER_RENDERER_MAIN_PLATFORM_DELEGATE_H_ |
| OLD | NEW |