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

Side by Side Diff: chrome/browser/history/history_backend.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, 2 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 #include "chrome/browser/history/history_backend.h" 5 #include "chrome/browser/history/history_backend.h"
6 6
7 #include <list> 7 #include <list>
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 1102 matching lines...) Expand 10 before | Expand all | Expand 10 after
1113 if (db_.get()) { 1113 if (db_.get()) {
1114 // If some "in progress" entries were not updated when Chrome exited, they 1114 // If some "in progress" entries were not updated when Chrome exited, they
1115 // need to be cleaned up. 1115 // need to be cleaned up.
1116 db_->CleanUpInProgressEntries(); 1116 db_->CleanUpInProgressEntries();
1117 } 1117 }
1118 } 1118 }
1119 1119
1120 // Update a particular download entry. 1120 // Update a particular download entry.
1121 void HistoryBackend::UpdateDownload(int64 received_bytes, 1121 void HistoryBackend::UpdateDownload(int64 received_bytes,
1122 int32 state, 1122 int32 state,
1123 const base::Time& end_time,
1123 int64 db_handle) { 1124 int64 db_handle) {
1124 if (db_.get()) 1125 if (db_.get())
1125 db_->UpdateDownload(received_bytes, state, db_handle); 1126 db_->UpdateDownload(received_bytes, state, end_time, db_handle);
1126 } 1127 }
1127 1128
1128 // Update the path of a particular download entry. 1129 // Update the path of a particular download entry.
1129 void HistoryBackend::UpdateDownloadPath(const FilePath& path, 1130 void HistoryBackend::UpdateDownloadPath(const FilePath& path,
1130 int64 db_handle) { 1131 int64 db_handle) {
1131 if (db_.get()) 1132 if (db_.get())
1132 db_->UpdateDownloadPath(path, db_handle); 1133 db_->UpdateDownloadPath(path, db_handle);
1133 } 1134 }
1134 1135
1135 // Create a new download entry and pass back the db_handle to it. 1136 // Create a new download entry and pass back the db_handle to it.
(...skipping 13 matching lines...) Expand all
1149 if (db_.get()) 1150 if (db_.get())
1150 db_->RemoveDownload(db_handle); 1151 db_->RemoveDownload(db_handle);
1151 } 1152 }
1152 1153
1153 void HistoryBackend::RemoveDownloadsBetween(const Time remove_begin, 1154 void HistoryBackend::RemoveDownloadsBetween(const Time remove_begin,
1154 const Time remove_end) { 1155 const Time remove_end) {
1155 if (db_.get()) 1156 if (db_.get())
1156 db_->RemoveDownloadsBetween(remove_begin, remove_end); 1157 db_->RemoveDownloadsBetween(remove_begin, remove_end);
1157 } 1158 }
1158 1159
1160 void HistoryBackend::MarkDownloadOpened(int64 db_handle) {
1161 if (db_.get())
1162 db_->MarkDownloadOpened(db_handle);
1163 }
1164
1159 void HistoryBackend::QueryHistory(scoped_refptr<QueryHistoryRequest> request, 1165 void HistoryBackend::QueryHistory(scoped_refptr<QueryHistoryRequest> request,
1160 const string16& text_query, 1166 const string16& text_query,
1161 const QueryOptions& options) { 1167 const QueryOptions& options) {
1162 if (request->canceled()) 1168 if (request->canceled())
1163 return; 1169 return;
1164 1170
1165 TimeTicks beginning_time = TimeTicks::Now(); 1171 TimeTicks beginning_time = TimeTicks::Now();
1166 1172
1167 if (db_.get()) { 1173 if (db_.get()) {
1168 if (text_query.empty()) { 1174 if (text_query.empty()) {
(...skipping 1082 matching lines...) Expand 10 before | Expand all | Expand 10 after
2251 return true; 2257 return true;
2252 } 2258 }
2253 2259
2254 BookmarkService* HistoryBackend::GetBookmarkService() { 2260 BookmarkService* HistoryBackend::GetBookmarkService() {
2255 if (bookmark_service_) 2261 if (bookmark_service_)
2256 bookmark_service_->BlockTillLoaded(); 2262 bookmark_service_->BlockTillLoaded();
2257 return bookmark_service_; 2263 return bookmark_service_;
2258 } 2264 }
2259 2265
2260 } // namespace history 2266 } // namespace history
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698