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

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

Issue 27073003: CSP Suborigins Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 2 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 { 72 {
73 m_sandboxFlags |= mask; 73 m_sandboxFlags |= mask;
74 74
75 // The SandboxOrigin is stored redundantly in the security origin. 75 // The SandboxOrigin is stored redundantly in the security origin.
76 if (isSandboxed(SandboxOrigin) && securityOrigin() && !securityOrigin()->isU nique()) { 76 if (isSandboxed(SandboxOrigin) && securityOrigin() && !securityOrigin()->isU nique()) {
77 setSecurityOrigin(SecurityOrigin::createUnique()); 77 setSecurityOrigin(SecurityOrigin::createUnique());
78 didUpdateSecurityOrigin(); 78 didUpdateSecurityOrigin();
79 } 79 }
80 } 80 }
81 81
82 void SecurityContext::enforceSuboriginFlags(const SuboriginFlags& mask)
83 {
84 }
85
82 void SecurityContext::didUpdateSecurityOrigin() 86 void SecurityContext::didUpdateSecurityOrigin()
83 { 87 {
84 // Subclasses can override this function if the need to do extra work when t he security origin changes. 88 // Subclasses can override this function if the need to do extra work when t he security origin changes.
85 } 89 }
86 90
87 SandboxFlags SecurityContext::parseSandboxPolicy(const String& policy, String& i nvalidTokensErrorMessage) 91 SandboxFlags SecurityContext::parseSandboxPolicy(const String& policy, String& i nvalidTokensErrorMessage)
88 { 92 {
89 // http://www.w3.org/TR/html5/the-iframe-element.html#attr-iframe-sandbox 93 // http://www.w3.org/TR/html5/the-iframe-element.html#attr-iframe-sandbox
90 // Parse the unordered set of unique space-separated tokens. 94 // Parse the unordered set of unique space-separated tokens.
91 SandboxFlags flags = SandboxAll; 95 SandboxFlags flags = SandboxAll;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 if (numberOfTokenErrors > 1) 138 if (numberOfTokenErrors > 1)
135 tokenErrors.appendLiteral(" are invalid sandbox flags."); 139 tokenErrors.appendLiteral(" are invalid sandbox flags.");
136 else 140 else
137 tokenErrors.appendLiteral(" is an invalid sandbox flag."); 141 tokenErrors.appendLiteral(" is an invalid sandbox flag.");
138 invalidTokensErrorMessage = tokenErrors.toString(); 142 invalidTokensErrorMessage = tokenErrors.toString();
139 } 143 }
140 144
141 return flags; 145 return flags;
142 } 146 }
143 147
148 SuboriginFlags SecurityContext::parseSuboriginPolicy(const String& policy, Strin g& invalidTokensErrorMessage)
149 {
150 return String("my-suborigin-name");
144 } 151 }
152
153 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698