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

Unified Diff: content/renderer/savable_resources.cc

Issue 149913011: Update content/renderer 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 | « content/renderer/dom_serializer_browsertest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/savable_resources.cc
diff --git a/content/renderer/savable_resources.cc b/content/renderer/savable_resources.cc
index 5e5e0478008de80b7b7dda63f18cacb8830bcb86..59e534f044ef4374d96a82d562da577bb82ae35d 100644
--- a/content/renderer/savable_resources.cc
+++ b/content/renderer/savable_resources.cc
@@ -13,19 +13,19 @@
#include "third_party/WebKit/public/platform/WebVector.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/WebInputElement.h"
#include "third_party/WebKit/public/web/WebNode.h"
-#include "third_party/WebKit/public/web/WebNodeCollection.h"
#include "third_party/WebKit/public/web/WebNodeList.h"
#include "third_party/WebKit/public/web/WebView.h"
using blink::WebDocument;
using blink::WebElement;
+using blink::WebElementCollection;
using blink::WebFrame;
using blink::WebInputElement;
using blink::WebNode;
-using blink::WebNodeCollection;
using blink::WebNodeList;
using blink::WebString;
using blink::WebVector;
@@ -130,14 +130,10 @@ void GetAllSavableResourceLinksForFrame(WebFrame* current_frame,
// Get current using document.
WebDocument current_doc = current_frame->document();
// Go through all descent nodes.
- WebNodeCollection all = current_doc.all();
- // Go through all node in this frame.
- for (WebNode node = all.firstItem(); !node.isNull();
- node = all.nextItem()) {
- // We only save HTML resources.
- if (!node.isElementNode())
- continue;
- WebElement element = node.to<WebElement>();
+ WebElementCollection all = current_doc.all();
+ // Go through all elements in this frame.
+ for (WebElement element = all.firstItem(); !element.isNull();
+ element = all.nextItem()) {
GetSavableResourceLinkForElement(element,
current_doc,
unique_check,
« no previous file with comments | « content/renderer/dom_serializer_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698