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

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

Issue 216703003: Docs: Memoize the FeaturesBundles that are created by AvailabilityFinder to (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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/features_bundle.py
diff --git a/chrome/common/extensions/docs/server2/features_bundle.py b/chrome/common/extensions/docs/server2/features_bundle.py
index b98bdfff576fc70e7a6a0eebfe28e5659688d56e..e58c650a9a8e0d6609d463b957c40a55a4763fe9 100644
--- a/chrome/common/extensions/docs/server2/features_bundle.py
+++ b/chrome/common/extensions/docs/server2/features_bundle.py
@@ -4,7 +4,7 @@
import posixpath
-from compiled_file_system import Unicode
+from compiled_file_system import SingleFile, Unicode
from extensions_paths import (
API_FEATURES, JSON_TEMPLATES, MANIFEST_FEATURES, PERMISSION_FEATURES)
import features_utility
@@ -40,8 +40,11 @@ def _AddPlatformsFromDependencies(feature,
class _FeaturesCache(object):
def __init__(self, file_system, compiled_fs_factory, *json_paths):
- self._cache = compiled_fs_factory.Create(
- file_system, self._CreateCache, type(self))
+ populate = self._CreateCache
+ if len(json_paths) == 1:
+ populate = SingleFile(populate)
not at google - send to devlin 2014/03/28 17:20:36 and this is a minor optimisation to stop us from r
+
+ self._cache = compiled_fs_factory.Create(file_system, populate, type(self))
self._text_cache = compiled_fs_factory.ForUnicode(file_system)
self._json_path = json_paths[0]
self._extra_paths = json_paths[1:]
« no previous file with comments | « chrome/common/extensions/docs/server2/cron.yaml ('k') | chrome/common/extensions/docs/server2/file_system.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698