Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1542)

Side by Side Diff: chrome/common/extensions/docs/server2/empty_dir_file_system.py

Issue 660383002: Docserver: Persist stat cache for versioned file systems (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: change caching strategy, better refresh cycle synchronization Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 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 from file_system import FileNotFoundError, FileSystem, StatInfo 5 from file_system import FileNotFoundError, FileSystem, StatInfo
6 from future import Future 6 from future import Future
7 from path_util import IsDirectory 7 from path_util import IsDirectory
8 8
9 9
10 class EmptyDirFileSystem(FileSystem): 10 class EmptyDirFileSystem(FileSystem):
(...skipping 10 matching lines...) Expand all
21 return Future(value=result) 21 return Future(value=result)
22 22
23 def Refresh(self): 23 def Refresh(self):
24 return Future(value=()) 24 return Future(value=())
25 25
26 def Stat(self, path): 26 def Stat(self, path):
27 if not IsDirectory(path): 27 if not IsDirectory(path):
28 raise FileNotFoundError('EmptyDirFileSystem cannot stat %s' % path) 28 raise FileNotFoundError('EmptyDirFileSystem cannot stat %s' % path)
29 return StatInfo(0, child_versions=[]) 29 return StatInfo(0, child_versions=[])
30 30
31 def GetIdentity(self): 31 def GetStableIdentity(self):
32 return self.__class__.__name__ 32 return self.__class__.__name__
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698