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

Issue 1471763003: [BackgroundSync] Only allow SyncManager.register to occur from main frame (Closed)

Created:
5 years, 1 month ago by jkarlin
Modified:
5 years ago
Reviewers:
michaeln, iclelland
CC:
chromium-reviews, tim+watch_chromium.org, jsbell+serviceworker_chromium.org, serviceworker-reviews, zea+watch_chromium.org, tzik, maxbogue+watch_chromium.org, jam, kinuko+serviceworker, nhiroki, pvalenzuela+watch_chromium.org, michaeln, darin-cc_chromium.org, jkarlin+watch_chromium.org, horo+watch_chromium.org, blink-reviews, plaree+watch_chromium.org, kinuko+watch, blink-worker-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@split
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Only allow SyncManager.register to occur from main frame This CL limits registrations of background syncs to: 1) Main frame documents 2) Service Workers with a main frame window client The main frame document check occurs in SyncManager.cpp The window client check occurs in BackgroundSyncManager.cpp. There are browser tests to verify the functionality. I've removed spurious unittests from background_sync_manager_service_impl.cc. There is not currently a unittest of the ServiceWorkerContextCore change, due to the difficulty of unit testing the render frame host (mocking it out seemed pointless). BUG=558388 Committed: https://crrev.com/0cafe7ecc2c99f9cd7c9392f56814eb83d7eb63d Cr-Commit-Position: refs/heads/master@{#361707}

Patch Set 1 #

Patch Set 2 : Nits #

Patch Set 3 : Rebase #

Patch Set 4 : Forgot file #

Patch Set 5 : Fix script #

Total comments: 4

Patch Set 6 : Address comments from PS5 #

Total comments: 7

