OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSDstyle license that can be | 2 // Use of this source code is governed by a BSDstyle license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/html/HTMLIFrameElementPermissions.h" | 5 #include "core/html/HTMLIFrameElementPermissions.h" |
6 | 6 |
7 #include "core/html/HTMLIFrameElement.h" | 7 #include "core/html/HTMLIFrameElement.h" |
8 #include "wtf/HashMap.h" | 8 #include "wtf/HashMap.h" |
9 #include "wtf/text/StringBuilder.h" | 9 #include "wtf/text/StringBuilder.h" |
10 | 10 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 HTMLIFrameElementPermissions::parseDelegatedPermissions( | 53 HTMLIFrameElementPermissions::parseDelegatedPermissions( |
54 String& invalidTokensErrorMessage) const { | 54 String& invalidTokensErrorMessage) const { |
55 Vector<WebPermissionType> permissions; | 55 Vector<WebPermissionType> permissions; |
56 unsigned numTokenErrors = 0; | 56 unsigned numTokenErrors = 0; |
57 StringBuilder tokenErrors; | 57 StringBuilder tokenErrors; |
58 const SpaceSplitString& tokens = this->tokens(); | 58 const SpaceSplitString& tokens = this->tokens(); |
59 | 59 |
60 for (size_t i = 0; i < tokens.size(); ++i) { | 60 for (size_t i = 0; i < tokens.size(); ++i) { |
61 WebPermissionType type; | 61 WebPermissionType type; |
62 if (getPermissionType(tokens[i], &type)) { | 62 if (getPermissionType(tokens[i], &type)) { |
63 permissions.append(type); | 63 permissions.push_back(type); |
64 } else { | 64 } else { |
65 if (numTokenErrors) | 65 if (numTokenErrors) |
66 tokenErrors.append(", '"); | 66 tokenErrors.append(", '"); |
67 else | 67 else |
68 tokenErrors.append('\''); | 68 tokenErrors.append('\''); |
69 tokenErrors.append(tokens[i]); | 69 tokenErrors.append(tokens[i]); |
70 tokenErrors.append('\''); | 70 tokenErrors.append('\''); |
71 ++numTokenErrors; | 71 ++numTokenErrors; |
72 } | 72 } |
73 } | 73 } |
(...skipping 15 matching lines...) Expand all Loading... |
89 WebPermissionType unused; | 89 WebPermissionType unused; |
90 return getPermissionType(tokenValue, &unused); | 90 return getPermissionType(tokenValue, &unused); |
91 } | 91 } |
92 | 92 |
93 void HTMLIFrameElementPermissions::valueWasSet() { | 93 void HTMLIFrameElementPermissions::valueWasSet() { |
94 if (m_element) | 94 if (m_element) |
95 m_element->permissionsValueWasSet(); | 95 m_element->permissionsValueWasSet(); |
96 } | 96 } |
97 | 97 |
98 } // namespace blink | 98 } // namespace blink |
OLD | NEW |