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 e58c650a9a8e0d6609d463b957c40a55a4763fe9..93c9008df3a4e67f6e6f4828c3a1e9bed9950ce1 100644 |
--- a/chrome/common/extensions/docs/server2/features_bundle.py |
+++ b/chrome/common/extensions/docs/server2/features_bundle.py |
@@ -6,13 +6,20 @@ import posixpath |
from compiled_file_system import SingleFile, Unicode |
from extensions_paths import ( |
- API_FEATURES, JSON_TEMPLATES, MANIFEST_FEATURES, PERMISSION_FEATURES) |
+ API_FEATURES, API_PATHS, JSON_TEMPLATES, MANIFEST_FEATURES, |
+ PERMISSION_FEATURES) |
import features_utility |
from file_system import FileNotFoundError |
from future import Future |
from third_party.json_schema_compiler.json_parse import Parse |
+def _GetFeaturePaths(feature_file, *extra_paths): |
+ paths = [posixpath.join(api_path, feature_file) for api_path in API_PATHS] |
+ paths.extend(extra_paths) |
+ return paths |
+ |
+ |
def _AddPlatformsFromDependencies(feature, |
api_features, |
manifest_features, |
@@ -39,7 +46,7 @@ def _AddPlatformsFromDependencies(feature, |
class _FeaturesCache(object): |
- def __init__(self, file_system, compiled_fs_factory, *json_paths): |
+ def __init__(self, file_system, compiled_fs_factory, json_paths): |
populate = self._CreateCache |
if len(json_paths) == 1: |
populate = SingleFile(populate) |
@@ -77,17 +84,17 @@ class FeaturesBundle(object): |
self._api_cache = _FeaturesCache( |
file_system, |
compiled_fs_factory, |
- API_FEATURES) |
+ _GetFeaturePaths(API_FEATURES)) |
self._manifest_cache = _FeaturesCache( |
file_system, |
compiled_fs_factory, |
- MANIFEST_FEATURES, |
- posixpath.join(JSON_TEMPLATES, 'manifest.json')) |
+ _GetFeaturePaths(MANIFEST_FEATURES, |
+ posixpath.join(JSON_TEMPLATES, 'manifest.json'))) |
self._permission_cache = _FeaturesCache( |
file_system, |
compiled_fs_factory, |
- PERMISSION_FEATURES, |
- posixpath.join(JSON_TEMPLATES, 'permissions.json')) |
+ _GetFeaturePaths(PERMISSION_FEATURES, |
+ posixpath.join(JSON_TEMPLATES, 'permissions.json'))) |
# Namespace the object store by the file system ID because this class is |
# used by the availability finder cross-channel. |
# TODO(kalman): Configure this at the ObjectStore level. |