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

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

Issue 1854043002: convert //headless to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « no previous file | headless/lib/browser/headless_browser_context.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
6
5 #include "base/bind.h" 7 #include "base/bind.h"
6 #include "base/callback.h" 8 #include "base/callback.h"
7 #include "base/command_line.h" 9 #include "base/command_line.h"
8 #include "base/location.h" 10 #include "base/location.h"
9 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
10 #include "base/numerics/safe_conversions.h" 12 #include "base/numerics/safe_conversions.h"
11 #include "base/strings/string_number_conversions.h" 13 #include "base/strings/string_number_conversions.h"
12 #include "content/public/common/content_switches.h" 14 #include "content/public/common/content_switches.h"
13 #include "headless/app/headless_shell_switches.h" 15 #include "headless/app/headless_shell_switches.h"
14 #include "headless/public/headless_browser.h" 16 #include "headless/public/headless_browser.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 68
67 // HeadlessWebContents::Observer implementation: 69 // HeadlessWebContents::Observer implementation:
68 void DocumentOnLoadCompletedInMainFrame() override { 70 void DocumentOnLoadCompletedInMainFrame() override {
69 ShutdownIfNeeded(); 71 ShutdownIfNeeded();
70 } 72 }
71 73
72 void DidFinishNavigation(bool success) override {} 74 void DidFinishNavigation(bool success) override {}
73 75
74 private: 76 private:
75 HeadlessBrowser* browser_; // Not owned. 77 HeadlessBrowser* browser_; // Not owned.
76 scoped_ptr<HeadlessWebContents> web_contents_; 78 std::unique_ptr<HeadlessWebContents> web_contents_;
77 79
78 DISALLOW_COPY_AND_ASSIGN(HeadlessShell); 80 DISALLOW_COPY_AND_ASSIGN(HeadlessShell);
79 }; 81 };
80 82
81 int main(int argc, const char** argv) { 83 int main(int argc, const char** argv) {
82 HeadlessShell shell; 84 HeadlessShell shell;
83 HeadlessBrowser::Options::Builder builder(argc, argv); 85 HeadlessBrowser::Options::Builder builder(argc, argv);
84 86
85 // Enable devtools if requested. 87 // Enable devtools if requested.
86 base::CommandLine command_line(argc, argv); 88 base::CommandLine command_line(argc, argv);
(...skipping 21 matching lines...) Expand all
108 LOG(ERROR) << "Malformed proxy server url"; 110 LOG(ERROR) << "Malformed proxy server url";
109 return EXIT_FAILURE; 111 return EXIT_FAILURE;
110 } 112 }
111 builder.SetProxyServer(parsed_proxy_server); 113 builder.SetProxyServer(parsed_proxy_server);
112 } 114 }
113 115
114 return HeadlessBrowserMain( 116 return HeadlessBrowserMain(
115 builder.Build(), 117 builder.Build(),
116 base::Bind(&HeadlessShell::OnStart, base::Unretained(&shell))); 118 base::Bind(&HeadlessShell::OnStart, base::Unretained(&shell)));
117 } 119 }
OLDNEW
« no previous file with comments | « no previous file | headless/lib/browser/headless_browser_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698