| Index: chrome/browser/safe_browsing/client_side_detection_host.cc
|
| diff --git a/chrome/browser/safe_browsing/client_side_detection_host.cc b/chrome/browser/safe_browsing/client_side_detection_host.cc
|
| index ce244104bbe9b8daa08bcf2d9357b7e9f77cfe2e..3ddfc2e19c8d6cf163091a30ea2e77d86b638c20 100644
|
| --- a/chrome/browser/safe_browsing/client_side_detection_host.cc
|
| +++ b/chrome/browser/safe_browsing/client_side_detection_host.cc
|
| @@ -161,7 +161,7 @@ class ClientSideDetectionHost::ShouldClassifyUrlRequest
|
|
|
| void CheckCsdWhitelist(const GURL& url) {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
|
| - if (!sb_service_ || sb_service_->MatchCsdWhitelistUrl(url)) {
|
| + if (!sb_service_.get() || sb_service_->MatchCsdWhitelistUrl(url)) {
|
| // We're done. There is no point in going back to the UI thread.
|
| VLOG(1) << "Skipping phishing classification for URL: " << url
|
| << " because it matches the csd whitelist";
|
| @@ -252,13 +252,13 @@ ClientSideDetectionHost::ClientSideDetectionHost(WebContents* tab)
|
| // Note: csd_service_ and sb_service_ will be NULL here in testing.
|
| registrar_.Add(this, content::NOTIFICATION_RESOURCE_RESPONSE_STARTED,
|
| content::Source<WebContents>(tab));
|
| - if (sb_service_) {
|
| + if (sb_service_.get()) {
|
| sb_service_->AddObserver(this);
|
| }
|
| }
|
|
|
| ClientSideDetectionHost::~ClientSideDetectionHost() {
|
| - if (sb_service_) {
|
| + if (sb_service_.get()) {
|
| sb_service_->RemoveObserver(this);
|
| }
|
| }
|
| @@ -315,7 +315,7 @@ void ClientSideDetectionHost::DidNavigateMainFrame(
|
| classification_request_ = new ShouldClassifyUrlRequest(params,
|
| web_contents(),
|
| csd_service_,
|
| - sb_service_,
|
| + sb_service_.get(),
|
| this);
|
| classification_request_->Start();
|
| }
|
| @@ -398,7 +398,7 @@ void ClientSideDetectionHost::MaybeShowPhishingWarning(GURL phishing_url,
|
| << " is_phishing:" << is_phishing;
|
| if (is_phishing) {
|
| DCHECK(web_contents());
|
| - if (sb_service_) {
|
| + if (sb_service_.get()) {
|
| SafeBrowsingService::UnsafeResource resource;
|
| resource.url = phishing_url;
|
| resource.original_url = phishing_url;
|
| @@ -470,11 +470,11 @@ void ClientSideDetectionHost::set_client_side_detection_service(
|
|
|
| void ClientSideDetectionHost::set_safe_browsing_service(
|
| SafeBrowsingService* service) {
|
| - if (sb_service_) {
|
| + if (sb_service_.get()) {
|
| sb_service_->RemoveObserver(this);
|
| }
|
| sb_service_ = service;
|
| - if (sb_service_) {
|
| + if (sb_service_.get()) {
|
| sb_service_->AddObserver(this);
|
| }
|
| }
|
|
|