Index: net/disk_cache/simple/simple_index_util.h |
diff --git a/net/disk_cache/simple/simple_index_util.h b/net/disk_cache/simple/simple_index_util.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..70414441393af225c02f15c9f64dc2eeec3e61fd |
--- /dev/null |
+++ b/net/disk_cache/simple/simple_index_util.h |
@@ -0,0 +1,38 @@ |
+// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_UTIL_H_ |
+#define NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_UTIL_H_ |
+ |
+#include <string> |
+ |
+#include "base/basictypes.h" |
+ |
+namespace base { |
+class Time; |
pasko-google - do not use
2013/04/15 14:23:55
not needed here
felipeg
2013/04/15 15:37:04
Done.
|
+} |
+ |
+namespace disk_cache { |
+ |
+// Size of the uint64 hash_key number in Hex format in a string. |
+const size_t kEntryHashKeyAsHexStringSize = 2 * sizeof(uint64); |
pasko-google - do not use
2013/04/15 14:23:55
it is encouraged to take sizeof(variable) instead
felipeg
2013/04/15 15:37:04
Done.
|
+ |
+std::string ConvertEntryHashKeyToHexString(uint64 hash_key); |
+ |
+// |key| is the regular HTTP Cache key, which is a URL. |
+// Returns the Hex ascii representation of the uint64 hash_key. |
+std::string GetEntryHashKeyAsHexString(const std::string& key); |
+ |
+// |key| is the regular HTTP Cache key, which is a URL. |
+// Returns the hash of the key as uint64. |
+uint64 GetEntryHashKey(const std::string& key); |
+ |
+// Parses the |hash_key| string into a uint64 buffer. |
+// |hash_key| string must be of the form: FFFFFFFFFFFFFFFF . |
+bool GetEntryHashKeyFromHexString(const std::string& hash_key, |
+ uint64* hash_key_out); |
+ |
+} // namespace disk_cache |
+ |
+#endif // NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_UTIL_H_ |