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

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

Issue 2796123003: Componentize safe_browsing: factor out chrome/ deps in ThreatDetailsRedirectsCollector. (Closed)
Patch Set: fix crashes Created 3 years, 8 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 | « no previous file | chrome/browser/safe_browsing/threat_details_history.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/safe_browsing/threat_details.cc
diff --git a/chrome/browser/safe_browsing/threat_details.cc b/chrome/browser/safe_browsing/threat_details.cc
index 27929cb652df7664d90101349be13cadab9cc6b7..d5b8467d14a5c89fe827fc32740d03c851a4ce2b 100644
--- a/chrome/browser/safe_browsing/threat_details.cc
+++ b/chrome/browser/safe_browsing/threat_details.cc
@@ -15,9 +15,11 @@
#include "base/macros.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/string_util.h"
+#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/safe_browsing/threat_details_cache.h"
#include "chrome/browser/safe_browsing/threat_details_history.h"
+#include "components/history/core/browser/history_service.h"
#include "components/safe_browsing/common/safebrowsing_messages.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/navigation_controller.h"
@@ -179,8 +181,13 @@ ThreatDetails::ThreatDetails(BaseUIManager* ui_manager,
did_proceed_(false),
num_visits_(0),
ambiguous_dom_(false),
- cache_collector_(new ThreatDetailsCacheCollector),
- redirects_collector_(new ThreatDetailsRedirectsCollector(profile_)) {
+ cache_collector_(new ThreatDetailsCacheCollector) {
+ history::HistoryService* history_service =
+ HistoryServiceFactory::GetForProfile(profile_,
+ ServiceAccessType::EXPLICIT_ACCESS);
+ redirects_collector_ = new ThreatDetailsRedirectsCollector(
Jialiu Lin 2017/04/05 18:19:47 If history_service is not available, maybe we don'
timvolodine 2017/04/06 14:15:23 Yes that would seem reasonable, because the redire
+ history_service ? history_service->AsWeakPtr()
+ : base::WeakPtr<history::HistoryService>());
StartCollection();
}
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/threat_details_history.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698