Chromium Code Reviews| Index: chrome/browser/net/sth_distributor_provider.cc |
| diff --git a/chrome/browser/net/sth_distributor_provider.cc b/chrome/browser/net/sth_distributor_provider.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..1357dea1d6680a0e27943e6f013ad86c095de483 |
| --- /dev/null |
| +++ b/chrome/browser/net/sth_distributor_provider.cc |
| @@ -0,0 +1,27 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "chrome/browser/net/sth_distributor_provider.h" |
| + |
| +#include "base/lazy_instance.h" |
| +#include "net/cert/sth_distributor.h" |
| + |
| +namespace chrome_browser_net { |
| + |
| +namespace { |
| +base::LazyInstance<std::unique_ptr<net::ct::STHDistributor>> |
| + global_sth_distributor = LAZY_INSTANCE_INITIALIZER; |
| +} // namespace |
| + |
| +void SetGlobalSTHDistributor( |
| + std::unique_ptr<net::ct::STHDistributor> distributor) { |
| + global_sth_distributor.Get().swap(distributor); |
| +} |
| + |
| +net::ct::STHDistributor* GetGlobalSTHDistributor() { |
| + CHECK(global_sth_distributor.Get() != nullptr); |
|
Ryan Sleevi
2016/05/27 04:59:53
Remove the != nullptr
(Plus, it'd be .Get().get()
Eran Messeri
2016/05/27 08:43:54
Done.
|
| + return global_sth_distributor.Get().get(); |
| +} |
| + |
| +} // namespace chrome_browser_net |