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

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

Issue 8008021: Add new UMA stats to get a handle on Downloads UI Usage (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: uma Created 9 years, 3 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 // IN_PROGRESS entries are the corrupted entries, not updated by next function 536 // IN_PROGRESS entries are the corrupted entries, not updated by next function
537 // because of the crash or some other extremal exit. 537 // because of the crash or some other extremal exit.
538 void HistoryService::CleanUpInProgressEntries() { 538 void HistoryService::CleanUpInProgressEntries() {
539 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::CleanUpInProgressEntries); 539 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::CleanUpInProgressEntries);
540 } 540 }
541 541
542 // Handle updates for a particular download. This is a 'fire and forget' 542 // Handle updates for a particular download. This is a 'fire and forget'
543 // operation, so we don't need to be called back. 543 // operation, so we don't need to be called back.
544 void HistoryService::UpdateDownload(int64 received_bytes, 544 void HistoryService::UpdateDownload(int64 received_bytes,
545 int32 state, 545 int32 state,
546 const base::Time& end_time,
546 int64 db_handle) { 547 int64 db_handle) {
547 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::UpdateDownload, 548 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::UpdateDownload,
548 received_bytes, state, db_handle); 549 received_bytes, state, end_time, db_handle);
549 } 550 }
550 551
551 void HistoryService::UpdateDownloadPath(const FilePath& path, 552 void HistoryService::UpdateDownloadPath(const FilePath& path,
552 int64 db_handle) { 553 int64 db_handle) {
553 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::UpdateDownloadPath, 554 ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::UpdateDownloadPath,
554 path, db_handle); 555 path, db_handle);
555 } 556 }
556 557
557 void HistoryService::RemoveDownload(int64 db_handle) { 558 void HistoryService::RemoveDownload(int64 db_handle) {
558 ScheduleAndForget(PRIORITY_NORMAL, 559 ScheduleAndForget(PRIORITY_NORMAL,
559 &HistoryBackend::RemoveDownload, db_handle); 560 &HistoryBackend::RemoveDownload, db_handle);
560 } 561 }
561 562
562 void HistoryService::RemoveDownloadsBetween(Time remove_begin, 563 void HistoryService::RemoveDownloadsBetween(Time remove_begin,
563 Time remove_end) { 564 Time remove_end) {
564 ScheduleAndForget(PRIORITY_NORMAL, 565 ScheduleAndForget(PRIORITY_NORMAL,
565 &HistoryBackend::RemoveDownloadsBetween, 566 &HistoryBackend::RemoveDownloadsBetween,
566 remove_begin, 567 remove_begin,
567 remove_end); 568 remove_end);
568 } 569 }
569 570
571 void HistoryService::MarkDownloadOpened(int64 db_handle) {
572 ScheduleAndForget(PRIORITY_NORMAL,
573 &HistoryBackend::MarkDownloadOpened, db_handle);
574 }
575
570 HistoryService::Handle HistoryService::QueryHistory( 576 HistoryService::Handle HistoryService::QueryHistory(
571 const string16& text_query, 577 const string16& text_query,
572 const history::QueryOptions& options, 578 const history::QueryOptions& options,
573 CancelableRequestConsumerBase* consumer, 579 CancelableRequestConsumerBase* consumer,
574 QueryHistoryCallback* callback) { 580 QueryHistoryCallback* callback) {
575 return Schedule(PRIORITY_UI, &HistoryBackend::QueryHistory, consumer, 581 return Schedule(PRIORITY_UI, &HistoryBackend::QueryHistory, consumer,
576 new history::QueryHistoryRequest(callback), 582 new history::QueryHistoryRequest(callback),
577 text_query, options); 583 text_query, options);
578 } 584 }
579 585
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
831 history::TopSites* ts = profile_->GetTopSitesWithoutCreating(); 837 history::TopSites* ts = profile_->GetTopSitesWithoutCreating();
832 if (ts) 838 if (ts)
833 ts->MigrateFromHistory(); 839 ts->MigrateFromHistory();
834 } 840 }
835 } 841 }
836 842
837 void HistoryService::OnTopSitesReady() { 843 void HistoryService::OnTopSitesReady() {
838 ScheduleAndForget(PRIORITY_NORMAL, 844 ScheduleAndForget(PRIORITY_NORMAL,
839 &HistoryBackend::MigrateThumbnailsDatabase); 845 &HistoryBackend::MigrateThumbnailsDatabase);
840 } 846 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698