OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_CDM_SESSION_ADAPTER_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_CDM_SESSION_ADAPTER_H_ |
6 #define CONTENT_RENDERER_MEDIA_CDM_SESSION_ADAPTER_H_ | 6 #define CONTENT_RENDERER_MEDIA_CDM_SESSION_ADAPTER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 void OnSessionClosed(uint32 session_id); | 80 void OnSessionClosed(uint32 session_id); |
81 void OnSessionError(uint32 session_id, | 81 void OnSessionError(uint32 session_id, |
82 media::MediaKeys::KeyError error_code, | 82 media::MediaKeys::KeyError error_code, |
83 uint32 system_code); | 83 uint32 system_code); |
84 | 84 |
85 // Helper function of the callbacks. | 85 // Helper function of the callbacks. |
86 WebContentDecryptionModuleSessionImpl* GetSession(uint32 session_id); | 86 WebContentDecryptionModuleSessionImpl* GetSession(uint32 session_id); |
87 | 87 |
88 scoped_ptr<media::MediaKeys> media_keys_; | 88 scoped_ptr<media::MediaKeys> media_keys_; |
89 | 89 |
90 base::WeakPtrFactory<CdmSessionAdapter> weak_ptr_factory_; | |
91 | |
92 SessionMap sessions_; | 90 SessionMap sessions_; |
93 | 91 |
94 // Session ID should be unique per renderer process for debugging purposes. | 92 // Session ID should be unique per renderer process for debugging purposes. |
95 static uint32 next_session_id_; | 93 static uint32 next_session_id_; |
96 | 94 |
| 95 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 96 base::WeakPtrFactory<CdmSessionAdapter> weak_ptr_factory_; |
| 97 |
97 DISALLOW_COPY_AND_ASSIGN(CdmSessionAdapter); | 98 DISALLOW_COPY_AND_ASSIGN(CdmSessionAdapter); |
98 }; | 99 }; |
99 | 100 |
100 } // namespace content | 101 } // namespace content |
101 | 102 |
102 #endif // CONTENT_RENDERER_MEDIA_CDM_SESSION_ADAPTER_H_ | 103 #endif // CONTENT_RENDERER_MEDIA_CDM_SESSION_ADAPTER_H_ |
OLD | NEW |