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

Side by Side Diff: third_party/WebKit/Source/core/dom/SecurityContext.cpp

Issue 2905113002: Initialize a default feature policy for all documents (Closed)
Patch Set: Nits 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All Rights Reserved. 2 * Copyright (C) 2011 Google Inc. All Rights Reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 DCHECK(!security_origin_->HasSuborigin() || 98 DCHECK(!security_origin_->HasSuborigin() ||
99 security_origin_->GetSuborigin()->GetName() == suborigin.GetName()); 99 security_origin_->GetSuborigin()->GetName() == suborigin.GetName());
100 security_origin_->AddSuborigin(suborigin); 100 security_origin_->AddSuborigin(suborigin);
101 DidUpdateSecurityOrigin(); 101 DidUpdateSecurityOrigin();
102 } 102 }
103 103
104 void SecurityContext::InitializeFeaturePolicy( 104 void SecurityContext::InitializeFeaturePolicy(
105 const WebParsedFeaturePolicy& parsed_header, 105 const WebParsedFeaturePolicy& parsed_header,
106 const WebParsedFeaturePolicy& container_policy, 106 const WebParsedFeaturePolicy& container_policy,
107 const WebFeaturePolicy* parent_feature_policy) { 107 const WebFeaturePolicy* parent_feature_policy) {
108 DCHECK(!feature_policy_);
109 WebSecurityOrigin origin = WebSecurityOrigin(security_origin_); 108 WebSecurityOrigin origin = WebSecurityOrigin(security_origin_);
110 feature_policy_ = Platform::Current()->CreateFeaturePolicy( 109 feature_policy_ = Platform::Current()->CreateFeaturePolicy(
111 parent_feature_policy, container_policy, parsed_header, origin); 110 parent_feature_policy, container_policy, parsed_header, origin);
112 } 111 }
113 112
114 void SecurityContext::UpdateFeaturePolicyOrigin() { 113 void SecurityContext::UpdateFeaturePolicyOrigin() {
115 if (!feature_policy_) 114 if (!feature_policy_)
116 return; 115 return;
117 feature_policy_ = Platform::Current()->DuplicateFeaturePolicyWithOrigin( 116 feature_policy_ = Platform::Current()->DuplicateFeaturePolicyWithOrigin(
118 *feature_policy_, WebSecurityOrigin(security_origin_)); 117 *feature_policy_, WebSecurityOrigin(security_origin_));
119 } 118 }
120 119
121 } // namespace blink 120 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | third_party/WebKit/Source/core/loader/DocumentLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698