| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium OS 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 /** | 5 /** |
| 6 * Check the validity of the policy extension manifest. | 6 * Check the validity of the policy extension manifest. |
| 7 * | 7 * |
| 8 * This function is invoked by entd before the policy is loaded in order to | 8 * This function is invoked by entd before the policy is loaded in order to |
| 9 * check the validity of the extension manifest. If this function returns | 9 * check the validity of the extension manifest. If this function returns |
| 10 * false, entd exits and does not restart until the next user logs in. | 10 * false, entd exits and does not restart until the next user logs in. |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 } | 45 } |
| 46 | 46 |
| 47 if (manifest.permissions) { | 47 if (manifest.permissions) { |
| 48 perms = manifest.permissions; | 48 perms = manifest.permissions; |
| 49 if (typeof perms == "string") | 49 if (typeof perms == "string") |
| 50 perms = [ perms ]; | 50 perms = [ perms ]; |
| 51 | 51 |
| 52 if (!(perms instanceof Array)) | 52 if (!(perms instanceof Array)) |
| 53 return fail('Invalid type for permissions: ' + perms); | 53 return fail('Invalid type for permissions: ' + perms); |
| 54 | 54 |
| 55 if (perms.length != 1 || perms[0].indexOf("http://127.0.0.1") != 0) | 55 if (perms.length != 1 || perms[0].indexOf("http://127.0.0.1/") != 0) |
| 56 return fail('Invalid permissions: ' + perms); | 56 return fail('Invalid permissions: ' + perms); |
| 57 } | 57 } |
| 58 | 58 |
| 59 return true; | 59 return true; |
| 60 } | 60 } |
| 61 | 61 |
| 62 entd.http.RESPONSE_OK = 200; | 62 entd.http.RESPONSE_OK = 200; |
| 63 | 63 |
| 64 /** | 64 /** |
| 65 * Policy constructor. | 65 * Policy constructor. |
| (...skipping 1650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1716 return str; | 1716 return str; |
| 1717 } | 1717 } |
| 1718 | 1718 |
| 1719 /** | 1719 /** |
| 1720 * Detect a raw string. | 1720 * Detect a raw string. |
| 1721 */ | 1721 */ |
| 1722 util.isRawString = | 1722 util.isRawString = |
| 1723 function isRawString(str) { | 1723 function isRawString(str) { |
| 1724 return str instanceof String && str.isRaw_ == true; | 1724 return str instanceof String && str.isRaw_ == true; |
| 1725 } | 1725 } |
| OLD | NEW |