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 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ |
6 #define CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ | 6 #define CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "base/id_map.h" | 14 #include "base/id_map.h" |
15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
17 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
18 #include "base/observer_list.h" | 18 #include "base/observer_list.h" |
19 #include "content/common/content_export.h" | |
20 #include "content/public/renderer/render_view_observer.h" | 19 #include "content/public/renderer/render_view_observer.h" |
21 #include "content/renderer/mouse_lock_dispatcher.h" | 20 #include "content/renderer/mouse_lock_dispatcher.h" |
22 #include "content/renderer/pepper/pepper_parent_context_provider.h" | 21 #include "content/renderer/pepper/pepper_parent_context_provider.h" |
| 22 #include "content/renderer/render_view_pepper_helper.h" |
23 #include "ppapi/shared_impl/private/ppb_host_resolver_shared.h" | 23 #include "ppapi/shared_impl/private/ppb_host_resolver_shared.h" |
24 #include "ppapi/shared_impl/private/ppb_tcp_server_socket_shared.h" | 24 #include "ppapi/shared_impl/private/ppb_tcp_server_socket_shared.h" |
25 #include "ppapi/shared_impl/private/tcp_socket_private_impl.h" | 25 #include "ppapi/shared_impl/private/tcp_socket_private_impl.h" |
26 #include "ppapi/shared_impl/private/udp_socket_private_impl.h" | 26 #include "ppapi/shared_impl/private/udp_socket_private_impl.h" |
27 #include "ui/base/ime/text_input_type.h" | 27 #include "ui/base/ime/text_input_type.h" |
28 #include "webkit/plugins/ppapi/plugin_delegate.h" | 28 #include "webkit/plugins/ppapi/plugin_delegate.h" |
29 | 29 |
30 class FilePath; | 30 class FilePath; |
31 class TransportDIB; | |
32 | |
33 namespace gfx { | |
34 class Point; | |
35 class Rect; | |
36 } | |
37 | 31 |
38 namespace IPC { | 32 namespace IPC { |
39 struct ChannelHandle; | 33 struct ChannelHandle; |
40 } | 34 } |
41 | 35 |
42 namespace ppapi { | 36 namespace ppapi { |
43 class PepperFilePath; | 37 class PepperFilePath; |
44 class PPB_X509Certificate_Fields; | 38 class PPB_X509Certificate_Fields; |
45 class PpapiPermissions; | 39 class PpapiPermissions; |
46 } | 40 } |
47 | 41 |
48 namespace ui { | |
49 class Range; | |
50 } | |
51 | |
52 namespace webkit { | 42 namespace webkit { |
53 struct WebPluginInfo; | 43 struct WebPluginInfo; |
54 namespace ppapi { | 44 namespace ppapi { |
55 class PluginInstance; | 45 class PluginInstance; |
56 class PluginModule; | 46 class PluginModule; |
57 } | 47 } |
58 } | 48 } |
59 | 49 |
60 namespace WebKit { | 50 namespace WebKit { |
61 class WebGamepads; | 51 class WebGamepads; |
62 class WebMouseEvent; | |
63 struct WebCompositionUnderline; | 52 struct WebCompositionUnderline; |
64 } | 53 } |
65 | 54 |
66 namespace content { | 55 namespace content { |
67 | |
68 class GamepadSharedMemoryReader; | 56 class GamepadSharedMemoryReader; |
69 class PepperBrokerImpl; | 57 class PepperBrokerImpl; |
70 class PepperDeviceEnumerationEventHandler; | 58 class PepperDeviceEnumerationEventHandler; |
71 class PepperPluginDelegateImpl; | |
72 class RenderViewImpl; | 59 class RenderViewImpl; |
73 | 60 |
74 class PepperPluginDelegateImpl | 61 class PepperPluginDelegateImpl |
75 : public webkit::ppapi::PluginDelegate, | 62 : public webkit::ppapi::PluginDelegate, |
| 63 public RenderViewPepperHelper, |
76 public base::SupportsWeakPtr<PepperPluginDelegateImpl>, | 64 public base::SupportsWeakPtr<PepperPluginDelegateImpl>, |
77 public PepperParentContextProvider, | 65 public PepperParentContextProvider, |
78 public RenderViewObserver { | 66 public RenderViewObserver { |
79 public: | 67 public: |
80 explicit PepperPluginDelegateImpl(RenderViewImpl* render_view); | 68 explicit PepperPluginDelegateImpl(RenderViewImpl* render_view); |
81 virtual ~PepperPluginDelegateImpl(); | 69 virtual ~PepperPluginDelegateImpl(); |
82 | 70 |
83 RenderViewImpl* render_view() { return render_view_; } | 71 RenderViewImpl* render_view() { return render_view_; } |
84 | 72 |
85 // Attempts to create a PPAPI plugin for the given filepath. On success, it | |
86 // will return the newly-created module. | |
87 // | |
88 // There are two reasons for failure. The first is that the plugin isn't | |
89 // a PPAPI plugin. In this case, |*pepper_plugin_was_registered| will be set | |
90 // to false and the caller may want to fall back on creating an NPAPI plugin. | |
91 // the second is that the plugin failed to initialize. In this case, | |
92 // |*pepper_plugin_was_registered| will be set to true and the caller should | |
93 // not fall back on any other plugin types. | |
94 CONTENT_EXPORT scoped_refptr<webkit::ppapi::PluginModule> | |
95 CreatePepperPluginModule( | |
96 const webkit::WebPluginInfo& webplugin_info, | |
97 bool* pepper_plugin_was_registered); | |
98 | |
99 // Sets up the renderer host and out-of-process proxy for an external plugin | 73 // Sets up the renderer host and out-of-process proxy for an external plugin |
100 // module. Returns the renderer host, or NULL if it couldn't be created. | 74 // module. Returns the renderer host, or NULL if it couldn't be created. |
101 RendererPpapiHost* CreateExternalPluginModule( | 75 RendererPpapiHost* CreateExternalPluginModule( |
102 scoped_refptr<webkit::ppapi::PluginModule> module, | 76 scoped_refptr<webkit::ppapi::PluginModule> module, |
103 const FilePath& path, | 77 const FilePath& path, |
104 ppapi::PpapiPermissions permissions, | 78 ppapi::PpapiPermissions permissions, |
105 const IPC::ChannelHandle& channel_handle, | 79 const IPC::ChannelHandle& channel_handle, |
106 int plugin_child_id); | 80 int plugin_child_id); |
107 | 81 |
108 // Called by RenderView to tell us about painting events, these two functions | 82 // Removes broker from pending_connect_broker_ if present. Returns true if so. |
109 // just correspond to the WillInitiatePaint, DidInitiatePaint and | 83 bool StopWaitingForBrokerConnection(PepperBrokerImpl* broker); |
110 // DidFlushPaint hooks in RenderView. | |
111 void ViewWillInitiatePaint(); | |
112 void ViewInitiatedPaint(); | |
113 void ViewFlushedPaint(); | |
114 | 84 |
115 // Called by RenderView to implement the corresponding function in its base | 85 CONTENT_EXPORT int GetRoutingID() const; |
116 // class RenderWidget (see that for more). | 86 |
117 webkit::ppapi::PluginInstance* GetBitmapForOptimizedPluginPaint( | 87 typedef base::Callback<void (int /* request_id */, |
| 88 bool /* succeeded */, |
| 89 const std::string& /* label */)> |
| 90 OpenDeviceCallback; |
| 91 |
| 92 // Opens the specified device. The request ID passed into the callback will be |
| 93 // the same as the return value. If successful, the label passed into the |
| 94 // callback identifies a audio/video steam, which can be used to call |
| 95 // CloseDevice() and GetSesssionID(). |
| 96 int OpenDevice(PP_DeviceType_Dev type, |
| 97 const std::string& device_id, |
| 98 const OpenDeviceCallback& callback); |
| 99 void CloseDevice(const std::string& label); |
| 100 // Gets audio/video session ID given a label. |
| 101 int GetSessionID(PP_DeviceType_Dev type, const std::string& label); |
| 102 |
| 103 private: |
| 104 // RenderViewPepperHelper implementation. |
| 105 virtual WebKit::WebPlugin* CreatePepperWebPlugin( |
| 106 const webkit::WebPluginInfo& webplugin_info, |
| 107 const WebKit::WebPluginParams& params) OVERRIDE; |
| 108 virtual void ViewWillInitiatePaint() OVERRIDE; |
| 109 virtual void ViewInitiatedPaint() OVERRIDE; |
| 110 virtual void ViewFlushedPaint() OVERRIDE; |
| 111 virtual webkit::ppapi::PluginInstance* GetBitmapForOptimizedPluginPaint( |
118 const gfx::Rect& paint_bounds, | 112 const gfx::Rect& paint_bounds, |
119 TransportDIB** dib, | 113 TransportDIB** dib, |
120 gfx::Rect* location, | 114 gfx::Rect* location, |
121 gfx::Rect* clip, | 115 gfx::Rect* clip, |
122 float* scale_factor); | 116 float* scale_factor) OVERRIDE; |
123 | 117 virtual void OnAsyncFileOpened(base::PlatformFileError error_code, |
124 // Called by RenderView when ViewMsg_AsyncOpenFile_ACK. | 118 base::PlatformFile file, |
125 void OnAsyncFileOpened(base::PlatformFileError error_code, | 119 int message_id) OVERRIDE; |
126 base::PlatformFile file, | 120 virtual void OnPpapiBrokerChannelCreated( |
127 int message_id); | 121 int request_id, |
128 | 122 const IPC::ChannelHandle& handle) OVERRIDE; |
129 // Called by RenderView when ViewMsg_PpapiBrokerChannelCreated. | 123 virtual void OnPpapiBrokerPermissionResult(int request_id, |
130 void OnPpapiBrokerChannelCreated(int request_id, | 124 bool result) OVERRIDE; |
131 const IPC::ChannelHandle& handle); | 125 virtual void OnSetFocus(bool has_focus) OVERRIDE; |
132 | 126 virtual void PageVisibilityChanged(bool is_visible) OVERRIDE; |
133 // Removes broker from pending_connect_broker_ if present. Returns true if so. | 127 virtual bool IsPluginFocused() const OVERRIDE; |
134 bool StopWaitingForBrokerConnection(PepperBrokerImpl* broker); | 128 virtual gfx::Rect GetCaretBounds() const OVERRIDE; |
135 | 129 virtual ui::TextInputType GetTextInputType() const OVERRIDE; |
136 // Called when we know whether permission to access the PPAPI broker was | 130 virtual bool IsPluginAcceptingCompositionEvents() const OVERRIDE; |
137 // granted. | 131 virtual bool CanComposeInline() const OVERRIDE; |
138 void OnPpapiBrokerPermissionResult(int request_id, bool result); | 132 virtual void GetSurroundingText(string16* text, |
139 | 133 ui::Range* range) const OVERRIDE; |
140 // Notification that the render view has been focused or defocused. This | 134 virtual void OnImeSetComposition( |
141 // notifies all of the plugins. | |
142 void OnSetFocus(bool has_focus); | |
143 | |
144 // Notification that the page visibility has changed. The default is visible. | |
145 void PageVisibilityChanged(bool is_visible); | |
146 | |
147 // IME status. | |
148 bool IsPluginFocused() const; | |
149 gfx::Rect GetCaretBounds() const; | |
150 ui::TextInputType GetTextInputType() const; | |
151 bool IsPluginAcceptingCompositionEvents() const; | |
152 bool CanComposeInline() const; | |
153 void GetSurroundingText(string16* text, ui::Range* range) const; | |
154 | |
155 // IME events. | |
156 void OnImeSetComposition( | |
157 const string16& text, | 135 const string16& text, |
158 const std::vector<WebKit::WebCompositionUnderline>& underlines, | 136 const std::vector<WebKit::WebCompositionUnderline>& underlines, |
159 int selection_start, | 137 int selection_start, |
160 int selection_end); | 138 int selection_end) OVERRIDE; |
161 void OnImeConfirmComposition(const string16& text); | 139 virtual void OnImeConfirmComposition(const string16& text) OVERRIDE; |
162 | 140 virtual void WillHandleMouseEvent() OVERRIDE; |
163 // Notification that a mouse event has arrived at the render view. | |
164 void WillHandleMouseEvent(); | |
165 | 141 |
166 // PluginDelegate implementation. | 142 // PluginDelegate implementation. |
167 virtual void PluginFocusChanged(webkit::ppapi::PluginInstance* instance, | 143 virtual void PluginFocusChanged(webkit::ppapi::PluginInstance* instance, |
168 bool focused) OVERRIDE; | 144 bool focused) OVERRIDE; |
169 virtual void PluginTextInputTypeChanged( | 145 virtual void PluginTextInputTypeChanged( |
170 webkit::ppapi::PluginInstance* instance) OVERRIDE; | 146 webkit::ppapi::PluginInstance* instance) OVERRIDE; |
171 virtual void PluginCaretPositionChanged( | 147 virtual void PluginCaretPositionChanged( |
172 webkit::ppapi::PluginInstance* instance) OVERRIDE; | 148 webkit::ppapi::PluginInstance* instance) OVERRIDE; |
173 virtual void PluginRequestedCancelComposition( | 149 virtual void PluginRequestedCancelComposition( |
174 webkit::ppapi::PluginInstance* instance) OVERRIDE; | 150 webkit::ppapi::PluginInstance* instance) OVERRIDE; |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 virtual base::PlatformFileError GetDirContents( | 258 virtual base::PlatformFileError GetDirContents( |
283 const ppapi::PepperFilePath& path, | 259 const ppapi::PepperFilePath& path, |
284 ppapi::DirContents* contents) OVERRIDE; | 260 ppapi::DirContents* contents) OVERRIDE; |
285 virtual base::PlatformFileError CreateTemporaryFile( | 261 virtual base::PlatformFileError CreateTemporaryFile( |
286 base::PlatformFile* file) OVERRIDE; | 262 base::PlatformFile* file) OVERRIDE; |
287 virtual void SyncGetFileSystemPlatformPath( | 263 virtual void SyncGetFileSystemPlatformPath( |
288 const GURL& url, | 264 const GURL& url, |
289 FilePath* platform_path) OVERRIDE; | 265 FilePath* platform_path) OVERRIDE; |
290 virtual scoped_refptr<base::MessageLoopProxy> | 266 virtual scoped_refptr<base::MessageLoopProxy> |
291 GetFileThreadMessageLoopProxy() OVERRIDE; | 267 GetFileThreadMessageLoopProxy() OVERRIDE; |
292 | |
293 virtual uint32 TCPSocketCreate() OVERRIDE; | 268 virtual uint32 TCPSocketCreate() OVERRIDE; |
294 virtual void TCPSocketConnect( | 269 virtual void TCPSocketConnect( |
295 webkit::ppapi::PPB_TCPSocket_Private_Impl* socket, | 270 webkit::ppapi::PPB_TCPSocket_Private_Impl* socket, |
296 uint32 socket_id, | 271 uint32 socket_id, |
297 const std::string& host, | 272 const std::string& host, |
298 uint16_t port) OVERRIDE; | 273 uint16_t port) OVERRIDE; |
299 virtual void TCPSocketConnectWithNetAddress( | 274 virtual void TCPSocketConnectWithNetAddress( |
300 webkit::ppapi::PPB_TCPSocket_Private_Impl* socket, | 275 webkit::ppapi::PPB_TCPSocket_Private_Impl* socket, |
301 uint32 socket_id, | 276 uint32 socket_id, |
302 const PP_NetAddress_Private& addr) OVERRIDE; | 277 const PP_NetAddress_Private& addr) OVERRIDE; |
303 virtual void TCPSocketSSLHandshake( | 278 virtual void TCPSocketSSLHandshake( |
304 uint32 socket_id, | 279 uint32 socket_id, |
305 const std::string& server_name, | 280 const std::string& server_name, |
306 uint16_t server_port, | 281 uint16_t server_port, |
307 const std::vector<std::vector<char> >& trusted_certs, | 282 const std::vector<std::vector<char> >& trusted_certs, |
308 const std::vector<std::vector<char> >& untrusted_certs) OVERRIDE; | 283 const std::vector<std::vector<char> >& untrusted_certs) OVERRIDE; |
309 virtual void TCPSocketRead(uint32 socket_id, int32_t bytes_to_read) OVERRIDE; | 284 virtual void TCPSocketRead(uint32 socket_id, int32_t bytes_to_read) OVERRIDE; |
310 virtual void TCPSocketWrite(uint32 socket_id, | 285 virtual void TCPSocketWrite(uint32 socket_id, |
311 const std::string& buffer) OVERRIDE; | 286 const std::string& buffer) OVERRIDE; |
312 virtual void TCPSocketDisconnect(uint32 socket_id) OVERRIDE; | 287 virtual void TCPSocketDisconnect(uint32 socket_id) OVERRIDE; |
313 virtual void RegisterTCPSocket( | 288 virtual void RegisterTCPSocket( |
314 webkit::ppapi::PPB_TCPSocket_Private_Impl* socket, | 289 webkit::ppapi::PPB_TCPSocket_Private_Impl* socket, |
315 uint32 socket_id) OVERRIDE; | 290 uint32 socket_id) OVERRIDE; |
316 | |
317 virtual uint32 UDPSocketCreate() OVERRIDE; | 291 virtual uint32 UDPSocketCreate() OVERRIDE; |
318 virtual void UDPSocketSetBoolSocketFeature( | 292 virtual void UDPSocketSetBoolSocketFeature( |
319 webkit::ppapi::PPB_UDPSocket_Private_Impl* socket, | 293 webkit::ppapi::PPB_UDPSocket_Private_Impl* socket, |
320 uint32 socket_id, | 294 uint32 socket_id, |
321 int32_t name, | 295 int32_t name, |
322 bool value) OVERRIDE; | 296 bool value) OVERRIDE; |
323 virtual void UDPSocketBind( | 297 virtual void UDPSocketBind( |
324 webkit::ppapi::PPB_UDPSocket_Private_Impl* socket, | 298 webkit::ppapi::PPB_UDPSocket_Private_Impl* socket, |
325 uint32 socket_id, | 299 uint32 socket_id, |
326 const PP_NetAddress_Private& addr) OVERRIDE; | 300 const PP_NetAddress_Private& addr) OVERRIDE; |
327 virtual void UDPSocketRecvFrom(uint32 socket_id, | 301 virtual void UDPSocketRecvFrom(uint32 socket_id, |
328 int32_t num_bytes) OVERRIDE; | 302 int32_t num_bytes) OVERRIDE; |
329 virtual void UDPSocketSendTo(uint32 socket_id, | 303 virtual void UDPSocketSendTo(uint32 socket_id, |
330 const std::string& buffer, | 304 const std::string& buffer, |
331 const PP_NetAddress_Private& addr) OVERRIDE; | 305 const PP_NetAddress_Private& addr) OVERRIDE; |
332 virtual void UDPSocketClose(uint32 socket_id) OVERRIDE; | 306 virtual void UDPSocketClose(uint32 socket_id) OVERRIDE; |
333 virtual void TCPServerSocketListen( | 307 virtual void TCPServerSocketListen( |
334 PP_Resource socket_resource, | 308 PP_Resource socket_resource, |
335 const PP_NetAddress_Private& addr, | 309 const PP_NetAddress_Private& addr, |
336 int32_t backlog) OVERRIDE; | 310 int32_t backlog) OVERRIDE; |
337 virtual void TCPServerSocketAccept(uint32 server_socket_id) OVERRIDE; | 311 virtual void TCPServerSocketAccept(uint32 server_socket_id) OVERRIDE; |
338 virtual void TCPServerSocketStopListening( | 312 virtual void TCPServerSocketStopListening( |
339 PP_Resource socket_resource, | 313 PP_Resource socket_resource, |
340 uint32 socket_id) OVERRIDE; | 314 uint32 socket_id) OVERRIDE; |
341 | |
342 virtual void RegisterHostResolver( | 315 virtual void RegisterHostResolver( |
343 ppapi::PPB_HostResolver_Shared* host_resolver, | 316 ppapi::PPB_HostResolver_Shared* host_resolver, |
344 uint32 host_resolver_id) OVERRIDE; | 317 uint32 host_resolver_id) OVERRIDE; |
345 virtual void HostResolverResolve( | 318 virtual void HostResolverResolve( |
346 uint32 host_resolver_id, | 319 uint32 host_resolver_id, |
347 const ::ppapi::HostPortPair& host_port, | 320 const ::ppapi::HostPortPair& host_port, |
348 const PP_HostResolver_Private_Hint* hint) OVERRIDE; | 321 const PP_HostResolver_Private_Hint* hint) OVERRIDE; |
349 virtual void UnregisterHostResolver(uint32 host_resolver_id) OVERRIDE; | 322 virtual void UnregisterHostResolver(uint32 host_resolver_id) OVERRIDE; |
350 | |
351 virtual bool AddNetworkListObserver( | 323 virtual bool AddNetworkListObserver( |
352 webkit_glue::NetworkListObserver* observer) OVERRIDE; | 324 webkit_glue::NetworkListObserver* observer) OVERRIDE; |
353 virtual void RemoveNetworkListObserver( | 325 virtual void RemoveNetworkListObserver( |
354 webkit_glue::NetworkListObserver* observer) OVERRIDE; | 326 webkit_glue::NetworkListObserver* observer) OVERRIDE; |
355 | |
356 virtual bool X509CertificateParseDER( | 327 virtual bool X509CertificateParseDER( |
357 const std::vector<char>& der, | 328 const std::vector<char>& der, |
358 ppapi::PPB_X509Certificate_Fields* fields) OVERRIDE; | 329 ppapi::PPB_X509Certificate_Fields* fields) OVERRIDE; |
359 virtual webkit::ppapi::FullscreenContainer* | 330 virtual webkit::ppapi::FullscreenContainer* |
360 CreateFullscreenContainer( | 331 CreateFullscreenContainer( |
361 webkit::ppapi::PluginInstance* instance) OVERRIDE; | 332 webkit::ppapi::PluginInstance* instance) OVERRIDE; |
362 virtual gfx::Size GetScreenSize() OVERRIDE; | 333 virtual gfx::Size GetScreenSize() OVERRIDE; |
363 virtual std::string GetDefaultEncoding() OVERRIDE; | 334 virtual std::string GetDefaultEncoding() OVERRIDE; |
364 virtual void ZoomLimitsChanged(double minimum_factor, double maximum_factor) | 335 virtual void ZoomLimitsChanged(double minimum_factor, double maximum_factor) |
365 OVERRIDE; | 336 OVERRIDE; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 uint32 accepted_socket_id, | 405 uint32 accepted_socket_id, |
435 const PP_NetAddress_Private& local_addr, | 406 const PP_NetAddress_Private& local_addr, |
436 const PP_NetAddress_Private& remote_addr); | 407 const PP_NetAddress_Private& remote_addr); |
437 void OnHostResolverResolveACK( | 408 void OnHostResolverResolveACK( |
438 uint32 plugin_dispatcher_id, | 409 uint32 plugin_dispatcher_id, |
439 uint32 host_resolver_id, | 410 uint32 host_resolver_id, |
440 bool succeeded, | 411 bool succeeded, |
441 const std::string& canonical_name, | 412 const std::string& canonical_name, |
442 const std::vector<PP_NetAddress_Private>& net_address_list); | 413 const std::vector<PP_NetAddress_Private>& net_address_list); |
443 | 414 |
444 CONTENT_EXPORT int GetRoutingID() const; | 415 // Attempts to create a PPAPI plugin for the given filepath. On success, it |
| 416 // will return the newly-created module. |
| 417 // |
| 418 // There are two reasons for failure. The first is that the plugin isn't |
| 419 // a PPAPI plugin. In this case, |*pepper_plugin_was_registered| will be set |
| 420 // to false and the caller may want to fall back on creating an NPAPI plugin. |
| 421 // the second is that the plugin failed to initialize. In this case, |
| 422 // |*pepper_plugin_was_registered| will be set to true and the caller should |
| 423 // not fall back on any other plugin types. |
| 424 scoped_refptr<webkit::ppapi::PluginModule> |
| 425 CreatePepperPluginModule( |
| 426 const webkit::WebPluginInfo& webplugin_info, |
| 427 bool* pepper_plugin_was_registered); |
445 | 428 |
446 typedef base::Callback<void (int /* request_id */, | |
447 bool /* succeeded */, | |
448 const std::string& /* label */)> | |
449 OpenDeviceCallback; | |
450 | |
451 // Opens the specified device. The request ID passed into the callback will be | |
452 // the same as the return value. If successful, the label passed into the | |
453 // callback identifies a audio/video steam, which can be used to call | |
454 // CloseDevice() and GetSesssionID(). | |
455 int OpenDevice(PP_DeviceType_Dev type, | |
456 const std::string& device_id, | |
457 const OpenDeviceCallback& callback); | |
458 void CloseDevice(const std::string& label); | |
459 // Gets audio/video session ID given a label. | |
460 int GetSessionID(PP_DeviceType_Dev type, const std::string& label); | |
461 | |
462 private: | |
463 // Asynchronously attempts to create a PPAPI broker for the given plugin. | 429 // Asynchronously attempts to create a PPAPI broker for the given plugin. |
464 scoped_refptr<PepperBrokerImpl> CreateBroker( | 430 scoped_refptr<PepperBrokerImpl> CreateBroker( |
465 webkit::ppapi::PluginModule* plugin_module); | 431 webkit::ppapi::PluginModule* plugin_module); |
466 | 432 |
467 // Create a new HostDispatcher for proxying, hook it to the PluginModule, | 433 // Create a new HostDispatcher for proxying, hook it to the PluginModule, |
468 // and perform other common initialization. | 434 // and perform other common initialization. |
469 RendererPpapiHost* CreateOutOfProcessModule( | 435 RendererPpapiHost* CreateOutOfProcessModule( |
470 webkit::ppapi::PluginModule* module, | 436 webkit::ppapi::PluginModule* module, |
471 const FilePath& path, | 437 const FilePath& path, |
472 ppapi::PpapiPermissions permissions, | 438 ppapi::PpapiPermissions permissions, |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 | 493 |
528 scoped_ptr<PepperDeviceEnumerationEventHandler> | 494 scoped_ptr<PepperDeviceEnumerationEventHandler> |
529 device_enumeration_event_handler_; | 495 device_enumeration_event_handler_; |
530 | 496 |
531 DISALLOW_COPY_AND_ASSIGN(PepperPluginDelegateImpl); | 497 DISALLOW_COPY_AND_ASSIGN(PepperPluginDelegateImpl); |
532 }; | 498 }; |
533 | 499 |
534 } // namespace content | 500 } // namespace content |
535 | 501 |
536 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ | 502 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ |
OLD | NEW |