コード例 #1
0
ファイル: run_isolated.py プロジェクト: rzr/Tizen_Crosswalk
  def touch(self, digest, size):
    # Verify an actual file is valid. Note that is doesn't compute the hash so
    # it could still be corrupted. Do it outside the lock.
    if not isolateserver.is_valid_file(self._path(digest), size):
      return False

    # Update it's LRU position.
    with self._lock:
      if digest not in self._lru:
        return False
      self._lru.touch(digest)
    return True
コード例 #2
0
ファイル: run_isolated.py プロジェクト: bbmjja8123/chromium-1
    def touch(self, digest, size):
        # Verify an actual file is valid. Note that is doesn't compute the hash so
        # it could still be corrupted. Do it outside the lock.
        if not isolateserver.is_valid_file(self._path(digest), size):
            return False

        # Update it's LRU position.
        with self._lock:
            if digest not in self._lru:
                return False
            self._lru.touch(digest)
        return True
コード例 #3
0
  def touch(self, digest, size):
    """Verifies an actual file is valid.

    Note that is doesn't compute the hash so it could still be corrupted if the
    file size didn't change.

    TODO(maruel): More stringent verification while keeping the check fast.
    """
    # Do the check outside the lock.
    if not isolateserver.is_valid_file(self._path(digest), size):
      return False

    # Update it's LRU position.
    with self._lock:
      if digest not in self._lru:
        return False
      self._lru.touch(digest)
    return True
コード例 #4
0
  def touch(self, digest, size):
    """Verifies an actual file is valid.

    Note that is doesn't compute the hash so it could still be corrupted if the
    file size didn't change.

    TODO(maruel): More stringent verification while keeping the check fast.
    """
    # Do the check outside the lock.
    if not isolateserver.is_valid_file(self._path(digest), size):
      return False

    # Update it's LRU position.
    with self._lock:
      if digest not in self._lru:
        return False
      self._lru.touch(digest)
    return True