service worker: Check installing registrations in ServiceWorkerRegistry (1 of 3)
Before this CL, FindRegistrationForClientUrl() worked like the below: 1. Initialize database if it's not via LazyInitialize(). LazyInitialize() initializes |registered_origins_|. 2. Check if |registered_origins_| contains registration(s). If not, try to find registrations from installing ones. 3. If |registered_origins_| contains registration(s), try to find registrations from database. This ordering doesn't fit well for the storage service migration because step 2 depends on in-memory representation of registrations but we want to move step 1 and 3 to the storage service. Keeping this ordering will require exposing low-level methods like LazyInitialize() to content/. This CL changes the ordering as the blow so that we don't have to expose low-level methods: 1. Initialize database if it's not via LazyInitialize(). 2. Check |registered_origins_| if there is stored registration(s). If not exists, skip database lookup and go to step 4. 3. Try to find registrations from database. 4. If NOT_FOUND is returned from database, try to find registrations from installing ones. The semantics changed slightly but it should be almost the same. There will be two following CLs which do the same for FindRegistrationForScope() and FindRegistrationForId{,Only}(). Bug: 1039200 Change-Id: I97a7821f9c534faae6ab4a638da6d731a4455a6f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1999974 Commit-Queue: Kenichi Ishibashi <bashi@chromium.org> Reviewed-by:Hiroki Nakagawa <nhiroki@chromium.org> Reviewed-by:
Matt Falkenhagen <falken@chromium.org> Cr-Commit-Position: refs/heads/master@{#732293}
Showing
Please register or sign in to comment