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

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

Issue 363293005: Remove page id from "page capture". (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: test4sure Created 6 years, 5 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
Index: chrome/renderer/safe_browsing/phishing_classifier_delegate.cc
diff --git a/chrome/renderer/safe_browsing/phishing_classifier_delegate.cc b/chrome/renderer/safe_browsing/phishing_classifier_delegate.cc
index cd120ed2589ba4418dab19b3e4fcffb660dcd529..74c592e7d6cc69d606ebc486e29600f4e1758293 100644
--- a/chrome/renderer/safe_browsing/phishing_classifier_delegate.cc
+++ b/chrome/renderer/safe_browsing/phishing_classifier_delegate.cc
@@ -144,28 +144,19 @@ void PhishingClassifierDelegate::OnStartPhishingDetection(const GURL& url) {
void PhishingClassifierDelegate::DidCommitProvisionalLoad(
blink::WebLocalFrame* frame, bool is_new_navigation) {
- // A new page is starting to load, so cancel classificaiton.
- //
- // TODO(bryner): We shouldn't need to cancel classification if the navigation
- // is within the same page. However, if we let classification continue in
- // this case, we need to properly deal with the fact that PageCaptured will
- // be called again for the in-page navigation. We need to be sure not to
- // swap out the page text while the term feature extractor is still running.
- DocumentState* document_state = DocumentState::FromDataSource(
- frame->dataSource());
- NavigationState* navigation_state = document_state->navigation_state();
- CancelPendingClassification(navigation_state->was_within_same_page() ?
- NAVIGATE_WITHIN_PAGE : NAVIGATE_AWAY);
if (frame == render_view()->GetWebView()->mainFrame()) {
+ DocumentState* document_state = DocumentState::FromDataSource(
+ frame->dataSource());
+ NavigationState* navigation_state = document_state->navigation_state();
last_main_frame_transition_ = navigation_state->transition_type();
}
}
void PhishingClassifierDelegate::PageCaptured(base::string16* page_text,
bool preliminary_capture) {
- if (preliminary_capture) {
+ if (preliminary_capture || *page_text == classifier_page_text_)
return;
- }
+
// Make sure there's no classification in progress. We don't want to swap
// out the page text string from underneath the term feature extractor.
//

Powered by Google App Engine
This is Rietveld 408576698