| OLD | NEW |
| 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/browser/appcache/appcache_quota_client.h" | 5 #include "webkit/browser/appcache/appcache_quota_client.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 current_delete_request_callback_ = callback; | 132 current_delete_request_callback_ = callback; |
| 133 if (type != quota::kStorageTypeTemporary) { | 133 if (type != quota::kStorageTypeTemporary) { |
| 134 DidDeleteAppCachesForOrigin(net::OK); | 134 DidDeleteAppCachesForOrigin(net::OK); |
| 135 return; | 135 return; |
| 136 } | 136 } |
| 137 | 137 |
| 138 service_->DeleteAppCachesForOrigin( | 138 service_->DeleteAppCachesForOrigin( |
| 139 origin, GetServiceDeleteCallback()->callback()); | 139 origin, GetServiceDeleteCallback()->callback()); |
| 140 } | 140 } |
| 141 | 141 |
| 142 bool AppCacheQuotaClient::DoesSupport(quota::StorageType type) const { |
| 143 return type == quota::kStorageTypeTemporary; |
| 144 } |
| 145 |
| 142 void AppCacheQuotaClient::DidDeleteAppCachesForOrigin(int rv) { | 146 void AppCacheQuotaClient::DidDeleteAppCachesForOrigin(int rv) { |
| 143 DCHECK(service_); | 147 DCHECK(service_); |
| 144 if (quota_manager_is_destroyed_) | 148 if (quota_manager_is_destroyed_) |
| 145 return; | 149 return; |
| 146 | 150 |
| 147 // Finish the request by calling our callers callback. | 151 // Finish the request by calling our callers callback. |
| 148 current_delete_request_callback_.Run(NetErrorCodeToQuotaStatus(rv)); | 152 current_delete_request_callback_.Run(NetErrorCodeToQuotaStatus(rv)); |
| 149 current_delete_request_callback_.Reset(); | 153 current_delete_request_callback_.Reset(); |
| 150 if (pending_serial_requests_.empty()) | 154 if (pending_serial_requests_.empty()) |
| 151 return; | 155 return; |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 current_delete_request_callback_.Run(quota::kQuotaErrorAbort); | 241 current_delete_request_callback_.Run(quota::kQuotaErrorAbort); |
| 238 current_delete_request_callback_.Reset(); | 242 current_delete_request_callback_.Reset(); |
| 239 GetServiceDeleteCallback()->Cancel(); | 243 GetServiceDeleteCallback()->Cancel(); |
| 240 } | 244 } |
| 241 | 245 |
| 242 if (quota_manager_is_destroyed_) | 246 if (quota_manager_is_destroyed_) |
| 243 delete this; | 247 delete this; |
| 244 } | 248 } |
| 245 | 249 |
| 246 } // namespace appcache | 250 } // namespace appcache |
| OLD | NEW |