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

Unified Diff: webkit/browser/appcache/appcache_disk_cache.cc

Issue 20737002: Change the API of disk_cache::CreateCacheBackend to use scoped_ptr (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix new test Created 7 years, 5 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/tools/dump_cache/upgrade_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/browser/appcache/appcache_disk_cache.cc
diff --git a/webkit/browser/appcache/appcache_disk_cache.cc b/webkit/browser/appcache/appcache_disk_cache.cc
index 542ec7cdbd7898e29087095d7ab5c617849f5926..e486f1d7d6f18d1ae30082bc13188dd586e0bfb0 100644
--- a/webkit/browser/appcache/appcache_disk_cache.cc
+++ b/webkit/browser/appcache/appcache_disk_cache.cc
@@ -22,7 +22,7 @@ class AppCacheDiskCache::CreateBackendCallbackShim
: public base::RefCounted<CreateBackendCallbackShim> {
public:
explicit CreateBackendCallbackShim(AppCacheDiskCache* object)
- : backend_ptr_(NULL), appcache_diskcache_(object) {
+ : appcache_diskcache_(object) {
}
void Cancel() {
@@ -34,13 +34,12 @@ class AppCacheDiskCache::CreateBackendCallbackShim
appcache_diskcache_->OnCreateBackendComplete(rv);
}
- disk_cache::Backend* backend_ptr_; // Accessed directly.
+ scoped_ptr<disk_cache::Backend> backend_ptr_; // Accessed directly.
private:
friend class base::RefCounted<CreateBackendCallbackShim>;
~CreateBackendCallbackShim() {
- delete backend_ptr_;
}
AppCacheDiskCache* appcache_diskcache_; // Unowned pointer.
@@ -285,8 +284,7 @@ int AppCacheDiskCache::Init(net::CacheType cache_type,
void AppCacheDiskCache::OnCreateBackendComplete(int rv) {
if (rv == net::OK) {
- disk_cache_.reset(create_backend_callback_->backend_ptr_);
- create_backend_callback_->backend_ptr_ = NULL;
+ disk_cache_ = create_backend_callback_->backend_ptr_.Pass();
}
create_backend_callback_ = NULL;
« no previous file with comments | « net/tools/dump_cache/upgrade_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698