From a1a130f7da9191abecf15b3c27e2aa7ee1faacb3 Mon Sep 17 00:00:00 2001 From: "pinkerton@google.com" Date: Fri, 9 Jan 2009 20:28:44 +0000 Subject: remove chrome dependencies from win sandboxing headers. Wrap sandbox code to make the main routine a little cleaner. Unify the parameters of each of the "main" entry points so we can more easily abstract platform differences in the future. BUG=5323 Review URL: http://codereview.chromium.org/17426 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7825 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/browser_main.cc | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'chrome/browser') diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc index cae10ad..25cff75 100644 --- a/chrome/browser/browser_main.cc +++ b/chrome/browser/browser_main.cc @@ -5,7 +5,11 @@ #include "build/build_config.h" #include "base/command_line.h" +#include "chrome/common/main_function_params.h" + +#if defined(OS_WIN) #include "sandbox/src/sandbox.h" +#endif // TODO(port): several win-only methods have been pulled out of this, but // BrowserMain() as a whole needs to be broken apart so that it's usable by @@ -141,8 +145,11 @@ StringPiece NetResourceProvider(int key) { } // namespace // Main routine for running as the Browser process. -int BrowserMain(CommandLine &parsed_command_line, - sandbox::BrokerServices* broker_services) { +int BrowserMain(const MainFunctionParams& parameters) { + CommandLine& parsed_command_line = parameters.command_line_; + sandbox::BrokerServices* broker_services = + parameters.sandbox_info_.BrokerServices(); + // WARNING: If we get a WM_ENDSESSION objects created on the stack here // are NOT deleted. If you need something to run during WM_ENDSESSION add it // to browser_shutdown::Shutdown or BrowserProcess::EndSession. @@ -503,8 +510,7 @@ int StartPlatformMessageLoop(); // TODO(port): merge this with above. Just a stub for now, not meant as a place // to duplicate code. // Main routine for running as the Browser process. -int BrowserMain(CommandLine &parsed_command_line, - sandbox::BrokerServices* broker_services) { +int BrowserMain(const MainFunctionParams& parameters) { return StartPlatformMessageLoop(); } -- cgit v1.1