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