Chromium Code Reviews

Unified Diff: chrome/browser/sync/util/path_helpers_posix.cc

Issue 211019: Fix compiling of sync on linux. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « chrome/browser/sync/util/path_helpers_linux.cc ('k') | chrome/browser/sync/util/pthread_helpers.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/util/path_helpers_posix.cc
===================================================================
--- chrome/browser/sync/util/path_helpers_posix.cc (revision 26817)
+++ chrome/browser/sync/util/path_helpers_posix.cc (working copy)
@@ -5,6 +5,7 @@
#include <pwd.h>
#include <string.h>
+#include "chrome/browser/sync/notifier/base/string.h"
#include "chrome/browser/sync/util/path_helpers.h"
#if ((!defined(OS_LINUX)) && (!defined(OS_MACOSX)))
@@ -25,15 +26,15 @@
namespace {
// TODO(sync): We really should use char[].
-string cache_dir_;
+ std::string cache_dir_;
}
-void set_cache_dir(string cache_dir) {
+void set_cache_dir(std::string cache_dir) {
CHECK(cache_dir_.empty());
cache_dir_ = cache_dir;
}
-string get_cache_dir() {
+std::string get_cache_dir() {
CHECK(!cache_dir_.empty());
return cache_dir_;
}
@@ -41,7 +42,7 @@
// On Posix, PathStrings are UTF-8, not UTF-16 as they are on Windows. Thus,
// this function is different from the Windows version.
PathString TruncatePathString(const PathString& original, int length) {
- if (original.size() <= length)
+ if (original.size() <= static_cast<size_t>(length))
return original;
if (length <= 0)
return original;
@@ -89,8 +90,7 @@
PathString MakePathComponentOSLegal(const PathString& component) {
if (PathString::npos == component.find("/"))
return PSTR("");
- PathString new_name;
- new_name.reserve(component.size());
- StringReplace(component, "/", ":", true, &new_name);
+ PathString new_name(component);
+ notifier::StringReplace(&new_name, "/", ":", true);
return new_name;
}
« no previous file with comments | « chrome/browser/sync/util/path_helpers_linux.cc ('k') | chrome/browser/sync/util/pthread_helpers.h » ('j') | no next file with comments »

Powered by Google App Engine