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

Unified Diff: chrome/common/extensions/docs/server2/sidenav_data_source.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/sidenav_data_source.py
diff --git a/chrome/common/extensions/docs/server2/sidenav_data_source.py b/chrome/common/extensions/docs/server2/sidenav_data_source.py
index e51fa476c1356eb0c9d301f0f5ce782808646950..be3cc491a661952bf84537ba0c1cdf90013adcf1 100644
--- a/chrome/common/extensions/docs/server2/sidenav_data_source.py
+++ b/chrome/common/extensions/docs/server2/sidenav_data_source.py
@@ -10,14 +10,18 @@ import compiled_file_system as compiled_fs
from file_system import FileNotFoundError
from third_party.json_schema_compiler.model import UnixName
+# Increment this if the data model changes for SidenavDataSource.
+_VERSION = 1
+
class SidenavDataSource(object):
"""This class reads in and caches a JSON file representing the side navigation
menu.
"""
class Factory(object):
- def __init__(self, cache_factory, json_path):
- self._cache = cache_factory.Create(self._CreateSidenavDict,
- compiled_fs.SIDENAV)
+ def __init__(self, compiled_fs_factory, json_path):
+ self._cache = compiled_fs_factory.Create(self._CreateSidenavDict,
+ SidenavDataSource,
+ version=_VERSION)
self._json_path = json_path
def Create(self, path):

Powered by Google App Engine
This is Rietveld 408576698