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

Unified Diff: Source/core/fetch/MemoryCacheTest.cpp

Issue 618583002: Correct data size argument type in resource loading path to unsigned (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add static_cast to RELEASE_ASSERT in AssociatedURLLoader::ClientAdapter::didReceiveData Created 6 years, 2 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
« no previous file with comments | « Source/core/fetch/ImageResource.cpp ('k') | Source/core/fetch/RawResource.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/fetch/MemoryCacheTest.cpp
diff --git a/Source/core/fetch/MemoryCacheTest.cpp b/Source/core/fetch/MemoryCacheTest.cpp
index e67c3c66b0ac229fbe64642f137110f32580f61b..a81a35b65f332a9fe078e943d05a658f4a27baf4 100644
--- a/Source/core/fetch/MemoryCacheTest.cpp
+++ b/Source/core/fetch/MemoryCacheTest.cpp
@@ -51,7 +51,7 @@ public:
{
}
- virtual void appendData(const char* data, int len)
+ virtual void appendData(const char* data, unsigned len)
{
Resource::appendData(data, len);
setDecodedSize(this->size());
@@ -150,7 +150,7 @@ TEST_F(MemoryCacheTest, DeadResourceEviction)
Resource* cachedResource =
new Resource(ResourceRequest("http://test/resource"), Resource::Raw);
const char data[5] = "abcd";
- cachedResource->appendData(data, 3);
+ cachedResource->appendData(data, 3u);
// The resource size has to be nonzero for this test to be meaningful, but
// we do not rely on it having any particular value.
ASSERT_GT(cachedResource->size(), 0u);
@@ -179,12 +179,12 @@ TEST_F(MemoryCacheTest, LiveResourceEvictionAtEndOfTask)
const char data[6] = "abcde";
Resource* cachedDeadResource =
new Resource(ResourceRequest("hhtp://foo"), Resource::Raw);
- cachedDeadResource->appendData(data, 3);
+ cachedDeadResource->appendData(data, 3u);
ResourcePtr<Resource> cachedLiveResource =
new FakeDecodedResource(ResourceRequest("http://test/resource"), Resource::Raw);
MockImageResourceClient client;
cachedLiveResource->addClient(&client);
- cachedLiveResource->appendData(data, 4);
+ cachedLiveResource->appendData(data, 4u);
class Task1 : public blink::WebThread::Task {
public:
@@ -254,12 +254,12 @@ TEST_F(MemoryCacheTest, ClientRemoval)
new FakeDecodedResource(ResourceRequest("http://foo.com"), Resource::Raw);
MockImageResourceClient client1;
resource1->addClient(&client1);
- resource1->appendData(data, 4);
+ resource1->appendData(data, 4u);
ResourcePtr<Resource> resource2 =
new FakeDecodedResource(ResourceRequest("http://test/resource"), Resource::Raw);
MockImageResourceClient client2;
resource2->addClient(&client2);
- resource2->appendData(data, 4);
+ resource2->appendData(data, 4u);
const unsigned minDeadCapacity = 0;
const unsigned maxDeadCapacity = ((resource1->size() + resource2->size()) / 2) - 1;
@@ -313,8 +313,8 @@ TEST_F(MemoryCacheTest, DecodeCacheOrder)
cachedImageHighPriority->addClient(&clientHighPriority);
const char data[5] = "abcd";
- cachedImageLowPriority->appendData(data, 1);
- cachedImageHighPriority->appendData(data, 4);
+ cachedImageLowPriority->appendData(data, 1u);
+ cachedImageHighPriority->appendData(data, 4u);
const unsigned lowPrioritySize = cachedImageLowPriority->size();
const unsigned highPrioritySize = cachedImageHighPriority->size();
const unsigned lowPriorityMockDecodeSize = cachedImageLowPriority->decodedSize();
« no previous file with comments | « Source/core/fetch/ImageResource.cpp ('k') | Source/core/fetch/RawResource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698