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

Unified Diff: third_party/mojo/src/mojo/public/python/mojo_bindings/promise.py

Issue 1019173002: Update mojo sdk to rev 7214b7ec7d27563b2666afad86cf1c5895c56c18 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Keep permission service alive if embedder drops requests Created 5 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: third_party/mojo/src/mojo/public/python/mojo_bindings/promise.py
diff --git a/third_party/mojo/src/mojo/public/python/mojo_bindings/promise.py b/third_party/mojo/src/mojo/public/python/mojo_bindings/promise.py
index 7ceb52c246a2820e229ada2d0c12d364cef90017..8a8b0dc77b19f1252d49b3ccfe2bd102d96e71c6 100644
--- a/third_party/mojo/src/mojo/public/python/mojo_bindings/promise.py
+++ b/third_party/mojo/src/mojo/public/python/mojo_bindings/promise.py
@@ -133,15 +133,15 @@ class Promise(object):
if isinstance(self._result, Promise):
return self._result.Then(onFullfilled, onRejected)
def GeneratorFunction(resolve, reject):
+ recover = reject
+ if onRejected:
+ recover = resolve
if self._state == Promise.STATE_PENDING:
self._onFulfilled.append(_Delegate(resolve, reject, onFullfilled))
- self._onRejected.append(_Delegate(reject, reject, onRejected))
+ self._onRejected.append(_Delegate(recover, reject, onRejected))
if self._state == self.STATE_FULLFILLED:
_Delegate(resolve, reject, onFullfilled)(self._result)
if self._state == self.STATE_REJECTED:
- recover = reject
- if onRejected:
- recover = resolve
_Delegate(recover, reject, onRejected)(self._result)
return Promise(GeneratorFunction)

Powered by Google App Engine
This is Rietveld 408576698