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

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

Issue 1327743005: relnote: Cache-align the encryption buffer in QuicPacketGenerator::SerializeAndSendPacket. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Close_QUIC_connection_101391398
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | 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_packet_generator.h" 5 #include "net/quic/quic_packet_generator.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "net/quic/quic_ack_notifier.h" 9 #include "net/quic/quic_ack_notifier.h"
10 #include "net/quic/quic_fec_group.h" 10 #include "net/quic/quic_fec_group.h"
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 bool success = needs_padding 447 bool success = needs_padding
448 ? packet_creator_.AddPaddedSavedFrame(frame, buffer) 448 ? packet_creator_.AddPaddedSavedFrame(frame, buffer)
449 : packet_creator_.AddSavedFrame(frame, buffer); 449 : packet_creator_.AddSavedFrame(frame, buffer);
450 if (success && debug_delegate_) { 450 if (success && debug_delegate_) {
451 debug_delegate_->OnFrameAddedToPacket(frame); 451 debug_delegate_->OnFrameAddedToPacket(frame);
452 } 452 }
453 return success; 453 return success;
454 } 454 }
455 455
456 void QuicPacketGenerator::SerializeAndSendPacket() { 456 void QuicPacketGenerator::SerializeAndSendPacket() {
457 char buffer[kMaxPacketSize]; 457 // The optimized encryption algorithm implementations run faster when
458 // operating on aligned memory.
459 //
460 // TODO(rtenneti): Change the default 64 alignas value (used the default
461 // value from CACHELINE_SIZE).
462 ALIGNAS(64) char buffer[kMaxPacketSize];
458 SerializedPacket serialized_packet = 463 SerializedPacket serialized_packet =
459 packet_creator_.SerializePacket(buffer, kMaxPacketSize); 464 packet_creator_.SerializePacket(buffer, kMaxPacketSize);
460 if (serialized_packet.packet == nullptr) { 465 if (serialized_packet.packet == nullptr) {
461 LOG(DFATAL) << "Failed to SerializePacket. fec_policy:" << fec_send_policy_ 466 LOG(DFATAL) << "Failed to SerializePacket. fec_policy:" << fec_send_policy_
462 << " should_fec_protect_:" << should_fec_protect_; 467 << " should_fec_protect_:" << should_fec_protect_;
463 delegate_->CloseConnection(QUIC_FAILED_TO_SERIALIZE_PACKET, false); 468 delegate_->CloseConnection(QUIC_FAILED_TO_SERIALIZE_PACKET, false);
464 return; 469 return;
465 } 470 }
466 471
467 // There may be AckNotifiers interested in this packet. 472 // There may be AckNotifiers interested in this packet.
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 void QuicPacketGenerator::set_encryption_level(EncryptionLevel level) { 555 void QuicPacketGenerator::set_encryption_level(EncryptionLevel level) {
551 packet_creator_.set_encryption_level(level); 556 packet_creator_.set_encryption_level(level);
552 } 557 }
553 558
554 void QuicPacketGenerator::SetEncrypter(EncryptionLevel level, 559 void QuicPacketGenerator::SetEncrypter(EncryptionLevel level,
555 QuicEncrypter* encrypter) { 560 QuicEncrypter* encrypter) {
556 packet_creator_.SetEncrypter(level, encrypter); 561 packet_creator_.SetEncrypter(level, encrypter);
557 } 562 }
558 563
559 } // namespace net 564 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698