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

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

Issue 10871006: Connect PpapiDecryptor and PluginInstance. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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/callback.h"
14 #include "base/compiler_specific.h" 14 #include "base/compiler_specific.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/string16.h" 18 #include "base/string16.h"
19 #include "media/base/decryptor.h"
ddorwin 2012/08/22 01:26:26 After 20
xhwang 2012/08/24 00:51:51 Done.
19 #include "googleurl/src/gurl.h" 20 #include "googleurl/src/gurl.h"
20 #include "ppapi/c/dev/pp_cursor_type_dev.h" 21 #include "ppapi/c/dev/pp_cursor_type_dev.h"
21 #include "ppapi/c/dev/ppp_printing_dev.h" 22 #include "ppapi/c/dev/ppp_printing_dev.h"
22 #include "ppapi/c/dev/ppp_find_dev.h" 23 #include "ppapi/c/dev/ppp_find_dev.h"
23 #include "ppapi/c/dev/ppp_selection_dev.h" 24 #include "ppapi/c/dev/ppp_selection_dev.h"
24 #include "ppapi/c/dev/ppp_text_input_dev.h" 25 #include "ppapi/c/dev/ppp_text_input_dev.h"
25 #include "ppapi/c/dev/ppp_zoom_dev.h" 26 #include "ppapi/c/dev/ppp_zoom_dev.h"
26 #include "ppapi/c/pp_completion_callback.h" 27 #include "ppapi/c/pp_completion_callback.h"
27 #include "ppapi/c/pp_instance.h" 28 #include "ppapi/c/pp_instance.h"
28 #include "ppapi/c/pp_resource.h" 29 #include "ppapi/c/pp_resource.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 62
62 namespace WebKit { 63 namespace WebKit {
63 class WebInputEvent; 64 class WebInputEvent;
64 class WebMouseEvent; 65 class WebMouseEvent;
65 class WebPluginContainer; 66 class WebPluginContainer;
66 struct WebCompositionUnderline; 67 struct WebCompositionUnderline;
67 struct WebCursorInfo; 68 struct WebCursorInfo;
68 struct WebPrintParams; 69 struct WebPrintParams;
69 } 70 }
70 71
72 namespace media {
73 class DecoderBuffer;
74 class DecryptorClient;
75 }
76
71 namespace ppapi { 77 namespace ppapi {
72 struct InputEventData; 78 struct InputEventData;
73 struct PPP_Instance_Combined; 79 struct PPP_Instance_Combined;
74 class Resource; 80 class Resource;
75 } 81 }
76 82
77 namespace ui { 83 namespace ui {
78 class Range; 84 class Range;
79 } 85 }
80 86
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 bool PrintPage(int page_number, WebKit::WebCanvas* canvas); 241 bool PrintPage(int page_number, WebKit::WebCanvas* canvas);
236 void PrintEnd(); 242 void PrintEnd();
237 243
238 bool CanRotateView(); 244 bool CanRotateView();
239 void RotateView(WebKit::WebPlugin::RotationType type); 245 void RotateView(WebKit::WebPlugin::RotationType type);
240 246
241 void Graphics3DContextLost(); 247 void Graphics3DContextLost();
242 248
243 // Provides access to PPP_ContentDecryptor_Private. 249 // Provides access to PPP_ContentDecryptor_Private.
244 // TODO(tomfinegan): Move decryptor methods to delegate class. 250 // TODO(tomfinegan): Move decryptor methods to delegate class.
245 typedef base::Callback<void(void*, int)> DecryptedDataCB; 251 void SetDecryptClient(media::DecryptorClient* client);
246 bool GenerateKeyRequest(const std::string& key_system, 252 bool GenerateKeyRequest(const std::string& key_system,
247 const std::string& init_data); 253 const std::string& init_data);
248 bool AddKey(const std::string& session_id, 254 bool AddKey(const std::string& session_id,
249 const std::string& key, 255 const std::string& key,
250 const std::string& init_data); 256 const std::string& init_data);
251 bool CancelKeyRequest(const std::string& session_id); 257 bool CancelKeyRequest(const std::string& session_id);
252 bool Decrypt(const base::StringPiece& encypted_block, 258 bool Decrypt(const scoped_refptr<media::DecoderBuffer>& encrypted_buffer,
253 const DecryptedDataCB& callback); 259 const media::Decryptor::DecryptCB& decrypt_cb);
254 bool DecryptAndDecode(const base::StringPiece& encypted_block, 260 // TODO(xhwang): Update this when we need to support decrypt and decode.
255 const DecryptedDataCB& callback); 261 bool DecryptAndDecode(
262 const scoped_refptr<media::DecoderBuffer>& encrypted_buffer,
263 const media::Decryptor::DecryptCB& decrypt_cb);
256 264
257 // There are 2 implementations of the fullscreen interface 265 // There are 2 implementations of the fullscreen interface
258 // PPB_FlashFullscreen is used by Pepper Flash. 266 // PPB_FlashFullscreen is used by Pepper Flash.
259 // PPB_Fullscreen is intended for other applications including NaCl. 267 // PPB_Fullscreen is intended for other applications including NaCl.
260 // The two interface are mutually exclusive. 268 // The two interface are mutually exclusive.
261 269
262 // Implementation of PPB_FlashFullscreen. 270 // Implementation of PPB_FlashFullscreen.
263 271
264 // Because going to fullscreen is asynchronous (but going out is not), there 272 // Because going to fullscreen is asynchronous (but going out is not), there
265 // are 3 states: 273 // are 3 states:
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
721 729
722 // We store the arguments so we can re-send them if we are reset to talk to 730 // We store the arguments so we can re-send them if we are reset to talk to
723 // NaCl via the IPC NaCl proxy. 731 // NaCl via the IPC NaCl proxy.
724 std::vector<std::string> argn_; 732 std::vector<std::string> argn_;
725 std::vector<std::string> argv_; 733 std::vector<std::string> argv_;
726 734
727 // This is NULL unless HandleDocumentLoad has called. In that case, we store 735 // This is NULL unless HandleDocumentLoad has called. In that case, we store
728 // the pointer so we can re-send it later if we are reset to talk to NaCl. 736 // the pointer so we can re-send it later if we are reset to talk to NaCl.
729 scoped_refptr<PPB_URLLoader_Impl> document_loader_; 737 scoped_refptr<PPB_URLLoader_Impl> document_loader_;
730 738
739 media::DecryptorClient* decryptor_client_;
740 uint64_t next_decryption_request_id_;
ddorwin 2012/08/22 04:09:21 Does this need to be unsigned? Does it really need
xhwang 2012/08/24 00:51:51 Done.
741 typedef std::map<uint64, media::Decryptor::DecryptCB> DecryptionCBMap;
742 DecryptionCBMap pending_decryption_cbs_;
743
731 DISALLOW_COPY_AND_ASSIGN(PluginInstance); 744 DISALLOW_COPY_AND_ASSIGN(PluginInstance);
732 }; 745 };
733 746
734 } // namespace ppapi 747 } // namespace ppapi
735 } // namespace webkit 748 } // namespace webkit
736 749
737 #endif // WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ 750 #endif // WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698