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

Side by Side Diff: net/quic/quic_end_to_end_unittest.cc

Issue 132073002: Fix end_to_end_test performance regression caused by using mutexes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | net/tools/quic/end_to_end_test.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 "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/compiler_specific.h" 6 #include "base/compiler_specific.h"
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "net/base/test_completion_callback.h" 10 #include "net/base/test_completion_callback.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 128
129 // Starts the QUIC server listening on a random port. 129 // Starts the QUIC server listening on a random port.
130 void StartServer() { 130 void StartServer() {
131 net::IPAddressNumber ip; 131 net::IPAddressNumber ip;
132 CHECK(net::ParseIPLiteralToNumber("127.0.0.1", &ip)); 132 CHECK(net::ParseIPLiteralToNumber("127.0.0.1", &ip));
133 server_address_ = IPEndPoint(ip, 0); 133 server_address_ = IPEndPoint(ip, 0);
134 server_config_.SetDefaults(); 134 server_config_.SetDefaults();
135 server_thread_.reset(new ServerThread(server_address_, server_config_, 135 server_thread_.reset(new ServerThread(server_address_, server_config_,
136 QuicSupportedVersions(), 136 QuicSupportedVersions(),
137 strike_register_no_startup_period_)); 137 strike_register_no_startup_period_));
138 server_thread_->Start(); 138 server_thread_->Initialize();
139 server_thread_->WaitForServerStartup();
140 server_address_ = IPEndPoint(server_address_.address(), 139 server_address_ = IPEndPoint(server_address_.address(),
141 server_thread_->GetPort()); 140 server_thread_->GetPort());
141 server_thread_->Start();
142 server_started_ = true; 142 server_started_ = true;
143 } 143 }
144 144
145 // Stops the QUIC server. 145 // Stops the QUIC server.
146 void StopServer() { 146 void StopServer() {
147 if (!server_started_) { 147 if (!server_started_) {
148 return; 148 return;
149 } 149 }
150 if (server_thread_.get()) { 150 if (server_thread_.get()) {
151 server_thread_->Quit(); 151 server_thread_->Quit();
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 base::MessageLoop::current()->Run(); 296 base::MessageLoop::current()->Run();
297 297
298 for (size_t i = 0; i < num_requests; ++i) { 298 for (size_t i = 0; i < num_requests; ++i) {
299 CheckResponse(*consumers[i], "HTTP/1.1 200 OK", kResponseBody); 299 CheckResponse(*consumers[i], "HTTP/1.1 200 OK", kResponseBody);
300 } 300 }
301 STLDeleteElements(&consumers); 301 STLDeleteElements(&consumers);
302 } 302 }
303 303
304 } // namespace test 304 } // namespace test
305 } // namespace net 305 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/tools/quic/end_to_end_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698