Commit d610e98c authored by Jose Lopes's avatar Jose Lopes Committed by Commit Bot

media: Migrate before creation callback to repeating closure.

This closure is run as part of a factory method, therefore it can be run
repeatedly:
* https://source.chromium.org/chromium/chromium/src/+/master:media/base/mock_filters.cc;drc=d9b91db0b32bcaed524db17b05f614c7e86326bc;l=232

This is part of the base::Callback migration.

Context: http://doc/1J4N3V5UmzZL9BZGNrn95E4xJu4cz3ynbg21zXR-J_qA#heading=h.uxpxu8vg4k4r

Bug: 1007805
Change-Id: Ied0c7ed6476c29577bf02821a54c71fdf361dd8a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2111096
Commit-Queue: Jose Lopes <jabolopes@google.com>
Auto-Submit: Jose Lopes <jabolopes@google.com>
Reviewed-by: default avatarXiaohan Wang <xhwang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#755890}
parent 1406e207
......@@ -247,8 +247,8 @@ MockCdm* MockCdmFactory::GetCreatedCdm() {
}
void MockCdmFactory::SetBeforeCreationCB(
const base::Closure& before_creation_cb) {
before_creation_cb_ = before_creation_cb;
base::RepeatingClosure before_creation_cb) {
before_creation_cb_ = std::move(before_creation_cb);
}
MockStreamParser::MockStreamParser() = default;
......
......@@ -650,14 +650,14 @@ class MockCdmFactory : public CdmFactory {
MockCdm* GetCreatedCdm();
// Provide a callback to be called before the CDM is created and returned.
void SetBeforeCreationCB(const base::Closure& before_creation_cb);
void SetBeforeCreationCB(base::RepeatingClosure before_creation_cb);
private:
// Reference to the created CDM.
scoped_refptr<MockCdm> created_cdm_;
// Callback to be used before Create() successfully calls |cdm_created_cb|.
base::Closure before_creation_cb_;
base::RepeatingClosure before_creation_cb_;
DISALLOW_COPY_AND_ASSIGN(MockCdmFactory);
};
......
......@@ -92,7 +92,7 @@ class MojoCdmTest : public ::testing::Test {
if (expected_result == CONNECTION_ERROR_DURING) {
// Create() will be successful, so provide a callback that will break
// the connection before returning the CDM.
cdm_factory_.SetBeforeCreationCB(base::Bind(
cdm_factory_.SetBeforeCreationCB(base::BindRepeating(
&MojoCdmTest::ForceConnectionError, base::Unretained(this)));
}
}
......
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