Chromium Code Reviews| Index: chrome/renderer/resources/extensions/notifications_custom_bindings.js |
| diff --git a/chrome/renderer/resources/extensions/notifications_custom_bindings.js b/chrome/renderer/resources/extensions/notifications_custom_bindings.js |
| index eebf2900920287f0b539b04e32d48e6219a2c444..5c278ec0e78f65ca6363b412031d0ae1b95ee36f 100644 |
| --- a/chrome/renderer/resources/extensions/notifications_custom_bindings.js |
| +++ b/chrome/renderer/resources/extensions/notifications_custom_bindings.js |
| @@ -7,6 +7,7 @@ |
| var binding = require('binding').Binding.create('notifications'); |
| var sendRequest = require('sendRequest').sendRequest; |
| +var exceptionHandler = require('uncaught_exception_handler'); |
| var imageUtil = require('imageUtil'); |
| var lastError = require('lastError'); |
| var notificationsPrivate = requireNative('notifications_private'); |
| @@ -111,20 +112,23 @@ function genHandle(name, failure_function) { |
| return function(id, input_notification_details, callback) { |
| // TODO(dewittj): Remove this hack. This is used as a way to deep |
|
not at google - send to devlin
2015/01/20 17:41:35
The best way to deep copy would be to expose a nat
robwu
2015/01/20 22:34:01
Recursive objects are invalid for this API, so tha
dewittj
2015/01/20 22:46:51
The JSON copy has 2 important properties:
1) Custo
robwu
2015/01/20 22:58:44
There are many other extension APIs that suffer fr
not at google - send to devlin
2015/01/21 22:21:19
I'm sure that copying is necessary. I was addressi
robwu
2015/01/21 23:21:09
Yep, I understood that, and I pointed out that cop
|
| // copy a complex JSON object. |
| - var notification_details = JSON.parse( |
| - JSON.stringify(input_notification_details)); |
| + var notification_details = $JSON.parse( |
| + $JSON.stringify(input_notification_details)); |
| var that = this; |
| + var stack = exceptionHandler.getExtensionStackTrace(); |
| replaceNotificationOptionURLs(notification_details, function(success) { |
| if (success) { |
| sendRequest(that.name, |
| [id, notification_details, callback], |
| - that.definition.parameters); |
| + that.definition.parameters, {stack: stack}); |
| return; |
| } |
| - lastError.run(name, |
| - 'Unable to download all specified images.', |
| - null, |
| - failure_function, [callback, id]) |
| + var error = 'Unable to download all specified images.'; |
| + if (callback) { |
| + lastError.run(name, error, stack, failure_function, [callback, id]); |
| + } else { |
| + lastError.reportUncheckedLastError(name, error, stack); |
| + } |
|
not at google - send to devlin
2015/01/21 22:21:19
You could avoid needing to expose reportUncheckedL
robwu
2015/01/21 23:21:09
Done. Though reportUncheckedLastError has to be pu
|
| }); |
| }; |
| } |