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

Side by Side Diff: media/blink/key_system_config_selector.cc

Issue 1157163005: Correct order-dependent argument evaluation in SelectConfigInternal(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Typo. Created 5 years, 6 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 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 #include "key_system_config_selector.h" 5 #include "key_system_config_selector.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after
734 &config_state, &accumulated_configuration); 734 &config_state, &accumulated_configuration);
735 switch (support) { 735 switch (support) {
736 case CONFIGURATION_NOT_SUPPORTED: 736 case CONFIGURATION_NOT_SUPPORTED:
737 continue; 737 continue;
738 case CONFIGURATION_REQUIRES_PERMISSION: 738 case CONFIGURATION_REQUIRES_PERMISSION:
739 if (request->was_permission_requested) { 739 if (request->was_permission_requested) {
740 DVLOG(2) << "Rejecting requested configuration because " 740 DVLOG(2) << "Rejecting requested configuration because "
741 << "permission was denied."; 741 << "permission was denied.";
742 continue; 742 continue;
743 } 743 }
744 media_permission_->RequestPermission( 744 {
745 MediaPermission::PROTECTED_MEDIA_IDENTIFIER, 745 // Note: the GURL must not be constructed inline because
746 GURL(request->security_origin.toString()), 746 // base::Passed(&request) sets |request| to null.
747 base::Bind(&KeySystemConfigSelector::OnPermissionResult, 747 GURL security_origin(request->security_origin.toString());
748 weak_factory_.GetWeakPtr(), base::Passed(&request))); 748 media_permission_->RequestPermission(
749 MediaPermission::PROTECTED_MEDIA_IDENTIFIER, security_origin,
750 base::Bind(&KeySystemConfigSelector::OnPermissionResult,
751 weak_factory_.GetWeakPtr(), base::Passed(&request)));
752 }
749 return; 753 return;
750 case CONFIGURATION_SUPPORTED: 754 case CONFIGURATION_SUPPORTED:
751 cdm_config.allow_distinctive_identifier = 755 cdm_config.allow_distinctive_identifier =
752 (accumulated_configuration.distinctiveIdentifier == 756 (accumulated_configuration.distinctiveIdentifier ==
753 blink::WebMediaKeySystemConfiguration::Requirement::Required); 757 blink::WebMediaKeySystemConfiguration::Requirement::Required);
754 cdm_config.allow_persistent_state = 758 cdm_config.allow_persistent_state =
755 (accumulated_configuration.persistentState == 759 (accumulated_configuration.persistentState ==
756 blink::WebMediaKeySystemConfiguration::Requirement::Required); 760 blink::WebMediaKeySystemConfiguration::Requirement::Required);
757 cdm_config.use_hw_secure_codecs = 761 cdm_config.use_hw_secure_codecs =
758 config_state.AreHwSecureCodecsRequired(); 762 config_state.AreHwSecureCodecsRequired();
(...skipping 10 matching lines...) Expand all
769 773
770 void KeySystemConfigSelector::OnPermissionResult( 774 void KeySystemConfigSelector::OnPermissionResult(
771 scoped_ptr<SelectionRequest> request, 775 scoped_ptr<SelectionRequest> request,
772 bool is_permission_granted) { 776 bool is_permission_granted) {
773 request->was_permission_requested = true; 777 request->was_permission_requested = true;
774 request->is_permission_granted = is_permission_granted; 778 request->is_permission_granted = is_permission_granted;
775 SelectConfigInternal(request.Pass()); 779 SelectConfigInternal(request.Pass());
776 } 780 }
777 781
778 } // namespace media 782 } // namespace media
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