Commit 2375e092 authored by Simeon Anfinrud's avatar Simeon Anfinrud Committed by Commit Bot

[Chromecast] Debug leaked validators in device capabilities.

This will print the keys of validators that were not properly
unregistered before the DeviceCapabilitiesImpl destructor on
debug builds.

Bug: Internal b/138262808
Test: cast_shell_browsertests
Change-Id: Ifda5d7f37844dceebc43902fabac0da86212e95a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1715552Reviewed-by: default avatarLuke Halliwell <halliwell@chromium.org>
Reviewed-by: default avatarSean Topping <seantopping@chromium.org>
Commit-Queue: Simeon Anfinrud <sanfin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#680571}
parent 0ab7bd09
......@@ -13,6 +13,7 @@
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/single_thread_task_runner.h"
#include "base/strings/string_util.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/values.h"
#include "chromecast/base/serializers.h"
......@@ -145,7 +146,14 @@ DeviceCapabilitiesImpl::DeviceCapabilitiesImpl()
DeviceCapabilitiesImpl::~DeviceCapabilitiesImpl() {
// Make sure that any registered Validators have unregistered at this point
DCHECK(validator_map_.empty());
DCHECK(validator_map_.empty())
<< "Some validators weren't properly unregistered: " << [this] {
std::vector<std::string> keys;
for (const auto& pair : validator_map_) {
keys.push_back(pair.first);
}
return base::JoinString(keys, ", ");
}();
// Make sure that all observers have been removed at this point
observer_list_->AssertEmpty();
}
......
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