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

Side by Side Diff: webkit/plugins/ppapi/ppapi_plugin_instance.h

Issue 10545036: Add PPAPI decryptor interfaces. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Implement enough thunk stuff to call into PluginInstance CDM stubs Created 8 years, 5 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 #ifndef WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ 5 #ifndef WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_
6 #define WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ 6 #define WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "base/callback.h"
13 #include "base/compiler_specific.h" 14 #include "base/compiler_specific.h"
14 #include "base/memory/ref_counted.h" 15 #include "base/memory/ref_counted.h"
15 #include "base/memory/scoped_ptr.h" 16 #include "base/memory/scoped_ptr.h"
16 #include "base/memory/weak_ptr.h" 17 #include "base/memory/weak_ptr.h"
17 #include "base/string16.h" 18 #include "base/string16.h"
18 #include "googleurl/src/gurl.h" 19 #include "googleurl/src/gurl.h"
19 #include "ppapi/c/dev/pp_cursor_type_dev.h" 20 #include "ppapi/c/dev/pp_cursor_type_dev.h"
21 #include "ppapi/c/dev/ppb_content_decryption_module_dev.h"
22 #include "ppapi/c/dev/ppp_content_decryption_module_dev.h"
20 #include "ppapi/c/dev/ppp_printing_dev.h" 23 #include "ppapi/c/dev/ppp_printing_dev.h"
21 #include "ppapi/c/dev/ppp_find_dev.h" 24 #include "ppapi/c/dev/ppp_find_dev.h"
22 #include "ppapi/c/dev/ppp_selection_dev.h" 25 #include "ppapi/c/dev/ppp_selection_dev.h"
23 #include "ppapi/c/dev/ppp_text_input_dev.h" 26 #include "ppapi/c/dev/ppp_text_input_dev.h"
24 #include "ppapi/c/dev/ppp_zoom_dev.h" 27 #include "ppapi/c/dev/ppp_zoom_dev.h"
25 #include "ppapi/c/pp_completion_callback.h" 28 #include "ppapi/c/pp_completion_callback.h"
26 #include "ppapi/c/pp_instance.h" 29 #include "ppapi/c/pp_instance.h"
27 #include "ppapi/c/pp_resource.h" 30 #include "ppapi/c/pp_resource.h"
28 #include "ppapi/c/pp_time.h" 31 #include "ppapi/c/pp_time.h"
29 #include "ppapi/c/pp_var.h" 32 #include "ppapi/c/pp_var.h"
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 bool IsPrintScalingDisabled(); 232 bool IsPrintScalingDisabled();
230 int PrintBegin(const WebKit::WebPrintParams& print_params); 233 int PrintBegin(const WebKit::WebPrintParams& print_params);
231 bool PrintPage(int page_number, WebKit::WebCanvas* canvas); 234 bool PrintPage(int page_number, WebKit::WebCanvas* canvas);
232 void PrintEnd(); 235 void PrintEnd();
233 236
234 bool CanRotateView(); 237 bool CanRotateView();
235 void RotateView(WebKit::WebPlugin::RotationType type); 238 void RotateView(WebKit::WebPlugin::RotationType type);
236 239
237 void Graphics3DContextLost(); 240 void Graphics3DContextLost();
238 241
242 // Implementation of PPP_ContentDecryptionModule_Dev.
ddorwin 2012/07/13 19:19:48 Not really an implementation of. Provides access t
Tom Finegan 2012/07/17 01:11:10 Done.
243 typedef base::Callback<void(void*, int)> CDMStatusCB;
244 bool GenerateKeyRequest(const std::string& key_system,
245 const std::string& init_data);
246 bool AddKey(const std::string& session_id,
247 const std::string& key);
248 bool CancelKeyRequest(const std::string& session_id);
249 bool Decrypt(const std::string& encypted_block,
250 const CDMStatusCB& callback);
ddorwin 2012/07/13 19:19:48 Hopefully this is some type of Base::Bind coming f
Tom Finegan 2012/07/17 01:11:10 Ok, the typedef is really just there for the sake
251 bool DecryptAndDecode(const std::string& encypted_block,
252 const CDMStatusCB& callback);
253
239 // There are 2 implementations of the fullscreen interface 254 // There are 2 implementations of the fullscreen interface
240 // PPB_FlashFullscreen is used by Pepper Flash. 255 // PPB_FlashFullscreen is used by Pepper Flash.
241 // PPB_Fullscreen is intended for other applications including NaCl. 256 // PPB_Fullscreen is intended for other applications including NaCl.
242 // The two interface are mutually exclusive. 257 // The two interface are mutually exclusive.
243 258
244 // Implementation of PPB_FlashFullscreen. 259 // Implementation of PPB_FlashFullscreen.
245 260
246 // Because going to fullscreen is asynchronous (but going out is not), there 261 // Because going to fullscreen is asynchronous (but going out is not), there
247 // are 3 states: 262 // are 3 states:
248 // - normal : fullscreen_container_ == NULL 263 // - normal : fullscreen_container_ == NULL
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 PP_Var relative, 412 PP_Var relative,
398 PP_URLComponents_Dev* components) OVERRIDE; 413 PP_URLComponents_Dev* components) OVERRIDE;
399 virtual PP_Bool DocumentCanRequest(PP_Instance instance, PP_Var url) OVERRIDE; 414 virtual PP_Bool DocumentCanRequest(PP_Instance instance, PP_Var url) OVERRIDE;
400 virtual PP_Bool DocumentCanAccessDocument(PP_Instance instance, 415 virtual PP_Bool DocumentCanAccessDocument(PP_Instance instance,
401 PP_Instance target) OVERRIDE; 416 PP_Instance target) OVERRIDE;
402 virtual PP_Var GetDocumentURL(PP_Instance instance, 417 virtual PP_Var GetDocumentURL(PP_Instance instance,
403 PP_URLComponents_Dev* components) OVERRIDE; 418 PP_URLComponents_Dev* components) OVERRIDE;
404 virtual PP_Var GetPluginInstanceURL( 419 virtual PP_Var GetPluginInstanceURL(
405 PP_Instance instance, 420 PP_Instance instance,
406 PP_URLComponents_Dev* components) OVERRIDE; 421 PP_URLComponents_Dev* components) OVERRIDE;
422 virtual void NeedKey(PP_Instance instance,
423 PP_Var key_system,
424 PP_Var session_id,
425 PP_Resource init_data) OVERRIDE;
426 virtual void KeyAdded(PP_Instance instance,
ddorwin 2012/07/13 19:19:48 As we move to an OOD for the API, I wonder if thes
427 PP_Var key_system,
428 PP_Var session_id) OVERRIDE;
429 virtual void KeyMessage(PP_Instance instance,
430 PP_Var key_system,
431 PP_Var session_id,
432 PP_Resource message,
433 PP_Var default_url) OVERRIDE;
434 virtual void KeyError(PP_Instance instance,
435 PP_Var key_system,
436 PP_Var session_id,
437 uint16_t media_error,
438 uint16_t system_error) OVERRIDE;
439 virtual void DeliverBlock(PP_Instance instance,
440 PP_Resource decrypted_block,
441 PP_CompletionCallback callback) OVERRIDE;
442 virtual void DeliverFrame(PP_Instance instance,
443 PP_Resource decrypted_frame,
444 PP_CompletionCallback callback) OVERRIDE;
445 virtual void DeliverSamples(PP_Instance instance,
446 PP_Resource decrypted_samples,
447 PP_CompletionCallback callback) OVERRIDE;
407 448
408 // Reset this instance as proxied. Resets cached interfaces to point to the 449 // Reset this instance as proxied. Resets cached interfaces to point to the
409 // proxy and re-sends DidCreate, DidChangeView, and HandleDocumentLoad (if 450 // proxy and re-sends DidCreate, DidChangeView, and HandleDocumentLoad (if
410 // necessary). 451 // necessary).
411 // This is for use with the NaCl proxy. 452 // This is for use with the NaCl proxy.
412 bool ResetAsProxied(); 453 bool ResetAsProxied();
413 454
414 private: 455 private:
415 // See the static Create functions above for creating PluginInstance objects. 456 // See the static Create functions above for creating PluginInstance objects.
416 // This constructor is private so that we can hide the PPP_Instance_Combined 457 // This constructor is private so that we can hide the PPP_Instance_Combined
417 // details while still having 1 constructor to maintain for member 458 // details while still having 1 constructor to maintain for member
418 // initialization. 459 // initialization.
419 PluginInstance(PluginDelegate* delegate, 460 PluginInstance(PluginDelegate* delegate,
420 PluginModule* module, 461 PluginModule* module,
421 ::ppapi::PPP_Instance_Combined* instance_interface); 462 ::ppapi::PPP_Instance_Combined* instance_interface);
422 463
464 bool LoadContentDecryptionModuleInterface();
423 bool LoadFindInterface(); 465 bool LoadFindInterface();
424 bool LoadInputEventInterface(); 466 bool LoadInputEventInterface();
425 bool LoadMessagingInterface(); 467 bool LoadMessagingInterface();
426 bool LoadMouseLockInterface(); 468 bool LoadMouseLockInterface();
427 bool LoadPdfInterface(); 469 bool LoadPdfInterface();
428 bool LoadPrintInterface(); 470 bool LoadPrintInterface();
429 bool LoadPrivateInterface(); 471 bool LoadPrivateInterface();
430 bool LoadSelectionInterface(); 472 bool LoadSelectionInterface();
431 bool LoadTextInputInterface(); 473 bool LoadTextInputInterface();
432 bool LoadZoomInterface(); 474 bool LoadZoomInterface();
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 bool has_webkit_focus_; 581 bool has_webkit_focus_;
540 bool has_content_area_focus_; 582 bool has_content_area_focus_;
541 583
542 // The id of the current find operation, or -1 if none is in process. 584 // The id of the current find operation, or -1 if none is in process.
543 int find_identifier_; 585 int find_identifier_;
544 586
545 // Helper object that creates resources. 587 // Helper object that creates resources.
546 scoped_ptr< ::ppapi::thunk::ResourceCreationAPI> resource_creation_; 588 scoped_ptr< ::ppapi::thunk::ResourceCreationAPI> resource_creation_;
547 589
548 // The plugin-provided interfaces. 590 // The plugin-provided interfaces.
591 const PPP_ContentDecryptionModule_Dev* plugin_decryption_interface_;
549 const PPP_Find_Dev* plugin_find_interface_; 592 const PPP_Find_Dev* plugin_find_interface_;
550 const PPP_InputEvent* plugin_input_event_interface_; 593 const PPP_InputEvent* plugin_input_event_interface_;
551 const PPP_Messaging* plugin_messaging_interface_; 594 const PPP_Messaging* plugin_messaging_interface_;
552 const PPP_MouseLock* plugin_mouse_lock_interface_; 595 const PPP_MouseLock* plugin_mouse_lock_interface_;
553 const PPP_Pdf* plugin_pdf_interface_; 596 const PPP_Pdf* plugin_pdf_interface_;
554 const PPP_Instance_Private* plugin_private_interface_; 597 const PPP_Instance_Private* plugin_private_interface_;
555 const PPP_Selection_Dev* plugin_selection_interface_; 598 const PPP_Selection_Dev* plugin_selection_interface_;
556 const PPP_TextInput_Dev* plugin_textinput_interface_; 599 const PPP_TextInput_Dev* plugin_textinput_interface_;
557 const PPP_Zoom_Dev* plugin_zoom_interface_; 600 const PPP_Zoom_Dev* plugin_zoom_interface_;
558 601
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 // the pointer so we can re-send it later if we are reset to talk to NaCl. 714 // the pointer so we can re-send it later if we are reset to talk to NaCl.
672 scoped_refptr<PPB_URLLoader_Impl> document_loader_; 715 scoped_refptr<PPB_URLLoader_Impl> document_loader_;
673 716
674 DISALLOW_COPY_AND_ASSIGN(PluginInstance); 717 DISALLOW_COPY_AND_ASSIGN(PluginInstance);
675 }; 718 };
676 719
677 } // namespace ppapi 720 } // namespace ppapi
678 } // namespace webkit 721 } // namespace webkit
679 722
680 #endif // WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ 723 #endif // WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698