Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(175)

Side by Side Diff: headless/lib/headless_content_main_delegate.h

Issue 2671713004: headless: Add command line flags for logging (Closed)
Patch Set: Review comments Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "content/public/app/content_main_delegate.h" 12 #include "content/public/app/content_main_delegate.h"
13 #include "headless/lib/browser/headless_platform_event_source.h" 13 #include "headless/lib/browser/headless_platform_event_source.h"
14 #include "headless/lib/headless_content_client.h" 14 #include "headless/lib/headless_content_client.h"
15 15
16 namespace base {
17 class CommandLine;
18 }
19
16 namespace headless { 20 namespace headless {
17 21
18 class HeadlessBrowserImpl; 22 class HeadlessBrowserImpl;
19 class HeadlessContentBrowserClient; 23 class HeadlessContentBrowserClient;
20 24
21 class HeadlessContentMainDelegate : public content::ContentMainDelegate { 25 class HeadlessContentMainDelegate : public content::ContentMainDelegate {
22 public: 26 public:
23 explicit HeadlessContentMainDelegate( 27 explicit HeadlessContentMainDelegate(
24 std::unique_ptr<HeadlessBrowserImpl> browser); 28 std::unique_ptr<HeadlessBrowserImpl> browser);
25 ~HeadlessContentMainDelegate() override; 29 ~HeadlessContentMainDelegate() override;
26 30
27 // content::ContentMainDelegate implementation: 31 // content::ContentMainDelegate implementation:
28 bool BasicStartupComplete(int* exit_code) override; 32 bool BasicStartupComplete(int* exit_code) override;
29 void PreSandboxStartup() override; 33 void PreSandboxStartup() override;
30 int RunProcess( 34 int RunProcess(
31 const std::string& process_type, 35 const std::string& process_type,
32 const content::MainFunctionParams& main_function_params) override; 36 const content::MainFunctionParams& main_function_params) override;
33 void ZygoteForked() override; 37 void ZygoteForked() override;
34 content::ContentBrowserClient* CreateContentBrowserClient() override; 38 content::ContentBrowserClient* CreateContentBrowserClient() override;
35 39
36 HeadlessBrowserImpl* browser() const { return browser_.get(); } 40 HeadlessBrowserImpl* browser() const { return browser_.get(); }
37 41
38 private: 42 private:
39 friend class HeadlessBrowserTest; 43 friend class HeadlessBrowserTest;
40 44
45 void InitLogging(const base::CommandLine& command_line);
41 static void InitializeResourceBundle(); 46 static void InitializeResourceBundle();
42 47
43 static HeadlessContentMainDelegate* GetInstance(); 48 static HeadlessContentMainDelegate* GetInstance();
44 49
45 std::unique_ptr<HeadlessContentBrowserClient> browser_client_; 50 std::unique_ptr<HeadlessContentBrowserClient> browser_client_;
46 HeadlessContentClient content_client_; 51 HeadlessContentClient content_client_;
47 HeadlessPlatformEventSource platform_event_source_; 52 HeadlessPlatformEventSource platform_event_source_;
48 53
49 std::unique_ptr<HeadlessBrowserImpl> browser_; 54 std::unique_ptr<HeadlessBrowserImpl> browser_;
50 55
51 DISALLOW_COPY_AND_ASSIGN(HeadlessContentMainDelegate); 56 DISALLOW_COPY_AND_ASSIGN(HeadlessContentMainDelegate);
52 }; 57 };
53 58
54 } // namespace headless 59 } // namespace headless
55 60
56 #endif // HEADLESS_LIB_HEADLESS_CONTENT_MAIN_DELEGATE_H_ 61 #endif // HEADLESS_LIB_HEADLESS_CONTENT_MAIN_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698