| 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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 std::unique_ptr<base::ListValue> database_list(new base::ListValue()); | 192 std::unique_ptr<base::ListValue> database_list(new base::ListValue()); |
| 193 | 193 |
| 194 for (IndexedDBFactory::OriginDBMapIterator it = range.first; | 194 for (IndexedDBFactory::OriginDBMapIterator it = range.first; |
| 195 it != range.second; | 195 it != range.second; |
| 196 ++it) { | 196 ++it) { |
| 197 const IndexedDBDatabase* db = it->second; | 197 const IndexedDBDatabase* db = it->second; |
| 198 std::unique_ptr<base::DictionaryValue> db_info( | 198 std::unique_ptr<base::DictionaryValue> db_info( |
| 199 new base::DictionaryValue()); | 199 new base::DictionaryValue()); |
| 200 | 200 |
| 201 db_info->SetString("name", db->name()); | 201 db_info->SetString("name", db->name()); |
| 202 db_info->SetDouble("pending_opens", db->PendingOpenCount()); | 202 db_info->SetDouble("connection_count", db->ConnectionCount()); |
| 203 db_info->SetDouble("pending_upgrades", db->PendingUpgradeCount()); | 203 db_info->SetDouble("active_open_delete", db->ActiveOpenDeleteCount()); |
| 204 db_info->SetDouble("running_upgrades", db->RunningUpgradeCount()); | 204 db_info->SetDouble("pending_open_delete", db->PendingOpenDeleteCount()); |
| 205 db_info->SetDouble("pending_deletes", db->PendingDeleteCount()); | |
| 206 db_info->SetDouble("connection_count", | |
| 207 db->ConnectionCount() - db->PendingUpgradeCount() - | |
| 208 db->RunningUpgradeCount()); | |
| 209 | 205 |
| 210 std::unique_ptr<base::ListValue> transaction_list( | 206 std::unique_ptr<base::ListValue> transaction_list( |
| 211 new base::ListValue()); | 207 new base::ListValue()); |
| 212 std::vector<const IndexedDBTransaction*> transactions = | 208 std::vector<const IndexedDBTransaction*> transactions = |
| 213 db->transaction_coordinator().GetTransactions(); | 209 db->transaction_coordinator().GetTransactions(); |
| 214 for (const auto* transaction : transactions) { | 210 for (const auto* transaction : transactions) { |
| 215 std::unique_ptr<base::DictionaryValue> transaction_info( | 211 std::unique_ptr<base::DictionaryValue> transaction_info( |
| 216 new base::DictionaryValue()); | 212 new base::DictionaryValue()); |
| 217 | 213 |
| 218 const char* const kModes[] = | 214 const char* const kModes[] = |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 void IndexedDBContextImpl::ResetCaches() { | 564 void IndexedDBContextImpl::ResetCaches() { |
| 569 origin_set_.reset(); | 565 origin_set_.reset(); |
| 570 origin_size_map_.clear(); | 566 origin_size_map_.clear(); |
| 571 } | 567 } |
| 572 | 568 |
| 573 base::SequencedTaskRunner* IndexedDBContextImpl::TaskRunner() const { | 569 base::SequencedTaskRunner* IndexedDBContextImpl::TaskRunner() const { |
| 574 return task_runner_.get(); | 570 return task_runner_.get(); |
| 575 } | 571 } |
| 576 | 572 |
| 577 } // namespace content | 573 } // namespace content |
| OLD | NEW |