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

Unified 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, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/key_system_config_selector.cc
diff --git a/media/blink/key_system_config_selector.cc b/media/blink/key_system_config_selector.cc
index ff53449d83c8a3aedf4a83c0f541370be0129cde..29fe49288c50ef1e3352ce6347c3c2b33449e440 100644
--- a/media/blink/key_system_config_selector.cc
+++ b/media/blink/key_system_config_selector.cc
@@ -741,11 +741,15 @@ void KeySystemConfigSelector::SelectConfigInternal(
<< "permission was denied.";
continue;
}
- media_permission_->RequestPermission(
- MediaPermission::PROTECTED_MEDIA_IDENTIFIER,
- GURL(request->security_origin.toString()),
- base::Bind(&KeySystemConfigSelector::OnPermissionResult,
- weak_factory_.GetWeakPtr(), base::Passed(&request)));
+ {
+ // Note: the GURL must not be constructed inline because
+ // base::Passed(&request) sets |request| to null.
+ GURL security_origin(request->security_origin.toString());
+ media_permission_->RequestPermission(
+ MediaPermission::PROTECTED_MEDIA_IDENTIFIER, security_origin,
+ base::Bind(&KeySystemConfigSelector::OnPermissionResult,
+ weak_factory_.GetWeakPtr(), base::Passed(&request)));
+ }
return;
case CONFIGURATION_SUPPORTED:
cdm_config.allow_distinctive_identifier =
« 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