Commit 6c2cc182 authored by Varun Khaneja's avatar Varun Khaneja Committed by Commit Bot

Add a check for callback in RunCallbackOnIOThread.

This should catch the cases when the callback is unexpectedly null and
provide a more useful call stack.

I'm not convinced this will trigger because the code already
de-references callback 2 lines later but I don't have a better lead at
the moment.

Bug: 889972
Change-Id: If63da6f5eaa611e9369da7c70cfcfc784695f01c
Reviewed-on: https://chromium-review.googlesource.com/c/1323721Reviewed-by: default avatarNathan Parker <nparker@chromium.org>
Commit-Queue: Varun Khaneja <vakh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#606359}
parent 7f2dee6e
...@@ -36,6 +36,7 @@ void RunCallbackOnIOThread( ...@@ -36,6 +36,7 @@ void RunCallbackOnIOThread(
std::unique_ptr<SafeBrowsingApiHandler::URLCheckCallbackMeta> callback, std::unique_ptr<SafeBrowsingApiHandler::URLCheckCallbackMeta> callback,
SBThreatType threat_type, SBThreatType threat_type,
const ThreatMetadata& metadata) { const ThreatMetadata& metadata) {
CHECK(callback); // Remove after fixing https://crbug.com/889972
base::PostTaskWithTraits( base::PostTaskWithTraits(
FROM_HERE, {BrowserThread::IO}, FROM_HERE, {BrowserThread::IO},
base::BindOnce(std::move(*callback), threat_type, metadata)); base::BindOnce(std::move(*callback), threat_type, metadata));
......
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