| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 | 111 |
| 112 base::WaitableEvent* NPChannelBase::GetModalDialogEvent( | 112 base::WaitableEvent* NPChannelBase::GetModalDialogEvent( |
| 113 gfx::NativeViewId containing_window) { | 113 gfx::NativeViewId containing_window) { |
| 114 return NULL; | 114 return NULL; |
| 115 } | 115 } |
| 116 | 116 |
| 117 bool NPChannelBase::Init(base::MessageLoopProxy* ipc_message_loop, | 117 bool NPChannelBase::Init(base::MessageLoopProxy* ipc_message_loop, |
| 118 bool create_pipe_now, | 118 bool create_pipe_now, |
| 119 base::WaitableEvent* shutdown_event) { | 119 base::WaitableEvent* shutdown_event) { |
| 120 #if defined(OS_POSIX) | 120 #if defined(OS_POSIX) |
| 121 // Check the validity of fd for bug investigation. Remove after fixed. | 121 // Attempting to initialize with an invalid channel handle. |
| 122 // See crbug.com/97285 for details. | 122 // See http://crbug.com/97285 for details. |
| 123 if (mode_ == IPC::Channel::MODE_CLIENT) | 123 if (mode_ == IPC::Channel::MODE_CLIENT && -1 == channel_handle_.socket.fd) |
| 124 CHECK_NE(-1, channel_handle_.socket.fd); | 124 return false; |
| 125 #endif | 125 #endif |
| 126 | 126 |
| 127 channel_.reset(new IPC::SyncChannel( | 127 channel_.reset(new IPC::SyncChannel( |
| 128 channel_handle_, mode_, this, ipc_message_loop, create_pipe_now, | 128 channel_handle_, mode_, this, ipc_message_loop, create_pipe_now, |
| 129 shutdown_event)); | 129 shutdown_event)); |
| 130 | 130 |
| 131 #if defined(OS_POSIX) | 131 #if defined(OS_POSIX) |
| 132 // Check the validity of fd for bug investigation. Remove after fixed. | 132 // Check the validity of fd for bug investigation. Remove after fixed. |
| 133 // See crbug.com/97285 for details. | 133 // See crbug.com/97285 for details. |
| 134 if (mode_ == IPC::Channel::MODE_SERVER) | 134 if (mode_ == IPC::Channel::MODE_SERVER) |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 | 293 |
| 294 void NPChannelBase::RemoveMappingForNPObjectStub(int route_id, | 294 void NPChannelBase::RemoveMappingForNPObjectStub(int route_id, |
| 295 NPObject* object) { | 295 NPObject* object) { |
| 296 DCHECK(object != NULL); | 296 DCHECK(object != NULL); |
| 297 stub_map_.erase(object); | 297 stub_map_.erase(object); |
| 298 } | 298 } |
| 299 | 299 |
| 300 void NPChannelBase::RemoveMappingForNPObjectProxy(int route_id) { | 300 void NPChannelBase::RemoveMappingForNPObjectProxy(int route_id) { |
| 301 proxy_map_.erase(route_id); | 301 proxy_map_.erase(route_id); |
| 302 } | 302 } |
| OLD | NEW |