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

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: Rebase. 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: 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_
OLDNEW
« no previous file with comments | « content/renderer/media/buffered_data_source.cc ('k') | content/renderer/media/crypto/ppapi_decryptor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698