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

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
Index: mojo/services/native_viewport/native_viewport_controller.cc
===================================================================
--- mojo/services/native_viewport/native_viewport_controller.cc (revision 233919)
+++ mojo/services/native_viewport/native_viewport_controller.cc (working copy)
@@ -4,6 +4,9 @@
#include "mojo/services/native_viewport/native_viewport_controller.h"
+#include <assert.h>
+#include <limits>
+
#include "base/bind.h"
#include "base/message_loop/message_loop.h"
#include "base/strings/stringprintf.h"
@@ -70,8 +73,9 @@
}
void NativeViewportController::SendString(const std::string& string) {
- WriteMessage(pipe_, string.c_str(), string.size()+1, NULL, 0,
- MOJO_WRITE_MESSAGE_FLAG_NONE);
+ assert((string.size() + 1) < std::numeric_limits<uint32_t>::max());
viettrungluu 2013/11/08 19:02:10 Here, you're allowed to use base, so you should pr
jschuh 2013/11/08 19:28:12 Done.
+ WriteMessage(pipe_, string.c_str(), static_cast<uint32_t>(string.size() + 1),
+ NULL, 0, MOJO_WRITE_MESSAGE_FLAG_NONE);
}
} // namespace services

Powered by Google App Engine
This is Rietveld 408576698