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

Issue 1701313002: Partial implementation of subscription restrictions. (Closed)

Created:
4 years, 10 months ago by harkness
Modified:
4 years, 9 months ago
CC:
blink-reviews, blink-reviews-api_chromium.org, chromium-reviews, darin-cc_chromium.org, dglazkov+blink, harkness+watch_chromium.org, jam, johnme+watch_chromium.org, kinuko+watch, mkwst+moarreviews-renderer_chromium.org, mlamouri+watch-content_chromium.org, mlamouri+watch-notifications_chromium.org, mvanouwerkerk+watch_chromium.org, Peter Beverloo
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Partial implementation of subscription restrictions. Currently, chrome requires that app developers provide a "sender_id" tag in the manifest. This id is generated by the developer console and is not standard for all browsers. In the future, the app developer will be able to specify a public key for their service, which will be registered with the push service and which the push service can use to validate app services requesting to send messages. BUG=583753 Committed: https://crrev.com/71f5a08bb30153b56e8a3f9b447264a54b6d9c12 Cr-Commit-Position: refs/heads/master@{#379045}

Patch Set 1 #

Total comments: 21

Patch Set 2 : Rebase and integrate code review comments #

Patch Set 3 : Fixed broken file #

Total comments: 17

Patch Set 4 : Added testing and integrated previous comments. #

Total comments: 20

Patch Set 5 : Added exception failure return and updated more tests #

Total comments: 34

Patch Set 6 : Integrated code review comments #

Total comments: 1

Patch Set 7 : Fixed missing include #

Patch Set 8 : Fix module export build issue #

Unified diffs Side-by-side diffs Delta from patch set Stats (+378 lines, -113 lines) Patch
M chrome/browser/push_messaging/push_messaging_browsertest.cc View 1 2 3 4 5 6 7 chunks +45 lines, -4 lines 0 comments Download
M chrome/browser/push_messaging/push_messaging_service_impl.h View 1 2 3 4 5 3 chunks +4 lines, -5 lines 0 comments Download
M chrome/browser/push_messaging/push_messaging_service_impl.cc View 1 2 3 4 5 6 8 chunks +9 lines, -10 lines 0 comments Download
M chrome/browser/push_messaging/push_messaging_service_unittest.cc View 1 2 3 4 5 6 2 chunks +5 lines, -1 line 0 comments Download
M chrome/test/data/push_messaging/push_test.js View 1 2 3 4 5 2 chunks +38 lines, -0 lines 0 comments Download
M content/browser/push_messaging/push_messaging_message_filter.h View 1 2 3 2 chunks +8 lines, -8 lines 0 comments Download
M content/browser/push_messaging/push_messaging_message_filter.cc View 1 2 3 4 5 9 chunks +27 lines, -23 lines 0 comments Download
M content/child/push_messaging/push_provider.cc View 1 2 3 1 chunk +4 lines, -1 line 0 comments Download
M content/common/push_messaging_messages.h View 1 2 3 3 chunks +9 lines, -4 lines 0 comments Download
M content/public/browser/push_messaging_service.h View 1 2 3 4 2 chunks +9 lines, -10 lines 0 comments Download
A content/public/common/push_subscription_options.h View 1 2 3 1 chunk +32 lines, -0 lines 0 comments Download
M content/renderer/push_messaging/push_messaging_dispatcher.h View 1 2 3 2 chunks +7 lines, -1 line 0 comments Download
M content/renderer/push_messaging/push_messaging_dispatcher.cc View 1 2 3 4 1 chunk +39 lines, -22 lines 0 comments Download
M content/shell/browser/layout_test/layout_test_push_messaging_service.h View 1 2 3 4 2 chunks +4 lines, -4 lines 0 comments Download
M content/shell/browser/layout_test/layout_test_push_messaging_service.cc View 1 2 3 4 5 2 chunks +5 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/modules/modules.gypi View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/push_messaging/PushManager.h View 1 2 3 4 5 6 7 2 chunks +12 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/modules/push_messaging/PushManager.cpp View 1 2 3 4 5 5 chunks +42 lines, -9 lines 0 comments Download
M third_party/WebKit/Source/modules/push_messaging/PushManager.idl View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
A third_party/WebKit/Source/modules/push_messaging/PushManagerTest.cpp View 1 2 3 4 5 1 chunk +68 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/push_messaging/PushSubscriptionOptions.idl View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/public/platform/modules/push_messaging/WebPushSubscriptionOptions.h View 1 2 chunks +6 lines, -0 lines 0 comments Download

