| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 } | 93 } |
| 94 | 94 |
| 95 WebEncryptedMediaClientImpl::~WebEncryptedMediaClientImpl() { | 95 WebEncryptedMediaClientImpl::~WebEncryptedMediaClientImpl() { |
| 96 } | 96 } |
| 97 | 97 |
| 98 void WebEncryptedMediaClientImpl::requestMediaKeySystemAccess( | 98 void WebEncryptedMediaClientImpl::requestMediaKeySystemAccess( |
| 99 blink::WebEncryptedMediaRequest request) { | 99 blink::WebEncryptedMediaRequest request) { |
| 100 GetReporter(request.keySystem())->ReportRequested(); | 100 GetReporter(request.keySystem())->ReportRequested(); |
| 101 | 101 |
| 102 if (GetMediaClient()) { | 102 if (GetMediaClient()) { |
| 103 GURL security_origin(request.securityOrigin().toString()); | 103 GURL security_origin(base::string16(request.securityOrigin().toString())); |
| 104 | 104 |
| 105 GetMediaClient()->RecordRapporURL("Media.OriginUrl.EME", security_origin); | 105 GetMediaClient()->RecordRapporURL("Media.OriginUrl.EME", security_origin); |
| 106 | 106 |
| 107 blink::WebString error_message; | 107 blink::WebString error_message; |
| 108 if (!request.securityOrigin().isPotentiallyTrustworthy(error_message)) { | 108 if (!request.securityOrigin().isPotentiallyTrustworthy(error_message)) { |
| 109 GetMediaClient()->RecordRapporURL("Media.OriginUrl.EME.Insecure", | 109 GetMediaClient()->RecordRapporURL("Media.OriginUrl.EME.Insecure", |
| 110 security_origin); | 110 security_origin); |
| 111 } | 111 } |
| 112 } | 112 } |
| 113 | 113 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 std::string uma_name = GetKeySystemNameForUMA(key_system_ascii); | 159 std::string uma_name = GetKeySystemNameForUMA(key_system_ascii); |
| 160 Reporter* reporter = reporters_.get(uma_name); | 160 Reporter* reporter = reporters_.get(uma_name); |
| 161 if (!reporter) { | 161 if (!reporter) { |
| 162 reporter = new Reporter(uma_name); | 162 reporter = new Reporter(uma_name); |
| 163 reporters_.add(uma_name, make_scoped_ptr(reporter)); | 163 reporters_.add(uma_name, make_scoped_ptr(reporter)); |
| 164 } | 164 } |
| 165 return reporter; | 165 return reporter; |
| 166 } | 166 } |
| 167 | 167 |
| 168 } // namespace media | 168 } // namespace media |
| OLD | NEW |