Commit 0881a400 authored by tzik's avatar tzik Committed by Commit Bot

Migrate //courgette to RepeatingCallback

This updates //courgette to use base::RepeatingCallback instead of
legacy base::Callback. No intended functional change is included.

This reduces the number of 'base::Bind' in //courgette from 3 to 0 as
tracked at http://goo.gl/LUVhDj

Bug: 714018
Change-Id: I40ec7c5cd7486f6b1110f13e35fd0368a4db9f3c
Reviewed-on: https://chromium-review.googlesource.com/954886Reviewed-by: default avatarSamuel Huang <huangs@chromium.org>
Commit-Queue: Taiju Tsuiki <tzik@chromium.org>
Cr-Commit-Position: refs/heads/master@{#541735}
parent 9fd63858
......@@ -54,7 +54,7 @@ class AdjustmentMethodTest : public testing::Test {
Label* labelA = prog->FindAbs32Label(kRvaA);
Label* labelB = prog->FindAbs32Label(kRvaB);
InstructionGenerator gen = base::Bind(
InstructionGenerator gen = base::BindRepeating(
[](Label* labelA, Label* labelB,
InstructionReceptor* receptor) -> CheckBool {
EXPECT_TRUE(receptor->EmitAbs32(labelA));
......
......@@ -391,8 +391,8 @@ void DisassemblerElf32::RemoveUnusedRel32Locations(AssemblyProgram* program) {
InstructionGenerator DisassemblerElf32::GetInstructionGenerator(
AssemblyProgram* program) {
return base::Bind(&DisassemblerElf32::ParseFile, base::Unretained(this),
program);
return base::BindRepeating(&DisassemblerElf32::ParseFile,
base::Unretained(this), program);
}
CheckBool DisassemblerElf32::ParseFile(AssemblyProgram* program,
......
......@@ -421,8 +421,8 @@ void DisassemblerWin32::RemoveUnusedRel32Locations(
InstructionGenerator DisassemblerWin32::GetInstructionGenerator(
AssemblyProgram* program) {
return base::Bind(&DisassemblerWin32::ParseFile, base::Unretained(this),
program);
return base::BindRepeating(&DisassemblerWin32::ParseFile,
base::Unretained(this), program);
}
CheckBool DisassemblerWin32::ParseFile(AssemblyProgram* program,
......
......@@ -59,7 +59,8 @@ class InstructionReceptor {
// A rerunable callback that emit instructions to a provided receptor. Returns
// true on success, and false otherwise.
using InstructionGenerator = base::Callback<CheckBool(InstructionReceptor*)>;
using InstructionGenerator =
base::RepeatingCallback<CheckBool(InstructionReceptor*)>;
// A counter that increments via .push_back(), so it can be passed via template
// to substitute std::vector<T>, to count elements instead of storing them.
......
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