libbrillo: update for libchrome uprev (1/n).

BUG=chromium:909719
TEST=emerge

Change-Id: I0bef4aecb7650e794cbb6a41587007983f5a37c3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform2/+/1898235
Tested-by: Qijiang Fan <fqj@google.com>
Commit-Queue: Qijiang Fan <fqj@google.com>
Reviewed-by: Eric Caruso <ejcaruso@chromium.org>
Cr-Mirrored-From: https://chromium.googlesource.com/chromiumos/platform2
Cr-Mirrored-Commit: 52483c8ca2621d102d40a6223ab7ffd8b4f67f5b
diff --git a/brillo/dbus/async_event_sequencer.cc b/brillo/dbus/async_event_sequencer.cc
index 8861e21..5cdf36d 100644
--- a/brillo/dbus/async_event_sequencer.cc
+++ b/brillo/dbus/async_event_sequencer.cc
@@ -4,6 +4,9 @@
 
 #include <brillo/dbus/async_event_sequencer.h>
 
+#include <base/bind.h>
+#include <base/callback.h>
+
 namespace brillo {
 
 namespace dbus_utils {
diff --git a/brillo/dbus/async_event_sequencer.h b/brillo/dbus/async_event_sequencer.h
index c817b55..cc532e6 100644
--- a/brillo/dbus/async_event_sequencer.h
+++ b/brillo/dbus/async_event_sequencer.h
@@ -9,7 +9,7 @@
 #include <string>
 #include <vector>
 
-#include <base/bind.h>
+#include <base/callback_forward.h>
 #include <base/macros.h>
 #include <base/memory/ref_counted.h>
 #include <brillo/brillo_export.h>
diff --git a/brillo/dbus/async_event_sequencer_test.cc b/brillo/dbus/async_event_sequencer_test.cc
index a3a21ba..1026afe 100644
--- a/brillo/dbus/async_event_sequencer_test.cc
+++ b/brillo/dbus/async_event_sequencer_test.cc
@@ -4,6 +4,7 @@
 
 #include <brillo/dbus/async_event_sequencer.h>
 
+#include <base/bind.h>
 #include <base/bind_helpers.h>
 #include <gmock/gmock.h>
 #include <gtest/gtest.h>
diff --git a/brillo/dbus/dbus_method_invoker.h b/brillo/dbus/dbus_method_invoker.h
index b1c15cd..385e98a 100644
--- a/brillo/dbus/dbus_method_invoker.h
+++ b/brillo/dbus/dbus_method_invoker.h
@@ -299,8 +299,9 @@
   ::dbus::ObjectProxy::ResponseCallback dbus_success_callback = base::Bind(
       &TranslateSuccessResponse<OutArgs...>, success_callback, error_callback);
 
-  object->CallMethodWithErrorCallback(
-      &method_call, timeout_ms, dbus_success_callback, dbus_error_callback);
+  object->CallMethodWithErrorCallback(&method_call, timeout_ms,
+                                      std::move(dbus_success_callback),
+                                      std::move(dbus_error_callback));
 }
 
 // Same as CallMethodWithTimeout() but uses a default timeout value.
diff --git a/brillo/dbus/dbus_method_invoker_test.cc b/brillo/dbus/dbus_method_invoker_test.cc
index 514895e..7f0e182 100644
--- a/brillo/dbus/dbus_method_invoker_test.cc
+++ b/brillo/dbus/dbus_method_invoker_test.cc
@@ -263,14 +263,14 @@
           auto response = Response::CreateEmpty();
           MessageWriter writer(response.get());
           writer.AppendString(std::to_string(v1 + v2));
-          success_callback.Run(response.get());
+          std::move(success_callback).Run(response.get());
         }
         return;
       } else if (method_call->GetMember() == kTestMethod2) {
         method_call->SetSerial(123);
         auto error_response = dbus::ErrorResponse::FromMethodCall(
             method_call, "org.MyError", "My error message");
-        error_callback.Run(error_response.get());
+        std::move(error_callback).Run(error_response.get());
         return;
       }
     }
diff --git a/brillo/dbus/dbus_signal_handler.h b/brillo/dbus/dbus_signal_handler.h
index cd4ffbd..e89f867 100644
--- a/brillo/dbus/dbus_signal_handler.h
+++ b/brillo/dbus/dbus_signal_handler.h
@@ -7,6 +7,7 @@
 
 #include <functional>
 #include <string>
+#include <utility>
 
 #include <base/bind.h>
 #include <brillo/dbus/dbus_param_reader.h>
@@ -58,10 +59,9 @@
 
   // Register our stub handler with D-Bus ObjectProxy.
   object_proxy->ConnectToSignal(
-      interface_name,
-      signal_name,
+      interface_name, signal_name,
       base::Bind(dbus_signal_callback, signal_callback_wrapper),
-      on_connected_callback);
+      std::move(on_connected_callback));
 }
 
 }  // namespace dbus_utils
