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

Unified Diff: chrome/common/extensions/docs/server2/patch_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: Addressing comments - Patch currently being broken up Created 7 years, 6 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/patch_servlet.py
diff --git a/chrome/common/extensions/docs/server2/patch_servlet.py b/chrome/common/extensions/docs/server2/patch_servlet.py
index 32e1f92e00d08fc4cabb4681649a46bae271d935..0146fcee2d51ab9be2018d40db4ebe071b585d47 100644
--- a/chrome/common/extensions/docs/server2/patch_servlet.py
+++ b/chrome/common/extensions/docs/server2/patch_servlet.py
@@ -30,10 +30,13 @@ class _PatchServletDelegate(RenderServlet.Delegate):
def CreateServerInstanceForChannel(self, channel):
base_object_store_creator = ObjectStoreCreator(channel,
start_empty=False)
+ branch_utility = self._delegate.CreateBranchUtility(
+ base_object_store_creator)
# TODO(fj): Use OfflineFileSystem here once all json/idl files in api/
# are pulled into data store by cron jobs.
base_file_system = CachingFileSystem(
- self._delegate.CreateHostFileSystemForBranch(channel),
+ self._delegate.CreateHostFileSystemForBranch(
+ branch_utility.GetChannelInfo(channel).branch),
base_object_store_creator)
base_compiled_fs_factory = CompiledFileSystem.Factory(
base_file_system, base_object_store_creator)
@@ -53,13 +56,22 @@ class _PatchServletDelegate(RenderServlet.Delegate):
compiled_fs_factory = ChainedCompiledFileSystem.Factory(
[(patched_compiled_fs_factory, patched_file_system),
(base_compiled_fs_factory, base_file_system)])
+
+ def create_file_system(version):
+ return CachingFileSystem(
+ self._delegate.CreateHostFileSystemForBranch(
+ branch_utility.GetBranchForVersion(version)),
+ base_object_store_creator)
+
return ServerInstance(channel,
object_store_creator,
patched_file_system,
self._delegate.CreateAppSamplesFileSystem(
base_object_store_creator),
'/_patch/%s' % self._issue,
- compiled_fs_factory)
+ compiled_fs_factory,
+ branch_utility,
+ create_file_system)
class PatchServlet(Servlet):
'''Servlet which renders patched docs.

Powered by Google App Engine
This is Rietveld 408576698