Commit abd82e14 authored by Hui Yingst's avatar Hui Yingst Committed by Chromium LUCI CQ

CodeHealthRotation: Migrate Bind to BindOnce/Repeating in extensions/renderer/bindings/

This CL migrates uses of base::Bind to BindOnce/BindRepeating, and
uses of base::Closure to OnceClosure/RepeatingClosure.

Bug: 1152265
Change-Id: Idfbc16778639cc6668c38b2be47ef839a6e2ca33
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2569960Reviewed-by: default avatarDevlin <rdevlin.cronin@chromium.org>
Commit-Queue: Hui Yingst <nigi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#835394}
parent cec5ff0a
...@@ -62,7 +62,7 @@ TEST_F(BindingAccessCheckerTest, TestHasAccessOrThrowError) { ...@@ -62,7 +62,7 @@ TEST_F(BindingAccessCheckerTest, TestHasAccessOrThrowError) {
TEST_F(BindingAccessCheckerTest, TestHasPromiseAccess) { TEST_F(BindingAccessCheckerTest, TestHasPromiseAccess) {
bool context_allows_promises = true; bool context_allows_promises = true;
auto promises_available = base::Bind( auto promises_available = base::BindRepeating(
[](bool* flag, v8::Local<v8::Context> context) { return *flag; }, [](bool* flag, v8::Local<v8::Context> context) { return *flag; },
&context_allows_promises); &context_allows_promises);
......
...@@ -58,10 +58,10 @@ TestJSRunner::PendingCall::PendingCall() {} ...@@ -58,10 +58,10 @@ TestJSRunner::PendingCall::PendingCall() {}
TestJSRunner::PendingCall::~PendingCall() = default; TestJSRunner::PendingCall::~PendingCall() = default;
TestJSRunner::PendingCall::PendingCall(PendingCall&& other) = default; TestJSRunner::PendingCall::PendingCall(PendingCall&& other) = default;
TestJSRunner::TestJSRunner() {} TestJSRunner::TestJSRunner() = default;
TestJSRunner::TestJSRunner(const base::Closure& will_call_js) TestJSRunner::TestJSRunner(const base::RepeatingClosure& will_call_js)
: will_call_js_(will_call_js) {} : will_call_js_(will_call_js) {}
TestJSRunner::~TestJSRunner() {} TestJSRunner::~TestJSRunner() = default;
void TestJSRunner::RunJSFunction(v8::Local<v8::Function> function, void TestJSRunner::RunJSFunction(v8::Local<v8::Function> function,
v8::Local<v8::Context> context, v8::Local<v8::Context> context,
......
...@@ -71,7 +71,7 @@ class TestJSRunner : public JSRunner { ...@@ -71,7 +71,7 @@ class TestJSRunner : public JSRunner {
TestJSRunner(); TestJSRunner();
// Provides a callback to be called just before JS will be executed. // Provides a callback to be called just before JS will be executed.
explicit TestJSRunner(const base::Closure& will_call_js); explicit TestJSRunner(const base::RepeatingClosure& will_call_js);
~TestJSRunner() override; ~TestJSRunner() override;
// JSRunner: // JSRunner:
...@@ -104,7 +104,7 @@ class TestJSRunner : public JSRunner { ...@@ -104,7 +104,7 @@ class TestJSRunner : public JSRunner {
// Runs all pending calls. // Runs all pending calls.
void Flush(); void Flush();
base::Closure will_call_js_; base::RepeatingClosure will_call_js_;
std::vector<PendingCall> pending_calls_; std::vector<PendingCall> pending_calls_;
DISALLOW_COPY_AND_ASSIGN(TestJSRunner); DISALLOW_COPY_AND_ASSIGN(TestJSRunner);
......
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