| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/safe_browsing/client_side_detection_host.h" | 5 #include "chrome/browser/safe_browsing/client_side_detection_host.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 if (entry->GetPageType() == content::PAGE_TYPE_INTERSTITIAL) | 472 if (entry->GetPageType() == content::PAGE_TYPE_INTERSTITIAL) |
| 473 entry = web_contents()->GetController().GetLastCommittedEntry(); | 473 entry = web_contents()->GetController().GetLastCommittedEntry(); |
| 474 if (!entry) | 474 if (!entry) |
| 475 return false; | 475 return false; |
| 476 } | 476 } |
| 477 | 477 |
| 478 base::string16 value; | 478 base::string16 value; |
| 479 return entry->GetExtraData(kSafeBrowsingMatchKey, &value); | 479 return entry->GetExtraData(kSafeBrowsingMatchKey, &value); |
| 480 } | 480 } |
| 481 | 481 |
| 482 void ClientSideDetectionHost::WebContentsDestroyed(WebContents* tab) { | 482 void ClientSideDetectionHost::WebContentsDestroyed() { |
| 483 DCHECK(tab); | |
| 484 // Tell any pending classification request that it is being canceled. | 483 // Tell any pending classification request that it is being canceled. |
| 485 if (classification_request_.get()) { | 484 if (classification_request_.get()) { |
| 486 classification_request_->Cancel(); | 485 classification_request_->Cancel(); |
| 487 } | 486 } |
| 488 // Cancel all pending feature extractions. | 487 // Cancel all pending feature extractions. |
| 489 feature_extractor_.reset(); | 488 feature_extractor_.reset(); |
| 490 } | 489 } |
| 491 | 490 |
| 492 void ClientSideDetectionHost::OnPhishingPreClassificationDone( | 491 void ClientSideDetectionHost::OnPhishingPreClassificationDone( |
| 493 bool should_classify) { | 492 bool should_classify) { |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 738 ui_manager_->RemoveObserver(this); | 737 ui_manager_->RemoveObserver(this); |
| 739 | 738 |
| 740 ui_manager_ = ui_manager; | 739 ui_manager_ = ui_manager; |
| 741 if (ui_manager) | 740 if (ui_manager) |
| 742 ui_manager_->AddObserver(this); | 741 ui_manager_->AddObserver(this); |
| 743 | 742 |
| 744 database_manager_ = database_manager; | 743 database_manager_ = database_manager; |
| 745 } | 744 } |
| 746 | 745 |
| 747 } // namespace safe_browsing | 746 } // namespace safe_browsing |
| OLD | NEW |