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 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 base::LinearHistogram::FactoryGet( | 477 base::LinearHistogram::FactoryGet( |
478 "WebCore.IndexedDB.BackingStore.OpenStatus" + suffix, | 478 "WebCore.IndexedDB.BackingStore.OpenStatus" + suffix, |
479 1, | 479 1, |
480 INDEXED_DB_BACKING_STORE_OPEN_MAX, | 480 INDEXED_DB_BACKING_STORE_OPEN_MAX, |
481 INDEXED_DB_BACKING_STORE_OPEN_MAX + 1, | 481 INDEXED_DB_BACKING_STORE_OPEN_MAX + 1, |
482 base::HistogramBase::kUmaTargetedHistogramFlag)->Add(result); | 482 base::HistogramBase::kUmaTargetedHistogramFlag)->Add(result); |
483 } | 483 } |
484 } | 484 } |
485 | 485 |
486 static bool IsPathTooLong(const base::FilePath& leveldb_dir) { | 486 static bool IsPathTooLong(const base::FilePath& leveldb_dir) { |
487 int limit = file_util::GetMaximumPathComponentLength(leveldb_dir.DirName()); | 487 int limit = base::GetMaximumPathComponentLength(leveldb_dir.DirName()); |
488 if (limit == -1) { | 488 if (limit == -1) { |
489 DLOG(WARNING) << "GetMaximumPathComponentLength returned -1"; | 489 DLOG(WARNING) << "GetMaximumPathComponentLength returned -1"; |
490 // In limited testing, ChromeOS returns 143, other OSes 255. | 490 // In limited testing, ChromeOS returns 143, other OSes 255. |
491 #if defined(OS_CHROMEOS) | 491 #if defined(OS_CHROMEOS) |
492 limit = 143; | 492 limit = 143; |
493 #else | 493 #else |
494 limit = 255; | 494 limit = 255; |
495 #endif | 495 #endif |
496 } | 496 } |
497 size_t component_length = leveldb_dir.BaseName().value().length(); | 497 size_t component_length = leveldb_dir.BaseName().value().length(); |
(...skipping 2146 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 |