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" |
11 #include "base/string_util.h" | 11 #include "base/string_util.h" |
12 #include "base/sys_string_conversions.h" | 12 #include "base/sys_string_conversions.h" |
13 #include "third_party/leveldb/include/leveldb/iterator.h" | 13 #include "third_party/leveldatabase/src/include/leveldb/iterator.h" |
14 #include "third_party/leveldb/include/leveldb/write_batch.h" | 14 #include "third_party/leveldatabase/src/include/leveldb/write_batch.h" |
15 | 15 |
16 namespace { | 16 namespace { |
17 | 17 |
18 const char kOriginKeyPrefix[] = "ORIGIN:"; | 18 const char kOriginKeyPrefix[] = "ORIGIN:"; |
19 const char kLastPathKey[] = "LAST_PATH"; | 19 const char kLastPathKey[] = "LAST_PATH"; |
20 | 20 |
21 std::string OriginToOriginKey(const std::string& origin) { | 21 std::string OriginToOriginKey(const std::string& origin) { |
22 std::string key(kOriginKeyPrefix); | 22 std::string key(kOriginKeyPrefix); |
23 return key + origin; | 23 return key + origin; |
24 } | 24 } |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 db_->Put(leveldb::WriteOptions(), LastPathKey(), std::string("-1")); | 194 db_->Put(leveldb::WriteOptions(), LastPathKey(), std::string("-1")); |
195 if (!status.ok()) { | 195 if (!status.ok()) { |
196 HandleError(status); | 196 HandleError(status); |
197 return false; | 197 return false; |
198 } | 198 } |
199 *number = -1; | 199 *number = -1; |
200 return true; | 200 return true; |
201 } | 201 } |
202 | 202 |
203 } // namespace fileapi | 203 } // namespace fileapi |
OLD | NEW |