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

Side by Side Diff: components/packed_ct_ev_whitelist/bit_stream_reader.cc

Issue 811353002: Move CT EV white list packaging API from chrome/ to components/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed missed nit Created 5 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chrome/browser/net/bit_stream_reader.h" 5 #include "components/packed_ct_ev_whitelist/bit_stream_reader.h"
6 6
7 #include "base/big_endian.h" 7 #include "base/big_endian.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/numerics/safe_conversions.h" 9 #include "base/numerics/safe_conversions.h"
10 10
11 namespace packed_ct_ev_whitelist {
11 namespace internal { 12 namespace internal {
12 13
13 BitStreamReader::BitStreamReader(const base::StringPiece& source) 14 BitStreamReader::BitStreamReader(const base::StringPiece& source)
14 : source_(source), current_byte_(0), current_bit_(7) { 15 : source_(source), current_byte_(0), current_bit_(7) {
15 DCHECK_LT(source_.length(), UINT32_MAX); 16 DCHECK_LT(source_.length(), UINT32_MAX);
16 } 17 }
17 18
18 bool BitStreamReader::ReadUnaryEncoding(uint64_t* out) { 19 bool BitStreamReader::ReadUnaryEncoding(uint64_t* out) {
19 if (BitsLeft() == 0) 20 if (BitsLeft() == 0)
20 return false; 21 return false;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 current_bit_--; 55 current_bit_--;
55 if (current_bit_ < 0) { 56 if (current_bit_ < 0) {
56 current_byte_++; 57 current_byte_++;
57 current_bit_ = 7; 58 current_bit_ = 7;
58 } 59 }
59 60
60 return res; 61 return res;
61 } 62 }
62 63
63 } // namespace internal 64 } // namespace internal
65 } // namespace packed_ct_ev_whitelist
OLDNEW
« no previous file with comments | « components/packed_ct_ev_whitelist/bit_stream_reader.h ('k') | components/packed_ct_ev_whitelist/bit_stream_reader_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698