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/npapi/plugin_channel_host.h" | 5 #include "content/renderer/npapi/plugin_channel_host.h" |
6 | 6 |
7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
9 #include "content/child/child_process.h" | 9 #include "content/child/child_process.h" |
10 #include "content/child/npapi/npobject_base.h" | 10 #include "content/child/npapi/npobject_base.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 #if defined(OS_MACOSX) | 53 #if defined(OS_MACOSX) |
54 // static | 54 // static |
55 bool* PluginChannelHost::GetRemoveTrackingFlag() { | 55 bool* PluginChannelHost::GetRemoveTrackingFlag() { |
56 return &remove_tracking; | 56 return &remove_tracking; |
57 } | 57 } |
58 #endif | 58 #endif |
59 | 59 |
60 // static | 60 // static |
61 PluginChannelHost* PluginChannelHost::GetPluginChannelHost( | 61 PluginChannelHost* PluginChannelHost::GetPluginChannelHost( |
62 const IPC::ChannelHandle& channel_handle, | 62 const IPC::ChannelHandle& channel_handle, |
63 base::SingleThreadTaskRunner* ipc_task_runner) { | 63 base::SingleThreadTaskRunner* ipc_task_runner, |
| 64 IPC::AttachmentBroker* broker) { |
64 PluginChannelHost* result = | 65 PluginChannelHost* result = |
65 static_cast<PluginChannelHost*>(NPChannelBase::GetChannel( | 66 static_cast<PluginChannelHost*>(NPChannelBase::GetChannel( |
66 channel_handle, IPC::Channel::MODE_CLIENT, ClassFactory, | 67 channel_handle, IPC::Channel::MODE_CLIENT, ClassFactory, |
67 ipc_task_runner, true, ChildProcess::current()->GetShutDownEvent())); | 68 ipc_task_runner, true, ChildProcess::current()->GetShutDownEvent(), |
| 69 broker)); |
68 return result; | 70 return result; |
69 } | 71 } |
70 | 72 |
71 PluginChannelHost::PluginChannelHost() : expecting_shutdown_(false) { | 73 PluginChannelHost::PluginChannelHost() : expecting_shutdown_(false) { |
72 } | 74 } |
73 | 75 |
74 PluginChannelHost::~PluginChannelHost() { | 76 PluginChannelHost::~PluginChannelHost() { |
75 } | 77 } |
76 | 78 |
77 bool PluginChannelHost::Init(base::SingleThreadTaskRunner* ipc_task_runner, | 79 bool PluginChannelHost::Init(base::SingleThreadTaskRunner* ipc_task_runner, |
78 bool create_pipe_now, | 80 bool create_pipe_now, |
79 base::WaitableEvent* shutdown_event) { | 81 base::WaitableEvent* shutdown_event, |
80 return NPChannelBase::Init(ipc_task_runner, create_pipe_now, shutdown_event); | 82 IPC::AttachmentBroker* broker) { |
| 83 return NPChannelBase::Init(ipc_task_runner, create_pipe_now, shutdown_event, |
| 84 broker); |
81 } | 85 } |
82 | 86 |
83 int PluginChannelHost::GenerateRouteID() { | 87 int PluginChannelHost::GenerateRouteID() { |
84 int route_id = MSG_ROUTING_NONE; | 88 int route_id = MSG_ROUTING_NONE; |
85 Send(new PluginMsg_GenerateRouteID(&route_id)); | 89 Send(new PluginMsg_GenerateRouteID(&route_id)); |
86 | 90 |
87 return route_id; | 91 return route_id; |
88 } | 92 } |
89 | 93 |
90 void PluginChannelHost::AddRoute(int route_id, | 94 void PluginChannelHost::AddRoute(int route_id, |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 | 160 |
157 for (ProxyMap::iterator iter = proxies_.begin(); | 161 for (ProxyMap::iterator iter = proxies_.begin(); |
158 iter != proxies_.end(); iter++) { | 162 iter != proxies_.end(); iter++) { |
159 iter->second->OnChannelError(); | 163 iter->second->OnChannelError(); |
160 } | 164 } |
161 | 165 |
162 proxies_.clear(); | 166 proxies_.clear(); |
163 } | 167 } |
164 | 168 |
165 } // namespace content | 169 } // namespace content |
OLD | NEW |