| 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_directory_database.h" | 5 #include "webkit/browser/fileapi/sandbox_directory_database.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <stack> | 10 #include <stack> |
| 11 | 11 |
| 12 #include "base/file_util.h" | 12 #include "base/file_util.h" |
| 13 #include "base/location.h" | 13 #include "base/location.h" |
| 14 #include "base/metrics/histogram.h" | 14 #include "base/metrics/histogram.h" |
| 15 #include "base/pickle.h" | 15 #include "base/pickle.h" |
| 16 #include "base/string_util.h" | 16 #include "base/string_util.h" |
| 17 #include "base/strings/string_number_conversions.h" | 17 #include "base/strings/string_number_conversions.h" |
| 18 #include "third_party/leveldatabase/src/include/leveldb/db.h" | 18 #include "third_party/leveldatabase/src/include/leveldb/db.h" |
| 19 #include "third_party/leveldatabase/src/include/leveldb/write_batch.h" | 19 #include "third_party/leveldatabase/src/include/leveldb/write_batch.h" |
| 20 #include "webkit/browser/fileapi/file_system_usage_cache.h" | 20 #include "webkit/browser/fileapi/file_system_usage_cache.h" |
| 21 #include "webkit/fileapi/file_system_util.h" | 21 #include "webkit/common/fileapi/file_system_util.h" |
| 22 | 22 |
| 23 namespace { | 23 namespace { |
| 24 | 24 |
| 25 bool PickleFromFileInfo( | 25 bool PickleFromFileInfo( |
| 26 const fileapi::SandboxDirectoryDatabase::FileInfo& info, | 26 const fileapi::SandboxDirectoryDatabase::FileInfo& info, |
| 27 Pickle* pickle) { | 27 Pickle* pickle) { |
| 28 DCHECK(pickle); | 28 DCHECK(pickle); |
| 29 std::string data_path; | 29 std::string data_path; |
| 30 // Round off here to match the behavior of the filesystem on real files. | 30 // Round off here to match the behavior of the filesystem on real files. |
| 31 base::Time time = | 31 base::Time time = |
| (...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 917 | 917 |
| 918 void SandboxDirectoryDatabase::HandleError( | 918 void SandboxDirectoryDatabase::HandleError( |
| 919 const tracked_objects::Location& from_here, | 919 const tracked_objects::Location& from_here, |
| 920 const leveldb::Status& status) { | 920 const leveldb::Status& status) { |
| 921 LOG(ERROR) << "SandboxDirectoryDatabase failed at: " | 921 LOG(ERROR) << "SandboxDirectoryDatabase failed at: " |
| 922 << from_here.ToString() << " with error: " << status.ToString(); | 922 << from_here.ToString() << " with error: " << status.ToString(); |
| 923 db_.reset(); | 923 db_.reset(); |
| 924 } | 924 } |
| 925 | 925 |
| 926 } // namespace fileapi | 926 } // namespace fileapi |
| OLD | NEW |