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

Side by Side Diff: net/tools/quic/test_tools/quic_test_client.cc

Issue 1349783006: Cleanup: Pass std::string as const reference if possible (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert third_party changes Created 5 years, 3 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "net/tools/quic/test_tools/quic_test_client.h" 5 #include "net/tools/quic/test_tools/quic_test_client.h"
6 6
7 #include "base/time/time.h" 7 #include "base/time/time.h"
8 #include "net/base/completion_callback.h" 8 #include "net/base/completion_callback.h"
9 #include "net/base/net_errors.h" 9 #include "net/base/net_errors.h"
10 #include "net/cert/cert_verify_result.h" 10 #include "net/cert/cert_verify_result.h"
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 311
312 scoped_ptr<BalsaHeaders> munged_headers(MungeHeaders(message.headers(), 312 scoped_ptr<BalsaHeaders> munged_headers(MungeHeaders(message.headers(),
313 secure_)); 313 secure_));
314 ssize_t ret = GetOrCreateStreamAndSendRequest( 314 ssize_t ret = GetOrCreateStreamAndSendRequest(
315 (munged_headers.get() ? munged_headers.get() : message.headers()), 315 (munged_headers.get() ? munged_headers.get() : message.headers()),
316 message.body(), message.has_complete_message(), nullptr); 316 message.body(), message.has_complete_message(), nullptr);
317 WaitForWriteToFlush(); 317 WaitForWriteToFlush();
318 return ret; 318 return ret;
319 } 319 }
320 320
321 ssize_t QuicTestClient::SendData(string data, bool last_data) { 321 ssize_t QuicTestClient::SendData(const string& data, bool last_data) {
322 return SendData(data, last_data, nullptr); 322 return SendData(data, last_data, nullptr);
323 } 323 }
324 324
325 ssize_t QuicTestClient::SendData(string data, 325 ssize_t QuicTestClient::SendData(const string& data,
326 bool last_data, 326 bool last_data,
327 QuicAckNotifier::DelegateInterface* delegate) { 327 QuicAckNotifier::DelegateInterface* delegate) {
328 return GetOrCreateStreamAndSendRequest(nullptr, StringPiece(data), last_data, 328 return GetOrCreateStreamAndSendRequest(nullptr, StringPiece(data), last_data,
329 delegate); 329 delegate);
330 } 330 }
331 331
332 bool QuicTestClient::response_complete() const { 332 bool QuicTestClient::response_complete() const {
333 return response_complete_; 333 return response_complete_;
334 } 334 }
335 335
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 message->headers()->SetRequestVersion( 641 message->headers()->SetRequestVersion(
642 HTTPMessage::VersionToString(HttpConstants::HTTP_1_1)); 642 HTTPMessage::VersionToString(HttpConstants::HTTP_1_1));
643 message->headers()->SetRequestMethod( 643 message->headers()->SetRequestMethod(
644 HTTPMessage::MethodToString(HttpConstants::GET)); 644 HTTPMessage::MethodToString(HttpConstants::GET));
645 message->headers()->SetRequestUri(uri); 645 message->headers()->SetRequestUri(uri);
646 } 646 }
647 647
648 } // namespace test 648 } // namespace test
649 } // namespace tools 649 } // namespace tools
650 } // namespace net 650 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698