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

Unified Diff: headless/lib/browser/headless_devtools.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, 9 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 side-by-side diff with in-line comments
Download patch
Index: headless/lib/browser/headless_devtools.cc
diff --git a/headless/lib/browser/headless_devtools.cc b/headless/lib/browser/headless_devtools.cc
index 258e9de2f96e1982b5d672b7e9077dff0e007e9c..5945e3dd4dc0e3ab9196d19d34b6ee1216d49f1f 100644
--- a/headless/lib/browser/headless_devtools.cc
+++ b/headless/lib/browser/headless_devtools.cc
@@ -5,6 +5,7 @@
#include "headless/lib/browser/headless_devtools.h"
#include "base/files/file_path.h"
+#include "base/memory/ptr_util.h"
#include "components/devtools_http_handler/devtools_http_handler.h"
#include "components/devtools_http_handler/devtools_http_handler_delegate.h"
#include "content/public/browser/browser_context.h"
@@ -33,11 +34,11 @@ class TCPServerSocketFactory : public DevToolsHttpHandler::ServerSocketFactory {
private:
// DevToolsHttpHandler::ServerSocketFactory implementation:
- scoped_ptr<net::ServerSocket> CreateForHttpServer() override {
- scoped_ptr<net::ServerSocket> socket(
+ std::unique_ptr<net::ServerSocket> CreateForHttpServer() override {
+ std::unique_ptr<net::ServerSocket> socket(
new net::TCPServerSocket(nullptr, net::NetLog::Source()));
if (socket->Listen(endpoint_, kBackLog) != net::OK)
- return scoped_ptr<net::ServerSocket>();
+ return std::unique_ptr<net::ServerSocket>();
return socket;
}
@@ -89,13 +90,13 @@ HeadlessDevToolsDelegate::HandleWebSocketConnection(const std::string& path) {
} // namespace
-scoped_ptr<DevToolsHttpHandler> CreateLocalDevToolsHttpHandler(
+std::unique_ptr<DevToolsHttpHandler> CreateLocalDevToolsHttpHandler(
HeadlessBrowserContext* browser_context) {
const net::IPEndPoint& endpoint =
browser_context->options().devtools_endpoint;
- scoped_ptr<DevToolsHttpHandler::ServerSocketFactory> socket_factory(
+ std::unique_ptr<DevToolsHttpHandler::ServerSocketFactory> socket_factory(
new TCPServerSocketFactory(endpoint));
- return make_scoped_ptr(new DevToolsHttpHandler(
+ return base::WrapUnique(new DevToolsHttpHandler(
std::move(socket_factory), std::string(), new HeadlessDevToolsDelegate(),
browser_context->GetPath(), base::FilePath(), std::string(),
browser_context->options().user_agent));
« no previous file with comments | « headless/lib/browser/headless_devtools.h ('k') | headless/lib/browser/headless_url_request_context_getter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698