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

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

Issue 12996003: Dynamically generate a heading for Extension Docs API pages (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: AvailabilityFinder Overhaul; Removing ConfigureFakeFetchers() calls 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/cron_servlet.py
diff --git a/chrome/common/extensions/docs/server2/cron_servlet.py b/chrome/common/extensions/docs/server2/cron_servlet.py
index 188475d242afbe45b5bfae87b5cfeab9550a3576..2cd2e962e333562b22a6681452146ad6eeaecc67 100644
--- a/chrome/common/extensions/docs/server2/cron_servlet.py
+++ b/chrome/common/extensions/docs/server2/cron_servlet.py
@@ -46,6 +46,9 @@ class CronServlet(Servlet):
def CreateHostFileSystemForBranchAndRevision(self, branch, revision):
return SubversionFileSystem.Create(branch, revision=revision)
+ def CreateFileSystemForBranch(self, branch):
+ return SubversionFileSystem.Create(branch)
+
def CreateAppSamplesFileSystem(self, object_store_creator):
# TODO(kalman): CachingFileSystem wrapper for GithubFileSystem, but it's
# not supported yet (see comment there).
@@ -217,7 +220,7 @@ class CronServlet(Servlet):
def _GetBranchForChannel(self, channel):
object_store_creator = self._CreateObjectStoreCreator(channel)
return (self._delegate.CreateBranchUtility(object_store_creator)
- .GetBranchForChannel(channel))
+ .GetChannelInfo(channel).branch)
def _CreateServerInstance(self, channel, revision):
object_store_creator = self._CreateObjectStoreCreator(channel)
@@ -231,9 +234,17 @@ class CronServlet(Servlet):
compiled_host_fs_factory = CompiledFileSystem.Factory(
host_file_system,
object_store_creator)
+ branch_utility = self._delegate.CreateBranchUtility(object_store_creator)
+ def create_file_system(version):
+ return CachingFileSystem(
+ self._delegate.CreateFileSystemForBranch(
+ branch_utility.GetBranchNumberForVersion(version)),
+ object_store_creator)
return ServerInstance(channel,
object_store_creator,
host_file_system,
app_samples_file_system,
'' if channel == 'stable' else '/%s' % channel,
- compiled_host_fs_factory)
+ compiled_host_fs_factory,
+ branch_utility,
epeterson 2013/06/02 00:25:50 Passing a branch utility to AvailabilityFinder via
+ create_file_system)

Powered by Google App Engine
This is Rietveld 408576698