Remove EWK_BRINGUPS for M120 #3
[platform/framework/web/chromium-efl.git] / chrome / app / chrome_main_delegate.h
1 // Copyright 2011 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_APP_CHROME_MAIN_DELEGATE_H_
6 #define CHROME_APP_CHROME_MAIN_DELEGATE_H_
7
8 #include <memory>
9 #include <vector>
10
11 #include "base/time/time.h"
12 #include "build/build_config.h"
13 #include "build/chromeos_buildflags.h"
14 #include "chrome/browser/startup_data.h"
15 #include "chrome/common/chrome_content_client.h"
16 #include "components/memory_system/memory_system.h"
17 #include "content/public/app/content_main_delegate.h"
18 #include "third_party/abseil-cpp/absl/types/optional.h"
19
20 namespace base {
21 class CommandLine;
22 }
23
24 namespace chromeos {
25 class LacrosService;
26 }
27
28 namespace tracing {
29 class TracingSamplerProfiler;
30 }
31
32 class ChromeContentBrowserClient;
33 class ChromeContentUtilityClient;
34
35 // Chrome implementation of ContentMainDelegate.
36 class ChromeMainDelegate : public content::ContentMainDelegate {
37  public:
38   static const char* const kNonWildcardDomainNonPortSchemes[];
39   static const size_t kNonWildcardDomainNonPortSchemesSize;
40
41   ChromeMainDelegate();
42
43   // |exe_entry_point_ticks| is the time at which the main function of the
44   // executable was entered, or null if not available.
45   explicit ChromeMainDelegate(base::TimeTicks exe_entry_point_ticks);
46
47   ChromeMainDelegate(const ChromeMainDelegate&) = delete;
48   ChromeMainDelegate& operator=(const ChromeMainDelegate&) = delete;
49
50   ~ChromeMainDelegate() override;
51
52  protected:
53   // content::ContentMainDelegate:
54   absl::optional<int> BasicStartupComplete() override;
55   void PreSandboxStartup() override;
56   void SandboxInitialized(const std::string& process_type) override;
57   absl::variant<int, content::MainFunctionParams> RunProcess(
58       const std::string& process_type,
59       content::MainFunctionParams main_function_params) override;
60   void ProcessExiting(const std::string& process_type) override;
61 #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
62   void ZygoteStarting(std::vector<std::unique_ptr<content::ZygoteForkDelegate>>*
63                           delegates) override;
64   void ZygoteForked() override;
65 #endif
66   absl::optional<int> PreBrowserMain() override;
67   absl::optional<int> PostEarlyInitialization(InvokedIn invoked_in) override;
68   bool ShouldCreateFeatureList(InvokedIn invoked_in) override;
69   bool ShouldInitializeMojo(InvokedIn invoked_in) override;
70 #if BUILDFLAG(IS_WIN)
71   bool ShouldHandleConsoleControlEvents() override;
72 #endif
73
74   content::ContentClient* CreateContentClient() override;
75   content::ContentBrowserClient* CreateContentBrowserClient() override;
76   content::ContentGpuClient* CreateContentGpuClient() override;
77   content::ContentRendererClient* CreateContentRendererClient() override;
78   content::ContentUtilityClient* CreateContentUtilityClient() override;
79
80   // Initialization that happens in all process types.
81   void CommonEarlyInitialization(InvokedIn invoked_in);
82
83   // Initializes |tracing_sampler_profiler_|. Deletes any existing
84   // |tracing_sampler_profiler_| as well.
85   void SetupTracing();
86
87 #if BUILDFLAG(IS_MAC)
88   void InitMacCrashReporter(const base::CommandLine& command_line,
89                             const std::string& process_type);
90   void SetUpInstallerPreferences(const base::CommandLine& command_line);
91 #endif  // BUILDFLAG(IS_MAC)
92
93   void InitializeMemorySystem();
94
95   std::unique_ptr<ChromeContentBrowserClient> chrome_content_browser_client_;
96   std::unique_ptr<ChromeContentUtilityClient> chrome_content_utility_client_;
97   std::unique_ptr<tracing::TracingSamplerProfiler> tracing_sampler_profiler_;
98
99   ChromeContentClient chrome_content_client_;
100
101   memory_system::MemorySystem memory_system_;
102
103 #if BUILDFLAG(IS_CHROMEOS_LACROS)
104   std::unique_ptr<chromeos::LacrosService> lacros_service_;
105 #endif
106 };
107
108 #endif  // CHROME_APP_CHROME_MAIN_DELEGATE_H_