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

Side by Side Diff: media/filters/decrypting_demuxer_stream.cc

Issue 167333004: Encrypted Media: No need to cancel NewKeyCB during tear down. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments addressed Created 6 years, 10 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "media/filters/decrypting_demuxer_stream.h" 5 #include "media/filters/decrypting_demuxer_stream.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 DCHECK(state_ != kUninitialized) << state_; 117 DCHECK(state_ != kUninitialized) << state_;
118 118
119 // Invalidate all weak pointers so that pending callbacks won't be fired into 119 // Invalidate all weak pointers so that pending callbacks won't be fired into
120 // this object. 120 // this object.
121 weak_factory_.InvalidateWeakPtrs(); 121 weak_factory_.InvalidateWeakPtrs();
122 122
123 // At this point the render thread is likely paused (in WebMediaPlayerImpl's 123 // At this point the render thread is likely paused (in WebMediaPlayerImpl's
124 // Destroy()), so running |closure| can't wait for anything that requires the 124 // Destroy()), so running |closure| can't wait for anything that requires the
125 // render thread to process messages to complete (such as PPAPI methods). 125 // render thread to process messages to complete (such as PPAPI methods).
126 if (decryptor_) { 126 if (decryptor_) {
127 // Clear the callback.
128 // TODO(xhwang): Since we invalidate all weak pointers during Stop(),
129 // canceling NewKeyCB seems unnecessary. Clean this up in all Decrypting*
130 // classes.
131 decryptor_->RegisterNewKeyCB(GetDecryptorStreamType(),
132 Decryptor::NewKeyCB());
133 decryptor_->CancelDecrypt(GetDecryptorStreamType()); 127 decryptor_->CancelDecrypt(GetDecryptorStreamType());
134 decryptor_ = NULL; 128 decryptor_ = NULL;
135 } 129 }
136 if (!set_decryptor_ready_cb_.is_null()) 130 if (!set_decryptor_ready_cb_.is_null())
137 base::ResetAndReturn(&set_decryptor_ready_cb_).Run(DecryptorReadyCB()); 131 base::ResetAndReturn(&set_decryptor_ready_cb_).Run(DecryptorReadyCB());
138 if (!init_cb_.is_null()) 132 if (!init_cb_.is_null())
139 base::ResetAndReturn(&init_cb_).Run(PIPELINE_ERROR_ABORT); 133 base::ResetAndReturn(&init_cb_).Run(PIPELINE_ERROR_ABORT);
140 if (!read_cb_.is_null()) 134 if (!read_cb_.is_null())
141 base::ResetAndReturn(&read_cb_).Run(kAborted, NULL); 135 base::ResetAndReturn(&read_cb_).Run(kAborted, NULL);
142 if (!reset_cb_.is_null()) 136 if (!reset_cb_.is_null())
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 break; 387 break;
394 } 388 }
395 389
396 default: 390 default:
397 NOTREACHED(); 391 NOTREACHED();
398 return; 392 return;
399 } 393 }
400 } 394 }
401 395
402 } // namespace media 396 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/decrypting_audio_decoder_unittest.cc ('k') | media/filters/decrypting_demuxer_stream_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698