Commit cff8ed5d authored by Nico Weber's avatar Nico Weber

Remove a few more unnecessary std::move() calls.

-Wpessimizing-move missed a few calls for a while. Now it finds them again,
so clean them up.

Bug: 1010458
Change-Id: Ifc7a9d354657a863b22324c3eae40787a1064718
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1834905
Commit-Queue: Nico Weber <thakis@chromium.org>
Auto-Submit: Nico Weber <thakis@chromium.org>
Reviewed-by: default avatarBo <boliu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#702084}
parent d754c782
...@@ -38,8 +38,8 @@ void JsJavaConfigurator::SetJsObjects( ...@@ -38,8 +38,8 @@ void JsJavaConfigurator::SetJsObjects(
JsObjectInfo* js_object_info = js_object_info_pair.first->second.get(); JsObjectInfo* js_object_info = js_object_info_pair.first->second.get();
js_object_info->allowed_origin_rules = js_object->allowed_origin_rules; js_object_info->allowed_origin_rules = js_object->allowed_origin_rules;
js_object_info->js_to_java_messaging = js_object_info->js_to_java_messaging =
std::move(mojo::AssociatedRemote<mojom::JsToJavaMessaging>( mojo::AssociatedRemote<mojom::JsToJavaMessaging>(
std::move(js_object->js_to_java_messaging))); std::move(js_object->js_to_java_messaging));
} }
js_objects_.swap(js_objects); js_objects_.swap(js_objects);
} }
......
...@@ -165,9 +165,9 @@ TEST_F(ProcessMetricsDecoratorTest, RefreshTimer) { ...@@ -165,9 +165,9 @@ TEST_F(ProcessMetricsDecoratorTest, RefreshTimer) {
TEST_F(ProcessMetricsDecoratorTest, PartialRefresh) { TEST_F(ProcessMetricsDecoratorTest, PartialRefresh) {
// Only contains the data for one of the two processes. // Only contains the data for one of the two processes.
auto partial_memory_dump = base::make_optional(std::move( auto partial_memory_dump = base::make_optional(
GenerateMemoryDump({{mock_graph()->process->process_id(), GenerateMemoryDump({{mock_graph()->process->process_id(),
kFakeResidentSetKb, kFakePrivateFootprintKb}}))); kFakeResidentSetKb, kFakePrivateFootprintKb}}));
EXPECT_CALL(*decorator(), GetMemoryDump()) EXPECT_CALL(*decorator(), GetMemoryDump())
.WillOnce( .WillOnce(
...@@ -181,9 +181,9 @@ TEST_F(ProcessMetricsDecoratorTest, PartialRefresh) { ...@@ -181,9 +181,9 @@ TEST_F(ProcessMetricsDecoratorTest, PartialRefresh) {
// Do another partial refresh but this time for the other process. The data // Do another partial refresh but this time for the other process. The data
// attached to |mock_graph()->process| shouldn't change. // attached to |mock_graph()->process| shouldn't change.
auto partial_memory_dump2 = base::make_optional(std::move(GenerateMemoryDump( auto partial_memory_dump2 = base::make_optional(GenerateMemoryDump(
{{mock_graph()->other_process->process_id(), kFakeResidentSetKb * 2, {{mock_graph()->other_process->process_id(), kFakeResidentSetKb * 2,
kFakePrivateFootprintKb * 2}}))); kFakePrivateFootprintKb * 2}}));
EXPECT_CALL(*decorator(), GetMemoryDump()) EXPECT_CALL(*decorator(), GetMemoryDump())
.WillOnce( .WillOnce(
testing::Return(testing::ByMove(std::move(partial_memory_dump2)))); testing::Return(testing::ByMove(std::move(partial_memory_dump2))));
......
...@@ -317,8 +317,8 @@ TEST_F(ChromeOmniboxNavigationObserverTest, AlternateNavInfoBar) { ...@@ -317,8 +317,8 @@ TEST_F(ChromeOmniboxNavigationObserverTest, AlternateNavInfoBar) {
net_status = network::URLLoaderCompletionStatus(net::ERR_FAILED); net_status = network::URLLoaderCompletionStatus(net::ERR_FAILED);
} else { } else {
net_status = network::URLLoaderCompletionStatus(net::OK); net_status = network::URLLoaderCompletionStatus(net::OK);
http_head = std::move(network::CreateURLResponseHead( http_head = network::CreateURLResponseHead(
static_cast<net::HttpStatusCode>(response.http_response_code))); static_cast<net::HttpStatusCode>(response.http_response_code));
} }
test_url_loader_factory.AddResponse(GURL(response.urls[0]), test_url_loader_factory.AddResponse(GURL(response.urls[0]),
......
...@@ -81,11 +81,11 @@ struct MockCollectUserDataOptions : public CollectUserDataOptions { ...@@ -81,11 +81,11 @@ struct MockCollectUserDataOptions : public CollectUserDataOptions {
MockCollectUserDataOptions() { MockCollectUserDataOptions() {
base::MockOnceCallback<void(std::unique_ptr<UserData>)> base::MockOnceCallback<void(std::unique_ptr<UserData>)>
mock_confirm_callback; mock_confirm_callback;
confirm_callback = std::move(mock_confirm_callback.Get()); confirm_callback = mock_confirm_callback.Get();
base::MockOnceCallback<void(int)> mock_actions_callback; base::MockOnceCallback<void(int)> mock_actions_callback;
additional_actions_callback = std::move(mock_actions_callback.Get()); additional_actions_callback = mock_actions_callback.Get();
base::MockOnceCallback<void(int)> mock_terms_callback; base::MockOnceCallback<void(int)> mock_terms_callback;
terms_link_callback = std::move(mock_terms_callback.Get()); terms_link_callback = mock_terms_callback.Get();
} }
}; };
......
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