| 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 "content/browser/indexed_db/indexed_db_quota_client.h" | 5 #include "content/browser/indexed_db/indexed_db_quota_client.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/message_loop_proxy.h" | 10 #include "base/message_loop_proxy.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 DCHECK(!callback.is_null()); | 80 DCHECK(!callback.is_null()); |
| 81 DCHECK(indexed_db_context_.get()); | 81 DCHECK(indexed_db_context_.get()); |
| 82 | 82 |
| 83 // IndexedDB is in the temp namespace for now. | 83 // IndexedDB is in the temp namespace for now. |
| 84 if (type != quota::kStorageTypeTemporary) { | 84 if (type != quota::kStorageTypeTemporary) { |
| 85 callback.Run(0); | 85 callback.Run(0); |
| 86 return; | 86 return; |
| 87 } | 87 } |
| 88 | 88 |
| 89 base::PostTaskAndReplyWithResult( | 89 base::PostTaskAndReplyWithResult( |
| 90 webkit_thread_message_loop_, | 90 webkit_thread_message_loop_.get(), |
| 91 FROM_HERE, | 91 FROM_HERE, |
| 92 base::Bind( | 92 base::Bind( |
| 93 &GetOriginUsageOnWebKitThread, indexed_db_context_, origin_url), | 93 &GetOriginUsageOnWebKitThread, indexed_db_context_, origin_url), |
| 94 callback); | 94 callback); |
| 95 } | 95 } |
| 96 | 96 |
| 97 void IndexedDBQuotaClient::GetOriginsForType( | 97 void IndexedDBQuotaClient::GetOriginsForType( |
| 98 quota::StorageType type, | 98 quota::StorageType type, |
| 99 const GetOriginsCallback& callback) { | 99 const GetOriginsCallback& callback) { |
| 100 DCHECK(!callback.is_null()); | 100 DCHECK(!callback.is_null()); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 | 140 |
| 141 void IndexedDBQuotaClient::DeleteOriginData(const GURL& origin, | 141 void IndexedDBQuotaClient::DeleteOriginData(const GURL& origin, |
| 142 quota::StorageType type, | 142 quota::StorageType type, |
| 143 const DeletionCallback& callback) { | 143 const DeletionCallback& callback) { |
| 144 if (type != quota::kStorageTypeTemporary) { | 144 if (type != quota::kStorageTypeTemporary) { |
| 145 callback.Run(quota::kQuotaErrorNotSupported); | 145 callback.Run(quota::kQuotaErrorNotSupported); |
| 146 return; | 146 return; |
| 147 } | 147 } |
| 148 | 148 |
| 149 base::PostTaskAndReplyWithResult( | 149 base::PostTaskAndReplyWithResult( |
| 150 webkit_thread_message_loop_, | 150 webkit_thread_message_loop_.get(), |
| 151 FROM_HERE, | 151 FROM_HERE, |
| 152 base::Bind(&DeleteOriginDataOnWebKitThread, indexed_db_context_, origin), | 152 base::Bind(&DeleteOriginDataOnWebKitThread, indexed_db_context_, origin), |
| 153 callback); | 153 callback); |
| 154 } | 154 } |
| 155 | 155 |
| 156 } // namespace content | 156 } // namespace content |
| OLD | NEW |