diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-23 15:35:25 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-23 15:35:25 +0000 |
commit | e5366896e9ccb3dd17c590d115bd999e987a33af (patch) | |
tree | 52f4fc2f07b73aaca1199adb1384b123130c22ed /chrome/browser/history/text_database_manager.cc | |
parent | b133cc2db84fc83d5c4aa53020237788fa344c75 (diff) | |
download | chromium_src-e5366896e9ccb3dd17c590d115bd999e987a33af.zip chromium_src-e5366896e9ccb3dd17c590d115bd999e987a33af.tar.gz chromium_src-e5366896e9ccb3dd17c590d115bd999e987a33af.tar.bz2 |
Replace wstring with string16 in history. The only time wstring is used now in history is for bookmark-related stuff (the bookmarks system is still wstring-based).
The substantial change here is in RTL to make a string16 variant of the functions and in changing the WordIterator to use string16 (this cleaned up some weird utf-32 code).
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/2808017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50597 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/history/text_database_manager.cc')
-rw-r--r-- | chrome/browser/history/text_database_manager.cc | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/chrome/browser/history/text_database_manager.cc b/chrome/browser/history/text_database_manager.cc index 13d681e..ff1ae38 100644 --- a/chrome/browser/history/text_database_manager.cc +++ b/chrome/browser/history/text_database_manager.cc @@ -4,8 +4,6 @@ #include "chrome/browser/history/text_database_manager.h" -#include <string> - #include "base/compiler_specific.h" #include "base/file_util.h" #include "base/histogram.h" @@ -28,17 +26,10 @@ namespace { // The number of database files we will be attached to at once. const int kCacheDBSize = 5; -std::string ConvertStringForIndexer(const std::wstring& input) { - // TODO(evanm): other transformations here? - return WideToUTF8(CollapseWhitespace(input, false)); -} - -#if !defined(OS_WIN) // string16 == wstring on Windows. std::string ConvertStringForIndexer(const string16& input) { // TODO(evanm): other transformations here? return UTF16ToUTF8(CollapseWhitespace(input, false)); } -#endif // Data older than this will be committed to the full text index even if we // haven't gotten a title and/or body. @@ -57,9 +48,9 @@ TextDatabaseManager::PageInfo::PageInfo(URLID url_id, added_time_ = TimeTicks::Now(); } -void TextDatabaseManager::PageInfo::set_title(const std::wstring& ttl) { +void TextDatabaseManager::PageInfo::set_title(const string16& ttl) { if (ttl.empty()) // Make the title nonempty when we set it for EverybodySet. - title_ = L" "; + title_ = ASCIIToUTF16(" "); else title_ = ttl; } @@ -184,7 +175,7 @@ void TextDatabaseManager::AddPageURL(const GURL& url, } void TextDatabaseManager::AddPageTitle(const GURL& url, - const std::wstring& title) { + const string16& title) { RecentChangeList::iterator found = recent_changes_.Peek(url); if (found == recent_changes_.end()) { // This page is not in our cache of recent pages. This is very much an edge @@ -271,7 +262,7 @@ bool TextDatabaseManager::AddPageData(const GURL& url, URLID url_id, VisitID visit_id, Time visit_time, - const std::wstring& title, + const string16& title, const string16& body) { TextDatabase* db = GetDBForTime(visit_time, true); if (!db) @@ -411,7 +402,7 @@ void TextDatabaseManager::OptimizeChangedDatabases( } void TextDatabaseManager::GetTextMatches( - const std::wstring& query, + const string16& query, const QueryOptions& options, std::vector<TextDatabase::Match>* results, Time* first_time_searched) { @@ -425,9 +416,9 @@ void TextDatabaseManager::GetTextMatches( } // Get the query into the proper format for the individual DBs. - std::wstring fts_query_wide; - query_parser_.ParseQuery(query, &fts_query_wide); - std::string fts_query = WideToUTF8(fts_query_wide); + string16 fts_query16; + query_parser_.ParseQuery(query, &fts_query16); + std::string fts_query = UTF16ToUTF8(fts_query16); // Need a copy of the options so we can modify the max count for each call // to the individual databases. |