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

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

Issue 2738623003: Extensions: Fix DocServer assert failures. (Closed)
Patch Set: Nit. 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
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
Devlin 2017/03/13 20:38:18 Maybe "APIs which are available to whitelisted app
karandeepb 2017/03/14 01:02:01 But the code wouldn't be consistent with the comme
Devlin 2017/03/14 01:12:05 Ah, right you are. Nevermind.
+ whitelisted apps/extensions.
+ "experimental": Experimental APIs.
+ "chrome": Public APIs.
'''
documented_apis = self._GenerateAPICategories()
+ if api_name.endswith('Internal'):
Devlin 2017/03/13 20:38:18 Let's hope we never have an fooInternal that's sup
karandeepb 2017/03/14 01:02:02 Hopefully not!
+ 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'

Powered by Google App Engine
This is Rietveld 408576698