| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All Rights Reserved. | 2 * Copyright (C) 2013 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 11 matching lines...) Expand all Loading... |
| 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 * | 24 * |
| 25 */ | 25 */ |
| 26 | 26 |
| 27 #include "core/dom/SandboxFlags.h" | 27 #include "core/dom/SandboxFlags.h" |
| 28 | 28 |
| 29 #include "core/html/HTMLIFrameElement.h" | 29 #include "core/html/HTMLIFrameElement.h" |
| 30 #include "core/html/parser/HTMLParserIdioms.h" | 30 #include "core/html/parser/HTMLParserIdioms.h" |
| 31 #include "platform/RuntimeEnabledFeatures.h" | 31 #include "platform/RuntimeEnabledFeatures.h" |
| 32 #include "wtf/text/StringBuilder.h" | 32 #include "platform/wtf/text/StringBuilder.h" |
| 33 | 33 |
| 34 namespace blink { | 34 namespace blink { |
| 35 | 35 |
| 36 SandboxFlags ParseSandboxPolicy(const SpaceSplitString& policy, | 36 SandboxFlags ParseSandboxPolicy(const SpaceSplitString& policy, |
| 37 String& invalid_tokens_error_message) { | 37 String& invalid_tokens_error_message) { |
| 38 // http://www.w3.org/TR/html5/the-iframe-element.html#attr-iframe-sandbox | 38 // http://www.w3.org/TR/html5/the-iframe-element.html#attr-iframe-sandbox |
| 39 // Parse the unordered set of unique space-separated tokens. | 39 // Parse the unordered set of unique space-separated tokens. |
| 40 SandboxFlags flags = kSandboxAll; | 40 SandboxFlags flags = kSandboxAll; |
| 41 unsigned length = policy.size(); | 41 unsigned length = policy.size(); |
| 42 unsigned number_of_token_errors = 0; | 42 unsigned number_of_token_errors = 0; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 token_errors.Append(number_of_token_errors > 1 | 88 token_errors.Append(number_of_token_errors > 1 |
| 89 ? " are invalid sandbox flags." | 89 ? " are invalid sandbox flags." |
| 90 : " is an invalid sandbox flag."); | 90 : " is an invalid sandbox flag."); |
| 91 invalid_tokens_error_message = token_errors.ToString(); | 91 invalid_tokens_error_message = token_errors.ToString(); |
| 92 } | 92 } |
| 93 | 93 |
| 94 return flags; | 94 return flags; |
| 95 } | 95 } |
| 96 | 96 |
| 97 } // namespace blink | 97 } // namespace blink |
| OLD | NEW |