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

Unified Diff: ios/web/net/crw_cert_verification_controller.mm

Issue 2522943003: [iOS/ARC] Fix a violation of ODR in base::BindBlock under ARC. (Closed)
Patch Set: Use EXPECT_NSEQ instead of EXPECT_EQ/EXPECT_TRUE. Created 4 years, 1 month 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
« no previous file with comments | « ios/web/net/clients/crw_redirect_network_client.mm ('k') | ios/web/net/request_tracker_impl.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/net/crw_cert_verification_controller.mm
diff --git a/ios/web/net/crw_cert_verification_controller.mm b/ios/web/net/crw_cert_verification_controller.mm
index 923e0abfc73d0797bc2f9b6b78230ba44d080f5f..4fe42a177d3dd43772709b6567dde9d69cc292b2 100644
--- a/ios/web/net/crw_cert_verification_controller.mm
+++ b/ios/web/net/crw_cert_verification_controller.mm
@@ -129,10 +129,11 @@ loadPolicyForRejectedTrustResult:(SecTrustResultType)trustResult
cert->os_cert_handle(), net::X509Certificate::OSCertHandles());
}
DCHECK(cert->GetIntermediateCertificates().empty());
- web::WebThread::PostTask(web::WebThread::IO, FROM_HERE, base::BindBlock(^{
- _certPolicyCache->AllowCertForHost(
- cert.get(), base::SysNSStringToUTF8(host), status);
- }));
+ web::WebThread::PostTask(web::WebThread::IO, FROM_HERE, base::BindBlockArc(^{
+ _certPolicyCache->AllowCertForHost(
+ cert.get(), base::SysNSStringToUTF8(host),
+ status);
+ }));
}
#pragma mark - Private
@@ -165,22 +166,24 @@ decideLoadPolicyForRejectedTrustResult:(SecTrustResultType)trustResult
completionHandler:(web::PolicyDecisionHandler)handler {
DCHECK_CURRENTLY_ON(web::WebThread::UI);
DCHECK(handler);
- web::WebThread::PostTask(web::WebThread::IO, FROM_HERE, base::BindBlock(^{
- // |loadPolicyForRejectedTrustResult:certStatus:serverTrust:host:| can
- // only be called on IO thread.
- net::CertStatus certStatus =
- [self certStatusFromTrustResult:trustResult serverTrust:trust];
-
- web::CertAcceptPolicy policy =
- [self loadPolicyForRejectedTrustResult:trustResult
- certStatus:certStatus
- serverTrust:trust.get()
- host:host];
-
- web::WebThread::PostTask(web::WebThread::UI, FROM_HERE, base::BindBlock(^{
- handler(policy, certStatus);
- }));
- }));
+ web::WebThread::PostTask(
+ web::WebThread::IO, FROM_HERE, base::BindBlockArc(^{
+ // |loadPolicyForRejectedTrustResult:certStatus:serverTrust:host:| can
+ // only be called on IO thread.
+ net::CertStatus certStatus =
+ [self certStatusFromTrustResult:trustResult serverTrust:trust];
+
+ web::CertAcceptPolicy policy =
+ [self loadPolicyForRejectedTrustResult:trustResult
+ certStatus:certStatus
+ serverTrust:trust.get()
+ host:host];
+
+ web::WebThread::PostTask(web::WebThread::UI, FROM_HERE,
+ base::BindBlockArc(^{
+ handler(policy, certStatus);
+ }));
+ }));
}
- (void)verifyTrust:(base::ScopedCFTypeRef<SecTrustRef>)trust
@@ -189,15 +192,18 @@ decideLoadPolicyForRejectedTrustResult:(SecTrustResultType)trustResult
DCHECK(completionHandler);
// SecTrustEvaluate performs trust evaluation synchronously, possibly making
// network requests. The UI thread should not be blocked by that operation.
- base::WorkerPool::PostTask(FROM_HERE, base::BindBlock(^{
- SecTrustResultType trustResult = kSecTrustResultInvalid;
- if (SecTrustEvaluate(trust.get(), &trustResult) != errSecSuccess) {
- trustResult = kSecTrustResultInvalid;
- }
- web::WebThread::PostTask(web::WebThread::UI, FROM_HERE, base::BindBlock(^{
- completionHandler(trustResult);
- }));
- }), false /* task_is_slow */);
+ base::WorkerPool::PostTask(
+ FROM_HERE, base::BindBlockArc(^{
+ SecTrustResultType trustResult = kSecTrustResultInvalid;
+ if (SecTrustEvaluate(trust.get(), &trustResult) != errSecSuccess) {
+ trustResult = kSecTrustResultInvalid;
+ }
+ web::WebThread::PostTask(web::WebThread::UI, FROM_HERE,
+ base::BindBlockArc(^{
+ completionHandler(trustResult);
+ }));
+ }),
+ false /* task_is_slow */);
}
- (web::CertAcceptPolicy)
« no previous file with comments | « ios/web/net/clients/crw_redirect_network_client.mm ('k') | ios/web/net/request_tracker_impl.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698