Chromium Code Reviews| 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..216469ac8b419b5be409c4a218a2a3ea8e784b29 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_) |
|
mattm
2014/07/08 23:35:50
should that be "==" ?
Avi (use Gerrit)
2014/07/08 23:43:18
D'oh. Yes.
|
| 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. |
| // |