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

Side by Side Diff: net/base/gzip_header.cc

Issue 12310041: experiment with -Wimplicit-fallthrough Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: rebase Created 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/base/gzip_header.h" 5 #include "net/base/gzip_header.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "third_party/zlib/zlib.h" 10 #include "third_party/zlib/zlib.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 pos++; 94 pos++;
95 state_++; 95 state_++;
96 break; 96 break;
97 case IN_XLEN_BYTE_1: 97 case IN_XLEN_BYTE_1:
98 extra_length_ += *pos << 8; 98 extra_length_ += *pos << 8;
99 pos++; 99 pos++;
100 state_++; 100 state_++;
101 // We intentionally fall through, because if we have a 101 // We intentionally fall through, because if we have a
102 // zero-length FEXTRA, we want to check to notice that we're 102 // zero-length FEXTRA, we want to check to notice that we're
103 // done reading the FEXTRA before we exit this loop... 103 // done reading the FEXTRA before we exit this loop...
104 104 FALLTHROUGH_INTENDED;
105 case IN_FEXTRA: { 105 case IN_FEXTRA: {
106 // Grab the rest of the bytes in the extra field, or as many 106 // Grab the rest of the bytes in the extra field, or as many
107 // of them as are actually present so far. 107 // of them as are actually present so far.
108 const int num_extra_bytes = static_cast<const int>(std::min( 108 const int num_extra_bytes = static_cast<const int>(std::min(
109 static_cast<ptrdiff_t>(extra_length_), 109 static_cast<ptrdiff_t>(extra_length_),
110 (end - pos))); 110 (end - pos)));
111 pos += num_extra_bytes; 111 pos += num_extra_bytes;
112 extra_length_ -= num_extra_bytes; 112 extra_length_ -= num_extra_bytes;
113 if ( extra_length_ == 0 ) { 113 if ( extra_length_ == 0 ) {
114 state_ = IN_FNAME; // advance when we've seen extra_length_ bytes 114 state_ = IN_FNAME; // advance when we've seen extra_length_ bytes
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 172
173 if ( (state_ > IN_HEADER_OS) && (flags_ == 0) ) { 173 if ( (state_ > IN_HEADER_OS) && (flags_ == 0) ) {
174 *header_end = reinterpret_cast<const char*>(pos); 174 *header_end = reinterpret_cast<const char*>(pos);
175 return COMPLETE_HEADER; 175 return COMPLETE_HEADER;
176 } else { 176 } else {
177 return INCOMPLETE_HEADER; 177 return INCOMPLETE_HEADER;
178 } 178 }
179 } 179 }
180 180
181 } // namespace net 181 } // namespace net
OLDNEW
« no previous file with comments | « net/base/gzip_filter.cc ('k') | net/base/registry_controlled_domains/registry_controlled_domain.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698