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

Side by Side Diff: net/disk_cache/simple/simple_entry_impl.cc

Issue 22926031: Sparse IO: Allow failover to network in debug builds (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | net/http/http_cache_transaction.cc » ('j') | net/http/http_cache_unittest.cc » ('J')
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/disk_cache/simple/simple_entry_impl.h" 5 #include "net/disk_cache/simple/simple_entry_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cstring> 8 #include <cstring>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 void SimpleEntryImpl::CancelSparseIO() { 489 void SimpleEntryImpl::CancelSparseIO() {
490 DCHECK(io_thread_checker_.CalledOnValidThread()); 490 DCHECK(io_thread_checker_.CalledOnValidThread());
491 // TODO(gavinp): Determine if the simple backend should support sparse data. 491 // TODO(gavinp): Determine if the simple backend should support sparse data.
492 NOTIMPLEMENTED(); 492 NOTIMPLEMENTED();
493 } 493 }
494 494
495 int SimpleEntryImpl::ReadyForSparseIO(const CompletionCallback& callback) { 495 int SimpleEntryImpl::ReadyForSparseIO(const CompletionCallback& callback) {
496 DCHECK(io_thread_checker_.CalledOnValidThread()); 496 DCHECK(io_thread_checker_.CalledOnValidThread());
497 // TODO(gavinp): Determine if the simple backend should support sparse data. 497 // TODO(gavinp): Determine if the simple backend should support sparse data.
498 NOTIMPLEMENTED(); 498 NOTIMPLEMENTED();
499 #if defined(OS_ANDROID)
rvargas (doing something else) 2013/08/28 21:35:47 There should not be an ifdef here.
gavinp 2013/08/28 21:41:25 This was specifically requested by the TPM to make
pasko 2013/08/28 21:56:28 I don't like this ifdef either, and maybe this one
rvargas (doing something else) 2013/08/28 22:33:40 I just commented on the bug. I understand the othe
500 return net::ERR_NOT_IMPLEMENTED;
501 #else
499 return net::ERR_FAILED; 502 return net::ERR_FAILED;
503 #endif
500 } 504 }
501 505
502 SimpleEntryImpl::~SimpleEntryImpl() { 506 SimpleEntryImpl::~SimpleEntryImpl() {
503 DCHECK(io_thread_checker_.CalledOnValidThread()); 507 DCHECK(io_thread_checker_.CalledOnValidThread());
504 DCHECK_EQ(0U, pending_operations_.size()); 508 DCHECK_EQ(0U, pending_operations_.size());
505 DCHECK(state_ == STATE_UNINITIALIZED || state_ == STATE_FAILURE); 509 DCHECK(state_ == STATE_UNINITIALIZED || state_ == STATE_FAILURE);
506 DCHECK(!synchronous_entry_); 510 DCHECK(!synchronous_entry_);
507 RemoveSelfFromBackend(); 511 RemoveSelfFromBackend();
508 net_log_.EndEvent(net::NetLog::TYPE_SIMPLE_CACHE_ENTRY); 512 net_log_.EndEvent(net::NetLog::TYPE_SIMPLE_CACHE_ENTRY);
509 } 513 }
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after
1195 } else { 1199 } else {
1196 type = conflicting ? WRITE_FOLLOWS_CONFLICTING_WRITE 1200 type = conflicting ? WRITE_FOLLOWS_CONFLICTING_WRITE
1197 : WRITE_FOLLOWS_NON_CONFLICTING_WRITE; 1201 : WRITE_FOLLOWS_NON_CONFLICTING_WRITE;
1198 } 1202 }
1199 } 1203 }
1200 UMA_HISTOGRAM_ENUMERATION( 1204 UMA_HISTOGRAM_ENUMERATION(
1201 "SimpleCache.WriteDependencyType", type, WRITE_DEPENDENCY_TYPE_MAX); 1205 "SimpleCache.WriteDependencyType", type, WRITE_DEPENDENCY_TYPE_MAX);
1202 } 1206 }
1203 1207
1204 } // namespace disk_cache 1208 } // namespace disk_cache
OLDNEW
« no previous file with comments | « no previous file | net/http/http_cache_transaction.cc » ('j') | net/http/http_cache_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698