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

Issue 855813002: Mark create/update/clear callbacks of notification API as optional (Closed)

Created:
5 years, 11 months ago by robwu
Modified:
5 years, 10 months ago
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Mark create/update/clear callbacks of notification API and create ID as optional Also improved error reporting: if an error occurs, and chrome.runtime.lastError is not checked, then an error is printed to the console (to be consistent with error reporting in the other async APIs). The documentation has been updated to mention that these parameters were required before Chrome 42, these lines should be removed once Chrome 42 hits stable (https://crbug.com/452990). BUG=163750 TEST=./out/Debug/interactive_ui_tests --gtest_filter=NotificationsApiTest.TestBasicUsage TEST=Manually, called chrome.tabs.create/update/clear without callback and observed that the notification is created as expected, and that an error is printed to the console when an error occurs (e.g. invalid iconUrl). R=kalman@chromium.org Committed: https://crrev.com/ff49cf31bc0e2c4c56e330a978a9f9599d75c6ab Cr-Commit-Position: refs/heads/master@{#314383}

Patch Set 1 #

Total comments: 17

Patch Set 2 : Address review up to comment 9 #

Patch Set 3 : fix export #

Patch Set 4 : Revert changes to last_error.js/send_request.js #

Total comments: 1

Patch Set 5 : Add note, see crbug.com/452990 #

Patch Set 6 : rebase #

Patch Set 7 : Mark ID as optional, add test #

Total comments: 2

Patch Set 8 : comments #25 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+52 lines, -16 lines) Patch
M chrome/browser/extensions/api/notifications/notifications_api.cc View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/common/extensions/api/notifications.idl View 1 2 3 4 5 6 7 1 chunk +17 lines, -8 lines 0 comments Download
M chrome/renderer/resources/extensions/notifications_custom_bindings.js View 1 2 chunks +7 lines, -5 lines 0 comments Download
M chrome/test/data/extensions/api_test/notifications/api/basic_usage/background.js View 1 2 3 4 5 6 1 chunk +26 lines, -1 line 0 comments Download

Messages

Total messages: 30 (4 generated)
robwu
5 years, 11 months ago (2015-01-17 13:42:13 UTC) #1
not at google - send to devlin
Adding +dewittj here as the author of the notifications API. I think that changing the ...
5 years, 11 months ago (2015-01-20 17:41:35 UTC) #3
robwu
https://codereview.chromium.org/855813002/diff/1/chrome/renderer/resources/extensions/notifications_custom_bindings.js File chrome/renderer/resources/extensions/notifications_custom_bindings.js (right): https://codereview.chromium.org/855813002/diff/1/chrome/renderer/resources/extensions/notifications_custom_bindings.js#newcode113 chrome/renderer/resources/extensions/notifications_custom_bindings.js:113: // TODO(dewittj): Remove this hack. This is used as ...
5 years, 11 months ago (2015-01-20 22:34:01 UTC) #4
robwu
On 2015/01/20 17:41:35, kalman wrote: > Adding +dewittj here as the author of the notifications ...
5 years, 11 months ago (2015-01-20 22:39:13 UTC) #5
dewittj
Do we aim for 100% forward compatibility in extension APIs? https://codereview.chromium.org/855813002/diff/1/chrome/renderer/resources/extensions/notifications_custom_bindings.js File chrome/renderer/resources/extensions/notifications_custom_bindings.js (right): https://codereview.chromium.org/855813002/diff/1/chrome/renderer/resources/extensions/notifications_custom_bindings.js#newcode113 ...
5 years, 11 months ago (2015-01-20 22:46:51 UTC) #6
robwu
https://codereview.chromium.org/855813002/diff/1/chrome/renderer/resources/extensions/notifications_custom_bindings.js File chrome/renderer/resources/extensions/notifications_custom_bindings.js (right): https://codereview.chromium.org/855813002/diff/1/chrome/renderer/resources/extensions/notifications_custom_bindings.js#newcode113 chrome/renderer/resources/extensions/notifications_custom_bindings.js:113: // TODO(dewittj): Remove this hack. This is used as ...
5 years, 11 months ago (2015-01-20 22:58:44 UTC) #7
dewittj
what is the motivation for the optional/required change? Consistency among apis? Conceptually lgtm, but I ...
5 years, 11 months ago (2015-01-21 18:46:28 UTC) #8
not at google - send to devlin
I'm still reviewing this, but I'm not sure it's worth it overall. Adding documentation like ...
5 years, 11 months ago (2015-01-21 22:21:19 UTC) #9
robwu
On 2015/01/21 22:21:19, kalman wrote: > I'm still reviewing this, but I'm not sure it's ...
5 years, 11 months ago (2015-01-21 23:21:09 UTC) #10
not at google - send to devlin
https://codereview.chromium.org/855813002/diff/1/extensions/renderer/resources/last_error.js File extensions/renderer/resources/last_error.js (right): https://codereview.chromium.org/855813002/diff/1/extensions/renderer/resources/last_error.js#newcode116 extensions/renderer/resources/last_error.js:116: if (!hasAccessed(targetChrome)) On 2015/01/21 23:21:09, robwu wrote: > On ...
5 years, 11 months ago (2015-01-21 23:24:32 UTC) #11
robwu
https://codereview.chromium.org/855813002/diff/1/extensions/renderer/resources/last_error.js File extensions/renderer/resources/last_error.js (right): https://codereview.chromium.org/855813002/diff/1/extensions/renderer/resources/last_error.js#newcode116 extensions/renderer/resources/last_error.js:116: if (!hasAccessed(targetChrome)) On 2015/01/21 23:24:32, kalman wrote: > On ...
5 years, 11 months ago (2015-01-21 23:28:18 UTC) #12
not at google - send to devlin
Ok you're right, I misread run(). This would be a lot simpler if we didn't ...
5 years, 11 months ago (2015-01-21 23:32:45 UTC) #13
robwu
On 2015/01/21 23:32:45, kalman wrote: > Ok you're right, I misread run(). This would be ...
5 years, 11 months ago (2015-01-21 23:42:45 UTC) #14
not at google - send to devlin
that would help, thanks.
5 years, 11 months ago (2015-01-21 23:51:02 UTC) #15
robwu
On 2015/01/21 23:51:02, kalman wrote: > that would help, thanks. Moved changes to lastError to ...
5 years, 11 months ago (2015-01-22 14:23:40 UTC) #16
robwu
On 2015/01/22 14:23:40, robwu wrote: > On 2015/01/21 23:51:02, kalman wrote: > > that would ...
5 years, 11 months ago (2015-01-27 22:32:38 UTC) #17
not at google - send to devlin
lgtm https://codereview.chromium.org/855813002/diff/60001/chrome/common/extensions/api/notifications.idl File chrome/common/extensions/api/notifications.idl (right): https://codereview.chromium.org/855813002/diff/60001/chrome/common/extensions/api/notifications.idl#newcode133 chrome/common/extensions/api/notifications.idl:133: // that represents the created notification. Could you ...
5 years, 10 months ago (2015-01-28 17:48:01 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/855813002/80001
5 years, 10 months ago (2015-01-28 18:07:31 UTC) #20
robwu
kalman@, while we are at it, we can as well mark the notificationId parameter of ...
5 years, 10 months ago (2015-01-28 18:24:10 UTC) #22
not at google - send to devlin
Alright, sure why not, with the same warning I suppose.
5 years, 10 months ago (2015-01-28 18:32:54 UTC) #23
robwu
kalman@: I've marked ID as optional and added a test. PTAL.
5 years, 10 months ago (2015-02-02 23:32:17 UTC) #24
not at google - send to devlin
lgtm https://codereview.chromium.org/855813002/diff/120001/chrome/common/extensions/api/notifications.idl File chrome/common/extensions/api/notifications.idl (right): https://codereview.chromium.org/855813002/diff/120001/chrome/common/extensions/api/notifications.idl#newcode131 chrome/common/extensions/api/notifications.idl:131: // The parameter was required before Chrome 42. ...
5 years, 10 months ago (2015-02-03 18:08:20 UTC) #25
robwu
https://codereview.chromium.org/855813002/diff/120001/chrome/common/extensions/api/notifications.idl File chrome/common/extensions/api/notifications.idl (right): https://codereview.chromium.org/855813002/diff/120001/chrome/common/extensions/api/notifications.idl#newcode131 chrome/common/extensions/api/notifications.idl:131: // The parameter was required before Chrome 42. On ...
5 years, 10 months ago (2015-02-03 18:13:08 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/855813002/140001
5 years, 10 months ago (2015-02-03 18:13:56 UTC) #28
commit-bot: I haz the power
Committed patchset #8 (id:140001)
5 years, 10 months ago (2015-02-03 19:31:38 UTC) #29
commit-bot: I haz the power
5 years, 10 months ago (2015-02-03 19:32:47 UTC) #30
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/ff49cf31bc0e2c4c56e330a978a9f9599d75c6ab
Cr-Commit-Position: refs/heads/master@{#314383}

Powered by Google App Engine
This is Rietveld 408576698