Chromium Code Reviews| 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 |