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

Unified Diff: chrome/browser/safe_browsing/protocol_manager.cc

Issue 303233002: [Android] Add UMA SB download size in background and foreground. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/safe_browsing/protocol_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/safe_browsing/protocol_manager.cc
diff --git a/chrome/browser/safe_browsing/protocol_manager.cc b/chrome/browser/safe_browsing/protocol_manager.cc
index 78d96ca102abcf7cb20ffa97c408eec0a222f946..a87013591408b6876d5add8011d1d29b70815e8d 100644
--- a/chrome/browser/safe_browsing/protocol_manager.cc
+++ b/chrome/browser/safe_browsing/protocol_manager.cc
@@ -124,7 +124,8 @@ SafeBrowsingProtocolManager::SafeBrowsingProtocolManager(
url_prefix_(config.url_prefix),
backup_update_reason_(BACKUP_UPDATE_REASON_MAX),
disable_auto_update_(config.disable_auto_update),
- url_fetcher_id_(0) {
+ url_fetcher_id_(0),
+ app_in_foreground_(true) {
DCHECK(!url_prefix_.empty());
backup_url_prefixes_[BACKUP_UPDATE_REASON_CONNECT] =
@@ -706,7 +707,14 @@ void SafeBrowsingProtocolManager::UpdateFinished(bool success) {
void SafeBrowsingProtocolManager::UpdateFinished(bool success, bool back_off) {
DCHECK(CalledOnValidThread());
+#if defined(OS_ANDROID)
+ if (app_in_foreground_)
+ UMA_HISTOGRAM_COUNTS("SB2.UpdateSizeForeground", update_size_);
+ else
+ UMA_HISTOGRAM_COUNTS("SB2.UpdateSizeBackground", update_size_);
+#else
UMA_HISTOGRAM_COUNTS("SB2.UpdateSize", update_size_);
Scott Hess - ex-Googler 2014/05/30 16:08:21 This should probably just be outside the condition
+#endif
update_size_ = 0;
bool update_success = success || request_type_ == CHUNK_REQUEST;
if (backup_update_reason_ == BACKUP_UPDATE_REASON_MAX) {
« no previous file with comments | « chrome/browser/safe_browsing/protocol_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698