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

Side by Side Diff: content/renderer/media/crypto/proxy_decryptor.cc

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 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 #include "content/renderer/media/crypto/proxy_decryptor.h" 5 #include "content/renderer/media/crypto/proxy_decryptor.h"
6 6
7 #include <cstring> 7 #include <cstring>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 29 matching lines...) Expand all
40 ProxyDecryptor::ProxyDecryptor( 40 ProxyDecryptor::ProxyDecryptor(
41 #if defined(ENABLE_PEPPER_CDMS) 41 #if defined(ENABLE_PEPPER_CDMS)
42 const CreatePepperCdmCB& create_pepper_cdm_cb, 42 const CreatePepperCdmCB& create_pepper_cdm_cb,
43 #elif defined(OS_ANDROID) 43 #elif defined(OS_ANDROID)
44 RendererMediaPlayerManager* manager, 44 RendererMediaPlayerManager* manager,
45 int cdm_id, 45 int cdm_id,
46 #endif // defined(ENABLE_PEPPER_CDMS) 46 #endif // defined(ENABLE_PEPPER_CDMS)
47 const KeyAddedCB& key_added_cb, 47 const KeyAddedCB& key_added_cb,
48 const KeyErrorCB& key_error_cb, 48 const KeyErrorCB& key_error_cb,
49 const KeyMessageCB& key_message_cb) 49 const KeyMessageCB& key_message_cb)
50 : weak_ptr_factory_(this), 50 :
51 #if defined(ENABLE_PEPPER_CDMS) 51 #if defined(ENABLE_PEPPER_CDMS)
52 create_pepper_cdm_cb_(create_pepper_cdm_cb), 52 create_pepper_cdm_cb_(create_pepper_cdm_cb),
53 #elif defined(OS_ANDROID) 53 #elif defined(OS_ANDROID)
54 manager_(manager), 54 manager_(manager),
55 cdm_id_(cdm_id), 55 cdm_id_(cdm_id),
56 #endif // defined(ENABLE_PEPPER_CDMS) 56 #endif // defined(ENABLE_PEPPER_CDMS)
57 key_added_cb_(key_added_cb), 57 key_added_cb_(key_added_cb),
58 key_error_cb_(key_error_cb), 58 key_error_cb_(key_error_cb),
59 key_message_cb_(key_message_cb), 59 key_message_cb_(key_message_cb),
60 is_clear_key_(false) { 60 is_clear_key_(false),
61 weak_ptr_factory_(this) {
61 #if defined(ENABLE_PEPPER_CDMS) 62 #if defined(ENABLE_PEPPER_CDMS)
62 DCHECK(!create_pepper_cdm_cb_.is_null()); 63 DCHECK(!create_pepper_cdm_cb_.is_null());
63 #endif // defined(ENABLE_PEPPER_CDMS) 64 #endif // defined(ENABLE_PEPPER_CDMS)
64 DCHECK(!key_added_cb_.is_null()); 65 DCHECK(!key_added_cb_.is_null());
65 DCHECK(!key_error_cb_.is_null()); 66 DCHECK(!key_error_cb_.is_null());
66 DCHECK(!key_message_cb_.is_null()); 67 DCHECK(!key_message_cb_.is_null());
67 } 68 }
68 69
69 ProxyDecryptor::~ProxyDecryptor() { 70 ProxyDecryptor::~ProxyDecryptor() {
70 // Destroy the decryptor explicitly before destroying the plugin. 71 // Destroy the decryptor explicitly before destroying the plugin.
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 263
263 const std::string& ProxyDecryptor::LookupWebSessionId(uint32 session_id) const { 264 const std::string& ProxyDecryptor::LookupWebSessionId(uint32 session_id) const {
264 DCHECK_NE(session_id, kInvalidSessionId); 265 DCHECK_NE(session_id, kInvalidSessionId);
265 266
266 // Session may not exist if error happens during GenerateKeyRequest(). 267 // Session may not exist if error happens during GenerateKeyRequest().
267 SessionIdMap::const_iterator it = sessions_.find(session_id); 268 SessionIdMap::const_iterator it = sessions_.find(session_id);
268 return (it != sessions_.end()) ? it->second : base::EmptyString(); 269 return (it != sessions_.end()) ? it->second : base::EmptyString();
269 } 270 }
270 271
271 } // namespace content 272 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/crypto/proxy_decryptor.h ('k') | content/renderer/media/rtc_video_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698