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

Side by Side Diff: mojo/public/bindings/lib/connector.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/public/bindings/lib/connector.h" 5 #include "mojo/public/bindings/lib/connector.h"
6 6
7 #include <assert.h> 7 #include <assert.h>
8 #include <stdlib.h> 8 #include <stdlib.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 } 111 }
112 112
113 void Connector::WriteMore() { 113 void Connector::WriteMore() {
114 while (!write_queue_.IsEmpty()) { 114 while (!write_queue_.IsEmpty()) {
115 const Message* message = write_queue_.Peek(); 115 const Message* message = write_queue_.Peek();
116 116
117 MojoResult rv = WriteMessage(message_pipe_, 117 MojoResult rv = WriteMessage(message_pipe_,
118 message->data, 118 message->data,
119 message->data->header.num_bytes, 119 message->data->header.num_bytes,
120 message->handles.data(), 120 message->handles.data(),
121 message->handles.size(), 121 static_cast<uint32_t>(message->handles.size()),
122 MOJO_WRITE_MESSAGE_FLAG_NONE); 122 MOJO_WRITE_MESSAGE_FLAG_NONE);
123 if (rv == MOJO_RESULT_OK) { 123 if (rv == MOJO_RESULT_OK) {
124 // TODO(darin): Handles were successfully transferred, and so we need 124 // TODO(darin): Handles were successfully transferred, and so we need
125 // to take care not to Close them here. 125 // to take care not to Close them here.
126 write_queue_.Pop(); 126 write_queue_.Pop();
127 continue; // Write another message. 127 continue; // Write another message.
128 } 128 }
129 129
130 error_ = true; 130 error_ = true;
131 break; 131 break;
(...skipping 21 matching lines...) Expand all
153 } 153 }
154 154
155 void Connector::Callback::OnHandleReady(MojoResult result) { 155 void Connector::Callback::OnHandleReady(MojoResult result) {
156 assert(owner_); 156 assert(owner_);
157 Connector* owner = NULL; 157 Connector* owner = NULL;
158 std::swap(owner, owner_); 158 std::swap(owner, owner_);
159 owner->OnHandleReady(this, result); 159 owner->OnHandleReady(this, result);
160 } 160 }
161 161
162 } // namespace mojo 162 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698