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

Unified Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_tamper_detection.cc

Issue 1074293003: Use int64 instead of int32 for response sizes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reuploading to try to fix corrupt issue Created 5 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: components/data_reduction_proxy/core/browser/data_reduction_proxy_tamper_detection.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_tamper_detection.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_tamper_detection.cc
index 5db6551e84cddc20a5f7805ba3ddf22ded02969c..a9f75c425e1a958380b4ce824030077453b8aacd 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_tamper_detection.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_tamper_detection.cc
@@ -81,7 +81,7 @@ namespace data_reduction_proxy {
bool DataReductionProxyTamperDetection::DetectAndReport(
const net::HttpResponseHeaders* headers,
bool scheme_is_https,
- int content_length) {
+ int64 content_length) {
if (headers == nullptr) {
return false;
}
@@ -140,7 +140,7 @@ bool DataReductionProxyTamperDetection::DetectAndReport(
if (GetDataReductionProxyActionFingerprintContentLength(
headers, &fingerprint)) {
- int original_content_length;
+ int64 original_content_length;
if (tamper_detection.ValidateContentLength(fingerprint,
content_length,
&original_content_length)) {
@@ -305,20 +305,20 @@ void DataReductionProxyTamperDetection::
bool DataReductionProxyTamperDetection::ValidateContentLength(
const std::string& fingerprint,
- int content_length,
- int* original_content_length) const {
+ int64 content_length,
+ int64* original_content_length) const {
DCHECK(original_content_length);
// Abort, if Content-Length value from the Data Reduction Proxy does not
// exist or it cannot be converted to an integer.
- if (!base::StringToInt(fingerprint, original_content_length))
+ if (!base::StringToInt64(fingerprint, original_content_length))
return false;
return *original_content_length != content_length;
}
-void DataReductionProxyTamperDetection::
- ReportUMAForContentLength(int content_length,
- int original_content_length) const {
+void DataReductionProxyTamperDetection::ReportUMAForContentLength(
+ int64 content_length,
+ int64 original_content_length) const {
// Gets MIME type of the response and reports to UMA histograms separately.
// Divides MIME types into 4 groups: JavaScript, CSS, Images, and others.
REPORT_TAMPER_DETECTION_UMA(

Powered by Google App Engine
This is Rietveld 408576698