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

Side by Side Diff: webkit/appcache/appcache_disk_cache.cc

Issue 11275088: Remove implicit scoped_refptr operator T* Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 8 years, 1 month 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 | « webkit/appcache/appcache.cc ('k') | webkit/appcache/appcache_request_handler.cc » ('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 "webkit/appcache/appcache_disk_cache.h" 5 #include "webkit/appcache/appcache_disk_cache.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 net::CompletionCallback callback_; 147 net::CompletionCallback callback_;
148 AppCacheDiskCache* owner_; 148 AppCacheDiskCache* owner_;
149 disk_cache::Entry* entry_ptr_; 149 disk_cache::Entry* entry_ptr_;
150 }; 150 };
151 151
152 AppCacheDiskCache::AppCacheDiskCache() 152 AppCacheDiskCache::AppCacheDiskCache()
153 : is_disabled_(false) { 153 : is_disabled_(false) {
154 } 154 }
155 155
156 AppCacheDiskCache::~AppCacheDiskCache() { 156 AppCacheDiskCache::~AppCacheDiskCache() {
157 if (create_backend_callback_) { 157 if (create_backend_callback_.get()) {
158 create_backend_callback_->Cancel(); 158 create_backend_callback_->Cancel();
159 create_backend_callback_ = NULL; 159 create_backend_callback_ = NULL;
160 OnCreateBackendComplete(net::ERR_ABORTED); 160 OnCreateBackendComplete(net::ERR_ABORTED);
161 } 161 }
162 disk_cache_.reset(); 162 disk_cache_.reset();
163 STLDeleteElements(&active_calls_); 163 STLDeleteElements(&active_calls_);
164 } 164 }
165 165
166 int AppCacheDiskCache::InitWithDiskBackend( 166 int AppCacheDiskCache::InitWithDiskBackend(
167 const FilePath& disk_cache_directory, int disk_cache_size, bool force, 167 const FilePath& disk_cache_directory, int disk_cache_size, bool force,
168 base::MessageLoopProxy* cache_thread, 168 base::MessageLoopProxy* cache_thread,
169 const net::CompletionCallback& callback) { 169 const net::CompletionCallback& callback) {
170 return Init(net::APP_CACHE, disk_cache_directory, 170 return Init(net::APP_CACHE, disk_cache_directory,
171 disk_cache_size, force, cache_thread, callback); 171 disk_cache_size, force, cache_thread, callback);
172 } 172 }
173 173
174 int AppCacheDiskCache::InitWithMemBackend( 174 int AppCacheDiskCache::InitWithMemBackend(
175 int mem_cache_size, const net::CompletionCallback& callback) { 175 int mem_cache_size, const net::CompletionCallback& callback) {
176 return Init(net::MEMORY_CACHE, FilePath(), mem_cache_size, false, NULL, 176 return Init(net::MEMORY_CACHE, FilePath(), mem_cache_size, false, NULL,
177 callback); 177 callback);
178 } 178 }
179 179
180 void AppCacheDiskCache::Disable() { 180 void AppCacheDiskCache::Disable() {
181 if (is_disabled_) 181 if (is_disabled_)
182 return; 182 return;
183 183
184 is_disabled_ = true; 184 is_disabled_ = true;
185 185
186 if (create_backend_callback_) { 186 if (create_backend_callback_.get()) {
187 create_backend_callback_->Cancel(); 187 create_backend_callback_->Cancel();
188 create_backend_callback_ = NULL; 188 create_backend_callback_ = NULL;
189 OnCreateBackendComplete(net::ERR_ABORTED); 189 OnCreateBackendComplete(net::ERR_ABORTED);
190 } 190 }
191 } 191 }
192 192
193 int AppCacheDiskCache::CreateEntry(int64 key, Entry** entry, 193 int AppCacheDiskCache::CreateEntry(int64 key, Entry** entry,
194 const net::CompletionCallback& callback) { 194 const net::CompletionCallback& callback) {
195 DCHECK(entry); 195 DCHECK(entry);
196 DCHECK(!callback.is_null()); 196 DCHECK(!callback.is_null());
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 NOTREACHED(); 313 NOTREACHED();
314 break; 314 break;
315 } 315 }
316 if (rv != net::ERR_IO_PENDING) 316 if (rv != net::ERR_IO_PENDING)
317 iter->callback.Run(rv); 317 iter->callback.Run(rv);
318 } 318 }
319 pending_calls_.clear(); 319 pending_calls_.clear();
320 } 320 }
321 321
322 } // namespace appcache 322 } // namespace appcache
OLDNEW
« no previous file with comments | « webkit/appcache/appcache.cc ('k') | webkit/appcache/appcache_request_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698