Patch Set 7 : Address comments from PS6 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+310 lines, -180 lines) Patch
M content/browser/background_sync/background_sync_browsertest.cc View 3 chunks +31 lines, -0 lines 0 comments Download
M content/browser/background_sync/background_sync_manager.h View 1 2 3 4 5 6 3 chunks +12 lines, -1 line 0 comments Download
M content/browser/background_sync/background_sync_manager.cc View 1 2 3 4 5 6 5 chunks +61 lines, -17 lines 0 comments Download
M content/browser/background_sync/background_sync_manager_unittest.cc View 8 chunks +20 lines, -46 lines 0 comments Download
M content/browser/background_sync/background_sync_service_impl_unittest.cc View 4 chunks +0 lines, -73 lines 0 comments Download
M content/browser/service_worker/service_worker_context_core.h View 2 chunks +5 lines, -3 lines 0 comments Download
M content/browser/service_worker/service_worker_context_core.cc View 1 2 3 4 5 6 3 chunks +44 lines, -2 lines 0 comments Download
M content/browser/service_worker/service_worker_context_unittest.cc View 1 chunk +0 lines, -25 lines 0 comments Download
M content/browser/service_worker/service_worker_context_wrapper.h View 2 chunks +3 lines, -1 line 0 comments Download
M content/browser/service_worker/service_worker_context_wrapper.cc View 1 chunk +9 lines, -5 lines 0 comments Download
M content/test/data/background_sync/background_sync_test_helpers.js View 1 chunk +56 lines, -0 lines 0 comments Download
A + content/test/data/background_sync/empty.html View 0 chunks +-1 lines, --1 lines 0 comments Download
A content/test/data/background_sync/register_sync.html View 1 chunk +10 lines, -0 lines 0 comments Download
A content/test/data/background_sync/register_sync.js View 1 chunk +21 lines, -0 lines 0 comments Download
A content/test/data/background_sync/register_sync_sw.js View 1 2 3 4 1 chunk +22 lines, -0 lines 0 comments Download
M content/test/data/background_sync/service_worker.js View 1 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/background_sync/oneshot.html View 3 chunks +8 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/modules/background_sync/SyncManager.cpp View 1 chunk +8 lines, -0 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 17 (7 generated)
jkarlin
iclelland: PTAL at everything michaeln: PTAL at service_worker code Many thanks!
5 years, 1 month ago (2015-11-23 18:06:01 UTC) #4
jkarlin
Ping!
5 years ago (2015-11-24 16:52:37 UTC) #5
michaeln
lgtm https://codereview.chromium.org/1471763003/diff/80001/content/browser/background_sync/background_sync_manager_unittest.cc File content/browser/background_sync/background_sync_manager_unittest.cc (right): https://codereview.chromium.org/1471763003/diff/80001/content/browser/background_sync/background_sync_manager_unittest.cc#newcode1690 content/browser/background_sync/background_sync_manager_unittest.cc:1690: test_background_sync_manager_->set_has_main_frame_provider_host(false); nice simplification! https://codereview.chromium.org/1471763003/diff/80001/content/browser/service_worker/service_worker_context_core.cc File content/browser/service_worker/service_worker_context_core.cc (right): https://codereview.chromium.org/1471763003/diff/80001/content/browser/service_worker/service_worker_context_core.cc#newcode314 ...
5 years ago (2015-11-25 01:09:46 UTC) #6
jkarlin
Thanks Michael. https://codereview.chromium.org/1471763003/diff/80001/content/browser/background_sync/background_sync_manager_unittest.cc File content/browser/background_sync/background_sync_manager_unittest.cc (right): https://codereview.chromium.org/1471763003/diff/80001/content/browser/background_sync/background_sync_manager_unittest.cc#newcode1690 content/browser/background_sync/background_sync_manager_unittest.cc:1690: test_background_sync_manager_->set_has_main_frame_provider_host(false); On 2015/11/25 01:09:46, michaeln wrote: > ...
5 years ago (2015-11-25 13:15:08 UTC) #7
iclelland
https://codereview.chromium.org/1471763003/diff/100001/content/browser/background_sync/background_sync_manager.cc File content/browser/background_sync/background_sync_manager.cc (right): https://codereview.chromium.org/1471763003/diff/100001/content/browser/background_sync/background_sync_manager.cc#newcode403 content/browser/background_sync/background_sync_manager.cc:403: void BackgroundSyncManager::RegisterCheckIfMainFrame( I know it makes it a bit ...
5 years ago (2015-11-25 14:58:16 UTC) #8
jkarlin
Thanks for the review, PTAL! https://codereview.chromium.org/1471763003/diff/100001/content/browser/background_sync/background_sync_manager.cc File content/browser/background_sync/background_sync_manager.cc (right): https://codereview.chromium.org/1471763003/diff/100001/content/browser/background_sync/background_sync_manager.cc#newcode403 content/browser/background_sync/background_sync_manager.cc:403: void BackgroundSyncManager::RegisterCheckIfMainFrame( On 2015/11/25 ...
5 years ago (2015-11-25 16:47:25 UTC) #9
iclelland
lgtm https://codereview.chromium.org/1471763003/diff/100001/content/browser/service_worker/service_worker_context_core.cc File content/browser/service_worker/service_worker_context_core.cc (right): https://codereview.chromium.org/1471763003/diff/100001/content/browser/service_worker/service_worker_context_core.cc#newcode315 content/browser/service_worker/service_worker_context_core.cc:315: base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, On 2015/11/25 16:47:25, jkarlin wrote: > On ...
5 years ago (2015-11-25 17:06:03 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1471763003/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1471763003/120001
5 years ago (2015-11-25 17:43:04 UTC) #13
commit-bot: I haz the power
Committed patchset #7 (id:120001)
5 years ago (2015-11-25 18:42:23 UTC) #15
commit-bot: I haz the power
5 years ago (2015-11-25 18:42:58 UTC) #17
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/0cafe7ecc2c99f9cd7c9392f56814eb83d7eb63d
Cr-Commit-Position: refs/heads/master@{#361707}

Powered by Google App Engine
This is Rietveld 408576698