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

Unified Diff: chrome/browser/permissions/permission_context_base.cc

Issue 2880503002: Block insecure pepper requests (Closed)
Patch Set: Block insecure pepper requests 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/media/webrtc/media_stream_devices_controller_browsertest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/permissions/permission_context_base.cc
diff --git a/chrome/browser/permissions/permission_context_base.cc b/chrome/browser/permissions/permission_context_base.cc
index 776322302c31e92852741a3b92d17d648e41a30b..0e5ac6a0873f5bbfcc05b2bc236ff69f23734567 100644
--- a/chrome/browser/permissions/permission_context_base.cc
+++ b/chrome/browser/permissions/permission_context_base.cc
@@ -225,10 +225,15 @@ PermissionResult PermissionContextBase::GetPermissionStatus(
PermissionStatusSource::KILL_SWITCH);
}
- if (IsRestrictedToSecureOrigins() &&
- !content::IsOriginSecure(requesting_origin)) {
- return PermissionResult(CONTENT_SETTING_BLOCK,
- PermissionStatusSource::UNSPECIFIED);
+ if (IsRestrictedToSecureOrigins()) {
+ // TODO(raymes): We should check the entire chain of embedders here whenever
+ // possible as this corresponds to the requirements of the secure contexts
+ // spec and matches what is implemented in blink.
+ if (!content::IsOriginSecure(requesting_origin) ||
+ !content::IsOriginSecure(embedding_origin)) {
+ return PermissionResult(CONTENT_SETTING_BLOCK,
+ PermissionStatusSource::UNSPECIFIED);
+ }
}
ContentSetting content_setting = GetPermissionStatusInternal(
« no previous file with comments | « chrome/browser/media/webrtc/media_stream_devices_controller_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698