OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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. |
| 4 |
| 5 #include "chrome/browser/net/sth_distributor_provider.h" |
| 6 |
| 7 #include "base/lazy_instance.h" |
| 8 #include "net/cert/sth_distributor.h" |
| 9 |
| 10 namespace chrome_browser_net { |
| 11 |
| 12 namespace { |
| 13 base::LazyInstance<std::unique_ptr<net::ct::STHDistributor>> |
| 14 global_sth_distributor = LAZY_INSTANCE_INITIALIZER; |
| 15 } // namespace |
| 16 |
| 17 void SetGlobalSTHDistributor( |
| 18 std::unique_ptr<net::ct::STHDistributor> distributor) { |
| 19 global_sth_distributor.Get().swap(distributor); |
| 20 } |
| 21 |
| 22 net::ct::STHDistributor* GetGlobalSTHDistributor() { |
| 23 CHECK(global_sth_distributor.Get()); |
| 24 return global_sth_distributor.Get().get(); |
| 25 } |
| 26 |
| 27 } // namespace chrome_browser_net |
OLD | NEW |