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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 from api_features import APIFeatures
6 from manifest_features import ManifestFeatures
7 from permission_features import PermissionFeatures
8
9 class FeaturesBundle(object):
10 '''Provides access to properties of API, Manifest, and Permission features.
11 '''
12 def __init__(self,
13 file_system,
14 compiled_fs_factory,
15 api_features_path,
16 manifest_features_path,
17 manifest_json_path,
18 permission_features_path,
19 permissions_json_path):
20 self._features = {}
21 self._features['manifest'] = ManifestFeatures(compiled_fs_factory,
22 manifest_features_path,
23 file_system,
24 manifest_json_path)
25 self._features['permission'] = PermissionFeatures(compiled_fs_factory,
26 permission_features_path,
27 file_system,
28 permissions_json_path)
29 self._features['api'] = APIFeatures(compiled_fs_factory,
30 api_features_path,
31 self._features['manifest'],
32 self._features['permission'])
not at google - send to devlin 2013/09/23 18:31:30 storing these in a dict seems unnecessary. just ha
33
34 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
35 '''Assign additional annotations that may depend on template data.'''
36 self._features['permission'].AddDependencyDescriptions(
37 self._features['api'], template_data_source_factory.Create(None, {}))
38
39 def get(self, key):
40 return self._features.get(key)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698