| 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 "storage/browser/fileapi/sandbox_directory_database.h" | 5 #include "storage/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> |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 return false; | 45 return false; |
| 46 } | 46 } |
| 47 | 47 |
| 48 bool FileInfoFromPickle(const Pickle& pickle, | 48 bool FileInfoFromPickle(const Pickle& pickle, |
| 49 storage::SandboxDirectoryDatabase::FileInfo* info) { | 49 storage::SandboxDirectoryDatabase::FileInfo* info) { |
| 50 PickleIterator iter(pickle); | 50 PickleIterator iter(pickle); |
| 51 std::string data_path; | 51 std::string data_path; |
| 52 std::string name; | 52 std::string name; |
| 53 int64 internal_time; | 53 int64 internal_time; |
| 54 | 54 |
| 55 if (iter.ReadInt64(&info->parent_id) && | 55 if (pickle.ReadInt64(&iter, &info->parent_id) && |
| 56 iter.ReadString(&data_path) && | 56 pickle.ReadString(&iter, &data_path) && |
| 57 iter.ReadString(&name) && | 57 pickle.ReadString(&iter, &name) && |
| 58 iter.ReadInt64(&internal_time)) { | 58 pickle.ReadInt64(&iter, &internal_time)) { |
| 59 info->data_path = storage::StringToFilePath(data_path); | 59 info->data_path = storage::StringToFilePath(data_path); |
| 60 info->name = storage::StringToFilePath(name).value(); | 60 info->name = storage::StringToFilePath(name).value(); |
| 61 info->modification_time = base::Time::FromInternalValue(internal_time); | 61 info->modification_time = base::Time::FromInternalValue(internal_time); |
| 62 return true; | 62 return true; |
| 63 } | 63 } |
| 64 LOG(ERROR) << "Pickle could not be digested!"; | 64 LOG(ERROR) << "Pickle could not be digested!"; |
| 65 return false; | 65 return false; |
| 66 } | 66 } |
| 67 | 67 |
| 68 const base::FilePath::CharType kDirectoryDatabaseName[] = | 68 const base::FilePath::CharType kDirectoryDatabaseName[] = |
| (...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 931 | 931 |
| 932 void SandboxDirectoryDatabase::HandleError( | 932 void SandboxDirectoryDatabase::HandleError( |
| 933 const tracked_objects::Location& from_here, | 933 const tracked_objects::Location& from_here, |
| 934 const leveldb::Status& status) { | 934 const leveldb::Status& status) { |
| 935 LOG(ERROR) << "SandboxDirectoryDatabase failed at: " | 935 LOG(ERROR) << "SandboxDirectoryDatabase failed at: " |
| 936 << from_here.ToString() << " with error: " << status.ToString(); | 936 << from_here.ToString() << " with error: " << status.ToString(); |
| 937 db_.reset(); | 937 db_.reset(); |
| 938 } | 938 } |
| 939 | 939 |
| 940 } // namespace storage | 940 } // namespace storage |
| OLD | NEW |