Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(801)

Unified Diff: remoting/host/native_messaging/native_messaging_reader_unittest.cc

Issue 1349783006: Cleanup: Pass std::string as const reference if possible (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert third_party changes Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: remoting/host/native_messaging/native_messaging_reader_unittest.cc
diff --git a/remoting/host/native_messaging/native_messaging_reader_unittest.cc b/remoting/host/native_messaging/native_messaging_reader_unittest.cc
index 38728b1a624845e96c9aa0545005d3af22206ae5..4a22ec827cd5b1ff56adf7997d3d375a7f3d0476 100644
--- a/remoting/host/native_messaging/native_messaging_reader_unittest.cc
+++ b/remoting/host/native_messaging/native_messaging_reader_unittest.cc
@@ -30,7 +30,7 @@ class NativeMessagingReaderTest : public testing::Test {
void OnMessage(scoped_ptr<base::Value> message);
// Writes a message (header+body) to the write-end of the pipe.
- void WriteMessage(std::string message);
+ void WriteMessage(const std::string& message);
// Writes some data to the write-end of the pipe.
void WriteData(const char* data, int length);
@@ -74,7 +74,7 @@ void NativeMessagingReaderTest::OnMessage(scoped_ptr<base::Value> message) {
message_ = message.Pass();
}
-void NativeMessagingReaderTest::WriteMessage(std::string message) {
+void NativeMessagingReaderTest::WriteMessage(const std::string& message) {
uint32 length = message.length();
WriteData(reinterpret_cast<char*>(&length), 4);
WriteData(message.data(), length);

Powered by Google App Engine
This is Rietveld 408576698