main_function_params.h revision a1401311d1ab56c4ed0a474bd38c108f75cb0cd9
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 3// found in the LICENSE file. 4 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 7// (e.g., POSIX doesn't need to pass any sandbox information). 8 9#ifndef CONTENT_PUBLIC_COMMON_MAIN_FUNCTION_PARAMS_H_ 10#define CONTENT_PUBLIC_COMMON_MAIN_FUNCTION_PARAMS_H_ 11 12#include "base/callback_forward.h" 13#include "base/command_line.h" 14 15#if defined(OS_WIN) 16namespace sandbox { 17struct SandboxInterfaceInfo; 18} 19#elif defined(OS_MACOSX) 20namespace base { 21namespace mac { 22class ScopedNSAutoreleasePool; 23} 24} 25#endif 26 27namespace content { 28 29struct MainFunctionParams { 30 explicit MainFunctionParams(const base::CommandLine& cl) 31 : command_line(cl), 32#if defined(OS_WIN) 33 sandbox_info(NULL), 34#elif defined(OS_MACOSX) 35 autorelease_pool(NULL), 36#endif 37 ui_task(NULL) { 38 } 39 40 const base::CommandLine& command_line; 41 42#if defined(OS_WIN) 43 sandbox::SandboxInterfaceInfo* sandbox_info; 44#elif defined(OS_MACOSX) 45 base::mac::ScopedNSAutoreleasePool* autorelease_pool; 46#endif 47 48 // Used by InProcessBrowserTest. If non-null BrowserMain schedules this 49 // task to run on the MessageLoop and BrowserInit is not invoked. 50 base::Closure* ui_task; 51}; 52 53} // namespace content 54 55#endif // CONTENT_PUBLIC_COMMON_MAIN_FUNCTION_PARAMS_H_ 56