| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 return path.substring(0, index); | 64 return path.substring(0, index); |
| 65 return "."; | 65 return "."; |
| 66 } | 66 } |
| 67 | 67 |
| 68 bool DOMFilePath::isParentOf(const String& parent, const String& mayBeChild) { | 68 bool DOMFilePath::isParentOf(const String& parent, const String& mayBeChild) { |
| 69 ASSERT(DOMFilePath::isAbsolute(parent)); | 69 ASSERT(DOMFilePath::isAbsolute(parent)); |
| 70 ASSERT(DOMFilePath::isAbsolute(mayBeChild)); | 70 ASSERT(DOMFilePath::isAbsolute(mayBeChild)); |
| 71 if (parent == DOMFilePath::root && mayBeChild != DOMFilePath::root) | 71 if (parent == DOMFilePath::root && mayBeChild != DOMFilePath::root) |
| 72 return true; | 72 return true; |
| 73 if (parent.length() >= mayBeChild.length() || | 73 if (parent.length() >= mayBeChild.length() || |
| 74 !mayBeChild.startsWith(parent, TextCaseInsensitive)) | 74 !mayBeChild.startsWith(parent, TextCaseUnicodeInsensitive)) |
| 75 return false; | 75 return false; |
| 76 if (mayBeChild[parent.length()] != DOMFilePath::separator) | 76 if (mayBeChild[parent.length()] != DOMFilePath::separator) |
| 77 return false; | 77 return false; |
| 78 return true; | 78 return true; |
| 79 } | 79 } |
| 80 | 80 |
| 81 String DOMFilePath::removeExtraParentReferences(const String& path) { | 81 String DOMFilePath::removeExtraParentReferences(const String& path) { |
| 82 ASSERT(DOMFilePath::isAbsolute(path)); | 82 ASSERT(DOMFilePath::isAbsolute(path)); |
| 83 Vector<String> components; | 83 Vector<String> components; |
| 84 Vector<String> canonicalized; | 84 Vector<String> canonicalized; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 bool DOMFilePath::isValidName(const String& name) { | 132 bool DOMFilePath::isValidName(const String& name) { |
| 133 if (name.isEmpty()) | 133 if (name.isEmpty()) |
| 134 return true; | 134 return true; |
| 135 // '/' is not allowed in name. | 135 // '/' is not allowed in name. |
| 136 if (name.contains('/')) | 136 if (name.contains('/')) |
| 137 return false; | 137 return false; |
| 138 return isValidPath(name); | 138 return isValidPath(name); |
| 139 } | 139 } |
| 140 | 140 |
| 141 } // namespace blink | 141 } // namespace blink |
| OLD | NEW |