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

Side by Side Diff: chrome/common/extensions/docs/server2/local_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, 2 months 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 (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 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 os 5 import os
6 import sys 6 import sys
7 7
8 from docs_server_utils import StringIdentity 8 from docs_server_utils import StringIdentity
9 from file_system import FileSystem, FileNotFoundError, StatInfo 9 from file_system import FileSystem, FileNotFoundError, StatInfo
10 from future import Future 10 from future import Future
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 99
100 def Refresh(self): 100 def Refresh(self):
101 return Future(value=()) 101 return Future(value=())
102 102
103 def Stat(self, path): 103 def Stat(self, path):
104 AssertIsValid(path) 104 AssertIsValid(path)
105 full_path = os.path.join(self._base_path, 105 full_path = os.path.join(self._base_path,
106 _ConvertToFilepath(path).lstrip(os.sep)) 106 _ConvertToFilepath(path).lstrip(os.sep))
107 return _CreateStatInfo(full_path) 107 return _CreateStatInfo(full_path)
108 108
109 def GetIdentity(self): 109 def GetStableIdentity(self):
110 return '@'.join((self.__class__.__name__, StringIdentity(self._base_path))) 110 return '@'.join((self.__class__.__name__, StringIdentity(self._base_path)))
111 111
112 def __repr__(self): 112 def __repr__(self):
113 return 'LocalFileSystem(%s)' % self._base_path 113 return 'LocalFileSystem(%s)' % self._base_path
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698