Chromium Code Reviews| Index: chrome/browser/resources/google_now/utility.js |
| diff --git a/chrome/browser/resources/google_now/utility.js b/chrome/browser/resources/google_now/utility.js |
| index 904da6b9cd885dd642262a30d114b1cb604b73e7..9bf0ad3ce40a09bfc6dc7c3647bb481522b9a665 100644 |
| --- a/chrome/browser/resources/google_now/utility.js |
| +++ b/chrome/browser/resources/google_now/utility.js |
| @@ -437,6 +437,17 @@ wrapper.instrumentChromeApiFunction('identity.removeCachedAuthToken', 1); |
| wrapper.instrumentChromeApiFunction('webstorePrivate.getBrowserLogin', 0); |
| /** |
| + * Add task tracking support to Promises. |
| + * @override |
| + **/ |
|
skare_
2014/02/11 20:07:44
tiny tiny nit: */ to close
robliao
2014/02/11 21:53:21
Done.
|
| +Promise.prototype.then = function() { |
|
skare_
2014/02/11 20:07:44
extending prototypes of builtins is warned against
robliao
2014/02/11 21:53:21
Unfortunately, this is the only way to get Promise
|
| + var originalThen = Promise.prototype.then; |
| + return function(callback) { |
| + originalThen.call(this, wrapper.wrapCallback(callback, false)); |
| + } |
| +}(); |
| + |
| +/** |
| * Builds the object to manage tasks (mutually exclusive chains of events). |
| * @param {function(string, string): boolean} areConflicting Function that |
| * checks if a new task can't be added to a task queue that contains an |