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

Side by Side Diff: content/renderer/pepper/content_decryptor_delegate.cc

Issue 594673002: Remove incorrect promise resolving type handling. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
« no previous file with comments | « no previous file | no next file » | 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 "content/renderer/pepper/content_decryptor_delegate.h" 5 #include "content/renderer/pepper/content_decryptor_delegate.h"
6 6
7 #include "base/callback_helpers.h" 7 #include "base/callback_helpers.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/message_loop/message_loop_proxy.h" 9 #include "base/message_loop/message_loop_proxy.h"
10 #include "base/metrics/sparse_histogram.h" 10 #include "base/metrics/sparse_histogram.h"
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after
688 688
689 // TODO(tomfinegan): Need to get stream type from media stack. 689 // TODO(tomfinegan): Need to get stream type from media stack.
690 ScopedPPResource pp_resource(encrypted_resource.get()); 690 ScopedPPResource pp_resource(encrypted_resource.get());
691 plugin_decryption_interface_->DecryptAndDecode( 691 plugin_decryption_interface_->DecryptAndDecode(
692 pp_instance_, PP_DECRYPTORSTREAMTYPE_VIDEO, pp_resource, &block_info); 692 pp_instance_, PP_DECRYPTORSTREAMTYPE_VIDEO, pp_resource, &block_info);
693 return true; 693 return true;
694 } 694 }
695 695
696 void ContentDecryptorDelegate::OnPromiseResolved(uint32 promise_id) { 696 void ContentDecryptorDelegate::OnPromiseResolved(uint32 promise_id) {
697 scoped_ptr<CdmPromise> promise = TakePromise(promise_id); 697 scoped_ptr<CdmPromise> promise = TakePromise(promise_id);
698
699 // Special case due to http://crbug.com/408330. CDM is resolving LoadSession()
700 // with this method when the session is not found. Instead it should call
701 // PromiseResolvedWithSession(""), so emulate that here until 408330 is fixed.
702 // TODO(jrummell): Remove this code when the CDM is updated.
703 if (promise &&
704 promise->GetResolveParameterType() == media::CdmPromise::STRING_TYPE) {
705 NewSessionCdmPromise* session_promise =
706 static_cast<NewSessionCdmPromise*>(promise.get());
707 session_promise->resolve(std::string());
708 return;
709 }
710
711 if (!promise || 698 if (!promise ||
712 promise->GetResolveParameterType() != media::CdmPromise::VOID_TYPE) { 699 promise->GetResolveParameterType() != media::CdmPromise::VOID_TYPE) {
713 NOTREACHED(); 700 NOTREACHED();
714 return; 701 return;
715 } 702 }
716 703
717 SimpleCdmPromise* simple_promise = 704 SimpleCdmPromise* simple_promise =
718 static_cast<SimpleCdmPromise*>(promise.get()); 705 static_cast<SimpleCdmPromise*>(promise.get());
719 simple_promise->resolve(); 706 simple_promise->resolve();
720 } 707 }
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
1318 1305
1319 scoped_ptr<CdmPromise> ContentDecryptorDelegate::TakePromise( 1306 scoped_ptr<CdmPromise> ContentDecryptorDelegate::TakePromise(
1320 uint32_t promise_id) { 1307 uint32_t promise_id) {
1321 PromiseMap::iterator it = promises_.find(promise_id); 1308 PromiseMap::iterator it = promises_.find(promise_id);
1322 if (it == promises_.end()) 1309 if (it == promises_.end())
1323 return scoped_ptr<CdmPromise>(); 1310 return scoped_ptr<CdmPromise>();
1324 return promises_.take_and_erase(it); 1311 return promises_.take_and_erase(it);
1325 } 1312 }
1326 1313
1327 } // namespace content 1314 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698