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

Unified Diff: chrome/common/extensions/docs/server2/memcache_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/memcache_object_store.py
diff --git a/chrome/common/extensions/docs/server2/memcache_object_store.py b/chrome/common/extensions/docs/server2/memcache_object_store.py
index 71751b8d772387cdf5262e3f914ff8de53833882..f16eacf529cbb4cb8ab810074c738161374bf342 100644
--- a/chrome/common/extensions/docs/server2/memcache_object_store.py
+++ b/chrome/common/extensions/docs/server2/memcache_object_store.py
@@ -13,12 +13,17 @@ class _AsyncMemcacheGetFuture(object):
return self._rpc.get_result()
class MemcacheObjectStore(ObjectStore):
- def SetMulti(self, mapping, namespace, time=CACHE_TIMEOUT):
- memcache.Client().set_multi_async(mapping, namespace=namespace, time=time)
+ def __init__(self, namespace):
+ self._namespace = namespace
- def GetMulti(self, keys, namespace, time=CACHE_TIMEOUT):
- rpc = memcache.Client().get_multi_async(keys, namespace=namespace)
+ def SetMulti(self, mapping, time=CACHE_TIMEOUT):
+ memcache.Client().set_multi_async(mapping,
+ namespace=self._namespace,
+ time=time)
+
+ def GetMulti(self, keys, time=CACHE_TIMEOUT):
+ rpc = memcache.Client().get_multi_async(keys, namespace=self._namespace)
return _AsyncMemcacheGetFuture(rpc)
- def Delete(self, key, namespace):
- memcache.delete(key, namespace=namespace)
+ def Delete(self, key):
+ memcache.delete(key, namespace=self._namespace)

Powered by Google App Engine
This is Rietveld 408576698