diff options
author | ch.dumez@samsung.com <ch.dumez@samsung.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-07 18:49:02 +0000 |
---|---|---|
committer | ch.dumez@samsung.com <ch.dumez@samsung.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-07 18:49:02 +0000 |
commit | c9393271bb6f6b4c6b01a4e96cd071b9d0d2a81b (patch) | |
tree | 85ac173abbf6c1d1476d913ede8ef0ac2fa30df5 /content/renderer/savable_resources.cc | |
parent | 961783a19e08087d92b69a158e51e1d2cab6044c (diff) | |
download | chromium_src-c9393271bb6f6b4c6b01a4e96cd071b9d0d2a81b.zip chromium_src-c9393271bb6f6b4c6b01a4e96cd071b9d0d2a81b.tar.gz chromium_src-c9393271bb6f6b4c6b01a4e96cd071b9d0d2a81b.tar.bz2 |
Update content/renderer code to use WebElementCollection instead of WebNodeCollection
Update content/renderer code to use WebElementCollection instead of WebNodeCollection.
Update safe_browsing code to use WebElementCollection instead of WebNodeCollection.
After Blink r166411 and r166500, WebNodeCollection is renamed to
WebElementCollection and its API returns WebElements instead of WebNodes.
The new code is clearer and avoids unnecessary isElementNode() checks.
Review URL: https://codereview.chromium.org/149913011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@249736 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer/savable_resources.cc')
-rw-r--r-- | content/renderer/savable_resources.cc | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/content/renderer/savable_resources.cc b/content/renderer/savable_resources.cc index 5e5e047..59e534f 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, |