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_context_impl.h" | 5 #include "content/browser/indexed_db/indexed_db_context_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 DCHECK(TaskRunner()->RunsTasksOnCurrentThread()); | 135 DCHECK(TaskRunner()->RunsTasksOnCurrentThread()); |
136 std::set<GURL>* origins_set = GetOriginSet(); | 136 std::set<GURL>* origins_set = GetOriginSet(); |
137 return std::vector<GURL>(origins_set->begin(), origins_set->end()); | 137 return std::vector<GURL>(origins_set->begin(), origins_set->end()); |
138 } | 138 } |
139 | 139 |
140 std::vector<IndexedDBInfo> IndexedDBContextImpl::GetAllOriginsInfo() { | 140 std::vector<IndexedDBInfo> IndexedDBContextImpl::GetAllOriginsInfo() { |
141 DCHECK(TaskRunner()->RunsTasksOnCurrentThread()); | 141 DCHECK(TaskRunner()->RunsTasksOnCurrentThread()); |
142 std::vector<GURL> origins = GetAllOrigins(); | 142 std::vector<GURL> origins = GetAllOrigins(); |
143 std::vector<IndexedDBInfo> result; | 143 std::vector<IndexedDBInfo> result; |
144 for (const auto& origin_url : origins) { | 144 for (const auto& origin_url : origins) { |
145 base::FilePath idb_directory = GetLevelDBPath(origin_url); | |
146 size_t connection_count = GetConnectionCount(origin_url); | 145 size_t connection_count = GetConnectionCount(origin_url); |
147 result.push_back(IndexedDBInfo(origin_url, | 146 result.push_back(IndexedDBInfo(origin_url, |
148 GetOriginDiskUsage(origin_url), | 147 GetOriginDiskUsage(origin_url), |
149 GetOriginLastModified(origin_url), | 148 GetOriginLastModified(origin_url), |
150 idb_directory, | |
151 connection_count)); | 149 connection_count)); |
152 } | 150 } |
153 return result; | 151 return result; |
154 } | 152 } |
155 | 153 |
156 static bool HostNameComparator(const GURL& i, const GURL& j) { | 154 static bool HostNameComparator(const GURL& i, const GURL& j) { |
157 return i.host() < j.host(); | 155 return i.host() < j.host(); |
158 } | 156 } |
159 | 157 |
160 base::ListValue* IndexedDBContextImpl::GetAllOriginsDetails() { | 158 base::ListValue* IndexedDBContextImpl::GetAllOriginsDetails() { |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
572 origin_set_.reset(); | 570 origin_set_.reset(); |
573 origin_size_map_.clear(); | 571 origin_size_map_.clear(); |
574 space_available_map_.clear(); | 572 space_available_map_.clear(); |
575 } | 573 } |
576 | 574 |
577 base::SequencedTaskRunner* IndexedDBContextImpl::TaskRunner() const { | 575 base::SequencedTaskRunner* IndexedDBContextImpl::TaskRunner() const { |
578 return task_runner_.get(); | 576 return task_runner_.get(); |
579 } | 577 } |
580 | 578 |
581 } // namespace content | 579 } // namespace content |
OLD | NEW |