| 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_SSL_CHANNEL_ID_SERVICE_H_ | 5 #ifndef NET_SSL_CHANNEL_ID_SERVICE_H_ |
| 6 #define NET_SSL_CHANNEL_ID_SERVICE_H_ | 6 #define NET_SSL_CHANNEL_ID_SERVICE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 #include <memory> | 11 #include <memory> |
| 12 #include <string> | 12 #include <string> |
| 13 #include <utility> | 13 #include <utility> |
| 14 #include <vector> | 14 #include <vector> |
| 15 | 15 |
| 16 #include "base/macros.h" | 16 #include "base/macros.h" |
| 17 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
| 18 #include "base/memory/weak_ptr.h" | 18 #include "base/memory/weak_ptr.h" |
| 19 #include "base/sequence_checker.h" |
| 19 #include "base/task_runner.h" | 20 #include "base/task_runner.h" |
| 20 #include "base/threading/non_thread_safe.h" | |
| 21 #include "net/base/completion_callback.h" | 21 #include "net/base/completion_callback.h" |
| 22 #include "net/base/net_export.h" | 22 #include "net/base/net_export.h" |
| 23 #include "net/ssl/channel_id_store.h" | 23 #include "net/ssl/channel_id_store.h" |
| 24 | 24 |
| 25 namespace crypto { | 25 namespace crypto { |
| 26 class ECPrivateKey; | 26 class ECPrivateKey; |
| 27 } // namespace crypto | 27 } // namespace crypto |
| 28 | 28 |
| 29 namespace net { | 29 namespace net { |
| 30 | 30 |
| 31 class ChannelIDServiceJob; | 31 class ChannelIDServiceJob; |
| 32 | 32 |
| 33 // A class for creating and fetching Channel IDs. | 33 // A class for creating and fetching Channel IDs. |
| 34 | 34 |
| 35 // Inherits from NonThreadSafe in order to use the function | 35 // Inherits from NonThreadSafe in order to use the function |
| 36 // |CalledOnValidThread|. | 36 // |CalledOnValidThread|. |
| 37 class NET_EXPORT ChannelIDService | 37 class NET_EXPORT ChannelIDService { |
| 38 : NON_EXPORTED_BASE(public base::NonThreadSafe) { | |
| 39 public: | 38 public: |
| 40 class NET_EXPORT Request { | 39 class NET_EXPORT Request { |
| 41 public: | 40 public: |
| 42 Request(); | 41 Request(); |
| 43 ~Request(); | 42 ~Request(); |
| 44 | 43 |
| 45 // Cancel the request. Does nothing if the request finished or was already | 44 // Cancel the request. Does nothing if the request finished or was already |
| 46 // cancelled. | 45 // cancelled. |
| 47 void Cancel(); | 46 void Cancel(); |
| 48 | 47 |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 | 168 |
| 170 // inflight_ maps from a server to an active generation which is taking | 169 // inflight_ maps from a server to an active generation which is taking |
| 171 // place. | 170 // place. |
| 172 std::map<std::string, std::unique_ptr<ChannelIDServiceJob>> inflight_; | 171 std::map<std::string, std::unique_ptr<ChannelIDServiceJob>> inflight_; |
| 173 | 172 |
| 174 uint64_t requests_; | 173 uint64_t requests_; |
| 175 uint64_t key_store_hits_; | 174 uint64_t key_store_hits_; |
| 176 uint64_t inflight_joins_; | 175 uint64_t inflight_joins_; |
| 177 uint64_t workers_created_; | 176 uint64_t workers_created_; |
| 178 | 177 |
| 178 SEQUENCE_CHECKER(sequence_checker_); |
| 179 |
| 179 base::WeakPtrFactory<ChannelIDService> weak_ptr_factory_; | 180 base::WeakPtrFactory<ChannelIDService> weak_ptr_factory_; |
| 180 | 181 |
| 181 DISALLOW_COPY_AND_ASSIGN(ChannelIDService); | 182 DISALLOW_COPY_AND_ASSIGN(ChannelIDService); |
| 182 }; | 183 }; |
| 183 | 184 |
| 184 } // namespace net | 185 } // namespace net |
| 185 | 186 |
| 186 #endif // NET_SSL_CHANNEL_ID_SERVICE_H_ | 187 #endif // NET_SSL_CHANNEL_ID_SERVICE_H_ |
| OLD | NEW |