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

Side by Side Diff: ios/web/net/crw_cert_policy_cache.mm

Issue 1357773002: WKWebView: Implemented recoverable SSL interstitials. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lock_coloring
Patch Set: Addressed unit tests review comments Created 5 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 unified diff | Download patch
« no previous file with comments | « ios/web/net/crw_cert_policy_cache.h ('k') | ios/web/net/crw_cert_policy_cache_unittest.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #import "ios/web/net/crw_cert_policy_cache.h"
6
7 #include "base/location.h"
8 #include "base/mac/bind_objc_block.h"
9 #include "base/strings/sys_string_conversions.h"
10 #include "ios/web/public/certificate_policy_cache.h"
11 #include "ios/web/public/web_thread.h"
12
13 @interface CRWCertPolicyCache () {
14 // Used to remember decisions about how to handle problematic certs.
15 scoped_refptr<web::CertificatePolicyCache> _impl;
16 }
17 @end
18
19 @implementation CRWCertPolicyCache
20
21 - (instancetype)init {
22 NOTREACHED();
23 return self;
24 }
25
26 - (instancetype)initWithCache:(scoped_refptr<web::CertificatePolicyCache>)impl {
27 DCHECK(impl);
28 self = [super init];
29 if (self) {
30 _impl = impl;
31 }
32 return self;
33 }
34
35 - (void)queryJudgementForCert:(scoped_refptr<net::X509Certificate>)cert
36 forHost:(NSString*)host
37 status:(net::CertStatus)status
38 completionHandler:(void (^)(web::CertPolicy::Judgment))handler {
39 DCHECK(handler);
40 web::WebThread::PostTask(web::WebThread::IO, FROM_HERE, base::BindBlock(^{
41 web::CertPolicy::Judgment policy =
42 _impl->QueryPolicy(cert.get(), base::SysNSStringToUTF8(host), status);
43 dispatch_async(dispatch_get_main_queue(), ^{
44 handler(policy);
45 });
46 }));
47 }
48
49 - (void)allowCert:(scoped_refptr<net::X509Certificate>)cert
50 forHost:(NSString*)host
51 status:(net::CertStatus)status {
52 web::WebThread::PostTask(web::WebThread::IO, FROM_HERE, base::BindBlock(^{
53 _impl->AllowCertForHost(cert.get(), base::SysNSStringToUTF8(host), status);
54 }));
55 }
56
57 @end
OLDNEW
« no previous file with comments | « ios/web/net/crw_cert_policy_cache.h ('k') | ios/web/net/crw_cert_policy_cache_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698