| OLD | NEW |
| 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 // Implementation of the MalwareDetailsRedirectsCollector class. | 5 // Implementation of the MalwareDetailsRedirectsCollector class. |
| 6 | 6 |
| 7 #include "chrome/browser/safe_browsing/malware_details_history.h" | 7 #include "chrome/browser/safe_browsing/malware_details_history.h" |
| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 } | 82 } |
| 83 | 83 |
| 84 void MalwareDetailsRedirectsCollector::GetRedirects(const GURL& url) { | 84 void MalwareDetailsRedirectsCollector::GetRedirects(const GURL& url) { |
| 85 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 85 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 86 if (!profile_) { | 86 if (!profile_) { |
| 87 AllDone(); | 87 AllDone(); |
| 88 return; | 88 return; |
| 89 } | 89 } |
| 90 | 90 |
| 91 HistoryService* history = HistoryServiceFactory::GetForProfile( | 91 HistoryService* history = HistoryServiceFactory::GetForProfile( |
| 92 profile_, Profile::EXPLICIT_ACCESS); | 92 profile_, ServiceAccessType::EXPLICIT_ACCESS); |
| 93 if (!history) { | 93 if (!history) { |
| 94 AllDone(); | 94 AllDone(); |
| 95 return; | 95 return; |
| 96 } | 96 } |
| 97 | 97 |
| 98 history->QueryRedirectsTo( | 98 history->QueryRedirectsTo( |
| 99 url, | 99 url, |
| 100 base::Bind(&MalwareDetailsRedirectsCollector::OnGotQueryRedirectsTo, | 100 base::Bind(&MalwareDetailsRedirectsCollector::OnGotQueryRedirectsTo, |
| 101 base::Unretained(this), | 101 base::Unretained(this), |
| 102 url), | 102 url), |
| (...skipping 19 matching lines...) Expand all Loading... |
| 122 } | 122 } |
| 123 | 123 |
| 124 GetRedirects(*urls_it_); | 124 GetRedirects(*urls_it_); |
| 125 } | 125 } |
| 126 | 126 |
| 127 void MalwareDetailsRedirectsCollector::AllDone() { | 127 void MalwareDetailsRedirectsCollector::AllDone() { |
| 128 DVLOG(1) << "AllDone"; | 128 DVLOG(1) << "AllDone"; |
| 129 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, callback_); | 129 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, callback_); |
| 130 callback_.Reset(); | 130 callback_.Reset(); |
| 131 } | 131 } |
| OLD | NEW |