diff options
author | ki.stfu <ki.stfu@gmail.com> | 2015-09-25 16:17:22 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-09-25 23:18:09 +0000 |
commit | 5e7a0f7968d389c782d56b87846c3cd34238193e (patch) | |
tree | cf1bfb5e98737ec69964966b453a69f516416003 /ipc/ipc_sync_message_unittest.cc | |
parent | f97b2571626e6a54a322515d80bc04de0172d867 (diff) | |
download | chromium_src-5e7a0f7968d389c782d56b87846c3cd34238193e.zip chromium_src-5e7a0f7968d389c782d56b87846c3cd34238193e.tar.gz chromium_src-5e7a0f7968d389c782d56b87846c3cd34238193e.tar.bz2 |
Cleanup: Pass std::string as const reference from ipc/
Passing std::string by reference can prevent extra copying of object.
BUG=367418
TEST=
R=agl@chromium.org,darin@chromium.org,cpu@chromium.org,jeremy@chromium.org
Review URL: https://codereview.chromium.org/1350163006
Cr-Commit-Position: refs/heads/master@{#350942}
Diffstat (limited to 'ipc/ipc_sync_message_unittest.cc')
-rw-r--r-- | ipc/ipc_sync_message_unittest.cc | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/ipc/ipc_sync_message_unittest.cc b/ipc/ipc_sync_message_unittest.cc index 2e3e324..c8edb0c 100644 --- a/ipc/ipc_sync_message_unittest.cc +++ b/ipc/ipc_sync_message_unittest.cc @@ -75,14 +75,18 @@ class TestMessageReceiver { *out3 = false; } - void On_3_1(int in1, bool in2, std::string in3, bool* out1) { + void On_3_1(int in1, bool in2, const std::string& in3, bool* out1) { DCHECK_EQ(1, in1); DCHECK(!in2); DCHECK_EQ("3_1", in3); *out1 = true; } - void On_3_2(std::string in1, bool in2, int in3, bool* out1, int* out2) { + void On_3_2(const std::string& in1, + bool in2, + int in3, + bool* out1, + int* out2) { DCHECK_EQ("3_2", in1); DCHECK(!in2); DCHECK_EQ(2, in3); @@ -90,7 +94,11 @@ class TestMessageReceiver { *out2 = 32; } - void On_3_3(int in1, std::string in2, bool in3, std::string* out1, int* out2, + void On_3_3(int in1, + const std::string& in2, + bool in3, + std::string* out1, + int* out2, bool* out3) { DCHECK_EQ(3, in1); DCHECK_EQ("3_3", in2); @@ -100,8 +108,13 @@ class TestMessageReceiver { *out3 = false; } - void On_3_4(bool in1, int in2, std::string in3, int* out1, bool* out2, - std::string* out3, bool* out4) { + void On_3_4(bool in1, + int in2, + const std::string& in3, + int* out1, + bool* out2, + std::string* out3, + bool* out4) { DCHECK(in1); DCHECK_EQ(3, in2); DCHECK_EQ("3_4", in3); |