| 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 } | 144 } |
| 145 | 145 |
| 146 int PluginChannelHost::GenerateRouteID() { | 146 int PluginChannelHost::GenerateRouteID() { |
| 147 int route_id = MSG_ROUTING_NONE; | 147 int route_id = MSG_ROUTING_NONE; |
| 148 Send(new PluginMsg_GenerateRouteID(&route_id)); | 148 Send(new PluginMsg_GenerateRouteID(&route_id)); |
| 149 | 149 |
| 150 return route_id; | 150 return route_id; |
| 151 } | 151 } |
| 152 | 152 |
| 153 void PluginChannelHost::AddRoute(int route_id, | 153 void PluginChannelHost::AddRoute(int route_id, |
| 154 IPC::Channel::Listener* listener, | 154 IPC::Listener* listener, |
| 155 NPObjectBase* npobject) { | 155 NPObjectBase* npobject) { |
| 156 NPChannelBase::AddRoute(route_id, listener, npobject); | 156 NPChannelBase::AddRoute(route_id, listener, npobject); |
| 157 | 157 |
| 158 if (!npobject) | 158 if (!npobject) |
| 159 proxies_[route_id] = listener; | 159 proxies_[route_id] = listener; |
| 160 } | 160 } |
| 161 | 161 |
| 162 void PluginChannelHost::RemoveRoute(int route_id) { | 162 void PluginChannelHost::RemoveRoute(int route_id) { |
| 163 #if defined(OS_MACOSX) | 163 #if defined(OS_MACOSX) |
| 164 if (remove_tracking) { | 164 if (remove_tracking) { |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 | 217 |
| 218 NPChannelBase::OnChannelError(); | 218 NPChannelBase::OnChannelError(); |
| 219 | 219 |
| 220 for (ProxyMap::iterator iter = proxies_.begin(); | 220 for (ProxyMap::iterator iter = proxies_.begin(); |
| 221 iter != proxies_.end(); iter++) { | 221 iter != proxies_.end(); iter++) { |
| 222 iter->second->OnChannelError(); | 222 iter->second->OnChannelError(); |
| 223 } | 223 } |
| 224 | 224 |
| 225 proxies_.clear(); | 225 proxies_.clear(); |
| 226 } | 226 } |
| OLD | NEW |