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 "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/metrics/stats_counters.h" | 9 #include "base/metrics/stats_counters.h" |
10 #include "chrome/common/chrome_content_client.h" | 10 #include "chrome/common/chrome_content_client.h" |
11 #include "content/public/app/content_main_delegate.h" | 11 #include "content/public/app/content_main_delegate.h" |
12 | 12 |
13 template <typename> | 13 template <typename> |
14 class ScopedVector; | 14 class ScopedVector; |
15 | 15 |
16 namespace base { | 16 namespace base { |
17 class CommandLine; | 17 class CommandLine; |
18 } | 18 } |
19 | 19 |
20 // Chrome implementation of ContentMainDelegate. | 20 // Chrome implementation of ContentMainDelegate. |
21 class ChromeMainDelegate : public content::ContentMainDelegate { | 21 class ChromeMainDelegate : public content::ContentMainDelegate { |
22 public: | 22 public: |
23 ChromeMainDelegate(); | 23 ChromeMainDelegate(); |
24 virtual ~ChromeMainDelegate(); | 24 virtual ~ChromeMainDelegate(); |
25 | 25 |
26 protected: | 26 protected: |
27 // content::ContentMainDelegate implementation: | 27 // content::ContentMainDelegate implementation: |
28 virtual bool BasicStartupComplete(int* exit_code) OVERRIDE; | 28 virtual bool BasicStartupComplete(int* exit_code) override; |
29 virtual void PreSandboxStartup() OVERRIDE; | 29 virtual void PreSandboxStartup() override; |
30 virtual void SandboxInitialized(const std::string& process_type) OVERRIDE; | 30 virtual void SandboxInitialized(const std::string& process_type) override; |
31 virtual int RunProcess( | 31 virtual int RunProcess( |
32 const std::string& process_type, | 32 const std::string& process_type, |
33 const content::MainFunctionParams& main_function_params) OVERRIDE; | 33 const content::MainFunctionParams& main_function_params) override; |
34 virtual void ProcessExiting(const std::string& process_type) OVERRIDE; | 34 virtual void ProcessExiting(const std::string& process_type) override; |
35 #if defined(OS_MACOSX) | 35 #if defined(OS_MACOSX) |
36 virtual bool ProcessRegistersWithSystemProcess( | 36 virtual bool ProcessRegistersWithSystemProcess( |
37 const std::string& process_type) OVERRIDE; | 37 const std::string& process_type) override; |
38 virtual bool ShouldSendMachPort(const std::string& process_type) OVERRIDE; | 38 virtual bool ShouldSendMachPort(const std::string& process_type) override; |
39 virtual bool DelaySandboxInitialization( | 39 virtual bool DelaySandboxInitialization( |
40 const std::string& process_type) OVERRIDE; | 40 const std::string& process_type) override; |
41 #elif defined(OS_POSIX) && !defined(OS_ANDROID) | 41 #elif defined(OS_POSIX) && !defined(OS_ANDROID) |
42 virtual void ZygoteStarting( | 42 virtual void ZygoteStarting( |
43 ScopedVector<content::ZygoteForkDelegate>* delegates) OVERRIDE; | 43 ScopedVector<content::ZygoteForkDelegate>* delegates) override; |
44 virtual void ZygoteForked() OVERRIDE; | 44 virtual void ZygoteForked() override; |
45 #elif defined(OS_WIN) | 45 #elif defined(OS_WIN) |
46 virtual bool ShouldEnableTerminationOnHeapCorruption() OVERRIDE; | 46 virtual bool ShouldEnableTerminationOnHeapCorruption() override; |
47 #endif | 47 #endif |
48 | 48 |
49 virtual content::ContentBrowserClient* CreateContentBrowserClient() OVERRIDE; | 49 virtual content::ContentBrowserClient* CreateContentBrowserClient() override; |
50 virtual content::ContentPluginClient* CreateContentPluginClient() OVERRIDE; | 50 virtual content::ContentPluginClient* CreateContentPluginClient() override; |
51 virtual content::ContentRendererClient* | 51 virtual content::ContentRendererClient* |
52 CreateContentRendererClient() OVERRIDE; | 52 CreateContentRendererClient() override; |
53 virtual content::ContentUtilityClient* CreateContentUtilityClient() OVERRIDE; | 53 virtual content::ContentUtilityClient* CreateContentUtilityClient() override; |
54 | 54 |
55 #if defined(OS_MACOSX) | 55 #if defined(OS_MACOSX) |
56 void InitMacCrashReporter(const base::CommandLine& command_line, | 56 void InitMacCrashReporter(const base::CommandLine& command_line, |
57 const std::string& process_type); | 57 const std::string& process_type); |
58 #endif // defined(OS_MACOSX) | 58 #endif // defined(OS_MACOSX) |
59 | 59 |
60 ChromeContentClient chrome_content_client_; | 60 ChromeContentClient chrome_content_client_; |
61 | 61 |
62 // startup_timer_ will hold a reference to stats_counter_timer_. Therefore, | 62 // startup_timer_ will hold a reference to stats_counter_timer_. Therefore, |
63 // the declaration order of these variables matters. Changing this order will | 63 // the declaration order of these variables matters. Changing this order will |
64 // cause startup_timer_ to be freed before stats_counter_timer_, leaving a | 64 // cause startup_timer_ to be freed before stats_counter_timer_, leaving a |
65 // dangling reference. | 65 // dangling reference. |
66 scoped_ptr<base::StatsCounterTimer> stats_counter_timer_; | 66 scoped_ptr<base::StatsCounterTimer> stats_counter_timer_; |
67 scoped_ptr<base::StatsScope<base::StatsCounterTimer> > startup_timer_; | 67 scoped_ptr<base::StatsScope<base::StatsCounterTimer> > startup_timer_; |
68 | 68 |
69 DISALLOW_COPY_AND_ASSIGN(ChromeMainDelegate); | 69 DISALLOW_COPY_AND_ASSIGN(ChromeMainDelegate); |
70 }; | 70 }; |
71 | 71 |
72 #endif // CHROME_APP_CHROME_MAIN_DELEGATE_H_ | 72 #endif // CHROME_APP_CHROME_MAIN_DELEGATE_H_ |
OLD | NEW |