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

Side by Side Diff: chrome/common/extensions/docs/server2/appengine_url_fetcher.py

Issue 10808065: Extensions Docs Server: TDS fix, no local caching (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes Created 8 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import logging
6 from google.appengine.api import urlfetch 5 from google.appengine.api import urlfetch
7 6
8 from future import Future 7 from future import Future
9 8
10 class _AsyncFetchDelegate(object): 9 class _AsyncFetchDelegate(object):
11 def __init__(self, rpc): 10 def __init__(self, rpc):
12 self._rpc = rpc 11 self._rpc = rpc
13 12
14 def Get(self): 13 def Get(self):
15 self._rpc.wait() 14 self._rpc.wait()
(...skipping 10 matching lines...) Expand all
26 """Fetches a file synchronously. 25 """Fetches a file synchronously.
27 """ 26 """
28 return urlfetch.fetch(self._base_path + '/' + url) 27 return urlfetch.fetch(self._base_path + '/' + url)
29 28
30 def FetchAsync(self, url): 29 def FetchAsync(self, url):
31 """Fetches a file asynchronously, and returns a Future with the result. 30 """Fetches a file asynchronously, and returns a Future with the result.
32 """ 31 """
33 rpc = urlfetch.create_rpc() 32 rpc = urlfetch.create_rpc()
34 urlfetch.make_fetch_call(rpc, self._base_path + '/' + url) 33 urlfetch.make_fetch_call(rpc, self._base_path + '/' + url)
35 return Future(delegate=_AsyncFetchDelegate(rpc)) 34 return Future(delegate=_AsyncFetchDelegate(rpc))
OLDNEW
« no previous file with comments | « chrome/common/extensions/docs/server2/api_data_source.py ('k') | chrome/common/extensions/docs/server2/echo_handler.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698