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

Unified Diff: chrome/renderer/safe_browsing/phishing_dom_feature_extractor.h

Issue 8055018: Merge 102541 - Change PhishingDOMFeatureExtractor to cache the WebDocument rather than a WebFrame... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/874/src/
Patch Set: Created 9 years, 3 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/phishing_dom_feature_extractor.h
===================================================================
--- chrome/renderer/safe_browsing/phishing_dom_feature_extractor.h (revision 102938)
+++ chrome/renderer/safe_browsing/phishing_dom_feature_extractor.h (working copy)
@@ -16,13 +16,13 @@
#include "base/callback_old.h"
#include "base/memory/scoped_ptr.h"
#include "base/task.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h"
class GURL;
class RenderView;
namespace WebKit {
class WebElement;
-class WebFrame;
}
namespace safe_browsing {
@@ -102,10 +102,14 @@
// Clears all internal feature extraction state.
void Clear();
- // Called after advancing |cur_frame_| to update the state in
+ // Called after advancing |cur_document_| to update the state in
// |cur_frame_data_|. Returns true if the state was updated successfully.
bool ResetFrameData();
+ // Returns the next document in frame-traversal order from cur_document_.
+ // If there are no more documents, returns a null WebDocument.
+ WebKit::WebDocument GetNextDocument();
+
// Given a URL, checks whether the domain is different from the domain of
// the current frame's URL. If so, stores the domain in |domain| and returns
// true, otherwise returns false.
@@ -126,10 +130,11 @@
FeatureMap* features_; // The caller keeps ownership of this.
scoped_ptr<DoneCallback> done_callback_;
- // Non-owned pointer to the current frame that we are processing.
- WebKit::WebFrame* cur_frame_;
+ // The current (sub-)document that we are processing. May be a null document
+ // (isNull()) if we are not currently extracting features.
+ WebKit::WebDocument cur_document_;
- // Stores extra state for |cur_frame_| that will be persisted until we
+ // Stores extra state for |cur_document_| that will be persisted until we
// advance to the next frame.
scoped_ptr<FrameData> cur_frame_data_;
« 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