net: Remove the remaining use of GG_(U)INTn_C macros.
[chromium-blink-merge.git] / net / quic / crypto / channel_id_chromium.h
blob43a1ed390b61d26542876dbfb58db7459eba8173
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
3 // found in the LICENSE file.
5 #ifndef NET_QUIC_CRYPTO_CHANNEL_ID_CHROMIUM_H_
6 #define NET_QUIC_CRYPTO_CHANNEL_ID_CHROMIUM_H_
8 #include <set>
10 #include "net/quic/crypto/channel_id.h"
12 namespace crypto {
13 class ECPrivateKey;
14 } // namespace crypto
16 namespace net {
18 class ChannelIDService;
20 class NET_EXPORT_PRIVATE ChannelIDKeyChromium: public ChannelIDKey {
21 public:
22 explicit ChannelIDKeyChromium(
23 scoped_ptr<crypto::ECPrivateKey> ec_private_key);
24 ~ChannelIDKeyChromium() override;
26 // ChannelIDKey interface
27 bool Sign(base::StringPiece signed_data,
28 std::string* out_signature) const override;
29 std::string SerializeKey() const override;
31 private:
32 scoped_ptr<crypto::ECPrivateKey> ec_private_key_;
35 // ChannelIDSourceChromium implements the QUIC ChannelIDSource interface.
36 class ChannelIDSourceChromium : public ChannelIDSource {
37 public:
38 explicit ChannelIDSourceChromium(
39 ChannelIDService* channel_id_service);
40 ~ChannelIDSourceChromium() override;
42 // ChannelIDSource interface
43 QuicAsyncStatus GetChannelIDKey(const std::string& hostname,
44 scoped_ptr<ChannelIDKey>* channel_id_key,
45 ChannelIDSourceCallback* callback) override;
47 private:
48 class Job;
49 typedef std::set<Job*> JobSet;
51 void OnJobComplete(Job* job);
53 // Set owning pointers to active jobs.
54 JobSet active_jobs_;
56 // The service for retrieving Channel ID keys.
57 ChannelIDService* const channel_id_service_;
59 DISALLOW_COPY_AND_ASSIGN(ChannelIDSourceChromium);
62 } // namespace net
64 #endif // NET_QUIC_CRYPTO_CHANNEL_ID_CHROMIUM_H_