| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/renderer_host/pepper/pepper_renderer_connection.h" | 5 #include "content/browser/renderer_host/pepper/pepper_renderer_connection.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "content/browser/browser_child_process_host_impl.h" | 9 #include "content/browser/browser_child_process_host_impl.h" |
| 10 #include "content/browser/ppapi_plugin_process_host.h" | 10 #include "content/browser/ppapi_plugin_process_host.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 base::FilePath(), | 103 base::FilePath(), |
| 104 true /* in_process */, | 104 true /* in_process */, |
| 105 false /* external_plugin */)); | 105 false /* external_plugin */)); |
| 106 } | 106 } |
| 107 | 107 |
| 108 PepperRendererConnection::~PepperRendererConnection() { | 108 PepperRendererConnection::~PepperRendererConnection() { |
| 109 } | 109 } |
| 110 | 110 |
| 111 BrowserPpapiHostImpl* PepperRendererConnection::GetHostForChildProcess( | 111 BrowserPpapiHostImpl* PepperRendererConnection::GetHostForChildProcess( |
| 112 int child_process_id) const { | 112 int child_process_id) const { |
| 113 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 113 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 114 | 114 |
| 115 // Find the plugin which this message refers to. Check NaCl plugins first. | 115 // Find the plugin which this message refers to. Check NaCl plugins first. |
| 116 BrowserPpapiHostImpl* host = static_cast<BrowserPpapiHostImpl*>( | 116 BrowserPpapiHostImpl* host = static_cast<BrowserPpapiHostImpl*>( |
| 117 GetContentClient()->browser()->GetExternalBrowserPpapiHost( | 117 GetContentClient()->browser()->GetExternalBrowserPpapiHost( |
| 118 child_process_id)); | 118 child_process_id)); |
| 119 | 119 |
| 120 if (!host) { | 120 if (!host) { |
| 121 // Check trusted pepper plugins. | 121 // Check trusted pepper plugins. |
| 122 for (PpapiPluginProcessHostIterator iter; !iter.Done(); ++iter) { | 122 for (PpapiPluginProcessHostIterator iter; !iter.Done(); ++iter) { |
| 123 if (iter->process() && | 123 if (iter->process() && |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 data.render_process_id = render_process_id_; | 238 data.render_process_id = render_process_id_; |
| 239 in_process_host_->AddInstance(instance, data); | 239 in_process_host_->AddInstance(instance, data); |
| 240 } | 240 } |
| 241 | 241 |
| 242 void PepperRendererConnection::OnMsgDidDeleteInProcessInstance( | 242 void PepperRendererConnection::OnMsgDidDeleteInProcessInstance( |
| 243 PP_Instance instance) { | 243 PP_Instance instance) { |
| 244 in_process_host_->DeleteInstance(instance); | 244 in_process_host_->DeleteInstance(instance); |
| 245 } | 245 } |
| 246 | 246 |
| 247 } // namespace content | 247 } // namespace content |
| OLD | NEW |