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

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

Issue 16951015: Remove TextDatabase from the history service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@replace_fts
Patch Set: Created 7 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // The history system runs on a background thread so that potentially slow 5 // The history system runs on a background thread so that potentially slow
6 // database operations don't delay the browser. This backend processing is 6 // database operations don't delay the browser. This backend processing is
7 // represented by HistoryBackend. The HistoryService's job is to dispatch to 7 // represented by HistoryBackend. The HistoryService's job is to dispatch to
8 // that thread. 8 // that thread.
9 // 9 //
10 // Main thread History thread 10 // Main thread History thread
11 // ----------- -------------- 11 // ----------- --------------
12 // HistoryService <----------------> HistoryBackend 12 // HistoryService <----------------> HistoryBackend
13 // -> HistoryDatabase 13 // -> HistoryDatabase
14 // -> SQLite connection to History 14 // -> SQLite connection to History
15 // -> ArchivedDatabase 15 // -> ArchivedDatabase
16 // -> SQLite connection to Archived History 16 // -> SQLite connection to Archived History
17 // -> TextDatabaseManager
18 // -> SQLite connection to one month's data
19 // -> SQLite connection to one month's data
20 // ...
21 // -> ThumbnailDatabase 17 // -> ThumbnailDatabase
22 // -> SQLite connection to Thumbnails 18 // -> SQLite connection to Thumbnails
23 // (and favicons) 19 // (and favicons)
24 20
25 #include "chrome/browser/history/history_service.h" 21 #include "chrome/browser/history/history_service.h"
26 22
27 #include "base/bind_helpers.h" 23 #include "base/bind_helpers.h"
28 #include "base/callback.h" 24 #include "base/callback.h"
29 #include "base/command_line.h" 25 #include "base/command_line.h"
30 #include "base/compiler_specific.h" 26 #include "base/compiler_specific.h"
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 ++i) 586 ++i)
591 urls.push_back(i->url()); 587 urls.push_back(i->url());
592 588
593 visitedlink_master_->AddURLs(urls); 589 visitedlink_master_->AddURLs(urls);
594 } 590 }
595 591
596 ScheduleAndForget(PRIORITY_NORMAL, 592 ScheduleAndForget(PRIORITY_NORMAL,
597 &HistoryBackend::AddPagesWithDetails, info, visit_source); 593 &HistoryBackend::AddPagesWithDetails, info, visit_source);
598 } 594 }
599 595
600 void HistoryService::SetPageContents(const GURL& url,
601 const string16& contents) {
602 DCHECK(thread_checker_.CalledOnValidThread());
603 if (!CanAddURL(url))
604 return;
605
606 ScheduleAndForget(PRIORITY_LOW, &HistoryBackend::SetPageContents,
607 url, contents);
608 }
609
610 HistoryService::Handle HistoryService::GetPageThumbnail( 596 HistoryService::Handle HistoryService::GetPageThumbnail(
611 const GURL& page_url, 597 const GURL& page_url,
612 CancelableRequestConsumerBase* consumer, 598 CancelableRequestConsumerBase* consumer,
613 const ThumbnailDataCallback& callback) { 599 const ThumbnailDataCallback& callback) {
614 DCHECK(thread_checker_.CalledOnValidThread()); 600 DCHECK(thread_checker_.CalledOnValidThread());
615 return Schedule(PRIORITY_NORMAL, &HistoryBackend::GetPageThumbnail, consumer, 601 return Schedule(PRIORITY_NORMAL, &HistoryBackend::GetPageThumbnail, consumer,
616 new history::GetPageThumbnailRequest(callback), page_url); 602 new history::GetPageThumbnailRequest(callback), page_url);
617 } 603 }
618 604
619 CancelableTaskTracker::TaskId HistoryService::GetFavicons( 605 CancelableTaskTracker::TaskId HistoryService::GetFavicons(
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
1273 DCHECK(thread_checker_.CalledOnValidThread()); 1259 DCHECK(thread_checker_.CalledOnValidThread());
1274 visit_database_observers_.RemoveObserver(observer); 1260 visit_database_observers_.RemoveObserver(observer);
1275 } 1261 }
1276 1262
1277 void HistoryService::NotifyVisitDBObserversOnAddVisit( 1263 void HistoryService::NotifyVisitDBObserversOnAddVisit(
1278 const history::BriefVisitInfo& info) { 1264 const history::BriefVisitInfo& info) {
1279 DCHECK(thread_checker_.CalledOnValidThread()); 1265 DCHECK(thread_checker_.CalledOnValidThread());
1280 FOR_EACH_OBSERVER(history::VisitDatabaseObserver, visit_database_observers_, 1266 FOR_EACH_OBSERVER(history::VisitDatabaseObserver, visit_database_observers_,
1281 OnAddVisit(info)); 1267 OnAddVisit(info));
1282 } 1268 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698