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

Side by Side Diff: content/renderer/media/crypto/ppapi_decryptor.h

Issue 116443009: Handle plugin instance crash in ContentDecryptorDelegate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments addressed Created 6 years, 11 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_MEDIA_CRYPTO_PPAPI_DECRYPTOR_H_ 5 #ifndef CONTENT_RENDERER_MEDIA_CRYPTO_PPAPI_DECRYPTOR_H_
6 #define CONTENT_RENDERER_MEDIA_CRYPTO_PPAPI_DECRYPTOR_H_ 6 #define CONTENT_RENDERER_MEDIA_CRYPTO_PPAPI_DECRYPTOR_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 virtual void DecryptAndDecodeAudio( 66 virtual void DecryptAndDecodeAudio(
67 const scoped_refptr<media::DecoderBuffer>& encrypted, 67 const scoped_refptr<media::DecoderBuffer>& encrypted,
68 const AudioDecodeCB& audio_decode_cb) OVERRIDE; 68 const AudioDecodeCB& audio_decode_cb) OVERRIDE;
69 virtual void DecryptAndDecodeVideo( 69 virtual void DecryptAndDecodeVideo(
70 const scoped_refptr<media::DecoderBuffer>& encrypted, 70 const scoped_refptr<media::DecoderBuffer>& encrypted,
71 const VideoDecodeCB& video_decode_cb) OVERRIDE; 71 const VideoDecodeCB& video_decode_cb) OVERRIDE;
72 virtual void ResetDecoder(StreamType stream_type) OVERRIDE; 72 virtual void ResetDecoder(StreamType stream_type) OVERRIDE;
73 virtual void DeinitializeDecoder(StreamType stream_type) OVERRIDE; 73 virtual void DeinitializeDecoder(StreamType stream_type) OVERRIDE;
74 74
75 private: 75 private:
76 PpapiDecryptor(const scoped_refptr<PepperPluginInstanceImpl>& plugin_instance, 76 PpapiDecryptor(const std::string& key_system,
77 const scoped_refptr<PepperPluginInstanceImpl>& plugin_instance,
77 ContentDecryptorDelegate* plugin_cdm_delegate, 78 ContentDecryptorDelegate* plugin_cdm_delegate,
78 const media::SessionCreatedCB& session_created_cb, 79 const media::SessionCreatedCB& session_created_cb,
79 const media::SessionMessageCB& session_message_cb, 80 const media::SessionMessageCB& session_message_cb,
80 const media::SessionReadyCB& session_ready_cb, 81 const media::SessionReadyCB& session_ready_cb,
81 const media::SessionClosedCB& session_closed_cb, 82 const media::SessionClosedCB& session_closed_cb,
82 const media::SessionErrorCB& session_error_cb, 83 const media::SessionErrorCB& session_error_cb,
83 const base::Closure& destroy_plugin_cb); 84 const base::Closure& destroy_plugin_cb);
84 85
85 void ReportFailureToCallPlugin(uint32 session_id); 86 void ReportFailureToCallPlugin(uint32 session_id);
86 87
87 void OnDecoderInitialized(StreamType stream_type, bool success); 88 void OnDecoderInitialized(StreamType stream_type, bool success);
88 89
89 // Callbacks for |plugin_cdm_delegate_| to fire session events. 90 // Callbacks for |plugin_cdm_delegate_| to fire session events.
90 void OnSessionCreated(uint32 session_id, const std::string& web_session_id); 91 void OnSessionCreated(uint32 session_id, const std::string& web_session_id);
91 void OnSessionMessage(uint32 session_id, 92 void OnSessionMessage(uint32 session_id,
92 const std::vector<uint8>& message, 93 const std::vector<uint8>& message,
93 const std::string& destination_url); 94 const std::string& destination_url);
94 void OnSessionReady(uint32 session_id); 95 void OnSessionReady(uint32 session_id);
95 void OnSessionClosed(uint32 session_id); 96 void OnSessionClosed(uint32 session_id);
96 void OnSessionError(uint32 session_id, 97 void OnSessionError(uint32 session_id,
97 media::MediaKeys::KeyError error_code, 98 media::MediaKeys::KeyError error_code,
98 int system_code); 99 int system_code);
99 100
101 // Callback to notify unexpected error happened in |plugin_cdm_delegate_|.
102 // After this call, |plugin_cdm_delegate_| should not be used.
ddorwin 2014/01/08 23:40:32 Between these two, maybe explicitly note that plug
xhwang 2014/01/09 01:58:49 Done.
103 void OnPluginError();
104
100 base::WeakPtr<PpapiDecryptor> weak_this_; 105 base::WeakPtr<PpapiDecryptor> weak_this_;
101 106
102 // Hold a reference of the plugin instance to make sure the plugin outlives 107 // Hold a reference of the plugin instance to make sure the plugin outlives
103 // the |plugin_cdm_delegate_|. This is needed because |plugin_cdm_delegate_| 108 // the |plugin_cdm_delegate_|. This is needed because |plugin_cdm_delegate_|
104 // is owned by the |plugin_instance_|. 109 // is owned by the |plugin_instance_|.
105 scoped_refptr<PepperPluginInstanceImpl> plugin_instance_; 110 scoped_refptr<PepperPluginInstanceImpl> plugin_instance_;
106 111
107 ContentDecryptorDelegate* plugin_cdm_delegate_; 112 ContentDecryptorDelegate* plugin_cdm_delegate_;
108 113
109 // Callbacks for firing session events. 114 // Callbacks for firing session events.
(...skipping 14 matching lines...) Expand all
124 NewKeyCB new_video_key_cb_; 129 NewKeyCB new_video_key_cb_;
125 130
126 base::WeakPtrFactory<PpapiDecryptor> weak_ptr_factory_; 131 base::WeakPtrFactory<PpapiDecryptor> weak_ptr_factory_;
127 132
128 DISALLOW_COPY_AND_ASSIGN(PpapiDecryptor); 133 DISALLOW_COPY_AND_ASSIGN(PpapiDecryptor);
129 }; 134 };
130 135
131 } // namespace content 136 } // namespace content
132 137
133 #endif // CONTENT_RENDERER_MEDIA_CRYPTO_PPAPI_DECRYPTOR_H_ 138 #endif // CONTENT_RENDERER_MEDIA_CRYPTO_PPAPI_DECRYPTOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698