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

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

Issue 2557063002: Upgrade Insecure Requests: bugfixes, tests, and support for OOPIF.
Patch Set: Addressed comments (@nasko #2). Created 4 years 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 14 matching lines...) Expand all
25 */ 25 */
26 26
27 #include "core/dom/SecurityContext.h" 27 #include "core/dom/SecurityContext.h"
28 28
29 #include "core/frame/csp/ContentSecurityPolicy.h" 29 #include "core/frame/csp/ContentSecurityPolicy.h"
30 #include "platform/RuntimeEnabledFeatures.h" 30 #include "platform/RuntimeEnabledFeatures.h"
31 #include "platform/weborigin/SecurityOrigin.h" 31 #include "platform/weborigin/SecurityOrigin.h"
32 32
33 namespace blink { 33 namespace blink {
34 34
35 // static
36 std::vector<unsigned> SecurityContext::serializeInsecureNavigationSet(
37 const InsecureNavigationsSet& set) {
38 // The set is serialized as a sorted vector.
39 std::vector<unsigned> serialized;
40 serialized.reserve(set.size());
41 for (unsigned host : set)
42 serialized.push_back(host);
43 std::sort(serialized.begin(), serialized.end());
44
45 return serialized;
46 }
47
35 SecurityContext::SecurityContext() 48 SecurityContext::SecurityContext()
36 : m_sandboxFlags(SandboxNone), 49 : m_sandboxFlags(SandboxNone),
37 m_addressSpace(WebAddressSpacePublic), 50 m_addressSpace(WebAddressSpacePublic),
38 m_insecureRequestPolicy(kLeaveInsecureRequestsAlone) {} 51 m_insecureRequestPolicy(kLeaveInsecureRequestsAlone) {}
39 52
40 SecurityContext::~SecurityContext() {} 53 SecurityContext::~SecurityContext() {}
41 54
42 DEFINE_TRACE(SecurityContext) { 55 DEFINE_TRACE(SecurityContext) {
43 visitor->trace(m_contentSecurityPolicy); 56 visitor->trace(m_contentSecurityPolicy);
44 } 57 }
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 void SecurityContext::setFeaturePolicyFromHeader( 115 void SecurityContext::setFeaturePolicyFromHeader(
103 const WebParsedFeaturePolicy& parsedHeader, 116 const WebParsedFeaturePolicy& parsedHeader,
104 FeaturePolicy* parentFeaturePolicy) { 117 FeaturePolicy* parentFeaturePolicy) {
105 DCHECK(!m_featurePolicy); 118 DCHECK(!m_featurePolicy);
106 m_featurePolicy = FeaturePolicy::createFromParentPolicy(parentFeaturePolicy, 119 m_featurePolicy = FeaturePolicy::createFromParentPolicy(parentFeaturePolicy,
107 m_securityOrigin); 120 m_securityOrigin);
108 m_featurePolicy->setHeaderPolicy(parsedHeader); 121 m_featurePolicy->setHeaderPolicy(parsedHeader);
109 } 122 }
110 123
111 } // namespace blink 124 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/SecurityContext.h ('k') | third_party/WebKit/Source/core/frame/Frame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698