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

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

Issue 19637009: Revert 212459 "Remove TextDatabase from the history service." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 5 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) 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 // ...
17 // -> ThumbnailDatabase 21 // -> ThumbnailDatabase
18 // -> SQLite connection to Thumbnails 22 // -> SQLite connection to Thumbnails
19 // (and favicons) 23 // (and favicons)
20 24
21 #include "chrome/browser/history/history_service.h" 25 #include "chrome/browser/history/history_service.h"
22 26
23 #include "base/bind_helpers.h" 27 #include "base/bind_helpers.h"
24 #include "base/callback.h" 28 #include "base/callback.h"
25 #include "base/command_line.h" 29 #include "base/command_line.h"
26 #include "base/compiler_specific.h" 30 #include "base/compiler_specific.h"
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 ++i) 590 ++i)
587 urls.push_back(i->url()); 591 urls.push_back(i->url());
588 592
589 visitedlink_master_->AddURLs(urls); 593 visitedlink_master_->AddURLs(urls);
590 } 594 }
591 595
592 ScheduleAndForget(PRIORITY_NORMAL, 596 ScheduleAndForget(PRIORITY_NORMAL,
593 &HistoryBackend::AddPagesWithDetails, info, visit_source); 597 &HistoryBackend::AddPagesWithDetails, info, visit_source);
594 } 598 }
595 599
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
596 HistoryService::Handle HistoryService::GetPageThumbnail( 610 HistoryService::Handle HistoryService::GetPageThumbnail(
597 const GURL& page_url, 611 const GURL& page_url,
598 CancelableRequestConsumerBase* consumer, 612 CancelableRequestConsumerBase* consumer,
599 const ThumbnailDataCallback& callback) { 613 const ThumbnailDataCallback& callback) {
600 DCHECK(thread_checker_.CalledOnValidThread()); 614 DCHECK(thread_checker_.CalledOnValidThread());
601 return Schedule(PRIORITY_NORMAL, &HistoryBackend::GetPageThumbnail, consumer, 615 return Schedule(PRIORITY_NORMAL, &HistoryBackend::GetPageThumbnail, consumer,
602 new history::GetPageThumbnailRequest(callback), page_url); 616 new history::GetPageThumbnailRequest(callback), page_url);
603 } 617 }
604 618
605 CancelableTaskTracker::TaskId HistoryService::GetFavicons( 619 CancelableTaskTracker::TaskId HistoryService::GetFavicons(
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after
1274 DCHECK(thread_checker_.CalledOnValidThread()); 1288 DCHECK(thread_checker_.CalledOnValidThread());
1275 visit_database_observers_.RemoveObserver(observer); 1289 visit_database_observers_.RemoveObserver(observer);
1276 } 1290 }
1277 1291
1278 void HistoryService::NotifyVisitDBObserversOnAddVisit( 1292 void HistoryService::NotifyVisitDBObserversOnAddVisit(
1279 const history::BriefVisitInfo& info) { 1293 const history::BriefVisitInfo& info) {
1280 DCHECK(thread_checker_.CalledOnValidThread()); 1294 DCHECK(thread_checker_.CalledOnValidThread());
1281 FOR_EACH_OBSERVER(history::VisitDatabaseObserver, visit_database_observers_, 1295 FOR_EACH_OBSERVER(history::VisitDatabaseObserver, visit_database_observers_,
1282 OnAddVisit(info)); 1296 OnAddVisit(info));
1283 } 1297 }
OLDNEW
« no previous file with comments | « trunk/src/chrome/browser/history/history_service.h ('k') | trunk/src/chrome/browser/history/history_tab_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698