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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "mojo/services/native_viewport/native_viewport_controller.h" 5 #include "mojo/services/native_viewport/native_viewport_controller.h"
6 6
7 #include <assert.h>
8 #include <limits>
9
7 #include "base/bind.h" 10 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 11 #include "base/message_loop/message_loop.h"
9 #include "base/strings/stringprintf.h" 12 #include "base/strings/stringprintf.h"
10 #include "gpu/command_buffer/client/gl_in_process_context.h" 13 #include "gpu/command_buffer/client/gl_in_process_context.h"
11 #include "gpu/command_buffer/client/gles2_implementation.h" 14 #include "gpu/command_buffer/client/gles2_implementation.h"
12 #include "mojo/services/native_viewport/native_viewport.h" 15 #include "mojo/services/native_viewport/native_viewport.h"
13 #include "ui/events/event.h" 16 #include "ui/events/event.h"
14 17
15 namespace mojo { 18 namespace mojo {
16 namespace services { 19 namespace services {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 SendString(base::StringPrintf("Sized to: %d x %d", 66 SendString(base::StringPrintf("Sized to: %d x %d",
64 size.width(), 67 size.width(),
65 size.height())); 68 size.height()));
66 } 69 }
67 70
68 void NativeViewportController::OnDestroyed() { 71 void NativeViewportController::OnDestroyed() {
69 base::MessageLoop::current()->Quit(); 72 base::MessageLoop::current()->Quit();
70 } 73 }
71 74
72 void NativeViewportController::SendString(const std::string& string) { 75 void NativeViewportController::SendString(const std::string& string) {
73 WriteMessage(pipe_, string.c_str(), string.size()+1, NULL, 0, 76 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.
74 MOJO_WRITE_MESSAGE_FLAG_NONE); 77 WriteMessage(pipe_, string.c_str(), static_cast<uint32_t>(string.size() + 1),
78 NULL, 0, MOJO_WRITE_MESSAGE_FLAG_NONE);
75 } 79 }
76 80
77 } // namespace services 81 } // namespace services
78 } // namespace mojo 82 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698