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

Unified Diff: content/renderer/pepper/content_decryptor_delegate.h

Issue 116443009: Handle plugin instance crash in ContentDecryptorDelegate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rabase & is_instance_crashed_ -> is_valid_ 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/pepper/content_decryptor_delegate.h
diff --git a/content/renderer/pepper/content_decryptor_delegate.h b/content/renderer/pepper/content_decryptor_delegate.h
index 4e5a4bd5661c4644305e2e7d96313dfec42de425..d3fdc532ef398c7bf3b0986e4b736cb11dfa38db 100644
--- a/content/renderer/pepper/content_decryptor_delegate.h
+++ b/content/renderer/pepper/content_decryptor_delegate.h
@@ -49,6 +49,8 @@ class ContentDecryptorDelegate {
const media::SessionClosedCB& session_closed_cb,
const media::SessionErrorCB& session_error_cb);
+ void InstanceCrashed();
+
// Provides access to PPP_ContentDecryptor_Private.
bool CreateSession(uint32 session_id,
const std::string& type,
@@ -109,8 +111,11 @@ class ContentDecryptorDelegate {
class TrackableCallback {
public:
TrackableCallback() : id_(0u) {}
- // TODO(xhwang): Check that no callback is pending in dtor.
- ~TrackableCallback() {};
+ ~TrackableCallback() {
+ // Callbacks must be satisfied.
+ DCHECK_EQ(id_, 0u);
+ DCHECK(is_null());
+ };
bool Matches(uint32_t id) const { return id == id_; }
@@ -162,6 +167,8 @@ class ContentDecryptorDelegate {
media::SampleFormat sample_format,
media::Decryptor::AudioBuffers* frames);
+ void CancelAllPendingCallbacks();
+
const PP_Instance pp_instance_;
const PPP_ContentDecryptor_Private* const plugin_decryption_interface_;
@@ -203,6 +210,9 @@ class ContentDecryptorDelegate {
base::WeakPtr<ContentDecryptorDelegate> weak_this_;
base::WeakPtrFactory<ContentDecryptorDelegate> weak_ptr_factory_;
+ // State of the current instance. Set to false if the plugin instance crashed.
+ bool is_valid_;
+
DISALLOW_COPY_AND_ASSIGN(ContentDecryptorDelegate);
};

Powered by Google App Engine
This is Rietveld 408576698