diff options
author | kalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-27 20:02:46 +0000 |
---|---|---|
committer | kalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-27 20:02:46 +0000 |
commit | 206ebea228b75fd6aa0f7d2867736799f4cadc56 (patch) | |
tree | 25bc16b76c739a6e8da5ff24d4c2468ab0b240ec /chrome/common/extensions/docs/server2/features_bundle.py | |
parent | 957cd5a210873c03233236dc038277a83a6069f9 (diff) | |
download | chromium_src-206ebea228b75fd6aa0f7d2867736799f4cadc56.zip chromium_src-206ebea228b75fd6aa0f7d2867736799f4cadc56.tar.gz chromium_src-206ebea228b75fd6aa0f7d2867736799f4cadc56.tar.bz2 |
Docs: Use the FeaturesBundle for all things features rather than
re-implementing similar logic in several places. This fixes a bug with the
commands API too (and desktopCapture, apparently).
BUG=357192
R=rockot@chromium.org
NOTRY=true
Review URL: https://codereview.chromium.org/212623015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@259958 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/extensions/docs/server2/features_bundle.py')
-rw-r--r-- | chrome/common/extensions/docs/server2/features_bundle.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/chrome/common/extensions/docs/server2/features_bundle.py b/chrome/common/extensions/docs/server2/features_bundle.py index 5d76cfe..b98bdff 100644 --- a/chrome/common/extensions/docs/server2/features_bundle.py +++ b/chrome/common/extensions/docs/server2/features_bundle.py @@ -8,6 +8,7 @@ from compiled_file_system import Unicode from extensions_paths import ( API_FEATURES, 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 @@ -51,7 +52,11 @@ class _FeaturesCache(object): for path in self._extra_paths] features = features_utility.Parse(Parse(features_json)) for path_future in extra_path_futures: - extra_json = path_future.Get() + try: + extra_json = path_future.Get() + except FileNotFoundError: + # Not all file system configurations have the extra files. + continue features = features_utility.MergedWith( features_utility.Parse(Parse(extra_json)), features) return features @@ -80,7 +85,11 @@ class FeaturesBundle(object): compiled_fs_factory, PERMISSION_FEATURES, posixpath.join(JSON_TEMPLATES, 'permissions.json')) - self._object_store = object_store_creator.Create(_FeaturesCache, 'features') + # 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. + self._object_store = object_store_creator.Create( + _FeaturesCache, category=file_system.GetIdentity()) def GetPermissionFeatures(self): return self._permission_cache.GetFeatures() |