| 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 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 switch (transaction->state()) { | 222 switch (transaction->state()) { |
| 223 case IndexedDBTransaction::CREATED: | 223 case IndexedDBTransaction::CREATED: |
| 224 transaction_info->SetString("status", "blocked"); | 224 transaction_info->SetString("status", "blocked"); |
| 225 break; | 225 break; |
| 226 case IndexedDBTransaction::STARTED: | 226 case IndexedDBTransaction::STARTED: |
| 227 if (transaction->diagnostics().tasks_scheduled > 0) | 227 if (transaction->diagnostics().tasks_scheduled > 0) |
| 228 transaction_info->SetString("status", "running"); | 228 transaction_info->SetString("status", "running"); |
| 229 else | 229 else |
| 230 transaction_info->SetString("status", "started"); | 230 transaction_info->SetString("status", "started"); |
| 231 break; | 231 break; |
| 232 case IndexedDBTransaction::COMMITTING: |
| 233 transaction_info->SetString("status", "committing"); |
| 232 case IndexedDBTransaction::FINISHED: | 234 case IndexedDBTransaction::FINISHED: |
| 233 transaction_info->SetString("status", "finished"); | 235 transaction_info->SetString("status", "finished"); |
| 234 break; | 236 break; |
| 235 } | 237 } |
| 236 | 238 |
| 237 transaction_info->SetDouble( | 239 transaction_info->SetDouble( |
| 238 "pid", | 240 "pid", |
| 239 IndexedDBDispatcherHost::TransactionIdToProcessId( | 241 IndexedDBDispatcherHost::TransactionIdToProcessId( |
| 240 transaction->id())); | 242 transaction->id())); |
| 241 transaction_info->SetDouble( | 243 transaction_info->SetDouble( |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 if (data_path_.empty()) | 453 if (data_path_.empty()) |
| 452 return; | 454 return; |
| 453 | 455 |
| 454 if (force_keep_session_state_) | 456 if (force_keep_session_state_) |
| 455 return; | 457 return; |
| 456 | 458 |
| 457 bool has_session_only_databases = | 459 bool has_session_only_databases = |
| 458 special_storage_policy_ && | 460 special_storage_policy_ && |
| 459 special_storage_policy_->HasSessionOnlyOrigins(); | 461 special_storage_policy_->HasSessionOnlyOrigins(); |
| 460 | 462 |
| 461 // Clearning only session-only databases, and there are none. | 463 // Clearing only session-only databases, and there are none. |
| 462 if (!has_session_only_databases) | 464 if (!has_session_only_databases) |
| 463 return; | 465 return; |
| 464 | 466 |
| 465 TaskRunner()->PostTask( | 467 TaskRunner()->PostTask( |
| 466 FROM_HERE, | 468 FROM_HERE, |
| 467 base::Bind( | 469 base::Bind( |
| 468 &ClearSessionOnlyOrigins, data_path_, special_storage_policy_)); | 470 &ClearSessionOnlyOrigins, data_path_, special_storage_policy_)); |
| 469 } | 471 } |
| 470 | 472 |
| 471 base::FilePath IndexedDBContextImpl::GetIndexedDBFilePath( | 473 base::FilePath IndexedDBContextImpl::GetIndexedDBFilePath( |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 origin_set_.reset(); | 573 origin_set_.reset(); |
| 572 origin_size_map_.clear(); | 574 origin_size_map_.clear(); |
| 573 space_available_map_.clear(); | 575 space_available_map_.clear(); |
| 574 } | 576 } |
| 575 | 577 |
| 576 base::TaskRunner* IndexedDBContextImpl::TaskRunner() const { | 578 base::TaskRunner* IndexedDBContextImpl::TaskRunner() const { |
| 577 return task_runner_; | 579 return task_runner_; |
| 578 } | 580 } |
| 579 | 581 |
| 580 } // namespace content | 582 } // namespace content |
| OLD | NEW |