OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/webmediaplayer_util.h" | 5 #include "media/blink/webmediaplayer_util.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 // Report the origin from where the media player is created. | 125 // Report the origin from where the media player is created. |
126 if (GetMediaClient()) { | 126 if (GetMediaClient()) { |
127 GURL security_origin_url( | 127 GURL security_origin_url( |
128 blink::WebStringToGURL(security_origin.toString())); | 128 blink::WebStringToGURL(security_origin.toString())); |
129 | 129 |
130 GetMediaClient()->RecordRapporURL( | 130 GetMediaClient()->RecordRapporURL( |
131 "Media.OriginUrl." + LoadTypeToString(load_type), security_origin_url); | 131 "Media.OriginUrl." + LoadTypeToString(load_type), security_origin_url); |
132 | 132 |
133 // For MSE, also report usage by secure/insecure origin. | 133 // For MSE, also report usage by secure/insecure origin. |
134 if (load_type == blink::WebMediaPlayer::LoadTypeMediaSource) { | 134 if (load_type == blink::WebMediaPlayer::LoadTypeMediaSource) { |
135 blink::WebString error_message; | 135 if (security_origin.isPotentiallyTrustworthy()) { |
136 if (security_origin.isPotentiallyTrustworthy(error_message)) { | |
137 GetMediaClient()->RecordRapporURL("Media.OriginUrl.MSE.Secure", | 136 GetMediaClient()->RecordRapporURL("Media.OriginUrl.MSE.Secure", |
138 security_origin_url); | 137 security_origin_url); |
139 } else { | 138 } else { |
140 GetMediaClient()->RecordRapporURL("Media.OriginUrl.MSE.Insecure", | 139 GetMediaClient()->RecordRapporURL("Media.OriginUrl.MSE.Insecure", |
141 security_origin_url); | 140 security_origin_url); |
142 } | 141 } |
143 } | 142 } |
144 } | 143 } |
145 } | 144 } |
146 | 145 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 | 239 |
241 } // namespace | 240 } // namespace |
242 | 241 |
243 SwitchOutputDeviceCB ConvertToSwitchOutputDeviceCB( | 242 SwitchOutputDeviceCB ConvertToSwitchOutputDeviceCB( |
244 blink::WebSetSinkIdCallbacks* web_callbacks) { | 243 blink::WebSetSinkIdCallbacks* web_callbacks) { |
245 return media::BindToCurrentLoop( | 244 return media::BindToCurrentLoop( |
246 base::Bind(RunSetSinkIdCallback, SetSinkIdCallback(web_callbacks))); | 245 base::Bind(RunSetSinkIdCallback, SetSinkIdCallback(web_callbacks))); |
247 } | 246 } |
248 | 247 |
249 } // namespace media | 248 } // namespace media |
OLD | NEW |