Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(389)

Side by Side Diff: chrome/browser/net/sth_distributor_provider.cc

Issue 2733283002: Require explicit selection of traits for LazyInstance (Closed)
Patch Set: l10n again Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 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 #include "chrome/browser/net/sth_distributor_provider.h" 5 #include "chrome/browser/net/sth_distributor_provider.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "net/cert/sth_distributor.h" 8 #include "net/cert/sth_distributor.h"
9 9
10 namespace chrome_browser_net { 10 namespace chrome_browser_net {
11 11
12 namespace { 12 namespace {
13 base::LazyInstance<std::unique_ptr<net::ct::STHDistributor>> 13 base::LazyInstance<std::unique_ptr<net::ct::STHDistributor>>::DestructorAtExit
14 global_sth_distributor = LAZY_INSTANCE_INITIALIZER; 14 global_sth_distributor = LAZY_INSTANCE_INITIALIZER;
15 } // namespace 15 } // namespace
16 16
17 void SetGlobalSTHDistributor( 17 void SetGlobalSTHDistributor(
18 std::unique_ptr<net::ct::STHDistributor> distributor) { 18 std::unique_ptr<net::ct::STHDistributor> distributor) {
19 global_sth_distributor.Get().swap(distributor); 19 global_sth_distributor.Get().swap(distributor);
20 } 20 }
21 21
22 net::ct::STHDistributor* GetGlobalSTHDistributor() { 22 net::ct::STHDistributor* GetGlobalSTHDistributor() {
23 CHECK(global_sth_distributor.Get()); 23 CHECK(global_sth_distributor.Get());
24 return global_sth_distributor.Get().get(); 24 return global_sth_distributor.Get().get();
25 } 25 }
26 26
27 } // namespace chrome_browser_net 27 } // namespace chrome_browser_net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698