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 #ifndef NET_QUIC_CRYPTO_CHANNEL_ID_CHROMIUM_H_ | 5 #ifndef NET_QUIC_CRYPTO_CHANNEL_ID_CHROMIUM_H_ |
6 #define NET_QUIC_CRYPTO_CHANNEL_ID_CHROMIUM_H_ | 6 #define NET_QUIC_CRYPTO_CHANNEL_ID_CHROMIUM_H_ |
7 | 7 |
8 #include <set> | 8 #include <map> |
| 9 #include <memory> |
9 #include <string> | 10 #include <string> |
10 | 11 |
11 #include "base/macros.h" | 12 #include "base/macros.h" |
12 #include "net/base/net_export.h" | 13 #include "net/base/net_export.h" |
13 #include "net/quic/core/crypto/channel_id.h" | 14 #include "net/quic/core/crypto/channel_id.h" |
14 | 15 |
15 namespace crypto { | 16 namespace crypto { |
16 class ECPrivateKey; | 17 class ECPrivateKey; |
17 } // namespace crypto | 18 } // namespace crypto |
18 | 19 |
(...skipping 22 matching lines...) Expand all Loading... |
41 explicit ChannelIDSourceChromium(ChannelIDService* channel_id_service); | 42 explicit ChannelIDSourceChromium(ChannelIDService* channel_id_service); |
42 ~ChannelIDSourceChromium() override; | 43 ~ChannelIDSourceChromium() override; |
43 | 44 |
44 // ChannelIDSource interface | 45 // ChannelIDSource interface |
45 QuicAsyncStatus GetChannelIDKey(const std::string& hostname, | 46 QuicAsyncStatus GetChannelIDKey(const std::string& hostname, |
46 std::unique_ptr<ChannelIDKey>* channel_id_key, | 47 std::unique_ptr<ChannelIDKey>* channel_id_key, |
47 ChannelIDSourceCallback* callback) override; | 48 ChannelIDSourceCallback* callback) override; |
48 | 49 |
49 private: | 50 private: |
50 class Job; | 51 class Job; |
51 typedef std::set<Job*> JobSet; | |
52 | 52 |
53 void OnJobComplete(Job* job); | 53 void OnJobComplete(Job* job); |
54 | 54 |
55 // Set owning pointers to active jobs. | 55 // Set owning pointers to active jobs. |
56 JobSet active_jobs_; | 56 std::map<Job*, std::unique_ptr<Job>> active_jobs_; |
57 | 57 |
58 // The service for retrieving Channel ID keys. | 58 // The service for retrieving Channel ID keys. |
59 ChannelIDService* const channel_id_service_; | 59 ChannelIDService* const channel_id_service_; |
60 | 60 |
61 DISALLOW_COPY_AND_ASSIGN(ChannelIDSourceChromium); | 61 DISALLOW_COPY_AND_ASSIGN(ChannelIDSourceChromium); |
62 }; | 62 }; |
63 | 63 |
64 } // namespace net | 64 } // namespace net |
65 | 65 |
66 #endif // NET_QUIC_CRYPTO_CHANNEL_ID_CHROMIUM_H_ | 66 #endif // NET_QUIC_CRYPTO_CHANNEL_ID_CHROMIUM_H_ |
OLD | NEW |