| 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 "content/browser/indexed_db/indexed_db_context_impl.h" | 10 #include "content/browser/indexed_db/indexed_db_context_impl.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 void GetAllOriginsOnIndexedDBThread(IndexedDBContextImpl* context, | 34 void GetAllOriginsOnIndexedDBThread(IndexedDBContextImpl* context, |
| 35 std::set<GURL>* origins_to_return) { | 35 std::set<GURL>* origins_to_return) { |
| 36 DCHECK(context->TaskRunner()->RunsTasksOnCurrentThread()); | 36 DCHECK(context->TaskRunner()->RunsTasksOnCurrentThread()); |
| 37 std::vector<GURL> all_origins = context->GetAllOrigins(); | 37 std::vector<GURL> all_origins = context->GetAllOrigins(); |
| 38 origins_to_return->insert(all_origins.begin(), all_origins.end()); | 38 origins_to_return->insert(all_origins.begin(), all_origins.end()); |
| 39 } | 39 } |
| 40 | 40 |
| 41 void DidGetOrigins(const IndexedDBQuotaClient::GetOriginsCallback& callback, | 41 void DidGetOrigins(const IndexedDBQuotaClient::GetOriginsCallback& callback, |
| 42 const std::set<GURL>* origins) { | 42 const std::set<GURL>* origins) { |
| 43 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 43 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 44 callback.Run(*origins); | 44 callback.Run(*origins); |
| 45 } | 45 } |
| 46 | 46 |
| 47 void GetOriginsForHostOnIndexedDBThread(IndexedDBContextImpl* context, | 47 void GetOriginsForHostOnIndexedDBThread(IndexedDBContextImpl* context, |
| 48 const std::string& host, | 48 const std::string& host, |
| 49 std::set<GURL>* origins_to_return) { | 49 std::set<GURL>* origins_to_return) { |
| 50 DCHECK(context->TaskRunner()->RunsTasksOnCurrentThread()); | 50 DCHECK(context->TaskRunner()->RunsTasksOnCurrentThread()); |
| 51 std::vector<GURL> all_origins = context->GetAllOrigins(); | 51 std::vector<GURL> all_origins = context->GetAllOrigins(); |
| 52 for (const auto& origin_url : all_origins) { | 52 for (const auto& origin_url : all_origins) { |
| 53 if (host == net::GetHostOrSpecFromURL(origin_url)) | 53 if (host == net::GetHostOrSpecFromURL(origin_url)) |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 base::Bind( | 171 base::Bind( |
| 172 &DeleteOriginDataOnIndexedDBThread, indexed_db_context_, origin), | 172 &DeleteOriginDataOnIndexedDBThread, indexed_db_context_, origin), |
| 173 callback); | 173 callback); |
| 174 } | 174 } |
| 175 | 175 |
| 176 bool IndexedDBQuotaClient::DoesSupport(storage::StorageType type) const { | 176 bool IndexedDBQuotaClient::DoesSupport(storage::StorageType type) const { |
| 177 return type == storage::kStorageTypeTemporary; | 177 return type == storage::kStorageTypeTemporary; |
| 178 } | 178 } |
| 179 | 179 |
| 180 } // namespace content | 180 } // namespace content |
| OLD | NEW |