| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/browser_thread.h" | |
| 10 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 9 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| 11 #include "chrome/browser/tab_contents/navigation_entry.h" | 10 #include "chrome/browser/tab_contents/navigation_entry.h" |
| 12 #include "chrome/browser/tab_contents/tab_contents.h" | 11 #include "chrome/browser/tab_contents/tab_contents.h" |
| 13 #include "chrome/browser/safe_browsing/report.pb.h" | 12 #include "chrome/browser/safe_browsing/report.pb.h" |
| 14 | 13 |
| 15 // Create a MalwareDetails for the given tab. Runs in the UI thread. | 14 // Create a MalwareDetails for the given tab. Runs in the UI thread. |
| 16 MalwareDetails::MalwareDetails( | 15 MalwareDetails::MalwareDetails( |
| 17 TabContents* tab_contents, | 16 TabContents* tab_contents, |
| 18 const SafeBrowsingService::UnsafeResource resource) | 17 const SafeBrowsingService::UnsafeResource resource) |
| 19 : tab_contents_(tab_contents), | 18 : tab_contents_(tab_contents), |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 | 89 |
| 91 // Called from the SB Service on the IO thread. | 90 // Called from the SB Service on the IO thread. |
| 92 const std::string* MalwareDetails::GetSerializedReport() { | 91 const std::string* MalwareDetails::GetSerializedReport() { |
| 93 scoped_ptr<std::string> request_data(new std::string()); | 92 scoped_ptr<std::string> request_data(new std::string()); |
| 94 if (!report_->SerializeToString(request_data.get())) { | 93 if (!report_->SerializeToString(request_data.get())) { |
| 95 DLOG(ERROR) << "Unable to serialize the malware report."; | 94 DLOG(ERROR) << "Unable to serialize the malware report."; |
| 96 } | 95 } |
| 97 | 96 |
| 98 return request_data.release(); | 97 return request_data.release(); |
| 99 } | 98 } |
| OLD | NEW |