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

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

Issue 246423002: Split feature definitions into extensions and chrome features. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: repack2 Created 6 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
« no previous file with comments | « chrome/common/extensions/docs/server2/extensions_paths.py ('k') | chrome/renderer/extensions/dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..5a93ba7e001537d29f762715e9df80fec88727f2 100644
--- a/chrome/common/extensions/docs/server2/features_bundle.py
+++ b/chrome/common/extensions/docs/server2/features_bundle.py
@@ -5,14 +5,24 @@
import posixpath
from compiled_file_system import SingleFile, Unicode
-from extensions_paths import (
- API_FEATURES, JSON_TEMPLATES, MANIFEST_FEATURES, PERMISSION_FEATURES)
+from extensions_paths import API_PATHS, JSON_TEMPLATES
import features_utility
from file_system import FileNotFoundError
from future import Future
from third_party.json_schema_compiler.json_parse import Parse
+_API_FEATURES = '_api_features.json'
+_MANIFEST_FEATURES = '_manifest_features.json'
+_PERMISSION_FEATURES = '_permission_features.json'
+
+
+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 +49,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 +87,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.
« no previous file with comments | « chrome/common/extensions/docs/server2/extensions_paths.py ('k') | chrome/renderer/extensions/dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698