OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 HEADLESS_LIB_HEADLESS_CONTENT_MAIN_DELEGATE_H_ | 5 #ifndef HEADLESS_LIB_HEADLESS_CONTENT_MAIN_DELEGATE_H_ |
6 #define HEADLESS_LIB_HEADLESS_CONTENT_MAIN_DELEGATE_H_ | 6 #define HEADLESS_LIB_HEADLESS_CONTENT_MAIN_DELEGATE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... | |
28 explicit HeadlessContentMainDelegate( | 28 explicit HeadlessContentMainDelegate( |
29 std::unique_ptr<HeadlessBrowserImpl> browser); | 29 std::unique_ptr<HeadlessBrowserImpl> browser); |
30 ~HeadlessContentMainDelegate() override; | 30 ~HeadlessContentMainDelegate() override; |
31 | 31 |
32 // content::ContentMainDelegate implementation: | 32 // content::ContentMainDelegate implementation: |
33 bool BasicStartupComplete(int* exit_code) override; | 33 bool BasicStartupComplete(int* exit_code) override; |
34 void PreSandboxStartup() override; | 34 void PreSandboxStartup() override; |
35 int RunProcess( | 35 int RunProcess( |
36 const std::string& process_type, | 36 const std::string& process_type, |
37 const content::MainFunctionParams& main_function_params) override; | 37 const content::MainFunctionParams& main_function_params) override; |
38 void ZygoteForked() override; | |
39 content::ContentBrowserClient* CreateContentBrowserClient() override; | 38 content::ContentBrowserClient* CreateContentBrowserClient() override; |
40 | 39 |
41 HeadlessBrowserImpl* browser() const { return browser_.get(); } | 40 HeadlessBrowserImpl* browser() const { return browser_.get(); } |
42 | 41 |
42 protected: | |
Sami
2017/02/24 11:41:57
Why protected? This looks like part of the public
dvallet
2017/02/27 03:08:28
Sorry, moved by mistake
| |
43 #if !defined(OS_MACOSX) && defined(OS_POSIX) && !defined(OS_ANDROID) | |
44 void ZygoteForked() override; | |
45 #endif | |
46 | |
43 private: | 47 private: |
44 friend class HeadlessBrowserTest; | 48 friend class HeadlessBrowserTest; |
45 | 49 |
46 void InitLogging(const base::CommandLine& command_line); | 50 void InitLogging(const base::CommandLine& command_line); |
47 void InitCrashReporter(const base::CommandLine& command_line); | 51 void InitCrashReporter(const base::CommandLine& command_line); |
48 static void InitializeResourceBundle(); | 52 static void InitializeResourceBundle(); |
49 | 53 |
50 static HeadlessContentMainDelegate* GetInstance(); | 54 static HeadlessContentMainDelegate* GetInstance(); |
51 | 55 |
52 std::unique_ptr<HeadlessContentBrowserClient> browser_client_; | 56 std::unique_ptr<HeadlessContentBrowserClient> browser_client_; |
53 HeadlessContentClient content_client_; | 57 HeadlessContentClient content_client_; |
54 HeadlessPlatformEventSource platform_event_source_; | 58 HeadlessPlatformEventSource platform_event_source_; |
55 | 59 |
56 std::unique_ptr<HeadlessBrowserImpl> browser_; | 60 std::unique_ptr<HeadlessBrowserImpl> browser_; |
57 | 61 |
58 DISALLOW_COPY_AND_ASSIGN(HeadlessContentMainDelegate); | 62 DISALLOW_COPY_AND_ASSIGN(HeadlessContentMainDelegate); |
59 }; | 63 }; |
60 | 64 |
61 } // namespace headless | 65 } // namespace headless |
62 | 66 |
63 #endif // HEADLESS_LIB_HEADLESS_CONTENT_MAIN_DELEGATE_H_ | 67 #endif // HEADLESS_LIB_HEADLESS_CONTENT_MAIN_DELEGATE_H_ |
OLD | NEW |