| Index: net/disk_cache/entry_impl.cc
|
| ===================================================================
|
| --- net/disk_cache/entry_impl.cc (revision 232523)
|
| +++ net/disk_cache/entry_impl.cc (working copy)
|
| @@ -96,7 +96,7 @@
|
| buffer_.reserve(kMaxBlockSize);
|
| }
|
| ~UserBuffer() {
|
| - if (backend_.get())
|
| + if (backend_)
|
| backend_->BufferDeleted(capacity() - kMaxBlockSize);
|
| }
|
|
|
| @@ -253,7 +253,7 @@
|
|
|
| void EntryImpl::UserBuffer::Reset() {
|
| if (!grow_allowed_) {
|
| - if (backend_.get())
|
| + if (backend_)
|
| backend_->BufferDeleted(capacity() - kMaxBlockSize);
|
| grow_allowed_ = true;
|
| std::vector<char> tmp;
|
| @@ -273,7 +273,7 @@
|
| if (required > limit)
|
| return false;
|
|
|
| - if (!backend_.get())
|
| + if (!backend_)
|
| return false;
|
|
|
| int to_add = std::max(required - current_size, kMaxBlockSize * 4);
|
| @@ -303,7 +303,7 @@
|
| }
|
|
|
| void EntryImpl::DoomImpl() {
|
| - if (doomed_ || !backend_.get())
|
| + if (doomed_ || !backend_)
|
| return;
|
|
|
| SetPointerForInvalidEntry(backend_->GetCurrentEntryId());
|
| @@ -673,7 +673,7 @@
|
| }
|
|
|
| void EntryImpl::DecrementIoCount() {
|
| - if (backend_.get())
|
| + if (backend_)
|
| backend_->DecrementIoCount();
|
| }
|
|
|
| @@ -689,7 +689,7 @@
|
| }
|
|
|
| void EntryImpl::ReportIOTime(Operation op, const base::TimeTicks& start) {
|
| - if (!backend_.get())
|
| + if (!backend_)
|
| return;
|
|
|
| switch (op) {
|
| @@ -747,12 +747,12 @@
|
| // ------------------------------------------------------------------------
|
|
|
| void EntryImpl::Doom() {
|
| - if (background_queue_.get())
|
| + if (background_queue_)
|
| background_queue_->DoomEntryImpl(this);
|
| }
|
|
|
| void EntryImpl::Close() {
|
| - if (background_queue_.get())
|
| + if (background_queue_)
|
| background_queue_->CloseEntryImpl(this);
|
| }
|
|
|
| @@ -822,7 +822,7 @@
|
| if (buf_len < 0)
|
| return net::ERR_INVALID_ARGUMENT;
|
|
|
| - if (!background_queue_.get())
|
| + if (!background_queue_)
|
| return net::ERR_UNEXPECTED;
|
|
|
| background_queue_->ReadData(this, index, offset, buf, buf_len, callback);
|
| @@ -841,7 +841,7 @@
|
| if (offset < 0 || buf_len < 0)
|
| return net::ERR_INVALID_ARGUMENT;
|
|
|
| - if (!background_queue_.get())
|
| + if (!background_queue_)
|
| return net::ERR_UNEXPECTED;
|
|
|
| background_queue_->WriteData(this, index, offset, buf, buf_len, truncate,
|
| @@ -854,7 +854,7 @@
|
| if (callback.is_null())
|
| return ReadSparseDataImpl(offset, buf, buf_len, callback);
|
|
|
| - if (!background_queue_.get())
|
| + if (!background_queue_)
|
| return net::ERR_UNEXPECTED;
|
|
|
| background_queue_->ReadSparseData(this, offset, buf, buf_len, callback);
|
| @@ -866,7 +866,7 @@
|
| if (callback.is_null())
|
| return WriteSparseDataImpl(offset, buf, buf_len, callback);
|
|
|
| - if (!background_queue_.get())
|
| + if (!background_queue_)
|
| return net::ERR_UNEXPECTED;
|
|
|
| background_queue_->WriteSparseData(this, offset, buf, buf_len, callback);
|
| @@ -875,7 +875,7 @@
|
|
|
| int EntryImpl::GetAvailableRange(int64 offset, int len, int64* start,
|
| const CompletionCallback& callback) {
|
| - if (!background_queue_.get())
|
| + if (!background_queue_)
|
| return net::ERR_UNEXPECTED;
|
|
|
| background_queue_->GetAvailableRange(this, offset, len, start, callback);
|
| @@ -892,7 +892,7 @@
|
| }
|
|
|
| void EntryImpl::CancelSparseIO() {
|
| - if (background_queue_.get())
|
| + if (background_queue_)
|
| background_queue_->CancelSparseIO(this);
|
| }
|
|
|
| @@ -900,7 +900,7 @@
|
| if (!sparse_.get())
|
| return net::OK;
|
|
|
| - if (!background_queue_.get())
|
| + if (!background_queue_)
|
| return net::ERR_UNEXPECTED;
|
|
|
| background_queue_->ReadyForSparseIO(this, callback);
|
| @@ -914,7 +914,7 @@
|
| // data related to a previous cache entry because the range was not fully
|
| // written before).
|
| EntryImpl::~EntryImpl() {
|
| - if (!backend_.get()) {
|
| + if (!backend_) {
|
| entry_.clear_modified();
|
| node_.clear_modified();
|
| return;
|
| @@ -982,7 +982,7 @@
|
| if (buf_len < 0)
|
| return net::ERR_INVALID_ARGUMENT;
|
|
|
| - if (!backend_.get())
|
| + if (!backend_)
|
| return net::ERR_UNEXPECTED;
|
|
|
| TimeTicks start = TimeTicks::Now();
|
| @@ -1064,7 +1064,7 @@
|
| if (offset < 0 || buf_len < 0)
|
| return net::ERR_INVALID_ARGUMENT;
|
|
|
| - if (!backend_.get())
|
| + if (!backend_)
|
| return net::ERR_UNEXPECTED;
|
|
|
| int max_file_size = backend_->MaxFileSize();
|
| @@ -1172,7 +1172,7 @@
|
|
|
| bool EntryImpl::CreateBlock(int size, Addr* address) {
|
| DCHECK(!address->is_initialized());
|
| - if (!backend_.get())
|
| + if (!backend_)
|
| return false;
|
|
|
| FileType file_type = Addr::RequiredFileType(size);
|
| @@ -1197,7 +1197,7 @@
|
| // important that the entry doesn't keep a reference to this address, or we'll
|
| // end up deleting the contents of |address| once again.
|
| void EntryImpl::DeleteData(Addr address, int index) {
|
| - DCHECK(backend_.get());
|
| + DCHECK(backend_);
|
| if (!address.is_initialized())
|
| return;
|
| if (address.is_separate_file()) {
|
| @@ -1207,7 +1207,7 @@
|
| LOG(ERROR) << "Failed to delete " <<
|
| backend_->GetFileName(address).value() << " from the cache.";
|
| }
|
| - if (files_[index].get())
|
| + if (files_[index])
|
| files_[index] = NULL; // Releases the object.
|
| } else {
|
| backend_->DeleteBlock(address, true);
|
| @@ -1215,7 +1215,7 @@
|
| }
|
|
|
| void EntryImpl::UpdateRank(bool modified) {
|
| - if (!backend_.get())
|
| + if (!backend_)
|
| return;
|
|
|
| if (!doomed_) {
|
| @@ -1232,7 +1232,7 @@
|
| }
|
|
|
| File* EntryImpl::GetBackingFile(Addr address, int index) {
|
| - if (!backend_.get())
|
| + if (!backend_)
|
| return NULL;
|
|
|
| File* file;
|
| @@ -1506,7 +1506,7 @@
|
| }
|
|
|
| void EntryImpl::GetData(int index, char** buffer, Addr* address) {
|
| - DCHECK(backend_.get());
|
| + DCHECK(backend_);
|
| if (user_buffers_[index].get() && user_buffers_[index]->Size() &&
|
| !user_buffers_[index]->Start()) {
|
| // The data is already in memory, just copy it and we're done.
|
|
|