| 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/renderer/plugin_channel_host.h" | 5 #include "content/renderer/plugin_channel_host.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
| 8 #include "base/time.h" | 8 #include "base/time.h" |
| 9 #include "content/common/child_process.h" | 9 #include "content/common/child_process.h" |
| 10 #include "content/common/npobject_base.h" | 10 #include "content/common/npobject_base.h" |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 } | 131 } |
| 132 | 132 |
| 133 PluginChannelHost::~PluginChannelHost() { | 133 PluginChannelHost::~PluginChannelHost() { |
| 134 } | 134 } |
| 135 | 135 |
| 136 bool PluginChannelHost::Init(base::MessageLoopProxy* ipc_message_loop, | 136 bool PluginChannelHost::Init(base::MessageLoopProxy* ipc_message_loop, |
| 137 bool create_pipe_now, | 137 bool create_pipe_now, |
| 138 base::WaitableEvent* shutdown_event) { | 138 base::WaitableEvent* shutdown_event) { |
| 139 bool ret = | 139 bool ret = |
| 140 NPChannelBase::Init(ipc_message_loop, create_pipe_now, shutdown_event); | 140 NPChannelBase::Init(ipc_message_loop, create_pipe_now, shutdown_event); |
| 141 is_listening_filter_ = new IsListeningFilter; | 141 if (ret) { |
| 142 channel_->AddFilter(is_listening_filter_); | 142 is_listening_filter_ = new IsListeningFilter; |
| 143 channel_->AddFilter(is_listening_filter_); |
| 144 } |
| 143 return ret; | 145 return ret; |
| 144 } | 146 } |
| 145 | 147 |
| 146 int PluginChannelHost::GenerateRouteID() { | 148 int PluginChannelHost::GenerateRouteID() { |
| 147 int route_id = MSG_ROUTING_NONE; | 149 int route_id = MSG_ROUTING_NONE; |
| 148 Send(new PluginMsg_GenerateRouteID(&route_id)); | 150 Send(new PluginMsg_GenerateRouteID(&route_id)); |
| 149 | 151 |
| 150 return route_id; | 152 return route_id; |
| 151 } | 153 } |
| 152 | 154 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 | 219 |
| 218 NPChannelBase::OnChannelError(); | 220 NPChannelBase::OnChannelError(); |
| 219 | 221 |
| 220 for (ProxyMap::iterator iter = proxies_.begin(); | 222 for (ProxyMap::iterator iter = proxies_.begin(); |
| 221 iter != proxies_.end(); iter++) { | 223 iter != proxies_.end(); iter++) { |
| 222 iter->second->OnChannelError(); | 224 iter->second->OnChannelError(); |
| 223 } | 225 } |
| 224 | 226 |
| 225 proxies_.clear(); | 227 proxies_.clear(); |
| 226 } | 228 } |
| OLD | NEW |