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

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

Issue 1423713009: EDK: Move ref counting classes to mojo/edk/util. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 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
« no previous file with comments | « mojo/edk/system/channel.h ('k') | mojo/edk/system/channel_endpoint.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/channel.h" 5 #include "mojo/edk/system/channel.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/strings/stringprintf.h" 12 #include "base/strings/stringprintf.h"
13 #include "mojo/edk/embedder/platform_handle_vector.h" 13 #include "mojo/edk/embedder/platform_handle_vector.h"
14 #include "mojo/edk/system/endpoint_relayer.h" 14 #include "mojo/edk/system/endpoint_relayer.h"
15 #include "mojo/edk/system/transport_data.h" 15 #include "mojo/edk/system/transport_data.h"
16 16
17 using mojo::util::MakeRefCounted;
18 using mojo::util::RefPtr;
19
17 namespace mojo { 20 namespace mojo {
18 namespace system { 21 namespace system {
19 22
20 namespace { 23 namespace {
21 24
22 struct SerializedEndpoint { 25 struct SerializedEndpoint {
23 // This is the endpoint ID on the receiving side, and should be a "remote ID". 26 // This is the endpoint ID on the receiving side, and should be a "remote ID".
24 // (The receiving side should already have had an endpoint attached and been 27 // (The receiving side should already have had an endpoint attached and been
25 // run via the |Channel|s. This endpoint will have both IDs assigned, so this 28 // run via the |Channel|s. This endpoint will have both IDs assigned, so this
26 // ID is only needed to associate that endpoint with a particular dispatcher.) 29 // ID is only needed to associate that endpoint with a particular dispatcher.)
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 << ", local ID " << local_id << ", remote ID " << remote_id; 623 << ", local ID " << local_id << ", remote ID " << remote_id;
621 std::unique_ptr<MessageInTransit> message(new MessageInTransit( 624 std::unique_ptr<MessageInTransit> message(new MessageInTransit(
622 MessageInTransit::Type::CHANNEL, subtype, num_bytes, bytes)); 625 MessageInTransit::Type::CHANNEL, subtype, num_bytes, bytes));
623 message->set_source_id(local_id); 626 message->set_source_id(local_id);
624 message->set_destination_id(remote_id); 627 message->set_destination_id(remote_id);
625 return WriteMessage(std::move(message)); 628 return WriteMessage(std::move(message));
626 } 629 }
627 630
628 } // namespace system 631 } // namespace system
629 } // namespace mojo 632 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/channel.h ('k') | mojo/edk/system/channel_endpoint.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698