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

Unified Diff: chrome/renderer/safe_browsing/malware_dom_details.cc

Issue 146053007: Update safe_browsing code to use WebElementCollection instead of WebNodeCollection (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 10 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/renderer/safe_browsing/phishing_dom_feature_extractor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/safe_browsing/malware_dom_details.cc
diff --git a/chrome/renderer/safe_browsing/malware_dom_details.cc b/chrome/renderer/safe_browsing/malware_dom_details.cc
index 605ab69f7acf3e27ad641eb55d2824e6ba76df11..3e83261d420d35b596f990749d52645770980211 100644
--- a/chrome/renderer/safe_browsing/malware_dom_details.cc
+++ b/chrome/renderer/safe_browsing/malware_dom_details.cc
@@ -11,8 +11,8 @@
#include "third_party/WebKit/public/platform/WebString.h"
#include "third_party/WebKit/public/web/WebDocument.h"
#include "third_party/WebKit/public/web/WebElement.h"
+#include "third_party/WebKit/public/web/WebElementCollection.h"
#include "third_party/WebKit/public/web/WebFrame.h"
-#include "third_party/WebKit/public/web/WebNodeCollection.h"
#include "third_party/WebKit/public/web/WebView.h"
namespace safe_browsing {
@@ -71,13 +71,9 @@ void MalwareDOMDetails::ExtractResources(
continue;
}
- blink::WebNodeCollection elements = document.all();
- blink::WebNode cur_node = elements.firstItem();
- for (; !cur_node.isNull(); cur_node = elements.nextItem()) {
- if (!cur_node.isElementNode()) {
- continue;
- }
- blink::WebElement element = cur_node.to<blink::WebElement>();
+ blink::WebElementCollection elements = document.all();
+ blink::WebElement element = elements.firstItem();
+ for (; !element.isNull(); element = elements.nextItem()) {
if (element.hasTagName("iframe") || element.hasTagName("frame") ||
element.hasTagName("embed") || element.hasTagName("script")) {
HandleElement(element, &details_node, resources);
« no previous file with comments | « no previous file | chrome/renderer/safe_browsing/phishing_dom_feature_extractor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698