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

Side by Side Diff: webkit/media/crypto/proxy_decryptor.cc

Issue 10964055: Call Decryptor::Stop() in FFmpegVideoDecoder::Reset(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 2 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
« no previous file with comments | « webkit/media/crypto/proxy_decryptor.h ('k') | webkit/media/crypto/proxy_decryptor_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "webkit/media/crypto/proxy_decryptor.h" 5 #include "webkit/media/crypto/proxy_decryptor.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 FireNeedKey(client_, encrypted); 159 FireNeedKey(client_, encrypted);
160 return; 160 return;
161 } 161 }
162 } 162 }
163 163
164 decryptor->Decrypt(encrypted, base::Bind( 164 decryptor->Decrypt(encrypted, base::Bind(
165 &ProxyDecryptor::OnBufferDecrypted, base::Unretained(this), 165 &ProxyDecryptor::OnBufferDecrypted, base::Unretained(this),
166 base::MessageLoopProxy::current(), encrypted, decrypt_cb)); 166 base::MessageLoopProxy::current(), encrypted, decrypt_cb));
167 } 167 }
168 168
169 void ProxyDecryptor::Stop() { 169 void ProxyDecryptor::CancelDecrypt() {
170 DVLOG(1) << "Stop()"; 170 DVLOG(1) << "Stop()";
171 171
172 std::vector<base::Closure> closures_to_run; 172 std::vector<base::Closure> closures_to_run;
173 { 173 {
174 base::AutoLock auto_lock(lock_); 174 base::AutoLock auto_lock(lock_);
175 if (decryptor_.get()) 175 if (decryptor_.get())
176 decryptor_->Stop(); 176 decryptor_->CancelDecrypt();
177 stopped_ = true; 177 stopped_ = true;
178 std::swap(pending_decrypt_closures_, closures_to_run); 178 std::swap(pending_decrypt_closures_, closures_to_run);
179 } 179 }
180 180
181 for (std::vector<base::Closure>::iterator iter = closures_to_run.begin(); 181 for (std::vector<base::Closure>::iterator iter = closures_to_run.begin();
182 iter != closures_to_run.end(); 182 iter != closures_to_run.end();
183 ++iter) { 183 ++iter) {
184 iter->Run(); 184 iter->Run();
185 } 185 }
186 } 186 }
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 &ProxyDecryptor::DecryptOnMessageLoop, base::Unretained(this), 269 &ProxyDecryptor::DecryptOnMessageLoop, base::Unretained(this),
270 message_loop_proxy, encrypted, decrypt_cb)); 270 message_loop_proxy, encrypted, decrypt_cb));
271 } 271 }
272 // TODO(xhwang): The same NeedKey may be fired multiple times here and also 272 // TODO(xhwang): The same NeedKey may be fired multiple times here and also
273 // in Decrypt(). While the spec says only one NeedKey should be fired. Leave 273 // in Decrypt(). While the spec says only one NeedKey should be fired. Leave
274 // them as is since the spec about this may change. 274 // them as is since the spec about this may change.
275 FireNeedKey(client_, encrypted); 275 FireNeedKey(client_, encrypted);
276 } 276 }
277 277
278 } // namespace webkit_media 278 } // namespace webkit_media
OLDNEW
« no previous file with comments | « webkit/media/crypto/proxy_decryptor.h ('k') | webkit/media/crypto/proxy_decryptor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698