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

Side by Side Diff: content/renderer/media/cdm_session_adapter.h

Issue 193303002: WeakPtr destruction order cleanup: media edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 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
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: This must always be last so it's invalidated before other member
96 // variables might be accessed.
97 base::WeakPtrFactory<CdmSessionAdapter> weak_ptr_factory_;
98
97 DISALLOW_COPY_AND_ASSIGN(CdmSessionAdapter); 99 DISALLOW_COPY_AND_ASSIGN(CdmSessionAdapter);
98 }; 100 };
99 101
100 } // namespace content 102 } // namespace content
101 103
102 #endif // CONTENT_RENDERER_MEDIA_CDM_SESSION_ADAPTER_H_ 104 #endif // CONTENT_RENDERER_MEDIA_CDM_SESSION_ADAPTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698