Messages

Total messages: 38 (14 generated)
harkness
4 years, 10 months ago (2016-02-17 15:53:10 UTC) #2
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1701313002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1701313002/1
4 years, 10 months ago (2016-02-17 15:55:01 UTC) #4
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: mac_chromium_gn_rel on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_gn_rel/builds/67552)
4 years, 10 months ago (2016-02-17 16:13:34 UTC) #6
Peter Beverloo
Thanks! Most significant comments in content_push_subscription_options.h. Two other points: (1) We need to validate the ...
4 years, 10 months ago (2016-02-17 16:15:36 UTC) #7
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1701313002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1701313002/1
4 years, 10 months ago (2016-02-17 16:21:44 UTC) #9
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: android_clang_dbg_recipe on tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_clang_dbg_recipe/builds/23040)
4 years, 10 months ago (2016-02-17 16:25:21 UTC) #11
harkness
I agree completely about adding more tests and format checking for the input, but I ...
4 years, 10 months ago (2016-02-18 10:45:15 UTC) #12
Peter Beverloo
https://codereview.chromium.org/1701313002/diff/1/content/public/common/content_push_subscription_options.h File content/public/common/content_push_subscription_options.h (right): https://codereview.chromium.org/1701313002/diff/1/content/public/common/content_push_subscription_options.h#newcode26 content/public/common/content_push_subscription_options.h:26: bool using_public_key; On 2016/02/18 10:45:14, harkness wrote: > On ...
4 years, 10 months ago (2016-02-18 11:39:43 UTC) #13
harkness
https://codereview.chromium.org/1701313002/diff/40001/content/browser/push_messaging/push_messaging_message_filter.cc File content/browser/push_messaging/push_messaging_message_filter.cc (right): https://codereview.chromium.org/1701313002/diff/40001/content/browser/push_messaging/push_messaging_message_filter.cc#newcode282 content/browser/push_messaging/push_messaging_message_filter.cc:282: : kPushSenderIdServiceWorkerKey; On 2016/02/18 11:39:43, Peter Beverloo wrote: > ...
4 years, 10 months ago (2016-02-22 15:40:43 UTC) #14
Peter Beverloo
Thanks! Browser side mostly lg, there are a few cleanups that we can do (e.g. ...
4 years, 10 months ago (2016-02-23 14:28:29 UTC) #15
harkness
https://codereview.chromium.org/1701313002/diff/60001/content/renderer/push_messaging/push_messaging_dispatcher.cc File content/renderer/push_messaging/push_messaging_dispatcher.cc (right): https://codereview.chromium.org/1701313002/diff/60001/content/renderer/push_messaging/push_messaging_dispatcher.cc#newcode55 content/renderer/push_messaging/push_messaging_dispatcher.cc:55: } else { On 2016/02/23 14:28:29, Peter Beverloo wrote: ...
4 years, 10 months ago (2016-02-26 11:44:27 UTC) #16
Peter Beverloo
code lgtm % nits and the bug in push_messaging_message_filter.cc. https://codereview.chromium.org/1701313002/diff/60001/content/renderer/push_messaging/push_messaging_dispatcher.cc File content/renderer/push_messaging/push_messaging_dispatcher.cc (right): https://codereview.chromium.org/1701313002/diff/60001/content/renderer/push_messaging/push_messaging_dispatcher.cc#newcode55 content/renderer/push_messaging/push_messaging_dispatcher.cc:55: ...
4 years, 10 months ago (2016-02-26 16:02:34 UTC) #17
harkness
https://codereview.chromium.org/1701313002/diff/80001/chrome/browser/push_messaging/push_messaging_browsertest.cc File chrome/browser/push_messaging/push_messaging_browsertest.cc (right): https://codereview.chromium.org/1701313002/diff/80001/chrome/browser/push_messaging/push_messaging_browsertest.cc#newcode103 chrome/browser/push_messaging/push_messaging_browsertest.cc:103: command_line->AppendSwitch( On 2016/02/26 16:02:33, Peter Beverloo wrote: > Please ...
4 years, 10 months ago (2016-02-26 17:12:05 UTC) #18
harkness
avi@chromium.org: Please review changes in content/public/common/push_subscription_options.h mkwst@chromium.org: Please review changes in content/common/push_messaging_messages.h
4 years, 10 months ago (2016-02-26 17:16:01 UTC) #20
Mike West
Moving the IPC's existing bool and string into a struct LGTM.
4 years, 9 months ago (2016-03-01 19:44:12 UTC) #21
Avi (use Gerrit)
lgtm works for me https://codereview.chromium.org/1701313002/diff/100001/chrome/browser/push_messaging/push_messaging_browsertest.cc File chrome/browser/push_messaging/push_messaging_browsertest.cc (right): https://codereview.chromium.org/1701313002/diff/100001/chrome/browser/push_messaging/push_messaging_browsertest.cc#newcode103 chrome/browser/push_messaging/push_messaging_browsertest.cc:103: // Enable experiemntal features for ...
4 years, 9 months ago (2016-03-01 20:02:59 UTC) #22
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1701313002/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1701313002/100001
4 years, 9 months ago (2016-03-02 18:08:17 UTC) #24
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_gn_chromeos_rel on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_gn_chromeos_rel/builds/151782) mac_chromium_rel_ng on ...
4 years, 9 months ago (2016-03-02 18:30:34 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1701313002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1701313002/120001
4 years, 9 months ago (2016-03-03 15:25:18 UTC) #29
commit-bot: I haz the power
Try jobs failed on following builders: android_clang_dbg_recipe on tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_clang_dbg_recipe/builds/30913)
4 years, 9 months ago (2016-03-03 15:54:29 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1701313002/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1701313002/140001
4 years, 9 months ago (2016-03-03 17:08:38 UTC) #34
commit-bot: I haz the power
Committed patchset #8 (id:140001)
4 years, 9 months ago (2016-03-03 18:45:30 UTC) #35
commit-bot: I haz the power
Patchset 8 (id:??) landed as https://crrev.com/71f5a08bb30153b56e8a3f9b447264a54b6d9c12 Cr-Commit-Position: refs/heads/master@{#379045}
4 years, 9 months ago (2016-03-03 18:47:34 UTC) #37
benwells
4 years, 9 months ago (2016-03-07 23:46:18 UTC) #38
Message was sent while issue was closed.
A revert of this CL (patchset #8 id:140001) has been created in
https://codereview.chromium.org/1770763003/ by benwells@chromium.org.

The reason for reverting is: Sorry about the delay in reverting ...

This is causing many memory errors on DrMemory.

I think there is an error in the patch, in push_messaging_dispatcher.cc. The
same WebPush...Callbacks* can be added twice to |subscription_callbacks_|, in
the new DidGetManifest and in the already existing DoSubscribe.

As |subscription_callbacks_| is declared with IDMapOwnPointer, this will cause
callbacks to be freed twice.

First build where it failed with example errors:

https://build.chromium.org/p/chromium.memory.fyi/builders/Windows%20Browser%2...

Sample output:

UNADDRESSABLE ACCESS beyond heap bounds: writing 0x09880330-0x09880334 4 byte(s)
# 0 modules.dll!blink::WebCallbacks<>::`scalar deleting destructor'
# 1 content.dll!IDMap<>::Releaser<>::release_all                              
[base\id_map.h:250]
# 2 content.dll!content::PushMessagingDispatcher::~PushMessagingDispatcher    
[content\renderer\push_messaging\push_messaging_dispatcher.cc:27]
# 3 content.dll!content::PushMessagingDispatcher::`scalar deleting destructor'
# 4 content.dll!content::RenderFrameObserver::OnDestruct                      
[content\public\renderer\render_frame_observer.cc:33]
# 5 content.dll!content::RenderFrameImpl::`vector deleting destructor'
# 6 content.dll!content::RenderFrameImpl::frameDetached                       
[content\renderer\render_frame_impl.cc:2740]
# 7 blink_web.dll!blink::FrameLoaderClientImpl::detached                      
[third_party\webkit\source\web\frameloaderclientimpl.cpp:383]
# 8 webcore_shared.dll!blink::Frame::detach                                   
[third_party\webkit\source\core\frame\frame.cpp:98]
# 9 webcore_shared.dll!blink::LocalFrame::detach                              
[third_party\webkit\source\core\frame\localframe.cpp:357]
#10 webcore_shared.dll!blink::Page::willBeDestroyed                           
[third_party\webkit\source\core\page\page.cpp:573]
#11 base.dll!base::debug::TaskAnnotator::RunTask                              
[base\debug\task_annotator.cc:51]
#12 scheduler.dll!scheduler::TaskQueueManager::ProcessTaskFromWorkQueue       
[components\scheduler\base\task_queue_manager.cc:288]
#13 scheduler.dll!scheduler::TaskQueueManager::DoWork                         
[components\scheduler\base\task_queue_manager.cc:200]
#14 scheduler.dll!base::internal::Invoker<>::Run                              
[base\bind_internal.h:354]
#15 base.dll!base::debug::TaskAnnotator::RunTask                              
[base\debug\task_annotator.cc:51]
#16 base.dll!base::MessageLoop::RunTask                                       
[base\message_loop\message_loop.cc:476]
#17 base.dll!base::MessageLoop::DeferOrRunPendingTask                         
[base\message_loop\message_loop.cc:485]
#18 base.dll!base::MessageLoop::DoWork                                        
[base\message_loop\message_loop.cc:597]
#19 base.dll!base::MessagePumpDefault::Run                                    
[base\message_loop\message_pump_default.cc:33]
#20 base.dll!base::MessageLoop::RunHandler                                    
[base\message_loop\message_loop.cc:440]
#21 base.dll!base::RunLoop::Run                                               
[base\run_loop.cc:35]
#22 base.dll!base::MessageLoop::Run                                           
[base\message_loop\message_loop.cc:293]
#23 content.dll!content::RendererMain                                         
[content\renderer\renderer_main.cc:219]
#24 content.dll!content::RunNamedProcessTypeMain                              
[content\app\content_main_runner.cc:395]
#25 content.dll!content::ContentMainRunnerImpl::Run                           
[content\app\content_main_runner.cc:766]
#26 content.dll!content::ContentMain                                          
[content\app\content_main.cc:19]
#27 content::LaunchTests                                                      
[content\public\test\test_launcher.cc:505]
#28 LaunchChromeTests                                                         
[chrome\test\base\chrome_test_launcher.cc:128]
#29 main                                                                      
[chrome\test\base\browser_tests_main.cc:21]
Note: @0:03:41.960 in thread 1944
Note: next higher malloc: 0x098804a0-0x098804c0
Note: prev lower malloc:  0x09880248-0x09880310
Note: instruction: mov    $0x679f7ef4 -> (%esi)
The report came from the
`PushMessagingBrowserTest.GrantAlreadyGrantedPermissionDoesNotUnsubscribe` test.
.

Powered by Google App Engine
This is Rietveld 408576698