| OLD | NEW |
| 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 "media/blink/webencryptedmediaclient_impl.h" | 5 #include "media/blink/webencryptedmediaclient_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 void WebEncryptedMediaClientImpl::requestMediaKeySystemAccess( | 99 void WebEncryptedMediaClientImpl::requestMediaKeySystemAccess( |
| 100 blink::WebEncryptedMediaRequest request) { | 100 blink::WebEncryptedMediaRequest request) { |
| 101 GetReporter(request.keySystem())->ReportRequested(); | 101 GetReporter(request.keySystem())->ReportRequested(); |
| 102 | 102 |
| 103 if (GetMediaClient()) { | 103 if (GetMediaClient()) { |
| 104 GURL security_origin( | 104 GURL security_origin( |
| 105 blink::WebStringToGURL(request.securityOrigin().toString())); | 105 blink::WebStringToGURL(request.securityOrigin().toString())); |
| 106 | 106 |
| 107 GetMediaClient()->RecordRapporURL("Media.OriginUrl.EME", security_origin); | 107 GetMediaClient()->RecordRapporURL("Media.OriginUrl.EME", security_origin); |
| 108 | 108 |
| 109 blink::WebString error_message; | 109 if (!request.securityOrigin().isPotentiallyTrustworthy()) { |
| 110 if (!request.securityOrigin().isPotentiallyTrustworthy(error_message)) { | |
| 111 GetMediaClient()->RecordRapporURL("Media.OriginUrl.EME.Insecure", | 110 GetMediaClient()->RecordRapporURL("Media.OriginUrl.EME.Insecure", |
| 112 security_origin); | 111 security_origin); |
| 113 } | 112 } |
| 114 } | 113 } |
| 115 | 114 |
| 116 key_system_config_selector_.SelectConfig( | 115 key_system_config_selector_.SelectConfig( |
| 117 request.keySystem(), request.supportedConfigurations(), | 116 request.keySystem(), request.supportedConfigurations(), |
| 118 request.securityOrigin(), are_secure_codecs_supported_cb_.Run(), | 117 request.securityOrigin(), are_secure_codecs_supported_cb_.Run(), |
| 119 base::Bind(&WebEncryptedMediaClientImpl::OnRequestSucceeded, | 118 base::Bind(&WebEncryptedMediaClientImpl::OnRequestSucceeded, |
| 120 weak_factory_.GetWeakPtr(), request), | 119 weak_factory_.GetWeakPtr(), request), |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 std::string uma_name = GetKeySystemNameForUMA(key_system_ascii); | 160 std::string uma_name = GetKeySystemNameForUMA(key_system_ascii); |
| 162 Reporter* reporter = reporters_.get(uma_name); | 161 Reporter* reporter = reporters_.get(uma_name); |
| 163 if (!reporter) { | 162 if (!reporter) { |
| 164 reporter = new Reporter(uma_name); | 163 reporter = new Reporter(uma_name); |
| 165 reporters_.add(uma_name, make_scoped_ptr(reporter)); | 164 reporters_.add(uma_name, make_scoped_ptr(reporter)); |
| 166 } | 165 } |
| 167 return reporter; | 166 return reporter; |
| 168 } | 167 } |
| 169 | 168 |
| 170 } // namespace media | 169 } // namespace media |
| OLD | NEW |