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

Unified Diff: Source/web/AssociatedURLLoader.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/platform/SharedBuffer.cpp ('k') | Source/web/WebSharedWorkerImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/AssociatedURLLoader.cpp
diff --git a/Source/web/AssociatedURLLoader.cpp b/Source/web/AssociatedURLLoader.cpp
index fee82952f4800a6053c7457cc483c1c6d6556e75..ec6e364bb76975714a8c79f11b0be8752762b56f 100644
--- a/Source/web/AssociatedURLLoader.cpp
+++ b/Source/web/AssociatedURLLoader.cpp
@@ -50,6 +50,7 @@
#include "web/WebLocalFrameImpl.h"
#include "wtf/HashSet.h"
#include "wtf/text/WTFString.h"
+#include <limits.h>
namespace blink {
@@ -127,7 +128,7 @@ public:
virtual void didReceiveResponse(unsigned long, const ResourceResponse&) OVERRIDE;
virtual void didDownloadData(int /*dataLength*/) OVERRIDE;
- virtual void didReceiveData(const char*, int /*dataLength*/) OVERRIDE;
+ virtual void didReceiveData(const char*, unsigned /*dataLength*/) OVERRIDE;
virtual void didReceiveCachedMetadata(const char*, int /*dataLength*/) OVERRIDE;
virtual void didFinishLoading(unsigned long /*identifier*/, double /*finishTime*/) OVERRIDE;
virtual void didFail(const ResourceError&) OVERRIDE;
@@ -223,11 +224,13 @@ void AssociatedURLLoader::ClientAdapter::didDownloadData(int dataLength)
m_client->didDownloadData(m_loader, dataLength, -1);
}
-void AssociatedURLLoader::ClientAdapter::didReceiveData(const char* data, int dataLength)
+void AssociatedURLLoader::ClientAdapter::didReceiveData(const char* data, unsigned dataLength)
{
if (!m_client)
return;
+ RELEASE_ASSERT(dataLength <= static_cast<unsigned>(std::numeric_limits<int>::max()));
+
m_client->didReceiveData(m_loader, data, dataLength, -1);
}
« no previous file with comments | « Source/platform/SharedBuffer.cpp ('k') | Source/web/WebSharedWorkerImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698