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

Unified Diff: mojo/edk/system/channel.cc

Issue 728133002: Update mojo sdk to rev e01f9a49449381a5eb430c1fd88bf2cae73ec35a (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: android + ios gyp fixes Created 6 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/channel.cc
diff --git a/mojo/edk/system/channel.cc b/mojo/edk/system/channel.cc
index b63aaeb7901220e3d030f5d769b6e143b218f3f9..2f2a2ab6702ed7bea9ca5cc09f950ce74f6c1165 100644
--- a/mojo/edk/system/channel.cc
+++ b/mojo/edk/system/channel.cc
@@ -20,7 +20,8 @@ namespace system {
Channel::Channel(embedder::PlatformSupport* platform_support)
: platform_support_(platform_support),
is_running_(false),
- is_shutting_down_(false) {
+ is_shutting_down_(false),
+ channel_manager_(nullptr) {
}
bool Channel::Init(scoped_ptr<RawChannel> raw_channel) {
@@ -41,6 +42,15 @@ bool Channel::Init(scoped_ptr<RawChannel> raw_channel) {
return true;
}
+void Channel::SetChannelManager(ChannelManager* channel_manager) {
+ DCHECK(channel_manager);
+
+ base::AutoLock locker(lock_);
+ DCHECK(!is_shutting_down_);
+ DCHECK(!channel_manager_);
+ channel_manager_ = channel_manager;
+}
+
void Channel::Shutdown() {
DCHECK(creation_thread_checker_.CalledOnValidThread());
@@ -62,8 +72,7 @@ void Channel::Shutdown() {
size_t num_live = 0;
size_t num_zombies = 0;
for (IdToEndpointMap::iterator it = to_destroy.begin();
- it != to_destroy.end();
- ++it) {
+ it != to_destroy.end(); ++it) {
if (it->second.get()) {
num_live++;
it->second->OnDisconnect();
@@ -80,6 +89,7 @@ void Channel::Shutdown() {
void Channel::WillShutdownSoon() {
base::AutoLock locker(lock_);
is_shutting_down_ = true;
+ channel_manager_ = nullptr;
}
// Note: |endpoint| being a |scoped_refptr| makes this function safe, since it
@@ -120,8 +130,7 @@ ChannelEndpointId Channel::AttachAndRunEndpoint(
if (!is_bootstrap) {
if (!SendControlMessage(
- MessageInTransit::kSubtypeChannelAttachAndRunEndpoint,
- local_id,
+ MessageInTransit::kSubtypeChannelAttachAndRunEndpoint, local_id,
remote_id)) {
HandleLocalError(base::StringPrintf(
"Failed to send message to run remote message pipe endpoint (local "
@@ -185,8 +194,7 @@ void Channel::DetachEndpoint(ChannelEndpoint* endpoint,
}
if (!SendControlMessage(
- MessageInTransit::kSubtypeChannelRemoveMessagePipeEndpoint,
- local_id,
+ MessageInTransit::kSubtypeChannelRemoveMessagePipeEndpoint, local_id,
remote_id)) {
HandleLocalError(base::StringPrintf(
"Failed to send message to remove remote message pipe endpoint (local "
@@ -207,7 +215,7 @@ scoped_refptr<MessagePipe> Channel::PassIncomingMessagePipe(
auto it = incoming_message_pipes_.find(local_id);
if (it == incoming_message_pipes_.end())
- return scoped_refptr<MessagePipe>();
+ return nullptr;
scoped_refptr<MessagePipe> rv;
rv.swap(it->second);
@@ -459,8 +467,7 @@ bool Channel::OnRemoveMessagePipeEndpoint(ChannelEndpointId local_id,
if (!SendControlMessage(
MessageInTransit::kSubtypeChannelRemoveMessagePipeEndpointAck,
- local_id,
- remote_id)) {
+ local_id, remote_id)) {
HandleLocalError(base::StringPrintf(
"Failed to send message to remove remote message pipe endpoint ack "
"(local ID %u, remote ID %u)",
« 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