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

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

Issue 1035573005: Change a bool type to an enum type in constructor argument of SpaceSplitString. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Move enum struct to SpaceSplitString and rename. Created 5 years, 9 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
« no previous file with comments | « Source/core/dom/ElementData.h ('k') | Source/core/dom/SpaceSplitString.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 16 matching lines...) Expand all
27 #include "config.h" 27 #include "config.h"
28 #include "core/dom/SandboxFlags.h" 28 #include "core/dom/SandboxFlags.h"
29 29
30 #include "core/html/parser/HTMLParserIdioms.h" 30 #include "core/html/parser/HTMLParserIdioms.h"
31 #include "wtf/text/StringBuilder.h" 31 #include "wtf/text/StringBuilder.h"
32 32
33 namespace blink { 33 namespace blink {
34 34
35 SandboxFlags parseSandboxPolicy(const String& policy, String& invalidTokensError Message) 35 SandboxFlags parseSandboxPolicy(const String& policy, String& invalidTokensError Message)
36 { 36 {
37 const bool shouldFoldCase = false; 37 SpaceSplitString policyTokens(AtomicString(policy), SpaceSplitString::Should NotFoldCase);
38 SpaceSplitString policyTokens(AtomicString(policy), shouldFoldCase);
39 return parseSandboxPolicy(policyTokens, invalidTokensErrorMessage); 38 return parseSandboxPolicy(policyTokens, invalidTokensErrorMessage);
40 } 39 }
41 40
42 SandboxFlags parseSandboxPolicy(const SpaceSplitString& policy, String& invalidT okensErrorMessage) 41 SandboxFlags parseSandboxPolicy(const SpaceSplitString& policy, String& invalidT okensErrorMessage)
43 { 42 {
44 // http://www.w3.org/TR/html5/the-iframe-element.html#attr-iframe-sandbox 43 // http://www.w3.org/TR/html5/the-iframe-element.html#attr-iframe-sandbox
45 // Parse the unordered set of unique space-separated tokens. 44 // Parse the unordered set of unique space-separated tokens.
46 SandboxFlags flags = SandboxAll; 45 SandboxFlags flags = SandboxAll;
47 unsigned length = policy.size(); 46 unsigned length = policy.size();
48 unsigned numberOfTokenErrors = 0; 47 unsigned numberOfTokenErrors = 0;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 tokenErrors.appendLiteral(" are invalid sandbox flags."); 81 tokenErrors.appendLiteral(" are invalid sandbox flags.");
83 else 82 else
84 tokenErrors.appendLiteral(" is an invalid sandbox flag."); 83 tokenErrors.appendLiteral(" is an invalid sandbox flag.");
85 invalidTokensErrorMessage = tokenErrors.toString(); 84 invalidTokensErrorMessage = tokenErrors.toString();
86 } 85 }
87 86
88 return flags; 87 return flags;
89 } 88 }
90 89
91 } 90 }
OLDNEW
« no previous file with comments | « Source/core/dom/ElementData.h ('k') | Source/core/dom/SpaceSplitString.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698