OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |