Commit 451c1510 authored by Victor Costan's avatar Victor Costan Committed by Chromium LUCI CQ

WebApps: Remove unused InstallableManager::has_pwa_check_.

The data member is never read. This CL simplifies the code by removing
the member and the now-unused IsParamsForPwaCheck() function.

Bug: 976033
Change-Id: Idf1f4a1fc17ba5b36854940741d4162bd034a44e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2567498
Commit-Queue: Victor Costan <pwnall@chromium.org>
Reviewed-by: default avatarDominick Ng <dominickn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#832602}
parent e681d675
...@@ -189,12 +189,6 @@ bool ShouldRejectDisplayMode(blink::mojom::DisplayMode display_mode) { ...@@ -189,12 +189,6 @@ bool ShouldRejectDisplayMode(blink::mojom::DisplayMode display_mode) {
base::FeatureList::IsEnabled(features::kWebAppWindowControlsOverlay))); base::FeatureList::IsEnabled(features::kWebAppWindowControlsOverlay)));
} }
// Returns true if |params| specifies a full PWA check.
bool IsParamsForPwaCheck(const InstallableParams& params) {
return params.valid_manifest && params.has_worker &&
params.valid_primary_icon;
}
void OnDidCompleteGetAllErrors( void OnDidCompleteGetAllErrors(
base::OnceCallback<void(std::vector<content::InstallabilityError> base::OnceCallback<void(std::vector<content::InstallabilityError>
installability_errors)> callback, installability_errors)> callback,
...@@ -234,7 +228,7 @@ InstallableManager::IconProperty::IconProperty() ...@@ -234,7 +228,7 @@ InstallableManager::IconProperty::IconProperty()
InstallableManager::IconProperty::IconProperty(IconProperty&& other) = default; InstallableManager::IconProperty::IconProperty(IconProperty&& other) = default;
InstallableManager::IconProperty::~IconProperty() {} InstallableManager::IconProperty::~IconProperty() = default;
InstallableManager::IconProperty& InstallableManager::IconProperty::operator=( InstallableManager::IconProperty& InstallableManager::IconProperty::operator=(
InstallableManager::IconProperty&& other) = default; InstallableManager::IconProperty&& other) = default;
...@@ -245,8 +239,7 @@ InstallableManager::InstallableManager(content::WebContents* web_contents) ...@@ -245,8 +239,7 @@ InstallableManager::InstallableManager(content::WebContents* web_contents)
manifest_(std::make_unique<ManifestProperty>()), manifest_(std::make_unique<ManifestProperty>()),
valid_manifest_(std::make_unique<ValidManifestProperty>()), valid_manifest_(std::make_unique<ValidManifestProperty>()),
worker_(std::make_unique<ServiceWorkerProperty>()), worker_(std::make_unique<ServiceWorkerProperty>()),
service_worker_context_(nullptr), service_worker_context_(nullptr) {
has_pwa_check_(false) {
// This is null in unit tests. // This is null in unit tests.
if (web_contents) { if (web_contents) {
content::StoragePartition* storage_partition = content::StoragePartition* storage_partition =
...@@ -304,9 +297,6 @@ void InstallableManager::GetData(const InstallableParams& params, ...@@ -304,9 +297,6 @@ void InstallableManager::GetData(const InstallableParams& params,
DCHECK_CURRENTLY_ON(content::BrowserThread::UI); DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
DCHECK(callback); DCHECK(callback);
if (IsParamsForPwaCheck(params))
has_pwa_check_ = true;
// Return immediately if we're already working on a task. The new task will be // Return immediately if we're already working on a task. The new task will be
// looked at once the current task is finished. // looked at once the current task is finished.
bool was_active = task_queue_.HasCurrent(); bool was_active = task_queue_.HasCurrent();
...@@ -482,7 +472,6 @@ void InstallableManager::Reset(base::Optional<InstallableStatusCode> error) { ...@@ -482,7 +472,6 @@ void InstallableManager::Reset(base::Optional<InstallableStatusCode> error) {
task_queue_.ResetWithError(error.value()); task_queue_.ResetWithError(error.value());
else else
task_queue_.Reset(); task_queue_.Reset();
has_pwa_check_ = false;
eligibility_ = std::make_unique<EligiblityProperty>(); eligibility_ = std::make_unique<EligiblityProperty>();
manifest_ = std::make_unique<ManifestProperty>(); manifest_ = std::make_unique<ManifestProperty>();
...@@ -835,7 +824,7 @@ void InstallableManager::OnIconFetched(const GURL icon_url, ...@@ -835,7 +824,7 @@ void InstallableManager::OnIconFetched(const GURL icon_url,
icon.error = NO_ICON_AVAILABLE; icon.error = NO_ICON_AVAILABLE;
} else { } else {
icon.url = icon_url; icon.url = icon_url;
icon.icon.reset(new SkBitmap(bitmap)); icon.icon = std::make_unique<SkBitmap>(bitmap);
} }
WorkOnTask(); WorkOnTask();
......
...@@ -259,10 +259,6 @@ class InstallableManager ...@@ -259,10 +259,6 @@ class InstallableManager
// this object is scoped to. // this object is scoped to.
content::ServiceWorkerContext* service_worker_context_; content::ServiceWorkerContext* service_worker_context_;
// True if for the current page load we have in queue or completed a task
// which queries the full PWA parameters.
bool has_pwa_check_;
base::WeakPtrFactory<InstallableManager> weak_factory_{this}; base::WeakPtrFactory<InstallableManager> weak_factory_{this};
WEB_CONTENTS_USER_DATA_KEY_DECL(); WEB_CONTENTS_USER_DATA_KEY_DECL();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment