| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/database/database_quota_client.h" | 5 #include "webkit/database/database_quota_client.h" |
| 6 | 6 |
| 7 #include "base/message_loop_proxy.h" | 7 #include "base/message_loop_proxy.h" |
| 8 #include "net/base/net_util.h" | 8 #include "net/base/net_util.h" |
| 9 #include "webkit/database/database_tracker.h" | 9 #include "webkit/database/database_tracker.h" |
| 10 #include "webkit/database/database_util.h" | 10 #include "webkit/database/database_util.h" |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 return; | 191 return; |
| 192 } | 192 } |
| 193 | 193 |
| 194 if (origins_for_host_callbacks_.Add(host, callback.release())) { | 194 if (origins_for_host_callbacks_.Add(host, callback.release())) { |
| 195 scoped_refptr<GetOriginsForHostTask> task( | 195 scoped_refptr<GetOriginsForHostTask> task( |
| 196 new GetOriginsForHostTask(this, db_tracker_thread_, host)); | 196 new GetOriginsForHostTask(this, db_tracker_thread_, host)); |
| 197 task->Start(); | 197 task->Start(); |
| 198 } | 198 } |
| 199 } | 199 } |
| 200 | 200 |
| 201 void DatabaseQuotaClient::DeleteOriginData(const GURL& origin, |
| 202 quota::StorageType type, |
| 203 DeletionCallback* callback) { |
| 204 // TODO(tzik): implement me |
| 205 callback->Run(quota::kQuotaErrorNotSupported); |
| 206 delete callback; |
| 207 } |
| 208 |
| 201 void DatabaseQuotaClient::DidGetOriginUsage( | 209 void DatabaseQuotaClient::DidGetOriginUsage( |
| 202 const GURL& origin_url, int64 usage) { | 210 const GURL& origin_url, int64 usage) { |
| 203 DCHECK(usage_for_origin_callbacks_.HasCallbacks(origin_url)); | 211 DCHECK(usage_for_origin_callbacks_.HasCallbacks(origin_url)); |
| 204 usage_for_origin_callbacks_.Run(origin_url, usage); | 212 usage_for_origin_callbacks_.Run(origin_url, usage); |
| 205 } | 213 } |
| 206 | 214 |
| 207 void DatabaseQuotaClient::DidGetAllOrigins(const std::set<GURL>& origins) { | 215 void DatabaseQuotaClient::DidGetAllOrigins(const std::set<GURL>& origins) { |
| 208 DCHECK(origins_for_type_callbacks_.HasCallbacks()); | 216 DCHECK(origins_for_type_callbacks_.HasCallbacks()); |
| 209 origins_for_type_callbacks_.Run(origins); | 217 origins_for_type_callbacks_.Run(origins); |
| 210 } | 218 } |
| 211 | 219 |
| 212 void DatabaseQuotaClient::DidGetOriginsForHost( | 220 void DatabaseQuotaClient::DidGetOriginsForHost( |
| 213 const std::string& host, const std::set<GURL>& origins) { | 221 const std::string& host, const std::set<GURL>& origins) { |
| 214 DCHECK(origins_for_host_callbacks_.HasCallbacks(host)); | 222 DCHECK(origins_for_host_callbacks_.HasCallbacks(host)); |
| 215 origins_for_host_callbacks_.Run(host, origins); | 223 origins_for_host_callbacks_.Run(host, origins); |
| 216 } | 224 } |
| 217 | 225 |
| 218 } // namespace webkit_database | 226 } // namespace webkit_database |
| OLD | NEW |