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/fileapi/file_system_directory_database.h" | 5 #include "webkit/fileapi/file_system_directory_database.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 | 8 |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/pickle.h" | 10 #include "base/pickle.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 pickle->WriteInt64(time.ToInternalValue())) | 40 pickle->WriteInt64(time.ToInternalValue())) |
41 return true; | 41 return true; |
42 | 42 |
43 NOTREACHED(); | 43 NOTREACHED(); |
44 return false; | 44 return false; |
45 } | 45 } |
46 | 46 |
47 bool FileInfoFromPickle( | 47 bool FileInfoFromPickle( |
48 const Pickle& pickle, | 48 const Pickle& pickle, |
49 fileapi::FileSystemDirectoryDatabase::FileInfo* info) { | 49 fileapi::FileSystemDirectoryDatabase::FileInfo* info) { |
50 void* iter = NULL; | 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 (pickle.ReadInt64(&iter, &info->parent_id) && | 55 if (pickle.ReadInt64(&iter, &info->parent_id) && |
56 pickle.ReadString(&iter, &data_path) && | 56 pickle.ReadString(&iter, &data_path) && |
57 pickle.ReadString(&iter, &name) && | 57 pickle.ReadString(&iter, &name) && |
58 pickle.ReadInt64(&iter, &internal_time)) { | 58 pickle.ReadInt64(&iter, &internal_time)) { |
59 #if defined(OS_POSIX) | 59 #if defined(OS_POSIX) |
60 info->data_path = FilePath(data_path); | 60 info->data_path = FilePath(data_path); |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 | 539 |
540 void FileSystemDirectoryDatabase::HandleError( | 540 void FileSystemDirectoryDatabase::HandleError( |
541 const tracked_objects::Location& from_here, | 541 const tracked_objects::Location& from_here, |
542 leveldb::Status status) { | 542 leveldb::Status status) { |
543 LOG(ERROR) << "FileSystemDirectoryDatabase failed at: " | 543 LOG(ERROR) << "FileSystemDirectoryDatabase failed at: " |
544 << from_here.ToString() << " with error: " << status.ToString(); | 544 << from_here.ToString() << " with error: " << status.ToString(); |
545 db_.reset(); | 545 db_.reset(); |
546 } | 546 } |
547 | 547 |
548 } // namespace fileapi | 548 } // namespace fileapi |
OLD | NEW |