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

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

Issue 12163003: Add FilePath to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « webkit/appcache/appcache_disk_cache.h ('k') | webkit/appcache/appcache_interfaces.h » ('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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 if (create_backend_callback_) { 157 if (create_backend_callback_) {
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 base::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, base::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_) {
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 const net::CompletionCallback& callback) 255 const net::CompletionCallback& callback)
256 : call_type(call_type), 256 : call_type(call_type),
257 key(key), 257 key(key),
258 entry(entry), 258 entry(entry),
259 callback(callback) { 259 callback(callback) {
260 } 260 }
261 261
262 AppCacheDiskCache::PendingCall::~PendingCall() {} 262 AppCacheDiskCache::PendingCall::~PendingCall() {}
263 263
264 int AppCacheDiskCache::Init(net::CacheType cache_type, 264 int AppCacheDiskCache::Init(net::CacheType cache_type,
265 const FilePath& cache_directory, 265 const base::FilePath& cache_directory,
266 int cache_size, bool force, 266 int cache_size, bool force,
267 base::MessageLoopProxy* cache_thread, 267 base::MessageLoopProxy* cache_thread,
268 const net::CompletionCallback& callback) { 268 const net::CompletionCallback& callback) {
269 DCHECK(!is_initializing() && !disk_cache_.get()); 269 DCHECK(!is_initializing() && !disk_cache_.get());
270 is_disabled_ = false; 270 is_disabled_ = false;
271 create_backend_callback_ = new CreateBackendCallbackShim(this); 271 create_backend_callback_ = new CreateBackendCallbackShim(this);
272 272
273 int rv = disk_cache::CreateCacheBackend( 273 int rv = disk_cache::CreateCacheBackend(
274 cache_type, cache_directory, cache_size, force, cache_thread, NULL, 274 cache_type, cache_directory, cache_size, force, cache_thread, NULL,
275 &(create_backend_callback_->backend_ptr_), 275 &(create_backend_callback_->backend_ptr_),
(...skipping 37 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_disk_cache.h ('k') | webkit/appcache/appcache_interfaces.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698