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

Side by Side Diff: net/http/http_cache_transaction.cc

Issue 428003: Merge 32707 - Http cache: Make sure that when we cancel a request for... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/249/src/
Patch Set: Created 11 years, 1 month 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_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 (c) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 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/http/http_cache_transaction.h" 5 #include "net/http/http_cache_transaction.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 8
9 #if defined(OS_POSIX) 9 #if defined(OS_POSIX)
10 #include <unistd.h> 10 #include <unistd.h>
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 NOTREACHED(); 451 NOTREACHED();
452 rv = ERR_FAILED; 452 rv = ERR_FAILED;
453 } 453 }
454 return rv; 454 return rv;
455 } 455 }
456 456
457 bool HttpCache::Transaction::AddTruncatedFlag() { 457 bool HttpCache::Transaction::AddTruncatedFlag() {
458 DCHECK(mode_ & WRITE); 458 DCHECK(mode_ & WRITE);
459 459
460 // Don't set the flag for sparse entries. 460 // Don't set the flag for sparse entries.
461 if (partial_.get()) 461 if (partial_.get() && !truncated_)
462 return true; 462 return true;
463 463
464 // Double check that there is something worth keeping. 464 // Double check that there is something worth keeping.
465 if (!entry_->disk_entry->GetDataSize(kResponseContentIndex)) 465 if (!entry_->disk_entry->GetDataSize(kResponseContentIndex))
466 return false; 466 return false;
467 467
468 truncated_ = true; 468 truncated_ = true;
469 WriteResponseInfoToEntry(true); 469 WriteResponseInfoToEntry(true);
470 return true; 470 return true;
471 } 471 }
(...skipping 898 matching lines...) Expand 10 before | Expand all | Expand 10 after
1370 void HttpCache::Transaction::OnCacheWriteCompleted(int result) { 1370 void HttpCache::Transaction::OnCacheWriteCompleted(int result) {
1371 DoCacheWriteCompleted(result); 1371 DoCacheWriteCompleted(result);
1372 } 1372 }
1373 1373
1374 void HttpCache::Transaction::OnCacheEntryReady(int result) { 1374 void HttpCache::Transaction::OnCacheEntryReady(int result) {
1375 DCHECK_EQ(OK, result); 1375 DCHECK_EQ(OK, result);
1376 ValidateEntryHeadersAndContinue(true); 1376 ValidateEntryHeadersAndContinue(true);
1377 } 1377 }
1378 1378
1379 } // namespace net 1379 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/http/http_cache_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698