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

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

Issue 2738623003: Extensions: Fix DocServer assert failures. (Closed)
Patch Set: Address review. Created 3 years, 9 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 | « no previous file | chrome/common/extensions/docs/server2/api_data_source.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/docs/server2/api_categorizer.py
diff --git a/chrome/common/extensions/docs/server2/api_categorizer.py b/chrome/common/extensions/docs/server2/api_categorizer.py
index 1daf828635525f5a101272595088784d3d5435dd..9b531e6757ec17de124433bdb8adf1cecab8f367 100644
--- a/chrome/common/extensions/docs/server2/api_categorizer.py
+++ b/chrome/common/extensions/docs/server2/api_categorizer.py
@@ -34,11 +34,19 @@ class APICategorizer(object):
return template_names
def GetCategory(self, api_name):
- '''Return the type of api.'Chrome' means the public apis,
- private means the api only used by chrome, and experimental means
- the apis with "experimental" prefix.
+ '''Returns the type of api:
+ "internal": Used by chrome internally. Never documented.
+ "private": APIs which are undocumented or are available to
+ whitelisted apps/extensions.
+ "experimental": Experimental APIs.
+ "chrome": Public APIs.
'''
documented_apis = self._GenerateAPICategories()
+ if api_name.endswith('Internal'):
+ assert api_name not in documented_apis, \
+ "Internal API %s on %s platform should not be documented" % (
+ api_name, self._platform)
+ return 'internal'
if (api_name.endswith('Private') or
api_name not in documented_apis):
return 'private'
« no previous file with comments | « no previous file | chrome/common/extensions/docs/server2/api_data_source.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698