| Index: chrome/common/extensions/docs/server2/api_data_source.py
|
| diff --git a/chrome/common/extensions/docs/server2/api_data_source.py b/chrome/common/extensions/docs/server2/api_data_source.py
|
| index f912e4e446cc8986cdba20e56549cc24407d9611..5234aa801f8149a150ad08a4e55a91ad0520c32a 100644
|
| --- a/chrome/common/extensions/docs/server2/api_data_source.py
|
| +++ b/chrome/common/extensions/docs/server2/api_data_source.py
|
| @@ -5,6 +5,7 @@
|
| import json
|
| import logging
|
| import os
|
| +import time
|
|
|
| from file_system import FileNotFoundError
|
| from handlebar_dict_generator import HandlebarDictGenerator
|
| @@ -37,9 +38,9 @@ class APIDataSource(object):
|
| self._base_path = base_path
|
|
|
| def Create(self, request):
|
| - return APIDataSource(self._permissions_cache,
|
| - self._json_cache,
|
| - self._idl_cache,
|
| + return APIDataSource(self._permissions_cache.ScopeToRequest(),
|
| + self._json_cache.ScopeToRequest(),
|
| + self._idl_cache.ScopeToRequest(),
|
| self._base_path,
|
| self._samples_factory.Create(request))
|
|
|
| @@ -96,6 +97,13 @@ class APIDataSource(object):
|
| return self.get(key)
|
|
|
| def get(self, key):
|
| + start_time = time.time()
|
| + try:
|
| + return self._do_get(key)
|
| + finally:
|
| + logging.info("ApiDataSource: %sms", (time.time() - start_time) * 1000)
|
| +
|
| + def _do_get(self, key):
|
| path, ext = os.path.splitext(key)
|
| unix_name = model.UnixName(path)
|
| json_path = unix_name + '.json'
|
|
|