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

Side by Side Diff: net/filter/sdch_filter.cc

Issue 509563003: Remove implicit conversions from scoped_refptr to T* in net/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 | « net/dns/mock_host_resolver.cc ('k') | net/server/http_server_unittest.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 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 "net/filter/sdch_filter.h" 5 #include "net/filter/sdch_filter.h"
6 6
7 #include <ctype.h> 7 #include <ctype.h>
8 #include <limits.h> 8 #include <limits.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 } 331 }
332 dictionary_hash_.append(next_stream_data_, bytes_needed); 332 dictionary_hash_.append(next_stream_data_, bytes_needed);
333 DCHECK(kServerIdLength == dictionary_hash_.size()); 333 DCHECK(kServerIdLength == dictionary_hash_.size());
334 stream_data_len_ -= bytes_needed; 334 stream_data_len_ -= bytes_needed;
335 DCHECK_LE(0, stream_data_len_); 335 DCHECK_LE(0, stream_data_len_);
336 if (stream_data_len_ > 0) 336 if (stream_data_len_ > 0)
337 next_stream_data_ += bytes_needed; 337 next_stream_data_ += bytes_needed;
338 else 338 else
339 next_stream_data_ = NULL; 339 next_stream_data_ = NULL;
340 340
341 DCHECK(!dictionary_); 341 DCHECK(!dictionary_.get());
342 dictionary_hash_is_plausible_ = true; // Assume plausible, but check. 342 dictionary_hash_is_plausible_ = true; // Assume plausible, but check.
343 343
344 if ('\0' == dictionary_hash_[kServerIdLength - 1]) { 344 if ('\0' == dictionary_hash_[kServerIdLength - 1]) {
345 SdchManager* manager(url_request_context_->sdch_manager()); 345 SdchManager* manager(url_request_context_->sdch_manager());
346 manager->GetVcdiffDictionary( 346 manager->GetVcdiffDictionary(
347 std::string(dictionary_hash_, 0, kServerIdLength - 1), 347 std::string(dictionary_hash_, 0, kServerIdLength - 1),
348 url_, &dictionary_); 348 url_, &dictionary_);
349 } else { 349 } else {
350 dictionary_hash_is_plausible_ = false; 350 dictionary_hash_is_plausible_ = false;
351 } 351 }
352 352
353 if (!dictionary_) { 353 if (!dictionary_.get()) {
354 DCHECK(dictionary_hash_.size() == kServerIdLength); 354 DCHECK(dictionary_hash_.size() == kServerIdLength);
355 // Since dictionary was not found, check to see if hash was even plausible. 355 // Since dictionary was not found, check to see if hash was even plausible.
356 for (size_t i = 0; i < kServerIdLength - 1; ++i) { 356 for (size_t i = 0; i < kServerIdLength - 1; ++i) {
357 char base64_char = dictionary_hash_[i]; 357 char base64_char = dictionary_hash_[i];
358 if (!isalnum(base64_char) && '-' != base64_char && '_' != base64_char) { 358 if (!isalnum(base64_char) && '-' != base64_char && '_' != base64_char) {
359 dictionary_hash_is_plausible_ = false; 359 dictionary_hash_is_plausible_ = false;
360 break; 360 break;
361 } 361 }
362 } 362 }
363 if (dictionary_hash_is_plausible_) 363 if (dictionary_hash_is_plausible_)
(...skipping 23 matching lines...) Expand all
387 dest_buffer_excess_index_ += amount; 387 dest_buffer_excess_index_ += amount;
388 if (dest_buffer_excess_.size() <= dest_buffer_excess_index_) { 388 if (dest_buffer_excess_.size() <= dest_buffer_excess_index_) {
389 DCHECK(dest_buffer_excess_.size() == dest_buffer_excess_index_); 389 DCHECK(dest_buffer_excess_.size() == dest_buffer_excess_index_);
390 dest_buffer_excess_.clear(); 390 dest_buffer_excess_.clear();
391 dest_buffer_excess_index_ = 0; 391 dest_buffer_excess_index_ = 0;
392 } 392 }
393 return amount; 393 return amount;
394 } 394 }
395 395
396 } // namespace net 396 } // namespace net
OLDNEW
« no previous file with comments | « net/dns/mock_host_resolver.cc ('k') | net/server/http_server_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698