| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/plugin/plugin_channel_base.h" | 5 #include "chrome/plugin/plugin_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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 if (iter == npobject_listeners_.end()) { | 108 if (iter == npobject_listeners_.end()) { |
| 109 DLOG(WARNING) << "Invalid route id passed in:" << route_id; | 109 DLOG(WARNING) << "Invalid route id passed in:" << route_id; |
| 110 return NULL; | 110 return NULL; |
| 111 } | 111 } |
| 112 return iter->second; | 112 return iter->second; |
| 113 } | 113 } |
| 114 | 114 |
| 115 bool PluginChannelBase::Init(MessageLoop* ipc_message_loop, | 115 bool PluginChannelBase::Init(MessageLoop* ipc_message_loop, |
| 116 bool create_pipe_now) { | 116 bool create_pipe_now) { |
| 117 channel_.reset(new IPC::SyncChannel( | 117 channel_.reset(new IPC::SyncChannel( |
| 118 channel_name_, mode_, this, NULL, ipc_message_loop, create_pipe_now, | 118 channel_name_, mode_, this, ipc_message_loop, create_pipe_now, |
| 119 ChildProcess::current()->GetShutDownEvent())); | 119 ChildProcess::current()->GetShutDownEvent())); |
| 120 channel_valid_ = true; | 120 channel_valid_ = true; |
| 121 return true; | 121 return true; |
| 122 } | 122 } |
| 123 | 123 |
| 124 bool PluginChannelBase::Send(IPC::Message* message) { | 124 bool PluginChannelBase::Send(IPC::Message* message) { |
| 125 if (!channel_.get()) { | 125 if (!channel_.get()) { |
| 126 delete message; | 126 delete message; |
| 127 return false; | 127 return false; |
| 128 } | 128 } |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 } | 239 } |
| 240 | 240 |
| 241 void PluginChannelBase::OnChannelError() { | 241 void PluginChannelBase::OnChannelError() { |
| 242 #if defined(OS_POSIX) | 242 #if defined(OS_POSIX) |
| 243 if (channel_valid()) { | 243 if (channel_valid()) { |
| 244 IPC::RemoveAndCloseChannelSocket(channel_name()); | 244 IPC::RemoveAndCloseChannelSocket(channel_name()); |
| 245 } | 245 } |
| 246 #endif | 246 #endif |
| 247 channel_valid_ = false; | 247 channel_valid_ = false; |
| 248 } | 248 } |
| OLD | NEW |