| 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 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 <map> |
| 8 #include <set> | 9 #include <set> |
| 9 #include <string> | 10 #include <string> |
| 10 #include <vector> | 11 #include <vector> |
| 11 | 12 |
| 12 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
| 13 #include "base/callback.h" | 14 #include "base/callback.h" |
| 14 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
| 15 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
| 16 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
| 17 #include "base/memory/weak_ptr.h" | 18 #include "base/memory/weak_ptr.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 #include "webkit/plugins/ppapi/plugin_delegate.h" | 52 #include "webkit/plugins/ppapi/plugin_delegate.h" |
| 52 #include "webkit/plugins/ppapi/ppb_flash_impl.h" | 53 #include "webkit/plugins/ppapi/ppb_flash_impl.h" |
| 53 #include "webkit/plugins/ppapi/ppp_pdf.h" | 54 #include "webkit/plugins/ppapi/ppp_pdf.h" |
| 54 #include "webkit/plugins/webkit_plugins_export.h" | 55 #include "webkit/plugins/webkit_plugins_export.h" |
| 55 | 56 |
| 56 struct PP_Point; | 57 struct PP_Point; |
| 57 | 58 |
| 58 class SkBitmap; | 59 class SkBitmap; |
| 59 class TransportDIB; | 60 class TransportDIB; |
| 60 | 61 |
| 62 namespace media { |
| 63 class DecoderBuffer; |
| 64 class DecryptorClient; |
| 65 } |
| 66 |
| 61 namespace WebKit { | 67 namespace WebKit { |
| 62 class WebInputEvent; | 68 class WebInputEvent; |
| 63 class WebMouseEvent; | 69 class WebMouseEvent; |
| 64 class WebPluginContainer; | 70 class WebPluginContainer; |
| 65 struct WebCompositionUnderline; | 71 struct WebCompositionUnderline; |
| 66 struct WebCursorInfo; | 72 struct WebCursorInfo; |
| 67 struct WebPrintParams; | 73 struct WebPrintParams; |
| 68 } | 74 } |
| 69 | 75 |
| 70 namespace ppapi { | 76 namespace ppapi { |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 bool PrintPage(int page_number, WebKit::WebCanvas* canvas); | 240 bool PrintPage(int page_number, WebKit::WebCanvas* canvas); |
| 235 void PrintEnd(); | 241 void PrintEnd(); |
| 236 | 242 |
| 237 bool CanRotateView(); | 243 bool CanRotateView(); |
| 238 void RotateView(WebKit::WebPlugin::RotationType type); | 244 void RotateView(WebKit::WebPlugin::RotationType type); |
| 239 | 245 |
| 240 void Graphics3DContextLost(); | 246 void Graphics3DContextLost(); |
| 241 | 247 |
| 242 // Provides access to PPP_ContentDecryptor_Dev. | 248 // Provides access to PPP_ContentDecryptor_Dev. |
| 243 typedef base::Callback<void(void*, int)> CDMStatusCB; | 249 typedef base::Callback<void(void*, int)> CDMStatusCB; |
| 250 void SetDecryptClient(media::DecryptorClient* client); |
| 251 |
| 244 bool GenerateKeyRequest(const std::string& key_system, | 252 bool GenerateKeyRequest(const std::string& key_system, |
| 245 const std::string& init_data); | 253 const std::string& init_data); |
| 246 bool AddKey(const std::string& session_id, | 254 bool AddKey(const std::string& session_id, |
| 247 const std::string& key); | 255 const std::string& key); |
| 248 bool CancelKeyRequest(const std::string& session_id); | 256 bool CancelKeyRequest(const std::string& session_id); |
| 249 bool Decrypt(const std::string& encypted_block, | 257 bool Decrypt(const scoped_refptr<media::DecoderBuffer>& encrypted_buffer, |
| 250 const CDMStatusCB& callback); | 258 const CDMStatusCB& callback); |
| 251 bool DecryptAndDecode(const std::string& encypted_block, | 259 bool DecryptAndDecode(const std::string& encypted_block, |
| 252 const CDMStatusCB& callback); | 260 const CDMStatusCB& callback); |
| 253 | 261 |
| 254 // There are 2 implementations of the fullscreen interface | 262 // There are 2 implementations of the fullscreen interface |
| 255 // PPB_FlashFullscreen is used by Pepper Flash. | 263 // PPB_FlashFullscreen is used by Pepper Flash. |
| 256 // PPB_Fullscreen is intended for other applications including NaCl. | 264 // PPB_Fullscreen is intended for other applications including NaCl. |
| 257 // The two interface are mutually exclusive. | 265 // The two interface are mutually exclusive. |
| 258 | 266 |
| 259 // Implementation of PPB_FlashFullscreen. | 267 // Implementation of PPB_FlashFullscreen. |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 PP_Var session_id, | 443 PP_Var session_id, |
| 436 PP_Resource message, | 444 PP_Resource message, |
| 437 PP_Var default_url) OVERRIDE; | 445 PP_Var default_url) OVERRIDE; |
| 438 virtual void KeyError(PP_Instance instance, | 446 virtual void KeyError(PP_Instance instance, |
| 439 PP_Var key_system, | 447 PP_Var key_system, |
| 440 PP_Var session_id, | 448 PP_Var session_id, |
| 441 uint16_t media_error, | 449 uint16_t media_error, |
| 442 uint16_t system_error) OVERRIDE; | 450 uint16_t system_error) OVERRIDE; |
| 443 virtual void DeliverBlock(PP_Instance instance, | 451 virtual void DeliverBlock(PP_Instance instance, |
| 444 PP_Resource decrypted_block, | 452 PP_Resource decrypted_block, |
| 445 PP_CompletionCallback callback) OVERRIDE; | 453 uint32_t id) OVERRIDE; |
| 446 virtual void DeliverFrame(PP_Instance instance, | 454 virtual void DeliverFrame(PP_Instance instance, |
| 447 PP_Resource decrypted_frame, | 455 PP_Resource decrypted_frame, |
| 448 PP_CompletionCallback callback) OVERRIDE; | 456 PP_CompletionCallback callback) OVERRIDE; |
| 449 virtual void DeliverSamples(PP_Instance instance, | 457 virtual void DeliverSamples(PP_Instance instance, |
| 450 PP_Resource decrypted_samples, | 458 PP_Resource decrypted_samples, |
| 451 PP_CompletionCallback callback) OVERRIDE; | 459 PP_CompletionCallback callback) OVERRIDE; |
| 452 | 460 |
| 453 // Reset this instance as proxied. Resets cached interfaces to point to the | 461 // Reset this instance as proxied. Resets cached interfaces to point to the |
| 454 // proxy and re-sends DidCreate, DidChangeView, and HandleDocumentLoad (if | 462 // proxy and re-sends DidCreate, DidChangeView, and HandleDocumentLoad (if |
| 455 // necessary). | 463 // necessary). |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 716 | 724 |
| 717 // We store the arguments so we can re-send them if we are reset to talk to | 725 // We store the arguments so we can re-send them if we are reset to talk to |
| 718 // NaCl via the IPC NaCl proxy. | 726 // NaCl via the IPC NaCl proxy. |
| 719 std::vector<std::string> argn_; | 727 std::vector<std::string> argn_; |
| 720 std::vector<std::string> argv_; | 728 std::vector<std::string> argv_; |
| 721 | 729 |
| 722 // This is NULL unless HandleDocumentLoad has called. In that case, we store | 730 // This is NULL unless HandleDocumentLoad has called. In that case, we store |
| 723 // the pointer so we can re-send it later if we are reset to talk to NaCl. | 731 // the pointer so we can re-send it later if we are reset to talk to NaCl. |
| 724 scoped_refptr<PPB_URLLoader_Impl> document_loader_; | 732 scoped_refptr<PPB_URLLoader_Impl> document_loader_; |
| 725 | 733 |
| 734 // We store the callback passed in from Decyrpt(). |
| 735 media::DecryptorClient* decryptor_client_; |
| 736 uint64_t next_decryption_buffer_id_; |
| 737 std::map<uint64_t, CDMStatusCB> cdm_status_cb_map_; |
| 738 |
| 726 DISALLOW_COPY_AND_ASSIGN(PluginInstance); | 739 DISALLOW_COPY_AND_ASSIGN(PluginInstance); |
| 727 }; | 740 }; |
| 728 | 741 |
| 729 } // namespace ppapi | 742 } // namespace ppapi |
| 730 } // namespace webkit | 743 } // namespace webkit |
| 731 | 744 |
| 732 #endif // WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ | 745 #endif // WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ |
| OLD | NEW |