Commit efc3cce3 authored by Daniel Murphy's avatar Daniel Murphy Committed by Commit Bot

[Installable] InstallableManager should never return nullptr Manifest.

The new error pathway populated the manifest pointer as a nullptr. The
code can assume that this is never a nullptr, so instead just create
a dummy empty manifest on the stack and send a pointer to that.

Bug: 1110771
Change-Id: If358b4d7251b0a6a858cf91e511dda60ba02ee89
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2327277Reviewed-by: default avatarDominick Ng <dominickn@chromium.org>
Reviewed-by: default avatarGlen Robertson <glenrob@chromium.org>
Commit-Queue: Daniel Murphy <dmurph@chromium.org>
Auto-Submit: Daniel Murphy <dmurph@chromium.org>
Cr-Commit-Position: refs/heads/master@{#795037}
parent 63856da4
...@@ -67,18 +67,20 @@ void InstallableTaskQueue::ResetWithError(InstallableStatusCode code) { ...@@ -67,18 +67,20 @@ void InstallableTaskQueue::ResetWithError(InstallableStatusCode code) {
std::deque<InstallableTask> paused_tasks = std::move(paused_tasks_); std::deque<InstallableTask> paused_tasks = std::move(paused_tasks_);
// Some callbacks might be already invalidated on certain resets, so we must // Some callbacks might be already invalidated on certain resets, so we must
// check for that. // check for that.
// Manifest is assumed to be non-null, so we create an empty one here.
blink::Manifest manifest;
for (InstallableTask& task : tasks) { for (InstallableTask& task : tasks) {
if (task.callback) { if (task.callback) {
std::move(task.callback) std::move(task.callback)
.Run(InstallableData({code}, GURL(), nullptr, GURL(), nullptr, false, .Run(InstallableData({code}, GURL(), &manifest, GURL(), nullptr,
GURL(), nullptr, false, false)); false, GURL(), nullptr, false, false));
} }
} }
for (InstallableTask& task : paused_tasks) { for (InstallableTask& task : paused_tasks) {
if (task.callback) { if (task.callback) {
std::move(task.callback) std::move(task.callback)
.Run(InstallableData({code}, GURL(), nullptr, GURL(), nullptr, false, .Run(InstallableData({code}, GURL(), &manifest, GURL(), nullptr,
GURL(), nullptr, false, false)); false, GURL(), nullptr, false, false));
} }
} }
} }
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