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

Side by Side Diff: net/disk_cache/blockfile/backend_worker_v3.cc

Issue 1499423004: Remove kint32max. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@kint9
Patch Set: rebase Created 5 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 | « media/formats/mp4/box_reader.cc ('k') | net/disk_cache/blockfile/entry_impl.h » ('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) 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/disk_cache/blockfile/backend_worker_v3.h" 5 #include "net/disk_cache/blockfile/backend_worker_v3.h"
6 6
7 #include <stdint.h>
8
9 #include <limits>
10
7 #include "base/bind.h" 11 #include "base/bind.h"
8 #include "base/bind_helpers.h" 12 #include "base/bind_helpers.h"
9 #include "base/files/file_path.h" 13 #include "base/files/file_path.h"
10 #include "base/files/file_util.h" 14 #include "base/files/file_util.h"
11 #include "base/message_loop/message_loop.h" 15 #include "base/message_loop/message_loop.h"
12 #include "base/strings/string_util.h" 16 #include "base/strings/string_util.h"
13 #include "base/strings/stringprintf.h" 17 #include "base/strings/stringprintf.h"
14 #include "base/time/time.h" 18 #include "base/time/time.h"
15 #include "base/timer/timer.h" 19 #include "base/timer/timer.h"
16 #include "net/base/net_errors.h" 20 #include "net/base/net_errors.h"
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 if (current_size < GetIndexSize(data_->header.table_len) || 394 if (current_size < GetIndexSize(data_->header.table_len) ||
391 data_->header.table_len & (kBaseTableLen - 1)) { 395 data_->header.table_len & (kBaseTableLen - 1)) {
392 LOG(ERROR) << "Corrupt Index file"; 396 LOG(ERROR) << "Corrupt Index file";
393 return false; 397 return false;
394 } 398 }
395 399
396 AdjustMaxCacheSize(data_->header.table_len); 400 AdjustMaxCacheSize(data_->header.table_len);
397 401
398 #if !defined(NET_BUILD_STRESS_CACHE) 402 #if !defined(NET_BUILD_STRESS_CACHE)
399 if (data_->header.num_bytes < 0 || 403 if (data_->header.num_bytes < 0 ||
400 (max_size_ < kint32max - kDefaultCacheSize && 404 (max_size_ < std::numeric_limits<int32_t>::max() - kDefaultCacheSize &&
401 data_->header.num_bytes > max_size_ + kDefaultCacheSize)) { 405 data_->header.num_bytes > max_size_ + kDefaultCacheSize)) {
402 LOG(ERROR) << "Invalid cache (current) size"; 406 LOG(ERROR) << "Invalid cache (current) size";
403 return false; 407 return false;
404 } 408 }
405 #endif 409 #endif
406 410
407 if (data_->header.num_entries < 0) { 411 if (data_->header.num_entries < 0) {
408 LOG(ERROR) << "Invalid number of entries"; 412 LOG(ERROR) << "Invalid number of entries";
409 return false; 413 return false;
410 } 414 }
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 #endif // defined(V3_NOT_JUST_YET_READY). 462 #endif // defined(V3_NOT_JUST_YET_READY).
459 463
460 int BackendImplV3::Worker::Init(const CompletionCallback& callback) { 464 int BackendImplV3::Worker::Init(const CompletionCallback& callback) {
461 return net::ERR_FAILED; 465 return net::ERR_FAILED;
462 } 466 }
463 467
464 BackendImplV3::Worker::~Worker() { 468 BackendImplV3::Worker::~Worker() {
465 } 469 }
466 470
467 } // namespace disk_cache 471 } // namespace disk_cache
OLDNEW
« no previous file with comments | « media/formats/mp4/box_reader.cc ('k') | net/disk_cache/blockfile/entry_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698