| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 MalwareDetails class. | 5 // Implementation of the MalwareDetails class. |
| 6 | 6 |
| 7 #include "chrome/browser/safe_browsing/malware_details.h" | 7 #include "chrome/browser/safe_browsing/malware_details.h" |
| 8 | 8 |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 const URLFetcher* source, | 106 const URLFetcher* source, |
| 107 const GURL& url, | 107 const GURL& url, |
| 108 const net::URLRequestStatus& status, | 108 const net::URLRequestStatus& status, |
| 109 int response_code, | 109 int response_code, |
| 110 const net::ResponseCookies& cookies, | 110 const net::ResponseCookies& cookies, |
| 111 const std::string& data) { | 111 const std::string& data) { |
| 112 DVLOG(1) << "OnUrlFetchComplete"; | 112 DVLOG(1) << "OnUrlFetchComplete"; |
| 113 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 113 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 114 DCHECK(current_fetch_.get()); | 114 DCHECK(current_fetch_.get()); |
| 115 if (status.status() != net::URLRequestStatus::SUCCESS && | 115 if (status.status() != net::URLRequestStatus::SUCCESS && |
| 116 status.os_error() == net::ERR_CACHE_MISS) { | 116 status.error() == net::ERR_CACHE_MISS) { |
| 117 // Cache miss, skip this resource. | 117 // Cache miss, skip this resource. |
| 118 DVLOG(1) << "Cache miss for url: " << url; | 118 DVLOG(1) << "Cache miss for url: " << url; |
| 119 AdvanceEntry(); | 119 AdvanceEntry(); |
| 120 return; | 120 return; |
| 121 } | 121 } |
| 122 | 122 |
| 123 if (status.status() != net::URLRequestStatus::SUCCESS) { | 123 if (status.status() != net::URLRequestStatus::SUCCESS) { |
| 124 // Some other error occurred, e.g. the request could have been cancelled. | 124 // Some other error occurred, e.g. the request could have been cancelled. |
| 125 DVLOG(1) << "Unsuccessful fetch: " << url; | 125 DVLOG(1) << "Unsuccessful fetch: " << url; |
| 126 AdvanceEntry(); | 126 AdvanceEntry(); |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 BrowserThread::IO, FROM_HERE, | 203 BrowserThread::IO, FROM_HERE, |
| 204 NewRunnableMethod(this, &MalwareDetailsCacheCollector::OpenEntry)); | 204 NewRunnableMethod(this, &MalwareDetailsCacheCollector::OpenEntry)); |
| 205 } | 205 } |
| 206 | 206 |
| 207 void MalwareDetailsCacheCollector::AllDone(bool success) { | 207 void MalwareDetailsCacheCollector::AllDone(bool success) { |
| 208 DVLOG(1) << "AllDone"; | 208 DVLOG(1) << "AllDone"; |
| 209 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 209 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 210 *result_ = success; | 210 *result_ = success; |
| 211 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, callback_); | 211 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, callback_); |
| 212 } | 212 } |
| OLD | NEW |