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

Side by Side Diff: chrome/browser/history/history_backend.cc

Issue 2714012: Convert page contents grabbing from wide to UTF16. The current code is a bit... (Closed) Base URL: svn://chrome-svn/chrome/trunk/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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/history/history_backend.h" 5 #include "chrome/browser/history/history_backend.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after
756 // then these additional entries will "shadow" the originals when querying 756 // then these additional entries will "shadow" the originals when querying
757 // for the most recent match only, and the user won't get snippets. This is 757 // for the most recent match only, and the user won't get snippets. This is
758 // a very minor issue, and fixing it will make import slower, so we don't 758 // a very minor issue, and fixing it will make import slower, so we don't
759 // bother. 759 // bother.
760 bool has_indexed = false; 760 bool has_indexed = false;
761 if (text_database_.get()) { 761 if (text_database_.get()) {
762 // We do not have to make it update the visit database, below, we will 762 // We do not have to make it update the visit database, below, we will
763 // create the visit entry with the indexed flag set. 763 // create the visit entry with the indexed flag set.
764 has_indexed = text_database_->AddPageData(i->url(), url_id, 0, 764 has_indexed = text_database_->AddPageData(i->url(), url_id, 0,
765 i->last_visit(), 765 i->last_visit(),
766 i->title(), std::wstring()); 766 i->title(), string16());
767 } 767 }
768 768
769 // Make up a visit to correspond to that page. 769 // Make up a visit to correspond to that page.
770 VisitRow visit_info(url_id, i->last_visit(), 0, 770 VisitRow visit_info(url_id, i->last_visit(), 0,
771 PageTransition::LINK | PageTransition::CHAIN_START | 771 PageTransition::LINK | PageTransition::CHAIN_START |
772 PageTransition::CHAIN_END, 0); 772 PageTransition::CHAIN_END, 0);
773 visit_info.is_indexed = has_indexed; 773 visit_info.is_indexed = has_indexed;
774 if (!visit_database->AddVisit(&visit_info)) { 774 if (!visit_database->AddVisit(&visit_info)) {
775 NOTREACHED() << "Adding visit failed."; 775 NOTREACHED() << "Adding visit failed.";
776 return; 776 return;
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after
1419 return true; 1419 return true;
1420 } 1420 }
1421 1421
1422 void HistoryBackend::ScheduleAutocomplete(HistoryURLProvider* provider, 1422 void HistoryBackend::ScheduleAutocomplete(HistoryURLProvider* provider,
1423 HistoryURLProviderParams* params) { 1423 HistoryURLProviderParams* params) {
1424 // ExecuteWithDB should handle the NULL database case. 1424 // ExecuteWithDB should handle the NULL database case.
1425 provider->ExecuteWithDB(this, db_.get(), params); 1425 provider->ExecuteWithDB(this, db_.get(), params);
1426 } 1426 }
1427 1427
1428 void HistoryBackend::SetPageContents(const GURL& url, 1428 void HistoryBackend::SetPageContents(const GURL& url,
1429 const std::wstring& contents) { 1429 const string16& contents) {
1430 // This is histogrammed in the text database manager. 1430 // This is histogrammed in the text database manager.
1431 if (!text_database_.get()) 1431 if (!text_database_.get())
1432 return; 1432 return;
1433 text_database_->AddPageContents(url, contents); 1433 text_database_->AddPageContents(url, contents);
1434 } 1434 }
1435 1435
1436 void HistoryBackend::SetPageThumbnail( 1436 void HistoryBackend::SetPageThumbnail(
1437 const GURL& url, 1437 const GURL& url,
1438 const SkBitmap& thumbnail, 1438 const SkBitmap& thumbnail,
1439 const ThumbnailScore& score) { 1439 const ThumbnailScore& score) {
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after
2131 return true; 2131 return true;
2132 } 2132 }
2133 2133
2134 BookmarkService* HistoryBackend::GetBookmarkService() { 2134 BookmarkService* HistoryBackend::GetBookmarkService() {
2135 if (bookmark_service_) 2135 if (bookmark_service_)
2136 bookmark_service_->BlockTillLoaded(); 2136 bookmark_service_->BlockTillLoaded();
2137 return bookmark_service_; 2137 return bookmark_service_;
2138 } 2138 }
2139 2139
2140 } // namespace history 2140 } // namespace history
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698