Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(339)

Side by Side Diff: content/renderer/pepper/pepper_plugin_delegate_impl.cc

Issue 9968097: Browser Plugin: Renderer-side changes (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Updated after merging with ToT Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/pepper/pepper_plugin_delegate_impl.h" 5 #include "content/renderer/pepper/pepper_plugin_delegate_impl.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <cstddef> 8 #include <cstddef>
9 #include <map> 9 #include <map>
10 #include <queue> 10 #include <queue>
(...skipping 16 matching lines...) Expand all
27 #include "content/common/pepper_file_messages.h" 27 #include "content/common/pepper_file_messages.h"
28 #include "content/common/pepper_plugin_registry.h" 28 #include "content/common/pepper_plugin_registry.h"
29 #include "content/common/pepper_messages.h" 29 #include "content/common/pepper_messages.h"
30 #include "content/common/quota_dispatcher.h" 30 #include "content/common/quota_dispatcher.h"
31 #include "content/common/view_messages.h" 31 #include "content/common/view_messages.h"
32 #include "content/public/common/content_switches.h" 32 #include "content/public/common/content_switches.h"
33 #include "content/public/common/context_menu_params.h" 33 #include "content/public/common/context_menu_params.h"
34 #include "content/public/common/media_stream_request.h" 34 #include "content/public/common/media_stream_request.h"
35 #include "content/public/common/referrer.h" 35 #include "content/public/common/referrer.h"
36 #include "content/public/renderer/content_renderer_client.h" 36 #include "content/public/renderer/content_renderer_client.h"
37 #include "content/renderer/browser_plugin/browser_plugin_constants.h"
37 #include "content/renderer/gamepad_shared_memory_reader.h" 38 #include "content/renderer/gamepad_shared_memory_reader.h"
38 #include "content/renderer/media/audio_hardware.h" 39 #include "content/renderer/media/audio_hardware.h"
39 #include "content/renderer/media/media_stream_dispatcher.h" 40 #include "content/renderer/media/media_stream_dispatcher.h"
40 #include "content/renderer/media/pepper_platform_video_decoder_impl.h" 41 #include "content/renderer/media/pepper_platform_video_decoder_impl.h"
41 #include "content/renderer/p2p/p2p_transport_impl.h" 42 #include "content/renderer/p2p/p2p_transport_impl.h"
42 #include "content/renderer/p2p/socket_dispatcher.h" 43 #include "content/renderer/p2p/socket_dispatcher.h"
43 #include "content/renderer/pepper/pepper_broker_impl.h" 44 #include "content/renderer/pepper/pepper_broker_impl.h"
44 #include "content/renderer/pepper/pepper_device_enumeration_event_handler.h" 45 #include "content/renderer/pepper/pepper_device_enumeration_event_handler.h"
45 #include "content/renderer/pepper/pepper_hung_plugin_filter.h" 46 #include "content/renderer/pepper/pepper_hung_plugin_filter.h"
46 #include "content/renderer/pepper/pepper_platform_audio_input_impl.h" 47 #include "content/renderer/pepper/pepper_platform_audio_input_impl.h"
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 channel_handle, 259 channel_handle,
259 module->pp_module(), 260 module->pp_module(),
260 webkit::ppapi::PluginModule::GetLocalGetInterfaceFunc(), 261 webkit::ppapi::PluginModule::GetLocalGetInterfaceFunc(),
261 GetPreferences(), 262 GetPreferences(),
262 hung_filter.get())) 263 hung_filter.get()))
263 return scoped_refptr<webkit::ppapi::PluginModule>(); 264 return scoped_refptr<webkit::ppapi::PluginModule>();
264 module->InitAsProxied(dispatcher.release()); 265 module->InitAsProxied(dispatcher.release());
265 return module; 266 return module;
266 } 267 }
267 268
269 scoped_refptr<webkit::ppapi::PluginModule>
270 PepperPluginDelegateImpl::CreateBrowserPluginModule(
271 const IPC::ChannelHandle& channel_handle,
272 int guest_process_id) {
273 BrowserPluginRegistry* registry =
274 RenderThreadImpl::current()->browser_plugin_registry();
275 scoped_refptr<webkit::ppapi::PluginModule> module =
276 registry->GetModule(guest_process_id);
277 if (module)
278 return module;
279
280 scoped_refptr<PepperHungPluginFilter> hung_filter(
281 new PepperHungPluginFilter(FilePath(kBrowserPluginPath),
282 render_view_->routing_id(),
283 guest_process_id));
284 // Create a new HostDispatcher for the proxying, and hook it to a new
285 // PluginModule.
286 module = new webkit::ppapi::PluginModule(kBrowserPluginName,
287 FilePath(kBrowserPluginPath),
288 registry);
289 RenderThreadImpl::current()->browser_plugin_registry()->AddModule(
290 guest_process_id, module);
291 scoped_ptr<HostDispatcherWrapper> dispatcher(new HostDispatcherWrapper);
292 if (!dispatcher->Init(
293 channel_handle,
294 module->pp_module(),
295 webkit::ppapi::PluginModule::GetLocalGetInterfaceFunc(),
296 GetPreferences(),
297 hung_filter.get()))
298 return scoped_refptr<webkit::ppapi::PluginModule>();
299 module->InitAsProxied(dispatcher.release());
300 return module;
301 }
302
268 scoped_refptr<PepperBrokerImpl> PepperPluginDelegateImpl::CreateBroker( 303 scoped_refptr<PepperBrokerImpl> PepperPluginDelegateImpl::CreateBroker(
269 webkit::ppapi::PluginModule* plugin_module) { 304 webkit::ppapi::PluginModule* plugin_module) {
270 DCHECK(plugin_module); 305 DCHECK(plugin_module);
271 DCHECK(!plugin_module->GetBroker()); 306 DCHECK(!plugin_module->GetBroker());
272 307
273 // The broker path is the same as the plugin. 308 // The broker path is the same as the plugin.
274 const FilePath& broker_path = plugin_module->path(); 309 const FilePath& broker_path = plugin_module->path();
275 310
276 scoped_refptr<PepperBrokerImpl> broker = 311 scoped_refptr<PepperBrokerImpl> broker =
277 new PepperBrokerImpl(plugin_module, this); 312 new PepperBrokerImpl(plugin_module, this);
(...skipping 1349 matching lines...) Expand 10 before | Expand all | Expand 10 after
1627 mouse_lock_instances_.erase(it); 1662 mouse_lock_instances_.erase(it);
1628 } 1663 }
1629 } 1664 }
1630 1665
1631 webkit_glue::ClipboardClient* 1666 webkit_glue::ClipboardClient*
1632 PepperPluginDelegateImpl::CreateClipboardClient() const { 1667 PepperPluginDelegateImpl::CreateClipboardClient() const {
1633 return new RendererClipboardClient; 1668 return new RendererClipboardClient;
1634 } 1669 }
1635 1670
1636 } // namespace content 1671 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698