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

Side by Side Diff: net/quic/crypto/cert_compressor.cc

Issue 761903003: Update from https://crrev.com/306655 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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/quic/congestion_control/tcp_loss_algorithm.h ('k') | net/quic/crypto/crypto_framer.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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "net/quic/crypto/cert_compressor.h" 5 #include "net/quic/crypto/cert_compressor.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "net/quic/quic_utils.h" 9 #include "net/quic/quic_utils.h"
10 #include "third_party/zlib/zlib.h" 10 #include "third_party/zlib/zlib.h"
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 entries_size++; // for end marker 253 entries_size++; // for end marker
254 254
255 return entries_size; 255 return entries_size;
256 } 256 }
257 257
258 // SerializeCertEntries serialises |entries| to |out|, which must have enough 258 // SerializeCertEntries serialises |entries| to |out|, which must have enough
259 // space to contain them. 259 // space to contain them.
260 void SerializeCertEntries(uint8* out, const vector<CertEntry>& entries) { 260 void SerializeCertEntries(uint8* out, const vector<CertEntry>& entries) {
261 for (vector<CertEntry>::const_iterator i = entries.begin(); 261 for (vector<CertEntry>::const_iterator i = entries.begin();
262 i != entries.end(); ++i) { 262 i != entries.end(); ++i) {
263 *out++ = i->type; 263 *out++ = static_cast<uint8>(i->type);
264 switch (i->type) { 264 switch (i->type) {
265 case CertEntry::COMPRESSED: 265 case CertEntry::COMPRESSED:
266 break; 266 break;
267 case CertEntry::CACHED: 267 case CertEntry::CACHED:
268 memcpy(out, &i->hash, sizeof(i->hash)); 268 memcpy(out, &i->hash, sizeof(i->hash));
269 out += sizeof(uint64); 269 out += sizeof(uint64);
270 break; 270 break;
271 case CertEntry::COMMON: 271 case CertEntry::COMMON:
272 // Assumes a little-endian machine. 272 // Assumes a little-endian machine.
273 memcpy(out, &i->set_hash, sizeof(i->set_hash)); 273 memcpy(out, &i->set_hash, sizeof(i->set_hash));
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
637 } 637 }
638 638
639 if (!uncompressed.empty()) { 639 if (!uncompressed.empty()) {
640 return false; 640 return false;
641 } 641 }
642 642
643 return true; 643 return true;
644 } 644 }
645 645
646 } // namespace net 646 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/congestion_control/tcp_loss_algorithm.h ('k') | net/quic/crypto/crypto_framer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698