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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 } else if (equalIgnoringCase(sandboxToken, "allow-top-navigation")) { | 61 } else if (equalIgnoringCase(sandboxToken, "allow-top-navigation")) { |
62 flags &= ~SandboxTopNavigation; | 62 flags &= ~SandboxTopNavigation; |
63 } else if (equalIgnoringCase(sandboxToken, "allow-popups")) { | 63 } else if (equalIgnoringCase(sandboxToken, "allow-popups")) { |
64 flags &= ~SandboxPopups; | 64 flags &= ~SandboxPopups; |
65 } else if (equalIgnoringCase(sandboxToken, "allow-pointer-lock")) { | 65 } else if (equalIgnoringCase(sandboxToken, "allow-pointer-lock")) { |
66 flags &= ~SandboxPointerLock; | 66 flags &= ~SandboxPointerLock; |
67 } else if (equalIgnoringCase(sandboxToken, "allow-orientation-lock")) { | 67 } else if (equalIgnoringCase(sandboxToken, "allow-orientation-lock")) { |
68 flags &= ~SandboxOrientationLock; | 68 flags &= ~SandboxOrientationLock; |
69 } else if (equalIgnoringCase(sandboxToken, "allow-unsandboxed-auxiliary"
) && RuntimeEnabledFeatures::unsandboxedAuxiliaryEnabled()) { | 69 } else if (equalIgnoringCase(sandboxToken, "allow-unsandboxed-auxiliary"
) && RuntimeEnabledFeatures::unsandboxedAuxiliaryEnabled()) { |
70 flags &= ~SandboxPropagatesToAuxiliaryBrowsingContexts; | 70 flags &= ~SandboxPropagatesToAuxiliaryBrowsingContexts; |
| 71 } else if (equalIgnoringCase(sandboxToken, "allow-modals") && RuntimeEna
bledFeatures::sandboxBlocksModalsEnabled()) { |
| 72 flags &= ~SandboxModals; |
71 } else { | 73 } else { |
72 if (numberOfTokenErrors) | 74 if (numberOfTokenErrors) |
73 tokenErrors.appendLiteral(", '"); | 75 tokenErrors.appendLiteral(", '"); |
74 else | 76 else |
75 tokenErrors.append('\''); | 77 tokenErrors.append('\''); |
76 tokenErrors.append(sandboxToken); | 78 tokenErrors.append(sandboxToken); |
77 tokenErrors.append('\''); | 79 tokenErrors.append('\''); |
78 numberOfTokenErrors++; | 80 numberOfTokenErrors++; |
79 } | 81 } |
80 } | 82 } |
81 | 83 |
82 if (numberOfTokenErrors) { | 84 if (numberOfTokenErrors) { |
83 if (numberOfTokenErrors > 1) | 85 if (numberOfTokenErrors > 1) |
84 tokenErrors.appendLiteral(" are invalid sandbox flags."); | 86 tokenErrors.appendLiteral(" are invalid sandbox flags."); |
85 else | 87 else |
86 tokenErrors.appendLiteral(" is an invalid sandbox flag."); | 88 tokenErrors.appendLiteral(" is an invalid sandbox flag."); |
87 invalidTokensErrorMessage = tokenErrors.toString(); | 89 invalidTokensErrorMessage = tokenErrors.toString(); |
88 } | 90 } |
89 | 91 |
90 return flags; | 92 return flags; |
91 } | 93 } |
92 | 94 |
93 } | 95 } |
OLD | NEW |