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

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

Issue 1436273002: Send safe browsing ThreatDetails to track download CTR when user tries to recover blocked downloads (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 5 years, 1 month 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/safe_browsing_service.h" 5 #include "chrome/browser/safe_browsing/safe_browsing_service.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after
638 638
639 state_callback_list_.Notify(); 639 state_callback_list_.Notify();
640 640
641 #if defined(FULL_SAFE_BROWSING) 641 #if defined(FULL_SAFE_BROWSING)
642 if (csd_service_) 642 if (csd_service_)
643 csd_service_->SetEnabledAndRefreshState(enable); 643 csd_service_->SetEnabledAndRefreshState(enable);
644 if (download_service_) 644 if (download_service_)
645 download_service_->SetEnabled(enable); 645 download_service_->SetEnabled(enable);
646 #endif 646 #endif
647 } 647 }
648
649 void SafeBrowsingService::SendDownloadRecoveryReport(
Nathan Parker 2015/11/14 01:04:27 How about moving the thread-hopping to the caller?
Jialiu Lin 2015/11/16 19:30:14 Actually, it is more convenient to do thread hoppi
650 const std::string& report) {
651 DCHECK_CURRENTLY_ON(BrowserThread::UI);
652 BrowserThread::PostTask(
653 BrowserThread::IO, FROM_HERE,
654 base::Bind(&SafeBrowsingService::OnSendDownloadRecoveryReport, this,
655 report));
656 }
657
658 void SafeBrowsingService::OnSendDownloadRecoveryReport(
659 const std::string& report) {
660 LOG(ERROR) << " OnSendDownloadRecoveryReport: " << report;
661 DCHECK_CURRENTLY_ON(BrowserThread::IO);
662 if (ping_manager())
663 ping_manager()->ReportThreatDetails(report);
664 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698