Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1296)

Unified Diff: net/disk_cache/simple/simple_index_util.h

Issue 14263005: Refactor our SimpleIndex file format and serialization to use Pickle instead of the previously bugg… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Philippe's comments Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_
gavinp 2013/04/15 15:40:54 Let's just move these into simple_util.h; if we ne
+
+#include <string>
+
+#include "base/basictypes.h"
+
+namespace base {
+class Time;
+}
+
+namespace disk_cache {
+
+// Size of the uint64 hash_key number in Hex format in a string.
+const size_t kEntryHashKeyAsHexStringSize = 2 * sizeof(uint64);
+
+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_

Powered by Google App Engine
This is Rietveld 408576698