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

Unified Diff: ppapi/proxy/url_loader_resource.cc

Issue 915403003: Enable size_t to int truncation warnings in PPAPI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ppapi_unittests win x64 Created 5 years, 10 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 | « ppapi/proxy/url_loader_resource.h ('k') | ppapi/proxy/video_capture_resource.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/url_loader_resource.cc
diff --git a/ppapi/proxy/url_loader_resource.cc b/ppapi/proxy/url_loader_resource.cc
index 73bdb2342f4e7362fd21f3fa7fd33590092fbf9b..0697e905c28b105ce26261463d7c598cc9f3b593 100644
--- a/ppapi/proxy/url_loader_resource.cc
+++ b/ppapi/proxy/url_loader_resource.cc
@@ -5,6 +5,7 @@
#include "ppapi/proxy/url_loader_resource.h"
#include "base/logging.h"
+#include "base/numerics/safe_conversions.h"
#include "ppapi/c/pp_completion_callback.h"
#include "ppapi/c/pp_errors.h"
#include "ppapi/c/ppb_url_loader.h"
@@ -374,7 +375,7 @@ void URLLoaderResource::SaveResponseInfo(const URLResponseInfoData& data) {
connection(), pp_instance(), data, body_as_file_ref);
}
-size_t URLLoaderResource::FillUserBuffer() {
+int32_t URLLoaderResource::FillUserBuffer() {
DCHECK(user_buffer_);
DCHECK(user_buffer_size_);
@@ -393,7 +394,7 @@ size_t URLLoaderResource::FillUserBuffer() {
// Reset for next time.
user_buffer_ = NULL;
user_buffer_size_ = 0;
- return bytes_to_copy;
+ return base::checked_cast<int32_t>(bytes_to_copy);
}
} // namespace proxy
« no previous file with comments | « ppapi/proxy/url_loader_resource.h ('k') | ppapi/proxy/video_capture_resource.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698