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

Unified Diff: webrtc/test/testsupport/fileutils.cc

Issue 2685583009: Make functions in fileutils.h use "const std::string&". (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « webrtc/test/testsupport/fileutils.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/test/testsupport/fileutils.cc
diff --git a/webrtc/test/testsupport/fileutils.cc b/webrtc/test/testsupport/fileutils.cc
index c8054ba826eca7dee6b6c2228fb2d51f74912348..2d3ea00925a10fc3ea7306eaf0454e41f4e8658f 100644
--- a/webrtc/test/testsupport/fileutils.cc
+++ b/webrtc/test/testsupport/fileutils.cc
@@ -101,7 +101,7 @@ void SetExecutablePath(const std::string& path) {
relative_dir_path_set = true;
}
-bool FileExists(std::string& file_name) {
+bool FileExists(const std::string& file_name) {
struct stat file_info = {0};
return stat(file_name.c_str(), &file_info) == 0;
}
@@ -206,7 +206,7 @@ std::string TempFilename(const std::string &dir, const std::string &prefix) {
#endif
}
-bool CreateDir(std::string directory_name) {
+bool CreateDir(const std::string& directory_name) {
struct stat path_info = {0};
// Check if the path exists already:
if (stat(directory_name.c_str(), &path_info) == 0) {
@@ -226,7 +226,8 @@ bool CreateDir(std::string directory_name) {
return true;
}
-std::string ResourcePath(std::string name, std::string extension) {
+std::string ResourcePath(const std::string& name,
+ const std::string& extension) {
#if defined(WEBRTC_IOS)
return IOSResourcePath(name, extension);
#else
@@ -270,7 +271,7 @@ std::string ResourcePath(std::string name, std::string extension) {
#endif // defined (WEBRTC_IOS)
}
-size_t GetFileSize(std::string filename) {
+size_t GetFileSize(const std::string& filename) {
FILE* f = fopen(filename.c_str(), "rb");
size_t size = 0;
if (f != NULL) {
« no previous file with comments | « webrtc/test/testsupport/fileutils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698