diff --git a/brillo/http/http_proxy_test.cc b/brillo/http/http_proxy_test.cc
index d921a27..6f77f69 100644
--- a/brillo/http/http_proxy_test.cc
+++ b/brillo/http/http_proxy_test.cc
@@ -6,6 +6,7 @@
 
 #include <memory>
 #include <string>
+#include <utility>
 #include <vector>
 
 #include <base/bind.h>
@@ -33,10 +34,10 @@
                                 int timeout_msec,
                                 dbus::ObjectProxy::ResponseCallback callback) {
     if (null_dbus_response_) {
-      callback.Run(nullptr);
+      std::move(callback).Run(nullptr);
       return;
     }
-    callback.Run(CreateDBusResponse(method_call).get());
+    std::move(callback).Run(CreateDBusResponse(method_call).get());
   }
 
   dbus::Response* ResolveProxyHandler(dbus::MethodCall* method_call,
diff --git a/brillo/message_loops/base_message_loop.cc b/brillo/message_loops/base_message_loop.cc
index a7da691..d1c2342 100644
--- a/brillo/message_loops/base_message_loop.cc
+++ b/brillo/message_loops/base_message_loop.cc
@@ -226,7 +226,8 @@
 
 Closure BaseMessageLoop::QuitClosure() const {
   if (base_run_loop_ == nullptr)
-    return base::Bind(&base::DoNothing);
+    // TODO(crbug.com/909719): Replace by base::DoNothing.
+    return base::Bind([]() {});
   return base_run_loop_->QuitClosure();
 }
 
diff --git a/brillo/message_loops/fake_message_loop_test.cc b/brillo/message_loops/fake_message_loop_test.cc
index bb168b7..9a1eca9 100644
--- a/brillo/message_loops/fake_message_loop_test.cc
+++ b/brillo/message_loops/fake_message_loop_test.cc
@@ -65,8 +65,9 @@
   Time start = Time::FromInternalValue(1000000);
   clock_.SetNow(start);
   loop_.reset(new FakeMessageLoop(&clock_));
-  loop_->PostDelayedTask(Bind(&base::DoNothing), TimeDelta::FromSeconds(1));
-  loop_->PostDelayedTask(Bind(&base::DoNothing), TimeDelta::FromSeconds(2));
+  // TODO(crbug.com/909719): Replace by base::DoNothing.
+  loop_->PostDelayedTask(Bind([]() {}), TimeDelta::FromSeconds(1));
+  loop_->PostDelayedTask(Bind([]() {}), TimeDelta::FromSeconds(2));
   EXPECT_FALSE(loop_->RunOnce(false));
   // If the callback didn't run, the time shouldn't change.
   EXPECT_EQ(start, clock_.Now());
@@ -113,7 +114,8 @@
 }
 
 TEST_F(FakeMessageLoopTest, PendingTasksTest) {
-  loop_->PostDelayedTask(Bind(&base::DoNothing), TimeDelta::FromSeconds(1));
+  // TODO(crbug.com/909719): Replace by base::DoNothing.
+  loop_->PostDelayedTask(Bind([]() {}), TimeDelta::FromSeconds(1));
   EXPECT_TRUE(loop_->PendingTasks());
   loop_->Run();
 }
diff --git a/brillo/message_loops/message_loop_test.cc b/brillo/message_loops/message_loop_test.cc
index 5811a42..ea45536 100644
--- a/brillo/message_loops/message_loop_test.cc
+++ b/brillo/message_loops/message_loop_test.cc
@@ -116,7 +116,8 @@
 // MessageLoop. This is important because only one of the two methods is
 // virtual, so you need to unhide the other when overriding the virtual one.
 TYPED_TEST(MessageLoopTest, PostDelayedTaskWithoutLocation) {
-  this->loop_->PostDelayedTask(Bind(&base::DoNothing), TimeDelta());
+  // TODO(crbug.com/909719): Replace by base::DoNothing.
+  this->loop_->PostDelayedTask(Bind([]() {}), TimeDelta());
   EXPECT_EQ(1, MessageLoopRunMaxIterations(this->loop_.get(), 100));
 }
 
diff --git a/brillo/streams/fake_stream.cc b/brillo/streams/fake_stream.cc
index 34cc419..9d7a044 100644
--- a/brillo/streams/fake_stream.cc
+++ b/brillo/streams/fake_stream.cc
@@ -382,7 +382,6 @@
                                      base::TimeDelta timeout,
                                      AccessMode* out_mode,
                                      ErrorPtr* error) {
-  const base::TimeDelta zero_delay;
   bool read_requested = stream_utils::IsReadAccessMode(in_mode);
   bool write_requested = stream_utils::IsWriteAccessMode(in_mode);