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 // Wrapper to the parameter list for the "main" entry points (browser, renderer, | 5 // Wrapper to the parameter list for the "main" entry points (browser, renderer, |
6 // plugin) to shield the call sites from the differences between platforms | 6 // plugin) to shield the call sites from the differences between platforms |
7 // (e.g., POSIX doesn't need to pass any sandbox information). | 7 // (e.g., POSIX doesn't need to pass any sandbox information). |
8 | 8 |
9 #ifndef CONTENT_COMMON_MAIN_FUNCTION_PARAMS_H_ | 9 #ifndef CONTENT_COMMON_MAIN_FUNCTION_PARAMS_H_ |
10 #define CONTENT_COMMON_MAIN_FUNCTION_PARAMS_H_ | 10 #define CONTENT_COMMON_MAIN_FUNCTION_PARAMS_H_ |
11 #pragma once | 11 #pragma once |
12 | 12 |
13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
14 #include "content/common/sandbox_init_wrapper.h" | |
15 | 14 |
| 15 #if defined(OS_WIN) |
| 16 namespace sandbox { |
| 17 struct SandboxInterfaceInfo; |
| 18 } |
| 19 #elif defined(OS_MACOSX) |
16 namespace base { | 20 namespace base { |
17 namespace mac { | 21 namespace mac { |
18 class ScopedNSAutoreleasePool; | 22 class ScopedNSAutoreleasePool; |
19 } | 23 } |
20 } | 24 } |
| 25 #endif |
21 | 26 |
22 class Task; | 27 class Task; |
23 | 28 |
24 struct MainFunctionParams { | 29 struct MainFunctionParams { |
25 MainFunctionParams(const CommandLine& cl, const SandboxInitWrapper& sb, | 30 explicit MainFunctionParams(const CommandLine& cl) |
26 base::mac::ScopedNSAutoreleasePool* pool) | 31 : command_line(cl), |
27 : command_line_(cl), sandbox_info_(sb), autorelease_pool_(pool), | 32 #if defined(OS_WIN) |
28 ui_task(NULL) { } | 33 sandbox_info(NULL), |
29 const CommandLine& command_line_; | 34 #elif defined(OS_MACOSX) |
30 const SandboxInitWrapper& sandbox_info_; | 35 autorelease_pool(NULL), |
31 base::mac::ScopedNSAutoreleasePool* autorelease_pool_; | 36 #endif |
| 37 ui_task(NULL) {} |
| 38 const CommandLine& command_line; |
| 39 #if defined(OS_WIN) |
| 40 sandbox::SandboxInterfaceInfo* sandbox_info; |
| 41 #elif defined(OS_MACOSX) |
| 42 base::mac::ScopedNSAutoreleasePool* autorelease_pool; |
| 43 #endif |
32 // Used by InProcessBrowserTest. If non-null BrowserMain schedules this | 44 // Used by InProcessBrowserTest. If non-null BrowserMain schedules this |
33 // task to run on the MessageLoop and BrowserInit is not invoked. | 45 // task to run on the MessageLoop and BrowserInit is not invoked. |
34 Task* ui_task; | 46 Task* ui_task; |
35 }; | 47 }; |
36 | 48 |
37 #endif // CONTENT_COMMON_MAIN_FUNCTION_PARAMS_H_ | 49 #endif // CONTENT_COMMON_MAIN_FUNCTION_PARAMS_H_ |
OLD | NEW |