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

Unified Diff: chrome/browser/history/text_database_manager.cc

Issue 2802010: Revert 49594 - Convert page contents grabbing from wide to UTF16. The current... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/437/src/
Patch Set: Created 10 years, 6 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
Index: chrome/browser/history/text_database_manager.cc
===================================================================
--- chrome/browser/history/text_database_manager.cc (revision 50158)
+++ chrome/browser/history/text_database_manager.cc (working copy)
@@ -28,18 +28,12 @@
// The number of database files we will be attached to at once.
const int kCacheDBSize = 5;
-std::string ConvertStringForIndexer(const std::wstring& input) {
+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.
const int kExpirationSec = 20;
@@ -64,9 +58,9 @@
title_ = ttl;
}
-void TextDatabaseManager::PageInfo::set_body(const string16& bdy) {
+void TextDatabaseManager::PageInfo::set_body(const std::wstring& bdy) {
if (bdy.empty()) // Make the body nonempty when we set it for EverybodySet.
- body_ = ASCIIToUTF16(" ");
+ body_ = L" ";
else
body_ = bdy;
}
@@ -215,7 +209,7 @@
}
AddPageData(url, url_row.id(), visit.visit_id, visit.visit_time,
- title, string16());
+ title, std::wstring());
return; // We don't know about this page, give up.
}
@@ -232,7 +226,7 @@
}
void TextDatabaseManager::AddPageContents(const GURL& url,
- const string16& body) {
+ const std::wstring& body) {
RecentChangeList::iterator found = recent_changes_.Peek(url);
if (found == recent_changes_.end()) {
// This page is not in our cache of recent pages. This means that the page
@@ -272,7 +266,7 @@
VisitID visit_id,
Time visit_time,
const std::wstring& title,
- const string16& body) {
+ const std::wstring& body) {
TextDatabase* db = GetDBForTime(visit_time, true);
if (!db)
return false;
« no previous file with comments | « chrome/browser/history/text_database_manager.h ('k') | chrome/browser/history/text_database_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698