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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 } else if (equalIgnoringCase(sandboxToken, "allow-orientation-lock")) { | 60 } else if (equalIgnoringCase(sandboxToken, "allow-orientation-lock")) { |
61 flags &= ~SandboxOrientationLock; | 61 flags &= ~SandboxOrientationLock; |
62 } else if (equalIgnoringCase(sandboxToken, "allow-popups-to-escape-sandb
ox") && RuntimeEnabledFeatures::unsandboxedAuxiliaryEnabled()) { | 62 } else if (equalIgnoringCase(sandboxToken, "allow-popups-to-escape-sandb
ox") && RuntimeEnabledFeatures::unsandboxedAuxiliaryEnabled()) { |
63 flags &= ~SandboxPropagatesToAuxiliaryBrowsingContexts; | 63 flags &= ~SandboxPropagatesToAuxiliaryBrowsingContexts; |
64 } else if (equalIgnoringCase(sandboxToken, "allow-modals") && RuntimeEna
bledFeatures::sandboxBlocksModalsEnabled()) { | 64 } else if (equalIgnoringCase(sandboxToken, "allow-modals") && RuntimeEna
bledFeatures::sandboxBlocksModalsEnabled()) { |
65 flags &= ~SandboxModals; | 65 flags &= ~SandboxModals; |
66 } else if (equalIgnoringCase(sandboxToken, "allow-presentation")) { | 66 } else if (equalIgnoringCase(sandboxToken, "allow-presentation")) { |
67 flags &= ~SandboxPresentation; | 67 flags &= ~SandboxPresentation; |
68 } else { | 68 } else { |
69 if (numberOfTokenErrors) | 69 if (numberOfTokenErrors) |
70 tokenErrors.append(", '"); | 70 tokenErrors.appendLiteral(", '"); |
71 else | 71 else |
72 tokenErrors.append('\''); | 72 tokenErrors.append('\''); |
73 tokenErrors.append(sandboxToken); | 73 tokenErrors.append(sandboxToken); |
74 tokenErrors.append('\''); | 74 tokenErrors.append('\''); |
75 numberOfTokenErrors++; | 75 numberOfTokenErrors++; |
76 } | 76 } |
77 } | 77 } |
78 | 78 |
79 if (numberOfTokenErrors) { | 79 if (numberOfTokenErrors) { |
80 if (numberOfTokenErrors > 1) | 80 if (numberOfTokenErrors > 1) |
81 tokenErrors.append(" are invalid sandbox flags."); | 81 tokenErrors.appendLiteral(" are invalid sandbox flags."); |
82 else | 82 else |
83 tokenErrors.append(" is an invalid sandbox flag."); | 83 tokenErrors.appendLiteral(" is an invalid sandbox flag."); |
84 invalidTokensErrorMessage = tokenErrors.toString(); | 84 invalidTokensErrorMessage = tokenErrors.toString(); |
85 } | 85 } |
86 | 86 |
87 return flags; | 87 return flags; |
88 } | 88 } |
89 | 89 |
90 } // namespace blink | 90 } // namespace blink |
OLD | NEW |