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

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

Issue 14856006: Docserver: achieve online vs offline (cron vs instance) behaviour at the object (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . 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/github_file_system.py
diff --git a/chrome/common/extensions/docs/server2/github_file_system.py b/chrome/common/extensions/docs/server2/github_file_system.py
index 97f694f6b7962e76f093ee06834d9a637131901c..da570f958e1983ab883eb41143c915ba3018bbd2 100644
--- a/chrome/common/extensions/docs/server2/github_file_system.py
+++ b/chrome/common/extensions/docs/server2/github_file_system.py
@@ -67,10 +67,12 @@ class _AsyncFetchFutureZip(object):
class GithubFileSystem(FileSystem):
"""FileSystem implementation which fetches resources from github.
"""
- def __init__(self, fetcher, blobstore):
- # The password store is the same for all branches and versions.
- password_store = (ObjectStoreCreator.GlobalFactory()
- .Create(GithubFileSystem).Create(category='password'))
+ def __init__(self, fetcher, blobstore, object_store_creator_factory):
+ # The password store is the same for all branches and versions. Don't use
+ # |object_store_creator_factory| for this since it's not necessarily global.
+ password_store = (
+ ObjectStoreCreator.GlobalFactory(ObjectStoreCreator.START_POPULATED)
+ .Create(GithubFileSystem).Create(category='password'))
if USERNAME is None:
password_data = password_store.GetMulti(('username', 'password')).Get()
self._username, self._password = (password_data.get('username'),
@@ -81,8 +83,8 @@ class GithubFileSystem(FileSystem):
self._fetcher = fetcher
self._blobstore = blobstore
- self._stat_object_store = (ObjectStoreCreator.SharedFactory(GetAppVersion())
- .Create(GithubFileSystem).Create())
+ self._stat_object_store = (
+ object_store_creator_factory.Create(GithubFileSystem).Create())
self._version = None
self._GetZip(self.Stat(ZIP_KEY).version)

Powered by Google App Engine
This is Rietveld 408576698