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

Side by Side Diff: chrome/browser/safe_browsing/download_protection_service.cc

Issue 2696973002: Allow Safe Browsing backend to select downloads to upload. (Closed)
Patch Set: Switch histogram to use enum, per isherman Created 3 years, 10 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 #include "chrome/browser/safe_browsing/download_protection_service.h" 5 #include "chrome/browser/safe_browsing/download_protection_service.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 LOG(DFATAL) << "Unknown download response verdict: " 590 LOG(DFATAL) << "Unknown download response verdict: "
591 << response.verdict(); 591 << response.verdict();
592 reason = REASON_INVALID_RESPONSE_VERDICT; 592 reason = REASON_INVALID_RESPONSE_VERDICT;
593 result = UNKNOWN; 593 result = UNKNOWN;
594 } 594 }
595 } 595 }
596 596
597 if (!token.empty()) 597 if (!token.empty())
598 SetDownloadPingToken(item_, token); 598 SetDownloadPingToken(item_, token);
599 599
600 bool upload_requested = response.upload();
600 DownloadFeedbackService::MaybeStorePingsForDownload( 601 DownloadFeedbackService::MaybeStorePingsForDownload(
601 result, item_, client_download_request_data_, data); 602 result, upload_requested, item_, client_download_request_data_, data);
602 } 603 }
603 // We don't need the fetcher anymore. 604 // We don't need the fetcher anymore.
604 fetcher_.reset(); 605 fetcher_.reset();
605 UMA_HISTOGRAM_TIMES("SBClientDownload.DownloadRequestDuration", 606 UMA_HISTOGRAM_TIMES("SBClientDownload.DownloadRequestDuration",
606 base::TimeTicks::Now() - start_time_); 607 base::TimeTicks::Now() - start_time_);
607 UMA_HISTOGRAM_TIMES("SBClientDownload.DownloadRequestNetworkDuration", 608 UMA_HISTOGRAM_TIMES("SBClientDownload.DownloadRequestNetworkDuration",
608 base::TimeTicks::Now() - request_start_time_); 609 base::TimeTicks::Now() - request_start_time_);
609 610
610 FinishRequest(result, reason); 611 FinishRequest(result, reason);
611 } 612 }
(...skipping 1303 matching lines...) Expand 10 before | Expand all | Expand 10 after
1915 UMA_HISTOGRAM_COUNTS_100( 1916 UMA_HISTOGRAM_COUNTS_100(
1916 "SafeBrowsing.ReferrerURLChainSize.PPAPIDownloadAttribution", 1917 "SafeBrowsing.ReferrerURLChainSize.PPAPIDownloadAttribution",
1917 out_request->referrer_chain_size()); 1918 out_request->referrer_chain_size());
1918 UMA_HISTOGRAM_ENUMERATION( 1919 UMA_HISTOGRAM_ENUMERATION(
1919 "SafeBrowsing.ReferrerAttributionResult.PPAPIDownloadAttribution", result, 1920 "SafeBrowsing.ReferrerAttributionResult.PPAPIDownloadAttribution", result,
1920 SafeBrowsingNavigationObserverManager::ATTRIBUTION_FAILURE_TYPE_MAX); 1921 SafeBrowsingNavigationObserverManager::ATTRIBUTION_FAILURE_TYPE_MAX);
1921 out_request->set_download_attribution_finch_enabled(true); 1922 out_request->set_download_attribution_finch_enabled(true);
1922 } 1923 }
1923 1924
1924 } // namespace safe_browsing 1925 } // namespace safe_browsing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698