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

Side by Side Diff: mojo/edk/system/message_pipe.cc

Issue 1949743002: EDK: HandleTransport::CreateEquivalentDispatcherAndClose() -> CreateEquivalentHandleAndClose(). (Closed) Base URL: https://github.com/domokit/mojo.git@work791_edk_handle_12-x-work790_edk_handle_11-x-work788_edk_handle_10
Patch Set: Created 4 years, 7 months 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
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/edk/system/message_pipe.h" 5 #include "mojo/edk/system/message_pipe.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 MessageInTransit* message, 357 MessageInTransit* message,
358 std::vector<HandleTransport>* transports) { 358 std::vector<HandleTransport>* transports) {
359 DCHECK(!message->has_dispatchers()); 359 DCHECK(!message->has_dispatchers());
360 360
361 // Clone the dispatchers and attach them to the message. (This must be done as 361 // Clone the dispatchers and attach them to the message. (This must be done as
362 // a separate loop, since we want to leave the dispatchers alone on failure.) 362 // a separate loop, since we want to leave the dispatchers alone on failure.)
363 std::unique_ptr<DispatcherVector> dispatchers(new DispatcherVector()); 363 std::unique_ptr<DispatcherVector> dispatchers(new DispatcherVector());
364 dispatchers->reserve(transports->size()); 364 dispatchers->reserve(transports->size());
365 for (size_t i = 0; i < transports->size(); i++) { 365 for (size_t i = 0; i < transports->size(); i++) {
366 if ((*transports)[i].is_valid()) { 366 if ((*transports)[i].is_valid()) {
367 dispatchers->push_back( 367 // TODO(vtl): Plumb this into |MessageInTransit|. (I.e., |dispatchers| ->
368 (*transports)[i].CreateEquivalentDispatcherAndClose(this, port)); 368 // |handles|, etc.)
369 Handle h = (*transports)[i].CreateEquivalentHandleAndClose(this, port);
370 dispatchers->push_back(std::move(h.dispatcher));
369 } else { 371 } else {
370 LOG(WARNING) << "Enqueueing null dispatcher"; 372 LOG(WARNING) << "Enqueueing null dispatcher";
371 dispatchers->push_back(nullptr); 373 dispatchers->push_back(nullptr);
372 } 374 }
373 } 375 }
374 message->SetDispatchers(std::move(dispatchers)); 376 message->SetDispatchers(std::move(dispatchers));
375 return MOJO_RESULT_OK; 377 return MOJO_RESULT_OK;
376 } 378 }
377 379
378 } // namespace system 380 } // namespace system
379 } // namespace mojo 381 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/handle_transport.h ('k') | mojo/edk/system/platform_handle_dispatcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698