From 3f6704035555c9173d54386ea41fc79fe86a09e7 Mon Sep 17 00:00:00 2001 From: "tfarina@chromium.org" Date: Sat, 3 Jul 2010 15:03:22 +0000 Subject: sync: Get rid of the now obsolete character_set_converters.h API. No one is using the utility functions in there, with the one exception. So fixed that case and removed the obsolete API. BUG=26443 TEST=trybots Review URL: http://codereview.chromium.org/2833047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51605 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/sync/engine/conflict_resolver.cc | 1 - chrome/browser/sync/engine/syncapi.cc | 1 - .../browser/sync/util/character_set_converters.h | 22 ---------------------- .../sync/util/character_set_converters_posix.cc | 19 ------------------- .../sync/util/character_set_converters_win.cc | 20 -------------------- chrome/browser/sync/util/user_settings_unittest.cc | 8 +++++--- chrome/chrome.gyp | 3 --- chrome/test/sync/engine/mock_connection_manager.cc | 1 - 8 files changed, 5 insertions(+), 70 deletions(-) delete mode 100644 chrome/browser/sync/util/character_set_converters.h delete mode 100644 chrome/browser/sync/util/character_set_converters_posix.cc delete mode 100644 chrome/browser/sync/util/character_set_converters_win.cc diff --git a/chrome/browser/sync/engine/conflict_resolver.cc b/chrome/browser/sync/engine/conflict_resolver.cc index f81525a..cb6f1f6 100644 --- a/chrome/browser/sync/engine/conflict_resolver.cc +++ b/chrome/browser/sync/engine/conflict_resolver.cc @@ -13,7 +13,6 @@ #include "chrome/browser/sync/sessions/status_controller.h" #include "chrome/browser/sync/syncable/directory_manager.h" #include "chrome/browser/sync/syncable/syncable.h" -#include "chrome/browser/sync/util/character_set_converters.h" #include "chrome/common/deprecated/event_sys-inl.h" using std::map; diff --git a/chrome/browser/sync/engine/syncapi.cc b/chrome/browser/sync/engine/syncapi.cc index d9bfae3..4b65ece 100644 --- a/chrome/browser/sync/engine/syncapi.cc +++ b/chrome/browser/sync/engine/syncapi.cc @@ -46,7 +46,6 @@ #include "chrome/browser/sync/sessions/sync_session_context.h" #include "chrome/browser/sync/syncable/directory_manager.h" #include "chrome/browser/sync/syncable/syncable.h" -#include "chrome/browser/sync/util/character_set_converters.h" #include "chrome/browser/sync/util/closure.h" #include "chrome/browser/sync/util/crypto_helpers.h" #include "chrome/browser/sync/util/path_helpers.h" diff --git a/chrome/browser/sync/util/character_set_converters.h b/chrome/browser/sync/util/character_set_converters.h deleted file mode 100644 index d3b03d3..0000000 --- a/chrome/browser/sync/util/character_set_converters.h +++ /dev/null @@ -1,22 +0,0 @@ -// 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. - -#ifndef CHROME_BROWSER_SYNC_UTIL_CHARACTER_SET_CONVERTERS_H_ -#define CHROME_BROWSER_SYNC_UTIL_CHARACTER_SET_CONVERTERS_H_ - -#include - -#include "base/file_path.h" - -namespace browser_sync { - -// Returns UTF8 string from the given FilePath. -std::string FilePathToUTF8(const FilePath& file_path); - -// Returns FilePath from the given UTF8 string. -FilePath UTF8ToFilePath(const std::string& utf8); - -} // namespace browser_sync - -#endif // CHROME_BROWSER_SYNC_UTIL_CHARACTER_SET_CONVERTERS_H_ diff --git a/chrome/browser/sync/util/character_set_converters_posix.cc b/chrome/browser/sync/util/character_set_converters_posix.cc deleted file mode 100644 index c6ba1b1..0000000 --- a/chrome/browser/sync/util/character_set_converters_posix.cc +++ /dev/null @@ -1,19 +0,0 @@ -// 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 "chrome/browser/sync/util/character_set_converters.h" - -namespace browser_sync { - -// Returns UTF8 string from the given FilePath. -std::string FilePathToUTF8(const FilePath& file_path) { - return file_path.value(); -} - -// Returns FilePath from the given UTF8 string. -FilePath UTF8ToFilePath(const std::string& utf8) { - return FilePath(utf8); -} - -} // namespace browser_sync diff --git a/chrome/browser/sync/util/character_set_converters_win.cc b/chrome/browser/sync/util/character_set_converters_win.cc deleted file mode 100644 index 1032f41..0000000 --- a/chrome/browser/sync/util/character_set_converters_win.cc +++ /dev/null @@ -1,20 +0,0 @@ -// 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/utf_string_conversions.h" -#include "chrome/browser/sync/util/character_set_converters.h" - -namespace browser_sync { - -// Returns UTF8 string from the given FilePath. -std::string FilePathToUTF8(const FilePath& file_path) { - return WideToUTF8(file_path.value()); -} - -// Returns FilePath from the given UTF8 string. -FilePath UTF8ToFilePath(const std::string& utf8) { - return FilePath(UTF8ToWide(utf8)); -} - -} // namespace browser_sync diff --git a/chrome/browser/sync/util/user_settings_unittest.cc b/chrome/browser/sync/util/user_settings_unittest.cc index a39f987..236ecab 100644 --- a/chrome/browser/sync/util/user_settings_unittest.cc +++ b/chrome/browser/sync/util/user_settings_unittest.cc @@ -8,7 +8,6 @@ #include "base/file_util.h" #include "base/scoped_temp_dir.h" #include "chrome/browser/sync/syncable/directory_manager.h" -#include "chrome/browser/sync/util/character_set_converters.h" #include "chrome/browser/sync/util/user_settings.h" #include "chrome/common/sqlite_utils.h" #include "testing/gtest/include/gtest/gtest.h" @@ -16,7 +15,6 @@ using browser_sync::APEncode; using browser_sync::APDecode; using browser_sync::ExecOrDie; -using browser_sync::FilePathToUTF8; using browser_sync::UserSettings; using std::numeric_limits; @@ -79,7 +77,11 @@ class UserSettingsTest : public testing::Test { statement.prepare(primer_handle, query); statement.bind_string(0, "foo@foo.com"); statement.bind_string(1, "foo@foo.com"); - statement.bind_string(2, FilePathToUTF8(old_style_sync_data_path_)); +#if defined(OS_WIN) + statement.bind_string(2, WideToUTF8(old_style_sync_data_path_.value())); +#elif defined(OS_POSIX) + statement.bind_string(2, old_style_sync_data_path_.value()); +#endif if (SQLITE_DONE != statement.step()) { LOG(FATAL) << query << "\n" << sqlite3_errmsg(primer_handle); } diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp index 9427025..2f28517 100644 --- a/chrome/chrome.gyp +++ b/chrome/chrome.gyp @@ -915,9 +915,6 @@ 'browser/sync/syncable/syncable_id.cc', 'browser/sync/syncable/syncable_id.h', 'browser/sync/util/channel.h', - 'browser/sync/util/character_set_converters.h', - 'browser/sync/util/character_set_converters_posix.cc', - 'browser/sync/util/character_set_converters_win.cc', 'browser/sync/util/closure.h', 'browser/sync/util/crypto_helpers.cc', 'browser/sync/util/crypto_helpers.h', diff --git a/chrome/test/sync/engine/mock_connection_manager.cc b/chrome/test/sync/engine/mock_connection_manager.cc index 024fb65..ac1e0f1 100644 --- a/chrome/test/sync/engine/mock_connection_manager.cc +++ b/chrome/test/sync/engine/mock_connection_manager.cc @@ -8,7 +8,6 @@ #include "chrome/browser/sync/engine/syncer_proto_util.h" #include "chrome/browser/sync/protocol/bookmark_specifics.pb.h" -#include "chrome/browser/sync/util/character_set_converters.h" #include "chrome/test/sync/engine/test_id_factory.h" #include "testing/gtest/include/gtest/gtest.h" -- cgit v1.1