Commit cf759126 authored by Patrick Monette's avatar Patrick Monette Committed by Commit Bot

Remove wrong DCHECK in ServiceWorkerContextWatcher::OnControlleeAdded

It turns out that it's not always true that the new controllee is not
already in the clients map. This CL removes the DCHECK introduced in
https://chromium-review.googlesource.com/c/chromium/src/+/2151246 and
restores the initial behavior. base::InsertOrAssign() is used instead
of the former usage of the square bracket operator so that a default
constructor for ServiceWorkerClientInfo is not needed.

Bug: 1077372
Change-Id: I4ae7270cc8e757cb0b7662d5d41a7ea0ce3d1f4b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2176287Reviewed-by: default avatarKenichi Ishibashi <bashi@chromium.org>
Reviewed-by: default avatarHiroki Nakagawa <nhiroki@chromium.org>
Commit-Queue: Patrick Monette <pmonette@chromium.org>
Cr-Commit-Position: refs/heads/master@{#766474}
parent 5c826aad
......@@ -7,6 +7,7 @@
#include <utility>
#include "base/bind.h"
#include "base/stl_util.h"
#include "base/task/post_task.h"
#include "content/browser/service_worker/embedded_worker_status.h"
#include "content/browser/service_worker/service_worker_context_wrapper.h"
......@@ -348,8 +349,7 @@ void ServiceWorkerContextWatcher::OnControlleeAdded(
return;
ServiceWorkerVersionInfo* version = it->second.get();
bool inserted = version->clients.emplace(uuid, info).second;
DCHECK(inserted);
base::InsertOrAssign(version->clients, uuid, info);
SendVersionInfo(*version);
}
......
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