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

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

Issue 532423002: Inlining references to internal APIs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Re-adding comment Created 6 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/api_models.py
diff --git a/chrome/common/extensions/docs/server2/api_models.py b/chrome/common/extensions/docs/server2/api_models.py
index 69220ce15097be99c4c08a224ba656912a881d55..2d5f311689bd188f803536c769b50df9a823b73c 100644
--- a/chrome/common/extensions/docs/server2/api_models.py
+++ b/chrome/common/extensions/docs/server2/api_models.py
@@ -12,7 +12,7 @@ from future import All, Future, Race
from operator import itemgetter
from path_util import Join
from platform_util import PlatformToExtensionType
-from schema_util import ProcessSchema
+from schema_processor import SchemaProcessor, SchemaProcessorFactory
from third_party.json_schema_compiler.json_schema import DeleteNodes
from third_party.json_schema_compiler.model import Namespace, UnixName
@@ -57,12 +57,15 @@ class APIModels(object):
compiled_fs_factory,
file_system,
object_store_creator,
- platform):
+ platform,
+ schema_processor_factory):
self._features_bundle = features_bundle
self._platform = PlatformToExtensionType(platform)
self._model_cache = compiled_fs_factory.Create(
file_system, self._CreateAPIModel, APIModels, category=self._platform)
self._object_store = object_store_creator.Create(APIModels)
+ self._schema_processor = Future(callback=lambda:
+ schema_processor_factory.Create(False))
@Cache
@SingleFile
@@ -73,11 +76,11 @@ class APIModels(object):
node['extension_types'] != 'all' and
self._platform not in node['extension_types'])
- schema = ProcessSchema(path, data)[0]
+ schema = self._schema_processor.Get().Process(path, data)[0]
if not schema:
raise ValueError('No schema for %s' % path)
return Namespace(DeleteNodes(
- schema, matcher=does_not_include_platform), schema['namespace'])
+ schema, matcher=does_not_include_platform), path)
def GetNames(self):
# API names appear alongside some of their methods/events/etc in the
« no previous file with comments | « chrome/common/extensions/api/_api_features.json ('k') | chrome/common/extensions/docs/server2/api_models_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698