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 "webkit/browser/fileapi/sandbox_origin_database.h" | 5 #include "webkit/browser/fileapi/sandbox_origin_database.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/format_macros.h" | 10 #include "base/format_macros.h" |
11 #include "base/location.h" | 11 #include "base/location.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
14 #include "base/string_util.h" | 14 #include "base/string_util.h" |
15 #include "base/stringprintf.h" | 15 #include "base/stringprintf.h" |
16 #include "base/strings/string_number_conversions.h" | 16 #include "base/strings/string_number_conversions.h" |
17 #include "third_party/leveldatabase/src/include/leveldb/db.h" | 17 #include "third_party/leveldatabase/src/include/leveldb/db.h" |
18 #include "third_party/leveldatabase/src/include/leveldb/write_batch.h" | 18 #include "third_party/leveldatabase/src/include/leveldb/write_batch.h" |
19 #include "webkit/fileapi/file_system_util.h" | 19 #include "webkit/common/fileapi/file_system_util.h" |
20 | 20 |
21 namespace { | 21 namespace { |
22 | 22 |
23 const base::FilePath::CharType kOriginDatabaseName[] = | 23 const base::FilePath::CharType kOriginDatabaseName[] = |
24 FILE_PATH_LITERAL("Origins"); | 24 FILE_PATH_LITERAL("Origins"); |
25 const char kOriginKeyPrefix[] = "ORIGIN:"; | 25 const char kOriginKeyPrefix[] = "ORIGIN:"; |
26 const char kLastPathKey[] = "LAST_PATH"; | 26 const char kLastPathKey[] = "LAST_PATH"; |
27 const int64 kMinimumReportIntervalHours = 1; | 27 const int64 kMinimumReportIntervalHours = 1; |
28 const char kInitStatusHistogramLabel[] = "FileSystem.OriginDatabaseInit"; | 28 const char kInitStatusHistogramLabel[] = "FileSystem.OriginDatabaseInit"; |
29 const char kDatabaseRepairHistogramLabel[] = "FileSystem.OriginDatabaseRepair"; | 29 const char kDatabaseRepairHistogramLabel[] = "FileSystem.OriginDatabaseRepair"; |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 db_->Put(leveldb::WriteOptions(), LastPathKey(), std::string("-1")); | 324 db_->Put(leveldb::WriteOptions(), LastPathKey(), std::string("-1")); |
325 if (!status.ok()) { | 325 if (!status.ok()) { |
326 HandleError(FROM_HERE, status); | 326 HandleError(FROM_HERE, status); |
327 return false; | 327 return false; |
328 } | 328 } |
329 *number = -1; | 329 *number = -1; |
330 return true; | 330 return true; |
331 } | 331 } |
332 | 332 |
333 } // namespace fileapi | 333 } // namespace fileapi |
OLD | NEW |