| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/renderer/plugin_channel_host.h" | 5 #include "content/renderer/plugin_channel_host.h" |
| 6 | 6 |
| 7 #include "content/common/plugin_messages.h" | 7 #include "content/common/plugin_messages.h" |
| 8 #include "content/plugin/npobject_base.h" | 8 #include "content/plugin/npobject_base.h" |
| 9 | 9 |
| 10 #if defined(OS_POSIX) | 10 #if defined(OS_POSIX) |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 bool PluginChannelHost::IsListening() { | 61 bool PluginChannelHost::IsListening() { |
| 62 return IsListeningFilter::is_listening_; | 62 return IsListeningFilter::is_listening_; |
| 63 } | 63 } |
| 64 | 64 |
| 65 // static | 65 // static |
| 66 void PluginChannelHost::SetListening(bool flag) { | 66 void PluginChannelHost::SetListening(bool flag) { |
| 67 IsListeningFilter::is_listening_ = flag; | 67 IsListeningFilter::is_listening_ = flag; |
| 68 } | 68 } |
| 69 | 69 |
| 70 PluginChannelHost* PluginChannelHost::GetPluginChannelHost( | 70 PluginChannelHost* PluginChannelHost::GetPluginChannelHost( |
| 71 const IPC::ChannelHandle& channel_handle, MessageLoop* ipc_message_loop) { | 71 const IPC::ChannelHandle& channel_handle, |
| 72 base::MessageLoopProxy* ipc_message_loop) { |
| 72 PluginChannelHost* result = | 73 PluginChannelHost* result = |
| 73 static_cast<PluginChannelHost*>(PluginChannelBase::GetChannel( | 74 static_cast<PluginChannelHost*>(PluginChannelBase::GetChannel( |
| 74 channel_handle, | 75 channel_handle, |
| 75 IPC::Channel::MODE_CLIENT, | 76 IPC::Channel::MODE_CLIENT, |
| 76 ClassFactory, | 77 ClassFactory, |
| 77 ipc_message_loop, | 78 ipc_message_loop, |
| 78 true)); | 79 true)); |
| 79 return result; | 80 return result; |
| 80 } | 81 } |
| 81 | 82 |
| 82 PluginChannelHost::PluginChannelHost() : expecting_shutdown_(false) { | 83 PluginChannelHost::PluginChannelHost() : expecting_shutdown_(false) { |
| 83 } | 84 } |
| 84 | 85 |
| 85 PluginChannelHost::~PluginChannelHost() { | 86 PluginChannelHost::~PluginChannelHost() { |
| 86 } | 87 } |
| 87 | 88 |
| 88 bool PluginChannelHost::Init(MessageLoop* ipc_message_loop, | 89 bool PluginChannelHost::Init(base::MessageLoopProxy* ipc_message_loop, |
| 89 bool create_pipe_now) { | 90 bool create_pipe_now) { |
| 90 bool ret = PluginChannelBase::Init(ipc_message_loop, create_pipe_now); | 91 bool ret = PluginChannelBase::Init(ipc_message_loop, create_pipe_now); |
| 91 is_listening_filter_ = new IsListeningFilter; | 92 is_listening_filter_ = new IsListeningFilter; |
| 92 channel_->AddFilter(is_listening_filter_); | 93 channel_->AddFilter(is_listening_filter_); |
| 93 return ret; | 94 return ret; |
| 94 } | 95 } |
| 95 | 96 |
| 96 int PluginChannelHost::GenerateRouteID() { | 97 int PluginChannelHost::GenerateRouteID() { |
| 97 int route_id = MSG_ROUTING_NONE; | 98 int route_id = MSG_ROUTING_NONE; |
| 98 Send(new PluginMsg_GenerateRouteID(&route_id)); | 99 Send(new PluginMsg_GenerateRouteID(&route_id)); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 void PluginChannelHost::OnChannelError() { | 137 void PluginChannelHost::OnChannelError() { |
| 137 PluginChannelBase::OnChannelError(); | 138 PluginChannelBase::OnChannelError(); |
| 138 | 139 |
| 139 for (ProxyMap::iterator iter = proxies_.begin(); | 140 for (ProxyMap::iterator iter = proxies_.begin(); |
| 140 iter != proxies_.end(); iter++) { | 141 iter != proxies_.end(); iter++) { |
| 141 iter->second->OnChannelError(); | 142 iter->second->OnChannelError(); |
| 142 } | 143 } |
| 143 | 144 |
| 144 proxies_.clear(); | 145 proxies_.clear(); |
| 145 } | 146 } |
| OLD | NEW |