Commit 98c1b878 authored by Chris Mumford's avatar Chris Mumford Committed by Commit Bot

TestURLLoaderThrottle::destruction_notifier_ now OnceClosure.

TestURLLoaderThrottle is only destroyed once, so OnceClosure
is appropriate.

Bug: 1007835
Change-Id: I2d6b8d4a0f4afa2591ec394c86c8135b0e62fbd6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1911708
Commit-Queue: Chris Mumford <cmumford@google.com>
Reviewed-by: default avatarMatt Falkenhagen <falken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#715785}
parent d78b413d
......@@ -226,12 +226,12 @@ class TestURLLoaderClient : public network::mojom::URLLoaderClient {
class TestURLLoaderThrottle : public blink::URLLoaderThrottle {
public:
TestURLLoaderThrottle() {}
explicit TestURLLoaderThrottle(const base::Closure& destruction_notifier)
: destruction_notifier_(destruction_notifier) {}
explicit TestURLLoaderThrottle(base::OnceClosure destruction_notifier)
: destruction_notifier_(std::move(destruction_notifier)) {}
~TestURLLoaderThrottle() override {
if (destruction_notifier_)
destruction_notifier_.Run();
std::move(destruction_notifier_).Run();
}
using ThrottleCallback =
......@@ -338,7 +338,7 @@ class TestURLLoaderThrottle : public blink::URLLoaderThrottle {
GURL modify_url_in_will_start_;
base::Closure destruction_notifier_;
base::OnceClosure destruction_notifier_;
DISALLOW_COPY_AND_ASSIGN(TestURLLoaderThrottle);
};
......@@ -354,8 +354,8 @@ class ThrottlingURLLoaderTest : public testing::Test {
// testing::Test implementation.
void SetUp() override {
auto throttle = std::make_unique<TestURLLoaderThrottle>(
base::Bind(&ThrottlingURLLoaderTest::ResetThrottleRawPointer,
weak_factory_.GetWeakPtr()));
base::BindOnce(&ThrottlingURLLoaderTest::ResetThrottleRawPointer,
weak_factory_.GetWeakPtr()));
throttle_ = throttle.get();
......
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