| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef CHROME_BROWSER_CHROMEOS_CERTIFICATE_PROVIDER_CERTIFICATE_REQUESTS_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_CERTIFICATE_PROVIDER_CERTIFICATE_REQUESTS_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_CERTIFICATE_PROVIDER_CERTIFICATE_REQUESTS_H_ | 6 #define CHROME_BROWSER_CHROMEOS_CERTIFICATE_PROVIDER_CERTIFICATE_REQUESTS_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> |
| 9 #include <string> | 10 #include <string> |
| 10 #include <vector> | 11 #include <vector> |
| 11 | 12 |
| 12 #include "base/callback_forward.h" | 13 #include "base/callback_forward.h" |
| 13 #include "base/macros.h" | 14 #include "base/macros.h" |
| 14 #include "base/memory/scoped_ptr.h" | |
| 15 #include "chrome/browser/chromeos/certificate_provider/certificate_info.h" | 15 #include "chrome/browser/chromeos/certificate_provider/certificate_info.h" |
| 16 #include "net/cert/x509_certificate.h" | 16 #include "net/cert/x509_certificate.h" |
| 17 | 17 |
| 18 namespace chromeos { | 18 namespace chromeos { |
| 19 namespace certificate_provider { | 19 namespace certificate_provider { |
| 20 | 20 |
| 21 class CertificateRequests { | 21 class CertificateRequests { |
| 22 public: | 22 public: |
| 23 CertificateRequests(); | 23 CertificateRequests(); |
| 24 ~CertificateRequests(); | 24 ~CertificateRequests(); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 49 std::map<std::string, CertificateInfoList>* certificates, | 49 std::map<std::string, CertificateInfoList>* certificates, |
| 50 base::Callback<void(const net::CertificateList&)>* callback); | 50 base::Callback<void(const net::CertificateList&)>* callback); |
| 51 | 51 |
| 52 // Removes this extension from all pending requests and returns the ids of | 52 // Removes this extension from all pending requests and returns the ids of |
| 53 // all completed requests. | 53 // all completed requests. |
| 54 std::vector<int> DropExtension(const std::string& extension_id); | 54 std::vector<int> DropExtension(const std::string& extension_id); |
| 55 | 55 |
| 56 private: | 56 private: |
| 57 struct CertificateRequestState; | 57 struct CertificateRequestState; |
| 58 | 58 |
| 59 std::map<int, scoped_ptr<CertificateRequestState>> requests_; | 59 std::map<int, std::unique_ptr<CertificateRequestState>> requests_; |
| 60 int next_free_request_id_ = 0; | 60 int next_free_request_id_ = 0; |
| 61 | 61 |
| 62 DISALLOW_COPY_AND_ASSIGN(CertificateRequests); | 62 DISALLOW_COPY_AND_ASSIGN(CertificateRequests); |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 } // namespace certificate_provider | 65 } // namespace certificate_provider |
| 66 } // namespace chromeos | 66 } // namespace chromeos |
| 67 | 67 |
| 68 #endif // CHROME_BROWSER_CHROMEOS_CERTIFICATE_PROVIDER_CERTIFICATE_REQUESTS_H_ | 68 #endif // CHROME_BROWSER_CHROMEOS_CERTIFICATE_PROVIDER_CERTIFICATE_REQUESTS_H_ |
| OLD | NEW |