OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/platform_keys/platform_keys.h" | 5 #include "chrome/browser/chromeos/platform_keys/platform_keys.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
11 #include "base/location.h" | 11 #include "base/location.h" |
| 12 #include "base/memory/ptr_util.h" |
12 #include "base/threading/worker_pool.h" | 13 #include "base/threading/worker_pool.h" |
13 #include "net/base/hash_value.h" | 14 #include "net/base/hash_value.h" |
14 #include "net/cert/x509_certificate.h" | 15 #include "net/cert/x509_certificate.h" |
15 | 16 |
16 namespace chromeos { | 17 namespace chromeos { |
17 | 18 |
18 namespace platform_keys { | 19 namespace platform_keys { |
19 | 20 |
20 namespace { | 21 namespace { |
21 | 22 |
(...skipping 29 matching lines...) Expand all Loading... |
51 | 52 |
52 ClientCertificateRequest::ClientCertificateRequest() { | 53 ClientCertificateRequest::ClientCertificateRequest() { |
53 } | 54 } |
54 | 55 |
55 ClientCertificateRequest::~ClientCertificateRequest() { | 56 ClientCertificateRequest::~ClientCertificateRequest() { |
56 } | 57 } |
57 | 58 |
58 void IntersectCertificates( | 59 void IntersectCertificates( |
59 const net::CertificateList& certs1, | 60 const net::CertificateList& certs1, |
60 const net::CertificateList& certs2, | 61 const net::CertificateList& certs2, |
61 const base::Callback<void(scoped_ptr<net::CertificateList>)>& callback) { | 62 const base::Callback<void(std::unique_ptr<net::CertificateList>)>& |
62 scoped_ptr<net::CertificateList> intersection(new net::CertificateList); | 63 callback) { |
| 64 std::unique_ptr<net::CertificateList> intersection(new net::CertificateList); |
63 net::CertificateList* const intersection_ptr = intersection.get(); | 65 net::CertificateList* const intersection_ptr = intersection.get(); |
64 if (!base::WorkerPool::PostTaskAndReply( | 66 if (!base::WorkerPool::PostTaskAndReply( |
65 FROM_HERE, base::Bind(&IntersectOnWorkerThread, certs1, certs2, | 67 FROM_HERE, base::Bind(&IntersectOnWorkerThread, certs1, certs2, |
66 intersection_ptr), | 68 intersection_ptr), |
67 base::Bind(callback, base::Passed(&intersection)), | 69 base::Bind(callback, base::Passed(&intersection)), |
68 false /* task_is_slow */)) { | 70 false /* task_is_slow */)) { |
69 callback.Run(make_scoped_ptr(new net::CertificateList)); | 71 callback.Run(base::WrapUnique(new net::CertificateList)); |
70 } | 72 } |
71 } | 73 } |
72 | 74 |
73 } // namespace platform_keys | 75 } // namespace platform_keys |
74 | 76 |
75 } // namespace chromeos | 77 } // namespace chromeos |
OLD | NEW |