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

Side by Side Diff: net/tools/testserver/run_testserver.cc

Issue 1893083002: Change scoped_ptr to std::unique_ptr in //net. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptr-net-all: iwyu 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 | « net/tools/quic/test_tools/server_thread.h ('k') | net/udp/udp_net_log_parameters.cc » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <stdio.h> 5 #include <stdio.h>
6 6
7 #include "base/at_exit.h" 7 #include "base/at_exit.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 } 88 }
89 } 89 }
90 90
91 base::FilePath doc_root = command_line->GetSwitchValuePath("doc-root"); 91 base::FilePath doc_root = command_line->GetSwitchValuePath("doc-root");
92 if (doc_root.empty()) { 92 if (doc_root.empty()) {
93 printf("Error: --doc-root must be specified\n"); 93 printf("Error: --doc-root must be specified\n");
94 PrintUsage(); 94 PrintUsage();
95 return -1; 95 return -1;
96 } 96 }
97 97
98 scoped_ptr<net::SpawnedTestServer> test_server; 98 std::unique_ptr<net::SpawnedTestServer> test_server;
99 if (net::SpawnedTestServer::UsingSSL(server_type)) { 99 if (net::SpawnedTestServer::UsingSSL(server_type)) {
100 test_server.reset( 100 test_server.reset(
101 new net::SpawnedTestServer(server_type, ssl_options, doc_root)); 101 new net::SpawnedTestServer(server_type, ssl_options, doc_root));
102 } else { 102 } else {
103 test_server.reset(new net::SpawnedTestServer( 103 test_server.reset(new net::SpawnedTestServer(
104 server_type, 104 server_type,
105 net::SpawnedTestServer::kLocalhost, 105 net::SpawnedTestServer::kLocalhost,
106 doc_root)); 106 doc_root));
107 } 107 }
108 108
109 if (!test_server->Start()) { 109 if (!test_server->Start()) {
110 printf("Error: failed to start test server. Exiting.\n"); 110 printf("Error: failed to start test server. Exiting.\n");
111 return -1; 111 return -1;
112 } 112 }
113 113
114 if (!base::DirectoryExists(test_server->document_root())) { 114 if (!base::DirectoryExists(test_server->document_root())) {
115 printf("Error: invalid doc root: \"%s\" does not exist!\n", 115 printf("Error: invalid doc root: \"%s\" does not exist!\n",
116 base::UTF16ToUTF8( 116 base::UTF16ToUTF8(
117 test_server->document_root().LossyDisplayName()).c_str()); 117 test_server->document_root().LossyDisplayName()).c_str());
118 return -1; 118 return -1;
119 } 119 }
120 120
121 printf("testserver running at %s (type ctrl+c to exit)\n", 121 printf("testserver running at %s (type ctrl+c to exit)\n",
122 test_server->host_port_pair().ToString().c_str()); 122 test_server->host_port_pair().ToString().c_str());
123 123
124 message_loop.Run(); 124 message_loop.Run();
125 return 0; 125 return 0;
126 } 126 }
OLDNEW
« no previous file with comments | « net/tools/quic/test_tools/server_thread.h ('k') | net/udp/udp_net_log_parameters.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698