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

Unified Diff: chrome/browser/extensions/api/notifications/notifications_api.cc

Issue 855813002: Mark create/update/clear callbacks of notification API as optional (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments #25 Created 5 years, 11 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
« no previous file with comments | « no previous file | chrome/common/extensions/api/notifications.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/notifications/notifications_api.cc
diff --git a/chrome/browser/extensions/api/notifications/notifications_api.cc b/chrome/browser/extensions/api/notifications/notifications_api.cc
index 3830a7cf3358656bc3cd5745470456688d1350d0..26ee99e1476b8054441f6119dd6854e2a7ef7d18 100644
--- a/chrome/browser/extensions/api/notifications/notifications_api.cc
+++ b/chrome/browser/extensions/api/notifications/notifications_api.cc
@@ -477,9 +477,9 @@ bool NotificationsCreateFunction::RunNotificationsApi() {
const std::string extension_id(extension_->id());
std::string notification_id;
- if (!params_->notification_id.empty()) {
+ if (params_->notification_id.get() && !params_->notification_id->empty()) {
// If the caller provided a notificationId, use that.
- notification_id = params_->notification_id;
+ notification_id = *params_->notification_id;
} else {
// Otherwise, use a randomly created GUID. In case that GenerateGUID returns
// the empty string, simply generate a random string.
« no previous file with comments | « no previous file | chrome/common/extensions/api/notifications.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698