| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/common/np_channel_base.h" | 5 #include "content/common/np_channel_base.h" |
| 6 | 6 |
| 7 #include <stack> | 7 #include <stack> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/hash_tables.h" | 10 #include "base/hash_tables.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 #if defined(OS_POSIX) | 124 #if defined(OS_POSIX) |
| 125 // Check the validity of fd for bug investigation. Remove after fixed. | 125 // Check the validity of fd for bug investigation. Remove after fixed. |
| 126 // See for details: crbug.com/95129, crbug.com/97285. | 126 // See for details: crbug.com/95129, crbug.com/97285. |
| 127 if (mode_ == IPC::Channel::MODE_CLIENT) | 127 if (mode_ == IPC::Channel::MODE_CLIENT) |
| 128 CHECK_NE(-1, channel_handle_.socket.fd); | 128 CHECK_NE(-1, channel_handle_.socket.fd); |
| 129 #endif | 129 #endif |
| 130 | 130 |
| 131 channel_.reset(new IPC::SyncChannel( | 131 channel_.reset(new IPC::SyncChannel( |
| 132 channel_handle_, mode_, this, ipc_message_loop, create_pipe_now, | 132 channel_handle_, mode_, this, ipc_message_loop, create_pipe_now, |
| 133 shutdown_event)); | 133 shutdown_event)); |
| 134 |
| 135 #if defined(OS_POSIX) |
| 136 // Check the validity of fd for bug investigation. Remove after fixed. |
| 137 // See for details: crbug.com/95129, crbug.com/97285. |
| 138 if (mode_ == IPC::Channel::MODE_SERVER) |
| 139 CHECK_NE(-1, channel_->GetClientFileDescriptor()); |
| 140 #endif |
| 141 |
| 134 channel_valid_ = true; | 142 channel_valid_ = true; |
| 135 return true; | 143 return true; |
| 136 } | 144 } |
| 137 | 145 |
| 138 bool NPChannelBase::Send(IPC::Message* message) { | 146 bool NPChannelBase::Send(IPC::Message* message) { |
| 139 if (!channel_.get()) { | 147 if (!channel_.get()) { |
| 140 delete message; | 148 delete message; |
| 141 return false; | 149 return false; |
| 142 } | 150 } |
| 143 | 151 |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 | 285 |
| 278 void NPChannelBase::RemoveMappingForNPObjectStub(int route_id, | 286 void NPChannelBase::RemoveMappingForNPObjectStub(int route_id, |
| 279 NPObject* object) { | 287 NPObject* object) { |
| 280 DCHECK(object != NULL); | 288 DCHECK(object != NULL); |
| 281 stub_map_.erase(object); | 289 stub_map_.erase(object); |
| 282 } | 290 } |
| 283 | 291 |
| 284 void NPChannelBase::RemoveMappingForNPObjectProxy(int route_id) { | 292 void NPChannelBase::RemoveMappingForNPObjectProxy(int route_id) { |
| 285 proxy_map_.erase(route_id); | 293 proxy_map_.erase(route_id); |
| 286 } | 294 } |
| OLD | NEW |