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

Side by Side Diff: net/disk_cache/blockfile/entry_impl_v3.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
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_v3.h" 5 #include "net/disk_cache/blockfile/entry_impl_v3.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 671 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 if (net::OK != result) 682 if (net::OK != result)
683 return result; 683 return result;
684 684
685 return sparse_->GetAvailableRange(offset, len, start); 685 return sparse_->GetAvailableRange(offset, len, start);
686 } 686 }
687 687
688 bool EntryImplV3::CouldBeSparse() const { 688 bool EntryImplV3::CouldBeSparse() const {
689 if (sparse_.get()) 689 if (sparse_.get())
690 return true; 690 return true;
691 691
692 scoped_ptr<SparseControl> sparse; 692 std::unique_ptr<SparseControl> sparse;
693 sparse.reset(new SparseControl(const_cast<EntryImpl*>(this))); 693 sparse.reset(new SparseControl(const_cast<EntryImpl*>(this)));
694 return sparse->CouldBeSparse(); 694 return sparse->CouldBeSparse();
695 } 695 }
696 696
697 void EntryImplV3::CancelSparseIO() { 697 void EntryImplV3::CancelSparseIO() {
698 if (background_queue_) 698 if (background_queue_)
699 background_queue_->CancelSparseIO(this); 699 background_queue_->CancelSparseIO(this);
700 } 700 }
701 701
702 void EntryImplV3::CancelSparseIOImpl() { 702 void EntryImplV3::CancelSparseIOImpl() {
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
1319 unreported_size_[index] += new_size - old_size; 1319 unreported_size_[index] += new_size - old_size;
1320 entry_.Data()->data_size[index] = new_size; 1320 entry_.Data()->data_size[index] = new_size;
1321 entry_.set_modified(); 1321 entry_.set_modified();
1322 } 1322 }
1323 1323
1324 int EntryImpl::InitSparseData() { 1324 int EntryImpl::InitSparseData() {
1325 if (sparse_.get()) 1325 if (sparse_.get())
1326 return net::OK; 1326 return net::OK;
1327 1327
1328 // Use a local variable so that sparse_ never goes from 'valid' to NULL. 1328 // Use a local variable so that sparse_ never goes from 'valid' to NULL.
1329 scoped_ptr<SparseControl> sparse(new SparseControl(this)); 1329 std::unique_ptr<SparseControl> sparse(new SparseControl(this));
1330 int result = sparse->Init(); 1330 int result = sparse->Init();
1331 if (net::OK == result) 1331 if (net::OK == result)
1332 sparse_.swap(sparse); 1332 sparse_.swap(sparse);
1333 1333
1334 return result; 1334 return result;
1335 } 1335 }
1336 1336
1337 void EntryImpl::SetEntryFlags(uint32_t flags) { 1337 void EntryImpl::SetEntryFlags(uint32_t flags) {
1338 entry_.Data()->flags |= flags; 1338 entry_.Data()->flags |= flags;
1339 entry_.set_modified(); 1339 entry_.set_modified();
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
1474 1474
1475 int EntryImplV3::ReadyForSparseIO(const CompletionCallback& callback) { 1475 int EntryImplV3::ReadyForSparseIO(const CompletionCallback& callback) {
1476 return net::ERR_FAILED; 1476 return net::ERR_FAILED;
1477 } 1477 }
1478 1478
1479 EntryImplV3::~EntryImplV3() { 1479 EntryImplV3::~EntryImplV3() {
1480 NOTIMPLEMENTED(); 1480 NOTIMPLEMENTED();
1481 } 1481 }
1482 1482
1483 } // namespace disk_cache 1483 } // namespace disk_cache
OLDNEW
« no previous file with comments | « net/disk_cache/blockfile/entry_impl_v3.h ('k') | net/disk_cache/blockfile/in_flight_backend_io.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698