diff options
author | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-13 22:25:24 +0000 |
---|---|---|
committer | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-13 22:25:24 +0000 |
commit | bac3d04d6bdabbb68e1b6701dc93853070ac4f5c (patch) | |
tree | 2749fac74e644dd89c558a0fb13c5e6ed3fb4a48 /chrome/browser/sync/util | |
parent | 08b4a2ab859622cff114da4a1f97621f1e067886 (diff) | |
download | chromium_src-bac3d04d6bdabbb68e1b6701dc93853070ac4f5c.zip chromium_src-bac3d04d6bdabbb68e1b6701dc93853070ac4f5c.tar.gz chromium_src-bac3d04d6bdabbb68e1b6701dc93853070ac4f5c.tar.bz2 |
Patched in 265058 (which was uploaded under akalin@gmail.com). Original
description:
Numerous fixes to get parts of Chrome Sync to compile on OS X.
Fixes include:
- Added missing definitions for some static const class variables.
- Added some missing dependencies.
- Marked some Windows-only dependencies as such.
- Added stub files for some platform-specific classes.
BUG=none
TEST=Put through trybots.
Review URL: http://codereview.chromium.org/266065
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28900 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync/util')
-rw-r--r-- | chrome/browser/sync/util/character_set_converters_posix.cc (renamed from chrome/browser/sync/util/character_set_converters_linux.cc) | 1 | ||||
-rw-r--r-- | chrome/browser/sync/util/path_helpers_linux.cc | 27 | ||||
-rw-r--r-- | chrome/browser/sync/util/path_helpers_mac.cc | 17 | ||||
-rw-r--r-- | chrome/browser/sync/util/path_helpers_posix.cc | 27 |
4 files changed, 45 insertions, 27 deletions
diff --git a/chrome/browser/sync/util/character_set_converters_linux.cc b/chrome/browser/sync/util/character_set_converters_posix.cc index 3cbcca8..d038f1f 100644 --- a/chrome/browser/sync/util/character_set_converters_linux.cc +++ b/chrome/browser/sync/util/character_set_converters_posix.cc @@ -58,3 +58,4 @@ void TrimPathStringToValidCharacter(PathString* string) { } } // namespace browser_sync + diff --git a/chrome/browser/sync/util/path_helpers_linux.cc b/chrome/browser/sync/util/path_helpers_linux.cc index 851e868..157fa48 100644 --- a/chrome/browser/sync/util/path_helpers_linux.cc +++ b/chrome/browser/sync/util/path_helpers_linux.cc @@ -2,42 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include <sys/types.h> - -#include <string.h> - -#include "base/logging.h" #include "base/port.h" -#include "chrome/browser/sync/util/character_set_converters.h" #include "chrome/browser/sync/util/path_helpers.h" #ifndef OS_LINUX #error Compile this file on Linux only. #endif -string LastPathSegment(const string& path) { - string str(path); - string::size_type final_slash = str.find_last_of('/'); - if (string::npos != final_slash && final_slash == str.length() - 1 - && str.length() > 1) { - str.erase(final_slash); - final_slash = str.find_last_of('/'); - } - if (string::npos == final_slash) - return str; - str.erase(0, final_slash + 1); - return str; -} - PathString GetFullPath(const PathString& path) { // TODO(sync): Not sure what the base of the relative path should be on // linux. return path; } - -PathString AppendSlash(const PathString& path) { - if ((!path.empty()) && (*path.rbegin() != '/')) { - return path + '/'; - } - return path; -} diff --git a/chrome/browser/sync/util/path_helpers_mac.cc b/chrome/browser/sync/util/path_helpers_mac.cc new file mode 100644 index 0000000..3b1c84a --- /dev/null +++ b/chrome/browser/sync/util/path_helpers_mac.cc @@ -0,0 +1,17 @@ +// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "base/port.h" +#include "chrome/browser/sync/util/path_helpers.h" + +#ifndef OS_MACOSX +#error Compile this file on Mac only. +#endif + +PathString GetFullPath(const PathString& path) { + // TODO(sync): Not sure what the base of the relative path should be on + // OS X. + return path; +} + diff --git a/chrome/browser/sync/util/path_helpers_posix.cc b/chrome/browser/sync/util/path_helpers_posix.cc index 9da1adb..f613f44 100644 --- a/chrome/browser/sync/util/path_helpers_posix.cc +++ b/chrome/browser/sync/util/path_helpers_posix.cc @@ -2,10 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <sys/types.h> + #include <algorithm> #include <pwd.h> #include <string.h> +#include "base/logging.h" +#include "base/port.h" +#include "chrome/browser/sync/util/character_set_converters.h" #include "chrome/browser/sync/util/path_helpers.h" #if ((!defined(OS_LINUX)) && (!defined(OS_MACOSX))) @@ -94,3 +99,25 @@ PathString MakePathComponentOSLegal(const PathString& component) { std::replace(new_name.begin(), new_name.end(), '/', ':'); return new_name; } + +string LastPathSegment(const string& path) { + string str(path); + string::size_type final_slash = str.find_last_of('/'); + if (string::npos != final_slash && final_slash == str.length() - 1 + && str.length() > 1) { + str.erase(final_slash); + final_slash = str.find_last_of('/'); + } + if (string::npos == final_slash) + return str; + str.erase(0, final_slash + 1); + return str; +} + +PathString AppendSlash(const PathString& path) { + if ((!path.empty()) && (*path.rbegin() != '/')) { + return path + '/'; + } + return path; +} + |