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_backing_store.h" | 5 #include "content/browser/indexed_db/indexed_db_backing_store.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/strings/string_piece.h" | 10 #include "base/strings/string_piece.h" |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 bool* is_disk_full, | 522 bool* is_disk_full, |
523 LevelDBFactory* leveldb_factory) { | 523 LevelDBFactory* leveldb_factory) { |
524 IDB_TRACE("IndexedDBBackingStore::Open"); | 524 IDB_TRACE("IndexedDBBackingStore::Open"); |
525 DCHECK(!path_base.empty()); | 525 DCHECK(!path_base.empty()); |
526 *data_loss = blink::WebIDBDataLossNone; | 526 *data_loss = blink::WebIDBDataLossNone; |
527 *data_loss_message = ""; | 527 *data_loss_message = ""; |
528 *is_disk_full = false; | 528 *is_disk_full = false; |
529 | 529 |
530 scoped_ptr<LevelDBComparator> comparator(new Comparator()); | 530 scoped_ptr<LevelDBComparator> comparator(new Comparator()); |
531 | 531 |
532 if (!IsStringASCII(path_base.AsUTF8Unsafe())) { | 532 if (!base::IsStringASCII(path_base.AsUTF8Unsafe())) { |
533 HistogramOpenStatus(INDEXED_DB_BACKING_STORE_OPEN_ATTEMPT_NON_ASCII, | 533 HistogramOpenStatus(INDEXED_DB_BACKING_STORE_OPEN_ATTEMPT_NON_ASCII, |
534 origin_url); | 534 origin_url); |
535 } | 535 } |
536 if (!base::CreateDirectory(path_base)) { | 536 if (!base::CreateDirectory(path_base)) { |
537 LOG(ERROR) << "Unable to create IndexedDB database path " | 537 LOG(ERROR) << "Unable to create IndexedDB database path " |
538 << path_base.AsUTF8Unsafe(); | 538 << path_base.AsUTF8Unsafe(); |
539 HistogramOpenStatus(INDEXED_DB_BACKING_STORE_OPEN_FAILED_DIRECTORY, | 539 HistogramOpenStatus(INDEXED_DB_BACKING_STORE_OPEN_FAILED_DIRECTORY, |
540 origin_url); | 540 origin_url); |
541 return scoped_refptr<IndexedDBBackingStore>(); | 541 return scoped_refptr<IndexedDBBackingStore>(); |
542 } | 542 } |
(...skipping 2101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2644 } | 2644 } |
2645 | 2645 |
2646 void IndexedDBBackingStore::Transaction::Rollback() { | 2646 void IndexedDBBackingStore::Transaction::Rollback() { |
2647 IDB_TRACE("IndexedDBBackingStore::Transaction::Rollback"); | 2647 IDB_TRACE("IndexedDBBackingStore::Transaction::Rollback"); |
2648 DCHECK(transaction_.get()); | 2648 DCHECK(transaction_.get()); |
2649 transaction_->Rollback(); | 2649 transaction_->Rollback(); |
2650 transaction_ = NULL; | 2650 transaction_ = NULL; |
2651 } | 2651 } |
2652 | 2652 |
2653 } // namespace content | 2653 } // namespace content |
OLD | NEW |