Title: [179781] trunk/Source/WebKit2
- Revision
- 179781
- Author
- [email protected]
- Date
- 2015-02-07 11:45:15 -0800 (Sat, 07 Feb 2015)
Log Message
Use longer hashes for cache keys
https://bugs.webkit.org/show_bug.cgi?id=141356
Rubber-stamped by Darin Adler.
Folloup and build fix.
* NetworkProcess/cache/NetworkCacheCoders.h:
* NetworkProcess/cache/NetworkCacheKey.cpp:
(WebKit::hashString):
Use containsOnlyASCII instead of is8Bit so both paths always compute the same hash.
* NetworkProcess/cache/NetworkCacheKey.h:
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (179780 => 179781)
--- trunk/Source/WebKit2/ChangeLog 2015-02-07 19:19:43 UTC (rev 179780)
+++ trunk/Source/WebKit2/ChangeLog 2015-02-07 19:45:15 UTC (rev 179781)
@@ -1,5 +1,22 @@
2015-02-07 Antti Koivisto <[email protected]>
+ Use longer hashes for cache keys
+ https://bugs.webkit.org/show_bug.cgi?id=141356
+
+ Rubber-stamped by Darin Adler.
+
+ Folloup and build fix.
+
+ * NetworkProcess/cache/NetworkCacheCoders.h:
+ * NetworkProcess/cache/NetworkCacheKey.cpp:
+ (WebKit::hashString):
+
+ Use containsOnlyASCII instead of is8Bit so both paths always compute the same hash.
+
+ * NetworkProcess/cache/NetworkCacheKey.h:
+
+2015-02-07 Antti Koivisto <[email protected]>
+
Remove a printf.
* NetworkProcess/cache/NetworkCache.cpp:
Modified: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheCoders.h (179780 => 179781)
--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheCoders.h 2015-02-07 19:19:43 UTC (rev 179780)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheCoders.h 2015-02-07 19:45:15 UTC (rev 179781)
@@ -35,8 +35,8 @@
#include <wtf/Forward.h>
#include <wtf/HashMap.h>
#include <wtf/HashSet.h>
+#include <wtf/MD5.h>
#include <wtf/Vector.h>
-#include <wtf/md5.h>
namespace WebKit {
Modified: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheKey.cpp (179780 => 179781)
--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheKey.cpp 2015-02-07 19:19:43 UTC (rev 179780)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheKey.cpp 2015-02-07 19:45:15 UTC (rev 179781)
@@ -62,7 +62,7 @@
static void hashString(MD5& md5, const String& string)
{
const uint8_t zero = 0;
- if (string.is8Bit()) {
+ if (string.containsOnlyASCII()) {
md5.addBytes(string.characters8(), string.length());
md5.addBytes(&zero, 1);
return;
@@ -88,6 +88,7 @@
String NetworkCacheKey::hashAsString() const
{
StringBuilder builder;
+ builder.reserveCapacity(hashStringLength());
for (auto byte : m_hash) {
builder.append(upperNibbleToASCIIHexDigit(byte));
builder.append(lowerNibbleToASCIIHexDigit(byte));
Modified: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheKey.h (179780 => 179781)
--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheKey.h 2015-02-07 19:19:43 UTC (rev 179780)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheKey.h 2015-02-07 19:45:15 UTC (rev 179781)
@@ -28,7 +28,7 @@
#if ENABLE(NETWORK_CACHE)
-#include <wtf/md5.h>
+#include <wtf/MD5.h>
#include <wtf/text/WTFString.h>
namespace WebKit {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes