OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/common/extensions/csp_validator.h" | 5 #include "chrome/common/extensions/csp_validator.h" |
6 | 6 |
7 #include "base/string_split.h" | 7 #include "base/string_split.h" |
8 #include "base/string_tokenizer.h" | 8 #include "base/string_tokenizer.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 | 10 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 StartsWithASCII(source, "http://localhost:", false) || | 54 StartsWithASCII(source, "http://localhost:", false) || |
55 StartsWithASCII(source, "https://", true) || | 55 StartsWithASCII(source, "https://", true) || |
56 StartsWithASCII(source, "chrome://", true) || | 56 StartsWithASCII(source, "chrome://", true) || |
57 StartsWithASCII(source, "chrome-extension://", true) || | 57 StartsWithASCII(source, "chrome-extension://", true) || |
58 StartsWithASCII(source, "chrome-extension-resource:", true)) { | 58 StartsWithASCII(source, "chrome-extension-resource:", true)) { |
59 continue; | 59 continue; |
60 } | 60 } |
61 | 61 |
62 // crbug.com/146487 | 62 // crbug.com/146487 |
63 if (type == Extension::TYPE_EXTENSION || | 63 if (type == Extension::TYPE_EXTENSION || |
64 type == Extension::TYPE_PACKAGED_APP) { | 64 type == Extension::TYPE_LEGACY_PACKAGED_APP) { |
65 if (source == "'unsafe-eval'") | 65 if (source == "'unsafe-eval'") |
66 continue; | 66 continue; |
67 } | 67 } |
68 | 68 |
69 return false; | 69 return false; |
70 } | 70 } |
71 | 71 |
72 return true; // Empty values default to 'none', which is secure. | 72 return true; // Empty values default to 'none', which is secure. |
73 } | 73 } |
74 | 74 |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 } | 177 } |
178 } | 178 } |
179 } | 179 } |
180 | 180 |
181 return seen_sandbox; | 181 return seen_sandbox; |
182 } | 182 } |
183 | 183 |
184 } // csp_validator | 184 } // csp_validator |
185 | 185 |
186 } // extensions | 186 } // extensions |
OLD | NEW |