| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_factory.h" | 5 #include "content/browser/indexed_db/indexed_db_factory.h" |
| 6 | 6 |
| 7 #include <vector> |
| 8 |
| 7 #include "base/logging.h" | 9 #include "base/logging.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| 9 #include "base/time/time.h" | 11 #include "base/time/time.h" |
| 10 #include "content/browser/indexed_db/indexed_db_backing_store.h" | 12 #include "content/browser/indexed_db/indexed_db_backing_store.h" |
| 11 #include "content/browser/indexed_db/indexed_db_context_impl.h" | 13 #include "content/browser/indexed_db/indexed_db_context_impl.h" |
| 12 #include "content/browser/indexed_db/indexed_db_database_error.h" | 14 #include "content/browser/indexed_db/indexed_db_database_error.h" |
| 13 #include "content/browser/indexed_db/indexed_db_tracing.h" | 15 #include "content/browser/indexed_db/indexed_db_tracing.h" |
| 14 #include "content/browser/indexed_db/indexed_db_transaction_coordinator.h" | 16 #include "content/browser/indexed_db/indexed_db_transaction_coordinator.h" |
| 15 #include "third_party/WebKit/public/platform/WebIDBDatabaseException.h" | 17 #include "third_party/WebKit/public/platform/WebIDBDatabaseException.h" |
| 16 #include "third_party/leveldatabase/env_chromium.h" | 18 #include "third_party/leveldatabase/env_chromium.h" |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 // Note: DestroyBackingStore only deletes LevelDB files, leaving all others, | 297 // Note: DestroyBackingStore only deletes LevelDB files, leaving all others, |
| 296 // so our corruption info file will remain. | 298 // so our corruption info file will remain. |
| 297 leveldb::Status s = | 299 leveldb::Status s = |
| 298 IndexedDBBackingStore::DestroyBackingStore(path_base, saved_origin_url); | 300 IndexedDBBackingStore::DestroyBackingStore(path_base, saved_origin_url); |
| 299 if (!s.ok()) | 301 if (!s.ok()) |
| 300 DLOG(ERROR) << "Unable to delete backing store: " << s.ToString(); | 302 DLOG(ERROR) << "Unable to delete backing store: " << s.ToString(); |
| 301 } | 303 } |
| 302 | 304 |
| 303 bool IndexedDBFactory::IsDatabaseOpen(const GURL& origin_url, | 305 bool IndexedDBFactory::IsDatabaseOpen(const GURL& origin_url, |
| 304 const base::string16& name) const { | 306 const base::string16& name) const { |
| 305 | |
| 306 return !!database_map_.count(IndexedDBDatabase::Identifier(origin_url, name)); | 307 return !!database_map_.count(IndexedDBDatabase::Identifier(origin_url, name)); |
| 307 } | 308 } |
| 308 | 309 |
| 309 bool IndexedDBFactory::IsBackingStoreOpen(const GURL& origin_url) const { | 310 bool IndexedDBFactory::IsBackingStoreOpen(const GURL& origin_url) const { |
| 310 return backing_store_map_.find(origin_url) != backing_store_map_.end(); | 311 return backing_store_map_.find(origin_url) != backing_store_map_.end(); |
| 311 } | 312 } |
| 312 | 313 |
| 313 bool IndexedDBFactory::IsBackingStorePendingClose(const GURL& origin_url) | 314 bool IndexedDBFactory::IsBackingStorePendingClose(const GURL& origin_url) |
| 314 const { | 315 const { |
| 315 IndexedDBBackingStoreMap::const_iterator it = | 316 IndexedDBBackingStoreMap::const_iterator it = |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 | 470 |
| 470 std::pair<OriginDBMapIterator, OriginDBMapIterator> range = | 471 std::pair<OriginDBMapIterator, OriginDBMapIterator> range = |
| 471 GetOpenDatabasesForOrigin(origin_url); | 472 GetOpenDatabasesForOrigin(origin_url); |
| 472 for (OriginDBMapIterator it = range.first; it != range.second; ++it) | 473 for (OriginDBMapIterator it = range.first; it != range.second; ++it) |
| 473 count += it->second->ConnectionCount(); | 474 count += it->second->ConnectionCount(); |
| 474 | 475 |
| 475 return count; | 476 return count; |
| 476 } | 477 } |
| 477 | 478 |
| 478 } // namespace content | 479 } // namespace content |
| OLD | NEW |