commit | 947f56d4f821d0b6207c138e59794fd8d18d7b4d | [log] [tgz] |
---|---|---|
author | Rayan Kanso <[email protected]> | Wed Sep 04 11:25:22 2019 |
committer | Commit Bot <[email protected]> | Wed Sep 04 11:25:22 2019 |
tree | ac82479f11570da7e6e9c17a6f9dbc6ea9db7652 | |
parent | e196c426624d27cc0316def72bcbe8270cce5f60 [diff] [blame] |
[ContentIndex] Check if the SW is active. As per 5.3.1.2 in the spec: https://rayankans.github.io/content-index/spec/#content-index-add Bug: 973844 Change-Id: Ib69b56b2f1def930ac62d40b4175a8bd65f964bb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1781679 Reviewed-by: Richard Knoll <[email protected]> Reviewed-by: Mike West <[email protected]> Commit-Queue: Rayan Kanso <[email protected]> Cr-Commit-Position: refs/heads/master@{#693115}
diff --git a/content/browser/content_index/content_index_database.cc b/content/browser/content_index/content_index_database.cc index 188ba82f..f3aaaa4 100644 --- a/content/browser/content_index/content_index_database.cc +++ b/content/browser/content_index/content_index_database.cc
@@ -174,6 +174,15 @@ return; } + auto* service_worker_registration = + service_worker_context_->GetLiveRegistration( + service_worker_registration_id); + if (!service_worker_registration || + !service_worker_registration->active_version()) { + std::move(callback).Run(blink::mojom::ContentIndexError::NO_SERVICE_WORKER); + return; + } + auto serialized_icons = std::make_unique<proto::SerializedIcons>(); proto::SerializedIcons* serialized_icons_ptr = serialized_icons.get();