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

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

Issue 23867003: Docserver: Consolidate features caching and access. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 7 years, 3 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
new file mode 100644
index 0000000000000000000000000000000000000000..f139fdcccff763ac0ab47006ad290e5bcfc84b88
--- /dev/null
+++ b/chrome/common/extensions/docs/server2/features_bundle.py
@@ -0,0 +1,40 @@
+# Copyright 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+from api_features import APIFeatures
+from manifest_features import ManifestFeatures
+from permission_features import PermissionFeatures
+
+class FeaturesBundle(object):
+ '''Provides access to properties of API, Manifest, and Permission features.
+ '''
+ def __init__(self,
+ file_system,
+ compiled_fs_factory,
+ api_features_path,
+ manifest_features_path,
+ manifest_json_path,
+ permission_features_path,
+ permissions_json_path):
+ self._features = {}
+ self._features['manifest'] = ManifestFeatures(compiled_fs_factory,
+ manifest_features_path,
+ file_system,
+ manifest_json_path)
+ self._features['permission'] = PermissionFeatures(compiled_fs_factory,
+ permission_features_path,
+ file_system,
+ permissions_json_path)
+ self._features['api'] = APIFeatures(compiled_fs_factory,
+ api_features_path,
+ self._features['manifest'],
+ self._features['permission'])
not at google - send to devlin 2013/09/23 18:31:30 storing these in a dict seems unnecessary. just ha
+
+ def AnnotateWithTemplateData(self, template_data_source_factory):
not at google - send to devlin 2013/09/23 18:31:30 Yeah it's a shame we need this. I don't think we w
+ '''Assign additional annotations that may depend on template data.'''
+ self._features['permission'].AddDependencyDescriptions(
+ self._features['api'], template_data_source_factory.Create(None, {}))
+
+ def get(self, key):
+ return self._features.get(key)

Powered by Google App Engine
This is Rietveld 408576698