Commit 3775f2c6 authored by Jeremy Roman's avatar Jeremy Roman Committed by Commit Bot

Remove std::bind from remoting/host/.

It's banned; other approaches are preferred in C++11.

Change-Id: I9aa36d895b0d4eb9a290ba6a4df049731faf5cb3
Reviewed-on: https://chromium-review.googlesource.com/574429Reviewed-by: default avatarJoe Downing <joedow@chromium.org>
Reviewed-by: default avatarSergey Ulanov <sergeyu@chromium.org>
Commit-Queue: Jeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#487241}
parent 8bced11d
......@@ -168,9 +168,8 @@ void X11CharacterInjectorTest::InjectAndRun(
const std::vector<uint32_t>& code_points) {
base::RunLoop run_loop;
keyboard_->SetKeyPressFinishedCallback(run_loop.QuitClosure());
std::for_each(code_points.begin(), code_points.end(),
std::bind(&X11CharacterInjector::Inject, injector_.get(),
std::placeholders::_1));
for (uint32_t code_point : code_points)
injector_->Inject(code_point);
keyboard_->ExpectEnterCodePoints(code_points);
run_loop.Run();
}
......
......@@ -66,11 +66,8 @@ bool IsCertificateValid(const std::string& issuer,
// |valid_expiry| is worse.
bool WorseThan(const std::string& issuer,
const base::Time& now,
const std::unique_ptr<net::ClientCertIdentity>& i1,
const std::unique_ptr<net::ClientCertIdentity>& i2) {
net::X509Certificate* c1 = i1->certificate();
net::X509Certificate* c2 = i2->certificate();
const net::X509Certificate* c1,
const net::X509Certificate* c2) {
if (!IsCertificateValid(issuer, now, c2))
return false;
......@@ -218,10 +215,12 @@ void TokenValidatorBase::OnCertificatesSelected(
base::Time now = base::Time::Now();
auto best_match_position =
std::max_element(selected_certs.begin(), selected_certs.end(),
std::bind(&WorseThan, issuer, now, std::placeholders::_1,
std::placeholders::_2));
auto best_match_position = std::max_element(
selected_certs.begin(), selected_certs.end(),
[&issuer, now](const std::unique_ptr<net::ClientCertIdentity>& i1,
const std::unique_ptr<net::ClientCertIdentity>& i2) {
return WorseThan(issuer, now, i1->certificate(), i2->certificate());
});
if (best_match_position == selected_certs.end() ||
!IsCertificateValid(issuer, now, (*best_match_position)->certificate())) {
......
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