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

Side by Side Diff: chrome/browser/chromeos/policy/policy_cert_verifier.cc

Issue 24153012: Fix cyclic dependency between ProfilePolicyConnector and PrefService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed. Created 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/chromeos/policy/policy_cert_verifier.h" 5 #include "chrome/browser/chromeos/policy/policy_cert_verifier.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/ref_counted.h"
9 #include "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
10 #include "content/public/browser/browser_thread.h" 9 #include "content/public/browser/browser_thread.h"
11 #include "net/base/net_errors.h" 10 #include "net/base/net_errors.h"
12 #include "net/cert/cert_verify_proc.h" 11 #include "net/cert/cert_verify_proc.h"
13 #include "net/cert/multi_threaded_cert_verifier.h" 12 #include "net/cert/multi_threaded_cert_verifier.h"
14 13
15 namespace policy { 14 namespace policy {
16 15
17 namespace { 16 namespace {
18 17
(...skipping 30 matching lines...) Expand all
49 PolicyCertVerifier::~PolicyCertVerifier() { 48 PolicyCertVerifier::~PolicyCertVerifier() {
50 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); 49 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
51 } 50 }
52 51
53 void PolicyCertVerifier::InitializeOnIOThread() { 52 void PolicyCertVerifier::InitializeOnIOThread() {
54 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); 53 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
55 scoped_refptr<net::CertVerifyProc> verify_proc = 54 scoped_refptr<net::CertVerifyProc> verify_proc =
56 net::CertVerifyProc::CreateDefault(); 55 net::CertVerifyProc::CreateDefault();
57 if (!verify_proc->SupportsAdditionalTrustAnchors()) { 56 if (!verify_proc->SupportsAdditionalTrustAnchors()) {
58 LOG(WARNING) 57 LOG(WARNING)
59 << "Additional trust anchors not supported in the current platform!"; 58 << "Additional trust anchors not supported on the current platform!";
60 } 59 }
61 net::MultiThreadedCertVerifier* verifier = 60 net::MultiThreadedCertVerifier* verifier =
62 new net::MultiThreadedCertVerifier(verify_proc.get()); 61 new net::MultiThreadedCertVerifier(verify_proc.get());
63 verifier->SetCertTrustAnchorProvider(this); 62 verifier->SetCertTrustAnchorProvider(this);
64 delegate_.reset(verifier); 63 delegate_.reset(verifier);
65 } 64 }
66 65
67 void PolicyCertVerifier::SetTrustAnchors( 66 void PolicyCertVerifier::SetTrustAnchors(
68 const net::CertificateList& trust_anchors) { 67 const net::CertificateList& trust_anchors) {
69 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); 68 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
(...skipping 26 matching lines...) Expand all
96 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); 95 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
97 delegate_->CancelRequest(req); 96 delegate_->CancelRequest(req);
98 } 97 }
99 98
100 const net::CertificateList& PolicyCertVerifier::GetAdditionalTrustAnchors() { 99 const net::CertificateList& PolicyCertVerifier::GetAdditionalTrustAnchors() {
101 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); 100 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
102 return trust_anchors_; 101 return trust_anchors_;
103 } 102 }
104 103
105 } // namespace policy 104 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698