| 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 #ifndef CHROME_APP_CHROME_MAIN_DELEGATE_H_ | 5 #ifndef CHROME_APP_CHROME_MAIN_DELEGATE_H_ |
| 6 #define CHROME_APP_CHROME_MAIN_DELEGATE_H_ | 6 #define CHROME_APP_CHROME_MAIN_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <vector> |
| 9 | 10 |
| 10 #include "base/macros.h" | 11 #include "base/macros.h" |
| 11 #include "base/time/time.h" | 12 #include "base/time/time.h" |
| 12 #include "build/build_config.h" | 13 #include "build/build_config.h" |
| 13 #include "chrome/common/chrome_content_client.h" | 14 #include "chrome/common/chrome_content_client.h" |
| 14 #include "content/public/app/content_main_delegate.h" | 15 #include "content/public/app/content_main_delegate.h" |
| 15 | 16 |
| 16 template <typename> | |
| 17 class ScopedVector; | |
| 18 | |
| 19 namespace base { | 17 namespace base { |
| 20 class CommandLine; | 18 class CommandLine; |
| 21 } | 19 } |
| 22 | 20 |
| 23 // Chrome implementation of ContentMainDelegate. | 21 // Chrome implementation of ContentMainDelegate. |
| 24 class ChromeMainDelegate : public content::ContentMainDelegate { | 22 class ChromeMainDelegate : public content::ContentMainDelegate { |
| 25 public: | 23 public: |
| 26 ChromeMainDelegate(); | 24 ChromeMainDelegate(); |
| 27 | 25 |
| 28 // |exe_entry_point_ticks| is the time at which the main function of the | 26 // |exe_entry_point_ticks| is the time at which the main function of the |
| 29 // executable was entered, or null if not available. | 27 // executable was entered, or null if not available. |
| 30 explicit ChromeMainDelegate(base::TimeTicks exe_entry_point_ticks); | 28 explicit ChromeMainDelegate(base::TimeTicks exe_entry_point_ticks); |
| 31 ~ChromeMainDelegate() override; | 29 ~ChromeMainDelegate() override; |
| 32 | 30 |
| 33 protected: | 31 protected: |
| 34 // content::ContentMainDelegate implementation: | 32 // content::ContentMainDelegate implementation: |
| 35 bool BasicStartupComplete(int* exit_code) override; | 33 bool BasicStartupComplete(int* exit_code) override; |
| 36 void PreSandboxStartup() override; | 34 void PreSandboxStartup() override; |
| 37 void SandboxInitialized(const std::string& process_type) override; | 35 void SandboxInitialized(const std::string& process_type) override; |
| 38 int RunProcess( | 36 int RunProcess( |
| 39 const std::string& process_type, | 37 const std::string& process_type, |
| 40 const content::MainFunctionParams& main_function_params) override; | 38 const content::MainFunctionParams& main_function_params) override; |
| 41 void ProcessExiting(const std::string& process_type) override; | 39 void ProcessExiting(const std::string& process_type) override; |
| 42 #if defined(OS_MACOSX) | 40 #if defined(OS_MACOSX) |
| 43 bool ProcessRegistersWithSystemProcess( | 41 bool ProcessRegistersWithSystemProcess( |
| 44 const std::string& process_type) override; | 42 const std::string& process_type) override; |
| 45 bool ShouldSendMachPort(const std::string& process_type) override; | 43 bool ShouldSendMachPort(const std::string& process_type) override; |
| 46 bool DelaySandboxInitialization(const std::string& process_type) override; | 44 bool DelaySandboxInitialization(const std::string& process_type) override; |
| 47 #elif defined(OS_POSIX) && !defined(OS_ANDROID) | 45 #elif defined(OS_POSIX) && !defined(OS_ANDROID) |
| 48 void ZygoteStarting( | 46 void ZygoteStarting(std::vector<std::unique_ptr<content::ZygoteForkDelegate>>* |
| 49 ScopedVector<content::ZygoteForkDelegate>* delegates) override; | 47 delegates) override; |
| 50 void ZygoteForked() override; | 48 void ZygoteForked() override; |
| 51 #endif | 49 #endif |
| 52 bool ShouldEnableProfilerRecording() override; | 50 bool ShouldEnableProfilerRecording() override; |
| 53 | 51 |
| 54 content::ContentBrowserClient* CreateContentBrowserClient() override; | 52 content::ContentBrowserClient* CreateContentBrowserClient() override; |
| 55 content::ContentGpuClient* CreateContentGpuClient() override; | 53 content::ContentGpuClient* CreateContentGpuClient() override; |
| 56 content::ContentRendererClient* CreateContentRendererClient() override; | 54 content::ContentRendererClient* CreateContentRendererClient() override; |
| 57 content::ContentUtilityClient* CreateContentUtilityClient() override; | 55 content::ContentUtilityClient* CreateContentUtilityClient() override; |
| 58 | 56 |
| 59 #if defined(OS_MACOSX) | 57 #if defined(OS_MACOSX) |
| 60 void InitMacCrashReporter(const base::CommandLine& command_line, | 58 void InitMacCrashReporter(const base::CommandLine& command_line, |
| 61 const std::string& process_type); | 59 const std::string& process_type); |
| 62 void SetUpInstallerPreferences(const base::CommandLine& command_line); | 60 void SetUpInstallerPreferences(const base::CommandLine& command_line); |
| 63 #endif // defined(OS_MACOSX) | 61 #endif // defined(OS_MACOSX) |
| 64 | 62 |
| 65 ChromeContentClient chrome_content_client_; | 63 ChromeContentClient chrome_content_client_; |
| 66 | 64 |
| 67 DISALLOW_COPY_AND_ASSIGN(ChromeMainDelegate); | 65 DISALLOW_COPY_AND_ASSIGN(ChromeMainDelegate); |
| 68 }; | 66 }; |
| 69 | 67 |
| 70 #endif // CHROME_APP_CHROME_MAIN_DELEGATE_H_ | 68 #endif // CHROME_APP_CHROME_MAIN_DELEGATE_H_ |
| OLD | NEW |