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

Side by Side Diff: headless/app/headless_shell.cc

Issue 1891843004: [headless] AddWindowTreeClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added tests and changed ownership model Created 4 years, 8 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #include <memory> 5 #include <memory>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 } 66 }
67 } 67 }
68 68
69 // HeadlessWebContents::Observer implementation: 69 // HeadlessWebContents::Observer implementation:
70 void DocumentOnLoadCompletedInMainFrame() override { 70 void DocumentOnLoadCompletedInMainFrame() override {
71 ShutdownIfNeeded(); 71 ShutdownIfNeeded();
72 } 72 }
73 73
74 private: 74 private:
75 HeadlessBrowser* browser_; // Not owned. 75 HeadlessBrowser* browser_; // Not owned.
76 std::unique_ptr<HeadlessWebContents> web_contents_; 76 HeadlessWebContents* web_contents_;
77 77
78 DISALLOW_COPY_AND_ASSIGN(HeadlessShell); 78 DISALLOW_COPY_AND_ASSIGN(HeadlessShell);
79 }; 79 };
80 80
81 int main(int argc, const char** argv) { 81 int main(int argc, const char** argv) {
82 HeadlessShell shell; 82 HeadlessShell shell;
83 HeadlessBrowser::Options::Builder builder(argc, argv); 83 HeadlessBrowser::Options::Builder builder(argc, argv);
84 84
85 // Enable devtools if requested. 85 // Enable devtools if requested.
86 base::CommandLine command_line(argc, argv); 86 base::CommandLine command_line(argc, argv);
(...skipping 21 matching lines...) Expand all
108 LOG(ERROR) << "Malformed proxy server url"; 108 LOG(ERROR) << "Malformed proxy server url";
109 return EXIT_FAILURE; 109 return EXIT_FAILURE;
110 } 110 }
111 builder.SetProxyServer(parsed_proxy_server); 111 builder.SetProxyServer(parsed_proxy_server);
112 } 112 }
113 113
114 return HeadlessBrowserMain( 114 return HeadlessBrowserMain(
115 builder.Build(), 115 builder.Build(),
116 base::Bind(&HeadlessShell::OnStart, base::Unretained(&shell))); 116 base::Bind(&HeadlessShell::OnStart, base::Unretained(&shell)));
117 } 117 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698