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

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

Issue 417163004: Docserver: Update Future.Then() to be more Promise-like (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/docs/server2/chroot_file_system.py
diff --git a/chrome/common/extensions/docs/server2/chroot_file_system.py b/chrome/common/extensions/docs/server2/chroot_file_system.py
index af521d8ebd45cc7fcdd2e3e9e0e5021f65a7c07e..2ed612f13f8fb2f5ef3123e87e093b1d0243938a 100644
--- a/chrome/common/extensions/docs/server2/chroot_file_system.py
+++ b/chrome/common/extensions/docs/server2/chroot_file_system.py
@@ -32,13 +32,11 @@ class ChrootFileSystem(FileSystem):
prefixed = posixpath.join(self._root, path)
prefixed_paths[prefixed] = path
return prefixed
- future_result = self._file_system.Read(
- tuple(prefix(path) for path in paths),
- skip_not_found=skip_not_found)
- def resolve():
+ def next(results):
return dict((prefixed_paths[path], content)
- for path, content in future_result.Get().iteritems())
- return Future(callback=resolve)
+ for path, content in results.iteritems())
+ return self._file_system.Read(tuple(prefix(path) for path in paths),
+ skip_not_found-skip_not_found).Then(next)
def Refresh(self):
return self._file_system.Refresh()

Powered by Google App Engine
This is Rietveld 408576698