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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 } | 114 } |
115 | 115 |
116 base::WaitableEvent* NPChannelBase::GetModalDialogEvent( | 116 base::WaitableEvent* NPChannelBase::GetModalDialogEvent( |
117 gfx::NativeViewId containing_window) { | 117 gfx::NativeViewId containing_window) { |
118 return NULL; | 118 return NULL; |
119 } | 119 } |
120 | 120 |
121 bool NPChannelBase::Init(base::MessageLoopProxy* ipc_message_loop, | 121 bool NPChannelBase::Init(base::MessageLoopProxy* ipc_message_loop, |
122 bool create_pipe_now, | 122 bool create_pipe_now, |
123 base::WaitableEvent* shutdown_event) { | 123 base::WaitableEvent* shutdown_event) { |
| 124 #if defined(OS_POSIX) |
| 125 // Check the validity of fd for bug investigation. Remove after fixed. |
| 126 // See for details: crbug.com/95129, crbug.com/97285. |
| 127 if (mode_ == IPC::Channel::MODE_CLIENT) |
| 128 CHECK_NE(-1, channel_handle_.socket.fd); |
| 129 #endif |
| 130 |
124 channel_.reset(new IPC::SyncChannel( | 131 channel_.reset(new IPC::SyncChannel( |
125 channel_handle_, mode_, this, ipc_message_loop, create_pipe_now, | 132 channel_handle_, mode_, this, ipc_message_loop, create_pipe_now, |
126 shutdown_event)); | 133 shutdown_event)); |
127 channel_valid_ = true; | 134 channel_valid_ = true; |
128 return true; | 135 return true; |
129 } | 136 } |
130 | 137 |
131 bool NPChannelBase::Send(IPC::Message* message) { | 138 bool NPChannelBase::Send(IPC::Message* message) { |
132 if (!channel_.get()) { | 139 if (!channel_.get()) { |
133 delete message; | 140 delete message; |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 | 277 |
271 void NPChannelBase::RemoveMappingForNPObjectStub(int route_id, | 278 void NPChannelBase::RemoveMappingForNPObjectStub(int route_id, |
272 NPObject* object) { | 279 NPObject* object) { |
273 DCHECK(object != NULL); | 280 DCHECK(object != NULL); |
274 stub_map_.erase(object); | 281 stub_map_.erase(object); |
275 } | 282 } |
276 | 283 |
277 void NPChannelBase::RemoveMappingForNPObjectProxy(int route_id) { | 284 void NPChannelBase::RemoveMappingForNPObjectProxy(int route_id) { |
278 proxy_map_.erase(route_id); | 285 proxy_map_.erase(route_id); |
279 } | 286 } |
OLD | NEW |