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

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

Issue 1906803004: Fix a few spurious string allocations in QuicCryptoServerStream and QuicCryptoStream. No functional… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@119871679
Patch Set: Rebase 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 | net/quic/quic_crypto_stream.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 (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/quic/quic_crypto_server_stream.h" 5 #include "net/quic/quic_crypto_server_stream.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "crypto/secure_hash.h" 10 #include "crypto/secure_hash.h"
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 session()->connection()->random_generator(), compressed_certs_cache_, 231 session()->connection()->random_generator(), compressed_certs_cache_,
232 crypto_negotiated_params_, cached_network_params, 232 crypto_negotiated_params_, cached_network_params,
233 &server_config_update_message)) { 233 &server_config_update_message)) {
234 DVLOG(1) << "Server: Failed to build server config update (SCUP)!"; 234 DVLOG(1) << "Server: Failed to build server config update (SCUP)!";
235 return; 235 return;
236 } 236 }
237 237
238 DVLOG(1) << "Server: Sending server config update: " 238 DVLOG(1) << "Server: Sending server config update: "
239 << server_config_update_message.DebugString(); 239 << server_config_update_message.DebugString();
240 const QuicData& data = server_config_update_message.GetSerialized(); 240 const QuicData& data = server_config_update_message.GetSerialized();
241 WriteOrBufferData(string(data.data(), data.length()), false, nullptr); 241 WriteOrBufferData(StringPiece(data.data(), data.length()), false, nullptr);
242 242
243 ++num_server_config_update_messages_sent_; 243 ++num_server_config_update_messages_sent_;
244 } 244 }
245 245
246 void QuicCryptoServerStream::OnServerHelloAcked() { 246 void QuicCryptoServerStream::OnServerHelloAcked() {
247 session()->connection()->OnHandshakeComplete(); 247 session()->connection()->OnHandshakeComplete();
248 } 248 }
249 249
250 uint8_t QuicCryptoServerStream::NumHandshakeMessages() const { 250 uint8_t QuicCryptoServerStream::NumHandshakeMessages() const {
251 return num_handshake_messages_; 251 return num_handshake_messages_;
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 } 382 }
383 for (size_t i = 0; i < received_tags_length; ++i) { 383 for (size_t i = 0; i < received_tags_length; ++i) {
384 if (received_tags[i] == kSREJ) { 384 if (received_tags[i] == kSREJ) {
385 return true; 385 return true;
386 } 386 }
387 } 387 }
388 return false; 388 return false;
389 } 389 }
390 390
391 } // namespace net 391 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/quic/quic_crypto_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698