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

Unified Diff: net/disk_cache/backend_impl.cc

Issue 15829004: Update net/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: license twerk Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/cookies/cookie_store_unittest.h ('k') | net/disk_cache/backend_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/backend_impl.cc
diff --git a/net/disk_cache/backend_impl.cc b/net/disk_cache/backend_impl.cc
index 5c8937611fcca4ba19b4225b96edc8a7454ff4b1..80d4f32c739b47b62d6805e2dea8de113f40e21c 100644
--- a/net/disk_cache/backend_impl.cc
+++ b/net/disk_cache/backend_impl.cc
@@ -607,7 +607,7 @@ EntryImpl* BackendImpl::CreateEntryImpl(const std::string& key) {
cache_entry->BeginLogging(net_log_, true);
// We are not failing the operation; let's add this to the map.
- open_entries_[entry_address.value()] = cache_entry;
+ open_entries_[entry_address.value()] = cache_entry.get();
// Save the entry.
cache_entry->entry()->Store();
@@ -623,7 +623,7 @@ EntryImpl* BackendImpl::CreateEntryImpl(const std::string& key) {
}
// Link this entry through the lists.
- eviction_.OnCreateEntry(cache_entry);
+ eviction_.OnCreateEntry(cache_entry.get());
CACHE_UMA(AGE_MS, "CreateTime", 0, start);
stats_.OnEvent(Stats::CREATE_HIT);
@@ -1146,7 +1146,7 @@ int BackendImpl::SelfCheck() {
}
void BackendImpl::FlushIndex() {
- if (index_ && !disabled_)
+ if (index_.get() && !disabled_)
index_->Flush();
}
@@ -1157,7 +1157,7 @@ net::CacheType BackendImpl::GetCacheType() const {
}
int32 BackendImpl::GetEntryCount() const {
- if (!index_ || disabled_)
+ if (!index_.get() || disabled_)
return 0;
// num_entries includes entries already evicted.
int32 not_deleted = data_->header.num_entries -
@@ -1294,7 +1294,7 @@ bool BackendImpl::InitBackingStore(bool* file_created) {
bool ret = true;
if (*file_created)
- ret = CreateBackingStore(file);
+ ret = CreateBackingStore(file.get());
file = NULL;
if (!ret)
@@ -1524,7 +1524,7 @@ int BackendImpl::NewEntry(Addr address, EntryImpl** entry) {
address.value());
}
- open_entries_[address.value()] = cache_entry;
+ open_entries_[address.value()] = cache_entry.get();
cache_entry->BeginLogging(net_log_, false);
cache_entry.swap(entry);
@@ -1570,7 +1570,7 @@ EntryImpl* BackendImpl::MatchEntry(const std::string& key, uint32 hash,
if (!error)
child.set_value(cache_entry->GetNextAddress());
- if (parent_entry) {
+ if (parent_entry.get()) {
parent_entry->SetNextAddress(child);
parent_entry = NULL;
} else {
@@ -1583,7 +1583,7 @@ EntryImpl* BackendImpl::MatchEntry(const std::string& key, uint32 hash,
if (!error) {
// It is important to call DestroyInvalidEntry after removing this
// entry from the table.
- DestroyInvalidEntry(cache_entry);
+ DestroyInvalidEntry(cache_entry.get());
cache_entry = NULL;
} else {
Trace("NewEntry failed on MatchEntry 0x%x", address.value());
@@ -1611,21 +1611,21 @@ EntryImpl* BackendImpl::MatchEntry(const std::string& key, uint32 hash,
cache_entry = NULL;
parent_entry = cache_entry;
cache_entry = NULL;
- if (!parent_entry)
+ if (!parent_entry.get())
break;
address.set_value(parent_entry->GetNextAddress());
}
- if (parent_entry && (!find_parent || !found))
+ if (parent_entry.get() && (!find_parent || !found))
parent_entry = NULL;
- if (find_parent && entry_addr.is_initialized() && !cache_entry) {
+ if (find_parent && entry_addr.is_initialized() && !cache_entry.get()) {
*match_error = true;
parent_entry = NULL;
}
- if (cache_entry && (find_parent || !found))
+ if (cache_entry.get() && (find_parent || !found))
cache_entry = NULL;
find_parent ? parent_entry.swap(&tmp) : cache_entry.swap(&tmp);
« no previous file with comments | « net/cookies/cookie_store_unittest.h ('k') | net/disk_cache/backend_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698