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

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

Issue 13470005: Refactor the devserver to make it easier to control caching (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cduvall, rebase Created 7 years, 8 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/object_store.py
diff --git a/chrome/common/extensions/docs/server2/object_store.py b/chrome/common/extensions/docs/server2/object_store.py
index 6d1f9cde1c4324da10d4078437793c28f29bf205..d524cf59cd69203940cca7763002e9286c466ec3 100644
--- a/chrome/common/extensions/docs/server2/object_store.py
+++ b/chrome/common/extensions/docs/server2/object_store.py
@@ -5,52 +5,42 @@
from appengine_wrappers import CACHE_TIMEOUT
from future import Future
-BRANCH_UTILITY = 'BranchUtility'
-FILE_SYSTEM_CACHE = 'CompiledFileSystem'
-FILE_SYSTEM_CACHE_LISTING = 'CompiledFileSystemListing'
-FILE_SYSTEM_READ = 'Read'
-FILE_SYSTEM_STAT = 'Stat'
-GITHUB_STAT = 'GithubStat'
-KNOWN_ISSUES = 'KnownIssues'
-REFERENCE_RESOLVER = 'ReferenceResolver'
-
class _SingleGetFuture(object):
def __init__(self, multi_get, key):
self._future = multi_get
self._key = key
def Get(self):
- return self._future.Get()[self._key]
+ return self._future.Get().get(self._key)
class ObjectStore(object):
"""A class for caching picklable objects.
"""
- def Set(self, key, value, namespace, time=CACHE_TIMEOUT):
+ def Set(self, key, value, time=CACHE_TIMEOUT):
"""Sets key -> value in the object store, with the specified timeout.
"""
- self.SetMulti({ key: value }, namespace, time=time)
+ self.SetMulti({ key: value }, time=time)
- def SetMulti(self, mapping, namespace, time=CACHE_TIMEOUT):
+ def SetMulti(self, mapping, time=CACHE_TIMEOUT):
"""Sets the mapping of keys to values in the object store with the specified
timeout.
"""
raise NotImplementedError()
- def Get(self, key, namespace, time=CACHE_TIMEOUT):
+ def Get(self, key, time=CACHE_TIMEOUT):
"""Gets a |Future| with the value of |key| in the object store, or None
if |key| is not in the object store.
"""
- return Future(delegate=_SingleGetFuture(
- self.GetMulti([key], namespace, time=time),
- key))
+ return Future(delegate=_SingleGetFuture(self.GetMulti([key], time=time),
+ key))
- def GetMulti(self, keys, namespace, time=CACHE_TIMEOUT):
+ def GetMulti(self, keys, time=CACHE_TIMEOUT):
"""Gets a |Future| with values mapped to |keys| from the object store, with
any keys not in the object store mapped to None.
"""
raise NotImplementedError()
- def Delete(self, key, namespace):
+ def Delete(self, key):
"""Deletes a key from the object store.
"""
raise NotImplementedError()

Powered by Google App Engine
This is Rietveld 408576698