| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 CONTENT_PUBLIC_BROWSER_BROWSER_MAIN_RUNNER_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_BROWSER_MAIN_RUNNER_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_BROWSER_MAIN_RUNNER_H_ | 6 #define CONTENT_PUBLIC_BROWSER_BROWSER_MAIN_RUNNER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
| 10 | 10 |
| 11 namespace content { | 11 namespace content { |
| 12 | 12 |
| 13 struct MainFunctionParams; | 13 struct MainFunctionParams; |
| 14 | 14 |
| 15 // This class is responsible for browser initialization, running and shutdown. | 15 // This class is responsible for browser initialization, running and shutdown. |
| 16 class CONTENT_EXPORT BrowserMainRunner { | 16 class CONTENT_EXPORT BrowserMainRunner { |
| 17 public: | 17 public: |
| 18 virtual ~BrowserMainRunner() {} | 18 virtual ~BrowserMainRunner() {} |
| 19 | 19 |
| 20 // Create a new BrowserMainRunner object. | 20 // Create a new BrowserMainRunner object. |
| 21 static BrowserMainRunner* Create(); | 21 static BrowserMainRunner* Create(); |
| 22 | 22 |
| 23 // Initialize all necessary browser state. The |parameters| values will be | 23 // Initialize all necessary browser state. The |parameters| values will be |
| 24 // copied. | 24 // copied. Returning a non-negative value indicates that initialization |
| 25 // failed, and the returned value is used as the exit code for the process. |
| 25 virtual int Initialize(const content::MainFunctionParams& parameters) = 0; | 26 virtual int Initialize(const content::MainFunctionParams& parameters) = 0; |
| 26 | 27 |
| 27 // Perform the default run logic. | 28 // Perform the default run logic. |
| 28 virtual int Run() = 0; | 29 virtual int Run() = 0; |
| 29 | 30 |
| 30 // Shut down the browser state. | 31 // Shut down the browser state. |
| 31 virtual void Shutdown() = 0; | 32 virtual void Shutdown() = 0; |
| 32 }; | 33 }; |
| 33 | 34 |
| 34 } // namespace content | 35 } // namespace content |
| 35 | 36 |
| 36 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_MAIN_RUNNER_H_ | 37 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_MAIN_RUNNER_H_ |
| OLD | NEW |