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

Side by Side Diff: media/blink/webcontentdecryptionmodulesession_impl.h

Issue 2484873002: EME: Make sure sessions are closed before they are destroyed (Closed)
Patch Set: changes Created 4 years, 1 month 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
« no previous file with comments | « no previous file | media/blink/webcontentdecryptionmodulesession_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 MEDIA_BLINK_WEBCONTENTDECRYPTIONMODULESESSION_IMPL_H_ 5 #ifndef MEDIA_BLINK_WEBCONTENTDECRYPTIONMODULESESSION_IMPL_H_
6 #define MEDIA_BLINK_WEBCONTENTDECRYPTIONMODULESESSION_IMPL_H_ 6 #define MEDIA_BLINK_WEBCONTENTDECRYPTIONMODULESESSION_IMPL_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 scoped_refptr<CdmSessionAdapter> adapter_; 68 scoped_refptr<CdmSessionAdapter> adapter_;
69 69
70 // Non-owned pointer. 70 // Non-owned pointer.
71 Client* client_; 71 Client* client_;
72 72
73 // Session ID is the app visible ID for this session generated by the CDM. 73 // Session ID is the app visible ID for this session generated by the CDM.
74 // This value is not set until the CDM resolves the initializeNewSession() 74 // This value is not set until the CDM resolves the initializeNewSession()
75 // promise. 75 // promise.
76 std::string session_id_; 76 std::string session_id_;
77 77
78 // Don't pass more than 1 close() event to blink:: 78 // Keep track of whether the session has been closed or not. The session
79 // TODO(jrummell): Remove this once blink tests handle close() promise and 79 // may be closed as a result of an application calling close(), or the CDM
80 // closed() event. 80 // may close the session at any point.
81 // https://w3c.github.io/encrypted-media/#session-closed
82 // |has_close_been_called_| is used to keep track of whether close() has
83 // been called or not. |is_closed_| is used to keep track of whether the
84 // close event has been received or not.
85 bool has_close_been_called_;
81 bool is_closed_; 86 bool is_closed_;
82 87
83 base::ThreadChecker thread_checker_; 88 base::ThreadChecker thread_checker_;
84 // Since promises will live until they are fired, use a weak reference when 89 // Since promises will live until they are fired, use a weak reference when
85 // creating a promise in case this class disappears before the promise 90 // creating a promise in case this class disappears before the promise
86 // actually fires. 91 // actually fires.
87 base::WeakPtrFactory<WebContentDecryptionModuleSessionImpl> weak_ptr_factory_; 92 base::WeakPtrFactory<WebContentDecryptionModuleSessionImpl> weak_ptr_factory_;
88 93
89 DISALLOW_COPY_AND_ASSIGN(WebContentDecryptionModuleSessionImpl); 94 DISALLOW_COPY_AND_ASSIGN(WebContentDecryptionModuleSessionImpl);
90 }; 95 };
91 96
92 } // namespace media 97 } // namespace media
93 98
94 #endif // MEDIA_BLINK_WEBCONTENTDECRYPTIONMODULESESSION_IMPL_H_ 99 #endif // MEDIA_BLINK_WEBCONTENTDECRYPTIONMODULESESSION_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | media/blink/webcontentdecryptionmodulesession_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698