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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 db->ConnectionCount() - db->PendingUpgradeCount() - | 207 db->ConnectionCount() - db->PendingUpgradeCount() - |
208 db->RunningUpgradeCount()); | 208 db->RunningUpgradeCount()); |
209 | 209 |
210 scoped_ptr<base::ListValue> transaction_list(new base::ListValue()); | 210 scoped_ptr<base::ListValue> transaction_list(new base::ListValue()); |
211 std::vector<const IndexedDBTransaction*> transactions = | 211 std::vector<const IndexedDBTransaction*> transactions = |
212 db->transaction_coordinator().GetTransactions(); | 212 db->transaction_coordinator().GetTransactions(); |
213 for (const auto* transaction : transactions) { | 213 for (const auto* transaction : transactions) { |
214 scoped_ptr<base::DictionaryValue> transaction_info( | 214 scoped_ptr<base::DictionaryValue> transaction_info( |
215 new base::DictionaryValue()); | 215 new base::DictionaryValue()); |
216 | 216 |
217 const char* kModes[] = { "readonly", "readwrite", "versionchange" }; | 217 const char* const kModes[] = |
| 218 { "readonly", "readwrite", "versionchange" }; |
218 transaction_info->SetString("mode", kModes[transaction->mode()]); | 219 transaction_info->SetString("mode", kModes[transaction->mode()]); |
219 switch (transaction->state()) { | 220 switch (transaction->state()) { |
220 case IndexedDBTransaction::CREATED: | 221 case IndexedDBTransaction::CREATED: |
221 transaction_info->SetString("status", "blocked"); | 222 transaction_info->SetString("status", "blocked"); |
222 break; | 223 break; |
223 case IndexedDBTransaction::STARTED: | 224 case IndexedDBTransaction::STARTED: |
224 if (transaction->diagnostics().tasks_scheduled > 0) | 225 if (transaction->diagnostics().tasks_scheduled > 0) |
225 transaction_info->SetString("status", "running"); | 226 transaction_info->SetString("status", "running"); |
226 else | 227 else |
227 transaction_info->SetString("status", "started"); | 228 transaction_info->SetString("status", "started"); |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 void IndexedDBContextImpl::ResetCaches() { | 547 void IndexedDBContextImpl::ResetCaches() { |
547 origin_set_.reset(); | 548 origin_set_.reset(); |
548 origin_size_map_.clear(); | 549 origin_size_map_.clear(); |
549 } | 550 } |
550 | 551 |
551 base::SequencedTaskRunner* IndexedDBContextImpl::TaskRunner() const { | 552 base::SequencedTaskRunner* IndexedDBContextImpl::TaskRunner() const { |
552 return task_runner_.get(); | 553 return task_runner_.get(); |
553 } | 554 } |
554 | 555 |
555 } // namespace content | 556 } // namespace content |
OLD | NEW |