OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_origin_database.h" | 5 #include "webkit/fileapi/file_system_origin_database.h" |
6 | 6 |
7 #include "base/format_macros.h" | 7 #include "base/format_macros.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 } | 24 } |
25 | 25 |
26 const char* LastPathKey() { | 26 const char* LastPathKey() { |
27 return kLastPathKey; | 27 return kLastPathKey; |
28 } | 28 } |
29 | 29 |
30 } | 30 } |
31 | 31 |
32 namespace fileapi { | 32 namespace fileapi { |
33 | 33 |
| 34 FileSystemOriginDatabase::OriginRecord::OriginRecord() { |
| 35 } |
| 36 |
| 37 FileSystemOriginDatabase::OriginRecord::OriginRecord( |
| 38 const std::string& origin_in, const FilePath& path_in) |
| 39 : origin(origin_in), path(path_in) { |
| 40 } |
| 41 |
| 42 FileSystemOriginDatabase::OriginRecord::~OriginRecord() { |
| 43 } |
| 44 |
34 FileSystemOriginDatabase::FileSystemOriginDatabase(const FilePath& path) { | 45 FileSystemOriginDatabase::FileSystemOriginDatabase(const FilePath& path) { |
35 #if defined(OS_POSIX) | 46 #if defined(OS_POSIX) |
36 path_ = path.value(); | 47 path_ = path.value(); |
37 #elif defined(OS_WIN) | 48 #elif defined(OS_WIN) |
38 path_ = base::SysWideToUTF8(path.value()); | 49 path_ = base::SysWideToUTF8(path.value()); |
39 #endif | 50 #endif |
40 } | 51 } |
41 | 52 |
42 FileSystemOriginDatabase::~FileSystemOriginDatabase() { | 53 FileSystemOriginDatabase::~FileSystemOriginDatabase() { |
43 } | 54 } |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 db_->Put(leveldb::WriteOptions(), LastPathKey(), std::string("-1")); | 194 db_->Put(leveldb::WriteOptions(), LastPathKey(), std::string("-1")); |
184 if (!status.ok()) { | 195 if (!status.ok()) { |
185 HandleError(status); | 196 HandleError(status); |
186 return false; | 197 return false; |
187 } | 198 } |
188 *number = -1; | 199 *number = -1; |
189 return true; | 200 return true; |
190 } | 201 } |
191 | 202 |
192 } // namespace fileapi | 203 } // namespace fileapi |
OLD | NEW |