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/browser/ppapi_plugin_process_host.h" | 5 #include "content/browser/ppapi_plugin_process_host.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/base_switches.h" | 9 #include "base/base_switches.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 return plugin_host; | 155 return plugin_host; |
156 | 156 |
157 NOTREACHED(); // Init is not expected to fail. | 157 NOTREACHED(); // Init is not expected to fail. |
158 return NULL; | 158 return NULL; |
159 } | 159 } |
160 | 160 |
161 // static | 161 // static |
162 void PpapiPluginProcessHost::DidCreateOutOfProcessInstance( | 162 void PpapiPluginProcessHost::DidCreateOutOfProcessInstance( |
163 int plugin_process_id, | 163 int plugin_process_id, |
164 int32 pp_instance, | 164 int32 pp_instance, |
165 const PepperRendererInstanceData& instance_data) { | 165 const PepperRendererInstanceData& instance_data, |
| 166 IPC::Sender* renderer_sender) { |
166 for (PpapiPluginProcessHostIterator iter; !iter.Done(); ++iter) { | 167 for (PpapiPluginProcessHostIterator iter; !iter.Done(); ++iter) { |
167 if (iter->process_.get() && | 168 if (iter->process_.get() && |
168 iter->process_->GetData().id == plugin_process_id) { | 169 iter->process_->GetData().id == plugin_process_id) { |
169 // Found the plugin. | 170 // Found the plugin. |
170 iter->host_impl_->AddInstance(pp_instance, instance_data); | 171 iter->host_impl_->AddInstance( |
| 172 pp_instance,instance_data, renderer_sender); |
171 return; | 173 return; |
172 } | 174 } |
173 } | 175 } |
174 // We'll see this passed with a 0 process ID for the browser tag stuff that | 176 // We'll see this passed with a 0 process ID for the browser tag stuff that |
175 // is currently in the process of being removed. | 177 // is currently in the process of being removed. |
176 // | 178 // |
177 // TODO(brettw) When old browser tag impl is removed | 179 // TODO(brettw) When old browser tag impl is removed |
178 // (PepperPluginDelegateImpl::CreateBrowserPluginModule passes a 0 plugin | 180 // (PepperPluginDelegateImpl::CreateBrowserPluginModule passes a 0 plugin |
179 // process ID) this should be converted to a NOTREACHED(). | 181 // process ID) this should be converted to a NOTREACHED(). |
180 DCHECK(plugin_process_id == 0) | 182 DCHECK(plugin_process_id == 0) |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 // sent_requests_ queue should be the one that the plugin just created. | 464 // sent_requests_ queue should be the one that the plugin just created. |
463 Client* client = sent_requests_.front(); | 465 Client* client = sent_requests_.front(); |
464 sent_requests_.pop(); | 466 sent_requests_.pop(); |
465 | 467 |
466 const ChildProcessData& data = process_->GetData(); | 468 const ChildProcessData& data = process_->GetData(); |
467 client->OnPpapiChannelOpened(channel_handle, base::GetProcId(data.handle), | 469 client->OnPpapiChannelOpened(channel_handle, base::GetProcId(data.handle), |
468 data.id); | 470 data.id); |
469 } | 471 } |
470 | 472 |
471 } // namespace content | 473 } // namespace content |
OLD | NEW |