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

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

Issue 1894733002: Change scoped_ptr to std::unique_ptr in //net/disk_cache. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/disk_cache/blockfile/entry_impl.h ('k') | net/disk_cache/blockfile/entry_impl_v3.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/entry_impl.h" 5 #include "net/disk_cache/blockfile/entry_impl.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/hash.h" 9 #include "base/hash.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after
895 return net::ERR_UNEXPECTED; 895 return net::ERR_UNEXPECTED;
896 896
897 background_queue_->GetAvailableRange(this, offset, len, start, callback); 897 background_queue_->GetAvailableRange(this, offset, len, start, callback);
898 return net::ERR_IO_PENDING; 898 return net::ERR_IO_PENDING;
899 } 899 }
900 900
901 bool EntryImpl::CouldBeSparse() const { 901 bool EntryImpl::CouldBeSparse() const {
902 if (sparse_.get()) 902 if (sparse_.get())
903 return true; 903 return true;
904 904
905 scoped_ptr<SparseControl> sparse; 905 std::unique_ptr<SparseControl> sparse;
906 sparse.reset(new SparseControl(const_cast<EntryImpl*>(this))); 906 sparse.reset(new SparseControl(const_cast<EntryImpl*>(this)));
907 return sparse->CouldBeSparse(); 907 return sparse->CouldBeSparse();
908 } 908 }
909 909
910 void EntryImpl::CancelSparseIO() { 910 void EntryImpl::CancelSparseIO() {
911 if (background_queue_.get()) 911 if (background_queue_.get())
912 background_queue_->CancelSparseIO(this); 912 background_queue_->CancelSparseIO(this);
913 } 913 }
914 914
915 int EntryImpl::ReadyForSparseIO(const CompletionCallback& callback) { 915 int EntryImpl::ReadyForSparseIO(const CompletionCallback& callback) {
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after
1498 unreported_size_[index] += new_size - old_size; 1498 unreported_size_[index] += new_size - old_size;
1499 entry_.Data()->data_size[index] = new_size; 1499 entry_.Data()->data_size[index] = new_size;
1500 entry_.set_modified(); 1500 entry_.set_modified();
1501 } 1501 }
1502 1502
1503 int EntryImpl::InitSparseData() { 1503 int EntryImpl::InitSparseData() {
1504 if (sparse_.get()) 1504 if (sparse_.get())
1505 return net::OK; 1505 return net::OK;
1506 1506
1507 // Use a local variable so that sparse_ never goes from 'valid' to NULL. 1507 // Use a local variable so that sparse_ never goes from 'valid' to NULL.
1508 scoped_ptr<SparseControl> sparse(new SparseControl(this)); 1508 std::unique_ptr<SparseControl> sparse(new SparseControl(this));
1509 int result = sparse->Init(); 1509 int result = sparse->Init();
1510 if (net::OK == result) 1510 if (net::OK == result)
1511 sparse_.swap(sparse); 1511 sparse_.swap(sparse);
1512 1512
1513 return result; 1513 return result;
1514 } 1514 }
1515 1515
1516 void EntryImpl::SetEntryFlags(uint32_t flags) { 1516 void EntryImpl::SetEntryFlags(uint32_t flags) {
1517 entry_.Data()->flags |= flags; 1517 entry_.Data()->flags |= flags;
1518 entry_.set_modified(); 1518 entry_.set_modified();
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
1558 Trace("%s 0x%p 0x%x 0x%x", msg, reinterpret_cast<void*>(this), 1558 Trace("%s 0x%p 0x%x 0x%x", msg, reinterpret_cast<void*>(this),
1559 entry_.address().value(), node_.address().value()); 1559 entry_.address().value(), node_.address().value());
1560 1560
1561 Trace(" data: 0x%x 0x%x 0x%x", entry_.Data()->data_addr[0], 1561 Trace(" data: 0x%x 0x%x 0x%x", entry_.Data()->data_addr[0],
1562 entry_.Data()->data_addr[1], entry_.Data()->long_key); 1562 entry_.Data()->data_addr[1], entry_.Data()->long_key);
1563 1563
1564 Trace(" doomed: %d 0x%x", doomed_, dirty); 1564 Trace(" doomed: %d 0x%x", doomed_, dirty);
1565 } 1565 }
1566 1566
1567 } // namespace disk_cache 1567 } // namespace disk_cache
OLDNEW
« no previous file with comments | « net/disk_cache/blockfile/entry_impl.h ('k') | net/disk_cache/blockfile/entry_impl_v3.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698