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

Unified Diff: chrome/common/extensions/docs/server2/compiled_file_system.py

Issue 14125010: Docserver: Add support for viewing docs with a codereview patch applied (Closed) Base URL: https://src.chromium.org/svn/trunk/src/
Patch Set: add executable bits for tests Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/docs/server2/compiled_file_system.py
diff --git a/chrome/common/extensions/docs/server2/compiled_file_system.py b/chrome/common/extensions/docs/server2/compiled_file_system.py
index 6ab06d8e9452a2bb34cbceb9c8173ee5188752bb..087eea8a08761efd4b172fc80181f7a45b8555d6 100644
--- a/chrome/common/extensions/docs/server2/compiled_file_system.py
+++ b/chrome/common/extensions/docs/server2/compiled_file_system.py
@@ -93,3 +93,17 @@ class CompiledFileSystem(object):
cache_data = self._populate_function(path, self._RecursiveList(path))
self._list_object_store.Set(path, _CacheEntry(cache_data, version))
return cache_data
+
+ def StatFile(self, path):
+ cache_entry = self._file_object_store.Get(path).Get()
+ if cache_entry is not None:
+ return cache_entry.version
+ return self._file_system.Stat(path).version
+
+ def StatFileListing(self, path):
+ if not path.endswith('/'):
+ path += '/'
+ cache_entry = self._list_object_store.Get(path).Get()
+ if cache_entry is not None:
+ return cache_entry.version
+ return self._file_system.Stat(path).version

Powered by Google App Engine
This is Rietveld 408576698