|
Generate Web Notification Ids in the //content layer
Today, Web Notifications get a random Id assigned to them by the delegate
used with the message_center::Notification object. This has a number of
implications:
(1) We don't get super smooth "update" transitions for message center
notifications upon replacing a notification.
(2) We continue to rely on the delegates associated with Notification
objects, which in themselves are incompatible with notifications
that can outlive the process they were created by.
(3) It's not possible for the //content layer, that has knowledge of the
notifications that *should* be showing, to close them when certain
events occur (for instance, the Service Worker unregistering). That
leads to unresponsive notifications.
This patch makes the NotificationIdGenerator responsible for creating the
notification Ids, giving us a clear path towards solving these issues. In
addition, it further isolates the concept of persistent notification Ids,
reducing the number of Ids readers of this code have to keep in mind.
The NotificationDatabase's keying scheme has been changed to refer to the
generated Id as opposed to the ever-incrementing persistent notification
ID. This avoids needing separate association keys and removes a DELETE
operation prior to writing data for a potentially replaced notification.
TBR=mkwst (type change in /web/)
BUG= 485985, 439950
Committed: https://crrev.com/c45944c33233a04614dca6eeed41f75e75a943be
Cr-Commit-Position: refs/heads/master@{#418241}
Total comments: 40
Total comments: 40
Total comments: 4
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+702 lines, -686 lines) |
Patch |
|
M |
chrome/browser/notifications/message_center_display_service.h
|
View
|
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
|
M |
chrome/browser/notifications/message_center_display_service.cc
|
View
|
|
1 chunk |
+0 lines, -4 lines |
0 comments
|
Download
|
|
M |
chrome/browser/notifications/message_center_notification_manager.cc
|
View
|
1
|
2 chunks |
+6 lines, -0 lines |
0 comments
|
Download
|
|
M |
chrome/browser/notifications/native_notification_display_service.h
|
View
|
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
|
M |
chrome/browser/notifications/native_notification_display_service.cc
|
View
|
|
1 chunk |
+0 lines, -4 lines |
0 comments
|
Download
|
|
M |
chrome/browser/notifications/notification_display_service.h
|
View
|
|
1 chunk |
+0 lines, -4 lines |
0 comments
|
Download
|
|
M |
chrome/browser/notifications/notification_object_proxy.h
|
View
|
|
2 chunks |
+2 lines, -1 line |
0 comments
|
Download
|
|
M |
chrome/browser/notifications/notification_object_proxy.cc
|
View
|
|
4 chunks |
+5 lines, -5 lines |
0 comments
|
Download
|
|
M |
chrome/browser/notifications/notification_platform_bridge.h
|
View
|
|
1 chunk |
+0 lines, -6 lines |
0 comments
|
Download
|
|
M |
chrome/browser/notifications/notification_platform_bridge_android.h
|
View
|
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
|
M |
chrome/browser/notifications/notification_platform_bridge_android.cc
|
View
|
1
|
2 chunks |
+0 lines, -5 lines |
0 comments
|
Download
|
|
M |
chrome/browser/notifications/notification_platform_bridge_mac.h
|
View
|
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
|
M |
chrome/browser/notifications/notification_platform_bridge_mac.mm
|
View
|
|
1 chunk |
+0 lines, -4 lines |
0 comments
|
Download
|
|
M |
chrome/browser/notifications/persistent_notification_delegate.h
|
View
|
|
3 chunks |
+2 lines, -10 lines |
0 comments
|
Download
|
|
M |
chrome/browser/notifications/persistent_notification_delegate.cc
|
View
|
|
4 chunks |
+6 lines, -21 lines |
0 comments
|
Download
|
|
M |
chrome/browser/notifications/persistent_notification_handler.h
|
View
|
|
1 chunk |
+1 line, -4 lines |
0 comments
|
Download
|
|
M |
chrome/browser/notifications/persistent_notification_handler.cc
|
View
|
1
2
3
|
2 chunks |
+7 lines, -19 lines |
0 comments
|
Download
|
|
M |
chrome/browser/notifications/platform_notification_service_impl.h
|
View
|
|
4 chunks |
+10 lines, -15 lines |
0 comments
|
Download
|
|
M |
chrome/browser/notifications/platform_notification_service_impl.cc
|
View
|
|
13 chunks |
+17 lines, -48 lines |
0 comments
|
Download
|
|
M |
chrome/browser/notifications/platform_notification_service_unittest.cc
|
View
|
1
2
|
7 chunks |
+12 lines, -18 lines |
0 comments
|
Download
|
|
M |
chrome/browser/notifications/stub_notification_platform_bridge.h
|
View
|
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
|
M |
chrome/browser/notifications/stub_notification_platform_bridge.cc
|
View
|
|
1 chunk |
+0 lines, -4 lines |
0 comments
|
Download
|
|
M |
chrome/browser/push_messaging/push_messaging_notification_manager.h
|
View
|
1
2
3
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
chrome/browser/push_messaging/push_messaging_notification_manager.cc
|
View
|
1
2
3
|
3 chunks |
+5 lines, -5 lines |
0 comments
|
Download
|
|
M |
content/browser/notifications/notification_database.h
|
View
|
1
2
3
|
6 chunks |
+25 lines, -19 lines |
0 comments
|
Download
|
|
M |
content/browser/notifications/notification_database.cc
|
View
|
1
2
3
4
|
10 chunks |
+68 lines, -65 lines |
0 comments
|
Download
|
|
M |
content/browser/notifications/notification_database_data.proto
|
View
|
1
2
3
4
|
1 chunk |
+5 lines, -2 lines |
0 comments
|
Download
|
|
M |
content/browser/notifications/notification_database_data_unittest.cc
|
View
|
1
2
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
content/browser/notifications/notification_database_unittest.cc
|
View
|
1
2
3
4
|
19 chunks |
+85 lines, -82 lines |
0 comments
|
Download
|
|
M |
content/browser/notifications/notification_event_dispatcher_impl.h
|
View
|
|
2 chunks |
+2 lines, -4 lines |
0 comments
|
Download
|
|
M |
content/browser/notifications/notification_event_dispatcher_impl.cc
|
View
|
2
|
8 chunks |
+19 lines, -18 lines |
0 comments
|
Download
|
|
M |
content/browser/notifications/notification_id_generator.h
|
View
|
1
|
2 chunks |
+4 lines, -6 lines |
0 comments
|
Download
|
|
M |
content/browser/notifications/notification_id_generator.cc
|
View
|
1
|
4 chunks |
+11 lines, -18 lines |
0 comments
|
Download
|
|
M |
content/browser/notifications/notification_id_generator_unittest.cc
|
View
|
|
12 chunks |
+66 lines, -51 lines |
0 comments
|
Download
|
|
M |
content/browser/notifications/notification_message_filter.h
|
View
|
1
2
|
7 chunks |
+18 lines, -10 lines |
0 comments
|
Download
|
|
M |
content/browser/notifications/notification_message_filter.cc
|
View
|
1
2
|
14 chunks |
+38 lines, -22 lines |
0 comments
|
Download
|
|
M |
content/browser/notifications/page_notification_delegate.h
|
View
|
|
3 chunks |
+7 lines, -2 lines |
0 comments
|
Download
|
|
M |
content/browser/notifications/page_notification_delegate.cc
|
View
|
|
4 chunks |
+12 lines, -5 lines |
0 comments
|
Download
|
|
M |
content/browser/notifications/platform_notification_context_impl.h
|
View
|
1
2
|
5 chunks |
+12 lines, -4 lines |
0 comments
|
Download
|
|
M |
content/browser/notifications/platform_notification_context_impl.cc
|
View
|
1
2
3
4
|
10 chunks |
+32 lines, -19 lines |
0 comments
|
Download
|
|
M |
content/browser/notifications/platform_notification_context_unittest.cc
|
View
|
|
12 chunks |
+15 lines, -14 lines |
0 comments
|
Download
|
|
M |
content/child/notifications/notification_manager.h
|
View
|
1
2
|
3 chunks |
+17 lines, -3 lines |
0 comments
|
Download
|
|
M |
content/child/notifications/notification_manager.cc
|
View
|
1
2
|
8 chunks |
+30 lines, -12 lines |
0 comments
|
Download
|
|
M |
content/common/platform_notification_messages.h
|
View
|
1
2
|
3 chunks |
+11 lines, -8 lines |
0 comments
|
Download
|
|
M |
content/common/service_worker/service_worker_messages.h
|
View
|
1
2
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
content/public/browser/BUILD.gn
|
View
|
1
2
3
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
content/public/browser/notification_database_data.h
|
View
|
1
2
3
4
|
2 chunks |
+11 lines, -3 lines |
0 comments
|
Download
|
|
A |
content/public/browser/notification_database_data.cc
|
View
|
1
2
3
4
|
1 chunk |
+19 lines, -0 lines |
0 comments
|
Download
|
|
M |
content/public/browser/notification_event_dispatcher.h
|
View
|
|
3 chunks |
+5 lines, -7 lines |
0 comments
|
Download
|
|
M |
content/public/browser/platform_notification_context.h
|
View
|
1
2
3
4
|
3 chunks |
+5 lines, -4 lines |
0 comments
|
Download
|
|
M |
content/public/browser/platform_notification_service.h
|
View
|
|
3 chunks |
+3 lines, -2 lines |
0 comments
|
Download
|
|
M |
content/renderer/service_worker/service_worker_context_client.h
|
View
|
1
2
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
content/renderer/service_worker/service_worker_context_client.cc
|
View
|
1
2
|
1 chunk |
+5 lines, -7 lines |
0 comments
|
Download
|
|
M |
content/shell/browser/layout_test/layout_test_notification_manager.h
|
View
|
1
|
4 chunks |
+14 lines, -14 lines |
0 comments
|
Download
|
|
M |
content/shell/browser/layout_test/layout_test_notification_manager.cc
|
View
|
1
|
3 chunks |
+65 lines, -76 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/modules/notifications/Notification.h
|
View
|
1
2
|
2 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/modules/notifications/Notification.cpp
|
View
|
1
2
|
5 chunks |
+4 lines, -7 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/modules/notifications/ServiceWorkerRegistrationNotifications.cpp
|
View
|
1
2
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.h
|
View
|
1
2
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp
|
View
|
1
2
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/public/platform/modules/notifications/WebNotificationManager.h
|
View
|
1
2
|
2 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/public/web/modules/serviceworker/WebServiceWorkerContextProxy.h
|
View
|
1
2
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
Depends on Patchset:
Dependent Patchsets:
Total messages: 59 (41 generated)
|