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

Side by Side Diff: chrome/common/extensions/docs/server2/chroot_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 import posixpath 5 import posixpath
6 6
7 from docs_server_utils import StringIdentity 7 from docs_server_utils import StringIdentity
8 from file_system import FileSystem 8 from file_system import FileSystem
9 from future import Future 9 from future import Future
10 10
(...skipping 26 matching lines...) Expand all
37 for path, content in results.iteritems()) 37 for path, content in results.iteritems())
38 return self._file_system.Read(tuple(prefix(path) for path in paths), 38 return self._file_system.Read(tuple(prefix(path) for path in paths),
39 skip_not_found-skip_not_found).Then(next) 39 skip_not_found-skip_not_found).Then(next)
40 40
41 def Refresh(self): 41 def Refresh(self):
42 return self._file_system.Refresh() 42 return self._file_system.Refresh()
43 43
44 def Stat(self, path): 44 def Stat(self, path):
45 return self._file_system.Stat(posixpath.join(self._root, path)) 45 return self._file_system.Stat(posixpath.join(self._root, path))
46 46
47 def GetIdentity(self): 47 def GetStableIdentity(self):
48 return StringIdentity( 48 return StringIdentity(
49 '%s/%s' % (self._file_system.GetIdentity(), self._root)) 49 '%s/%s' % (self._file_system.GetIdentity(), self._root))
50 50
51 def __repr__(self): 51 def __repr__(self):
52 return 'ChrootFileSystem(%s, %s)' % ( 52 return 'ChrootFileSystem(%s, %s)' % (
53 self._root, repr(self._file_system)) 53 self._root, repr(self._file_system))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698