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

Side by Side Diff: chrome/browser/loader/safe_browsing_resource_throttle.cc

Issue 2828663002: Rewrite base::Bind to base::BindOnce with base_bind_rewriters in //chrome/browser/{i,l,m,n,p,r}* (Closed)
Patch Set: Created 3 years, 8 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 unified diff | Download patch
OLDNEW
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/loader/safe_browsing_resource_throttle.h" 5 #include "chrome/browser/loader/safe_browsing_resource_throttle.h"
6 6
7 #include <iterator> 7 #include <iterator>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 66
67 const char* SafeBrowsingResourceThrottle::GetNameForLogging() const { 67 const char* SafeBrowsingResourceThrottle::GetNameForLogging() const {
68 return "SafeBrowsingResourceThrottle"; 68 return "SafeBrowsingResourceThrottle";
69 } 69 }
70 70
71 void SafeBrowsingResourceThrottle::MaybeDestroyPrerenderContents( 71 void SafeBrowsingResourceThrottle::MaybeDestroyPrerenderContents(
72 const content::ResourceRequestInfo* info) { 72 const content::ResourceRequestInfo* info) {
73 // Destroy the prefetch with FINAL_STATUS_SAFEBROSWING. 73 // Destroy the prefetch with FINAL_STATUS_SAFEBROSWING.
74 content::BrowserThread::PostTask( 74 content::BrowserThread::PostTask(
75 content::BrowserThread::UI, FROM_HERE, 75 content::BrowserThread::UI, FROM_HERE,
76 base::Bind(&DestroyPrerenderContents, 76 base::BindOnce(&DestroyPrerenderContents,
77 info->GetWebContentsGetterForRequest())); 77 info->GetWebContentsGetterForRequest()));
78 } 78 }
79 79
80 void SafeBrowsingResourceThrottle::StartDisplayingBlockingPageHelper( 80 void SafeBrowsingResourceThrottle::StartDisplayingBlockingPageHelper(
81 security_interstitials::UnsafeResource resource) { 81 security_interstitials::UnsafeResource resource) {
82 content::BrowserThread::PostTask( 82 content::BrowserThread::PostTask(
83 content::BrowserThread::UI, FROM_HERE, 83 content::BrowserThread::UI, FROM_HERE,
84 base::Bind(&SafeBrowsingResourceThrottle::StartDisplayingBlockingPage, 84 base::BindOnce(&SafeBrowsingResourceThrottle::StartDisplayingBlockingPage,
85 AsWeakPtr(), ui_manager(), resource)); 85 AsWeakPtr(), ui_manager(), resource));
86 } 86 }
87 87
88 // Static 88 // Static
89 void SafeBrowsingResourceThrottle::StartDisplayingBlockingPage( 89 void SafeBrowsingResourceThrottle::StartDisplayingBlockingPage(
90 const base::WeakPtr<safe_browsing::BaseResourceThrottle>& throttle, 90 const base::WeakPtr<safe_browsing::BaseResourceThrottle>& throttle,
91 scoped_refptr<BaseUIManager> ui_manager, 91 scoped_refptr<BaseUIManager> ui_manager,
92 const security_interstitials::UnsafeResource& resource) { 92 const security_interstitials::UnsafeResource& resource) {
93 content::WebContents* web_contents = resource.web_contents_getter.Run(); 93 content::WebContents* web_contents = resource.web_contents_getter.Run();
94 if (web_contents) { 94 if (web_contents) {
95 BaseResourceThrottle::NotifySubresourceFilterOfBlockedResource(resource); 95 BaseResourceThrottle::NotifySubresourceFilterOfBlockedResource(resource);
96 prerender::PrerenderContents* prerender_contents = 96 prerender::PrerenderContents* prerender_contents =
97 prerender::PrerenderContents::FromWebContents(web_contents); 97 prerender::PrerenderContents::FromWebContents(web_contents);
98 if (prerender_contents) { 98 if (prerender_contents) {
99 prerender_contents->Destroy(prerender::FINAL_STATUS_SAFE_BROWSING); 99 prerender_contents->Destroy(prerender::FINAL_STATUS_SAFE_BROWSING);
100 } else { 100 } else {
101 ui_manager->DisplayBlockingPage(resource); 101 ui_manager->DisplayBlockingPage(resource);
102 return; 102 return;
103 } 103 }
104 } 104 }
105 105
106 // Tab is gone or it's being prerendered. 106 // Tab is gone or it's being prerendered.
107 content::BrowserThread::PostTask( 107 content::BrowserThread::PostTask(
108 content::BrowserThread::IO, FROM_HERE, 108 content::BrowserThread::IO, FROM_HERE,
109 base::Bind(&SafeBrowsingResourceThrottle::Cancel, throttle)); 109 base::BindOnce(&SafeBrowsingResourceThrottle::Cancel, throttle));
110 } 110 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698