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" |
11 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
12 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
13 #include "media/base/key_systems.h" | 13 #include "media/base/key_systems.h" |
14 #include "media/base/media_client.h" | 14 #include "media/base/media_client.h" |
15 #include "media/base/media_permission.h" | 15 #include "media/base/media_permission.h" |
16 #include "media/blink/webcontentdecryptionmodule_impl.h" | 16 #include "media/blink/webcontentdecryptionmodule_impl.h" |
17 #include "media/blink/webcontentdecryptionmoduleaccess_impl.h" | 17 #include "media/blink/webcontentdecryptionmoduleaccess_impl.h" |
| 18 #include "third_party/WebKit/public/platform/URLConversion.h" |
18 #include "third_party/WebKit/public/platform/WebContentDecryptionModuleResult.h" | 19 #include "third_party/WebKit/public/platform/WebContentDecryptionModuleResult.h" |
19 #include "third_party/WebKit/public/platform/WebEncryptedMediaRequest.h" | 20 #include "third_party/WebKit/public/platform/WebEncryptedMediaRequest.h" |
20 #include "third_party/WebKit/public/platform/WebMediaKeySystemConfiguration.h" | 21 #include "third_party/WebKit/public/platform/WebMediaKeySystemConfiguration.h" |
21 #include "third_party/WebKit/public/platform/WebString.h" | 22 #include "third_party/WebKit/public/platform/WebString.h" |
22 #include "third_party/WebKit/public/web/WebSecurityOrigin.h" | 23 #include "third_party/WebKit/public/web/WebSecurityOrigin.h" |
23 | 24 |
24 namespace media { | 25 namespace media { |
25 | 26 |
26 namespace { | 27 namespace { |
27 | 28 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 } | 94 } |
94 | 95 |
95 WebEncryptedMediaClientImpl::~WebEncryptedMediaClientImpl() { | 96 WebEncryptedMediaClientImpl::~WebEncryptedMediaClientImpl() { |
96 } | 97 } |
97 | 98 |
98 void WebEncryptedMediaClientImpl::requestMediaKeySystemAccess( | 99 void WebEncryptedMediaClientImpl::requestMediaKeySystemAccess( |
99 blink::WebEncryptedMediaRequest request) { | 100 blink::WebEncryptedMediaRequest request) { |
100 GetReporter(request.keySystem())->ReportRequested(); | 101 GetReporter(request.keySystem())->ReportRequested(); |
101 | 102 |
102 if (GetMediaClient()) { | 103 if (GetMediaClient()) { |
103 GURL security_origin(request.securityOrigin().toString()); | 104 GURL security_origin( |
| 105 blink::WebStringToGURL(request.securityOrigin().toString())); |
104 | 106 |
105 GetMediaClient()->RecordRapporURL("Media.OriginUrl.EME", security_origin); | 107 GetMediaClient()->RecordRapporURL("Media.OriginUrl.EME", security_origin); |
106 | 108 |
107 blink::WebString error_message; | 109 blink::WebString error_message; |
108 if (!request.securityOrigin().isPotentiallyTrustworthy(error_message)) { | 110 if (!request.securityOrigin().isPotentiallyTrustworthy(error_message)) { |
109 GetMediaClient()->RecordRapporURL("Media.OriginUrl.EME.Insecure", | 111 GetMediaClient()->RecordRapporURL("Media.OriginUrl.EME.Insecure", |
110 security_origin); | 112 security_origin); |
111 } | 113 } |
112 } | 114 } |
113 | 115 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 std::string uma_name = GetKeySystemNameForUMA(key_system_ascii); | 161 std::string uma_name = GetKeySystemNameForUMA(key_system_ascii); |
160 Reporter* reporter = reporters_.get(uma_name); | 162 Reporter* reporter = reporters_.get(uma_name); |
161 if (!reporter) { | 163 if (!reporter) { |
162 reporter = new Reporter(uma_name); | 164 reporter = new Reporter(uma_name); |
163 reporters_.add(uma_name, make_scoped_ptr(reporter)); | 165 reporters_.add(uma_name, make_scoped_ptr(reporter)); |
164 } | 166 } |
165 return reporter; | 167 return reporter; |
166 } | 168 } |
167 | 169 |
168 } // namespace media | 170 } // namespace media |
OLD | NEW |