Code:    bool HasPermissionsForFile(const FilePath& file, int permissions) {
     FilePath current_path = file.StripTrailingSeparators();
     FilePath last_path;
     while (current_path != last_path) {
      if (file_permissions_.find(current_path) != file_permissions_.end())
        return (file_permissions_[current_path] & permissions) == permissions;
       last_path = current_path;
       current_path = current_path.DirName();
     }

    return false;
  }

Commit Message: Apply missing kParentDirectory check

BUG=161564

Review URL: https://chromiumcodereview.appspot.com/11414046

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168692 0039d316-1c4b-4281-b951-d872f2087c98
CWE ID: 
   bool HasPermissionsForFile(const FilePath& file, int permissions) {
     FilePath current_path = file.StripTrailingSeparators();
     FilePath last_path;
    int skip = 0;
     while (current_path != last_path) {
      FilePath base_name =  current_path.BaseName();
      if (base_name.value() == FilePath::kParentDirectory) {
        ++skip;
      } else if (skip > 0) {
        if (base_name.value() != FilePath::kCurrentDirectory)
          --skip;
      } else {
        if (file_permissions_.find(current_path) != file_permissions_.end())
          return (file_permissions_[current_path] & permissions) == permissions;
      }
       last_path = current_path;
       current_path = current_path.DirName();
     }

    return false;
  }
