Chromium Code Reviews| Index: content/app/content_main_runner.h |
| =================================================================== |
| --- content/app/content_main_runner.h (revision 0) |
| +++ content/app/content_main_runner.h (revision 0) |
| @@ -0,0 +1,61 @@ |
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
|
jam
2012/01/12 18:07:18
if you intend for this to be a public API to be us
|
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CONTENT_APP_CONTENT_MAIN_RUNNER_H_ |
| +#define CONTENT_APP_CONTENT_MAIN_RUNNER_H_ |
| +#pragma once |
| + |
| +#include <string> |
| + |
| +#include "build/build_config.h" |
| +#include "content/common/content_export.h" |
| + |
| +#if defined(OS_WIN) |
| +#include <windows.h> |
| +#endif |
| + |
| +namespace sandbox { |
| +struct SandboxInterfaceInfo; |
| +} |
| + |
| +namespace content { |
| + |
| +class ContentMainDelegate; |
| + |
| +// This class is responsible for content initialization, running and shutdown. |
| +class ContentMainRunner { |
| + public: |
| + virtual ~ContentMainRunner() {} |
| + |
| + // Create a new ContentMainRunner object. |
| + static ContentMainRunner* CreateMainRunner(); |
|
jam
2012/01/12 18:07:18
nit: we usually call these just "Create" since Con
|
| + |
| + // Initialize all necessary content state. |
| +#if defined(OS_WIN) |
| + // The |sandbox_info| and |delegate| objects must outlive this class. |
| + // |sandbox_info| should be initialized using InitializeSandboxInfo from |
| + // content_main_win.h. |
| + virtual int Initialize(HINSTANCE instance, |
| + sandbox::SandboxInterfaceInfo* sandbox_info, |
| + ContentMainDelegate* delegate) = 0; |
| +#else |
| + // The |delegate| object must outlive this class. |
| + virtual int Initialize(int argc, |
| + const char** argv, |
| + ContentMainDelegate* delegate) = 0; |
| +#endif |
| + |
| + // Perform the default run logic. |
| + virtual int Run() = 0; |
| + |
| + // Shut down the content state. |
| + virtual void Shutdown() = 0; |
| +}; |
| + |
| +// Return the process type. |
| +std::string GetProcessType(int argc, const char** argv); |
|
jam
2012/01/12 18:07:18
is this really needed? a lot of the code knows how
|
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_APP_CONTENT_MAIN_RUNNER_H_ |
| Property changes on: content\app\content_main_runner.h |
| ___________________________________________________________________ |
| Added: svn:eol-style |
| + LF |