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

Unified Diff: mojo/services/native_viewport/native_viewport_controller.cc

Issue 64623003: Fix win64 build failure on size truncation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 1 month 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 | « mojo/public/tests/bindings_connector_unittest.cc ('k') | mojo/system/message_pipe_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/native_viewport/native_viewport_controller.cc
===================================================================
--- mojo/services/native_viewport/native_viewport_controller.cc (revision 234554)
+++ mojo/services/native_viewport/native_viewport_controller.cc (working copy)
@@ -4,6 +4,8 @@
#include "mojo/services/native_viewport/native_viewport_controller.h"
+#include <limits>
+
#include "base/bind.h"
#include "base/message_loop/message_loop.h"
#include "base/strings/stringprintf.h"
@@ -70,8 +72,9 @@
}
void NativeViewportController::SendString(const std::string& string) {
- WriteMessage(pipe_, string.c_str(), string.size()+1, NULL, 0,
- MOJO_WRITE_MESSAGE_FLAG_NONE);
+ DCHECK_LT(string.size() + 1, std::numeric_limits<uint32_t>::max());
+ WriteMessage(pipe_, string.c_str(), static_cast<uint32_t>(string.size() + 1),
+ NULL, 0, MOJO_WRITE_MESSAGE_FLAG_NONE);
}
} // namespace services
« no previous file with comments | « mojo/public/tests/bindings_connector_unittest.cc ('k') | mojo/system/message_pipe_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698