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

Side by Side Diff: chrome/browser/media/protected_media_identifier_permission_context.cc

Issue 2859293003: media: Restrict ProtectedMediaIdentifier permission to secure origins (Closed)
Patch Set: Created 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "chrome/browser/media/protected_media_identifier_permission_context.h" 5 #include "chrome/browser/media/protected_media_identifier_permission_context.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/user_metrics.h" 8 #include "base/metrics/user_metrics.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "chrome/browser/content_settings/tab_specific_content_settings.h" 10 #include "chrome/browser/content_settings/tab_specific_content_settings.h"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 // WebContents may have gone away. 138 // WebContents may have gone away.
139 TabSpecificContentSettings* content_settings = 139 TabSpecificContentSettings* content_settings =
140 TabSpecificContentSettings::GetForFrame(id.render_process_id(), 140 TabSpecificContentSettings::GetForFrame(id.render_process_id(),
141 id.render_frame_id()); 141 id.render_frame_id());
142 if (content_settings) { 142 if (content_settings) {
143 content_settings->OnProtectedMediaIdentifierPermissionSet( 143 content_settings->OnProtectedMediaIdentifierPermissionSet(
144 requesting_frame.GetOrigin(), allowed); 144 requesting_frame.GetOrigin(), allowed);
145 } 145 }
146 } 146 }
147 147
148 bool 148 bool ProtectedMediaIdentifierPermissionContext::IsRestrictedToSecureOrigins()
149 ProtectedMediaIdentifierPermissionContext::IsRestrictedToSecureOrigins() const { 149 const {
150 return false; 150 // EME is not supported on insecure origins, see https://goo.gl/Ks5zf7
151 // Note that origins whitelisted by --unsafely-treat-insecure-origin-as-secure
152 // flag will be treated as "secure" so they will not be affected.
153 return true;
151 } 154 }
152 155
153 // TODO(xhwang): We should consolidate the "protected content" related pref 156 // TODO(xhwang): We should consolidate the "protected content" related pref
154 // across platforms. 157 // across platforms.
155 bool ProtectedMediaIdentifierPermissionContext:: 158 bool ProtectedMediaIdentifierPermissionContext::
156 IsProtectedMediaIdentifierEnabled() const { 159 IsProtectedMediaIdentifierEnabled() const {
157 #if defined(OS_CHROMEOS) 160 #if defined(OS_CHROMEOS)
158 // Platform verification is not allowed in incognito or guest mode. 161 // Platform verification is not allowed in incognito or guest mode.
159 if (profile()->IsOffTheRecord() || profile()->IsGuestSession()) { 162 if (profile()->IsOffTheRecord() || profile()->IsGuestSession()) {
160 DVLOG(1) << "Protected media identifier disabled in incognito or guest " 163 DVLOG(1) << "Protected media identifier disabled in incognito or guest "
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 content_setting = CONTENT_SETTING_BLOCK; 227 content_setting = CONTENT_SETTING_BLOCK;
225 persist = true; 228 persist = true;
226 break; 229 break;
227 } 230 }
228 231
229 NotifyPermissionSet( 232 NotifyPermissionSet(
230 id, requesting_origin, embedding_origin, callback, 233 id, requesting_origin, embedding_origin, callback,
231 persist, content_setting); 234 persist, content_setting);
232 } 235 }
233 #endif 236 #endif
OLDNEW
« 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