| 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 ThreatDetails class. | 5 // Implementation of the ThreatDetails class. |
| 6 | 6 |
| 7 #include "chrome/browser/safe_browsing/threat_details.h" | 7 #include "chrome/browser/safe_browsing/threat_details.h" |
| 8 | 8 |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 #include <stdint.h> | 10 #include <stdint.h> |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 #include "content/public/browser/navigation_entry.h" | 24 #include "content/public/browser/navigation_entry.h" |
| 25 #include "content/public/browser/render_frame_host.h" | 25 #include "content/public/browser/render_frame_host.h" |
| 26 #include "content/public/browser/web_contents.h" | 26 #include "content/public/browser/web_contents.h" |
| 27 #include "net/url_request/url_request_context_getter.h" | 27 #include "net/url_request/url_request_context_getter.h" |
| 28 | 28 |
| 29 using content::BrowserThread; | 29 using content::BrowserThread; |
| 30 using content::NavigationEntry; | 30 using content::NavigationEntry; |
| 31 using content::RenderFrameHost; | 31 using content::RenderFrameHost; |
| 32 using content::WebContents; | 32 using content::WebContents; |
| 33 | 33 |
| 34 // Keep in sync with KMaxNodes in renderer/safe_browsing/threat_dom_details | 34 // Keep in sync with KMaxNodes in components/safe_browsing/renderer/ |
| 35 // threat_dom_details.cc |
| 35 static const uint32_t kMaxDomNodes = 500; | 36 static const uint32_t kMaxDomNodes = 500; |
| 36 | 37 |
| 37 namespace safe_browsing { | 38 namespace safe_browsing { |
| 38 | 39 |
| 39 // static | 40 // static |
| 40 ThreatDetailsFactory* ThreatDetails::factory_ = NULL; | 41 ThreatDetailsFactory* ThreatDetails::factory_ = NULL; |
| 41 | 42 |
| 42 namespace { | 43 namespace { |
| 43 | 44 |
| 44 typedef std::unordered_set<std::string> StringSet; | 45 typedef std::unordered_set<std::string> StringSet; |
| (...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 582 // Send the report, using the SafeBrowsingService. | 583 // Send the report, using the SafeBrowsingService. |
| 583 std::string serialized; | 584 std::string serialized; |
| 584 if (!report_->SerializeToString(&serialized)) { | 585 if (!report_->SerializeToString(&serialized)) { |
| 585 DLOG(ERROR) << "Unable to serialize the threat report."; | 586 DLOG(ERROR) << "Unable to serialize the threat report."; |
| 586 return; | 587 return; |
| 587 } | 588 } |
| 588 ui_manager_->SendSerializedThreatDetails(serialized); | 589 ui_manager_->SendSerializedThreatDetails(serialized); |
| 589 } | 590 } |
| 590 | 591 |
| 591 } // namespace safe_browsing | 592 } // namespace safe_browsing |
| OLD | NEW |