| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "extensions/browser/guest_view/guest_view_events.h" | 5 #include "extensions/browser/guest_view/guest_view_events.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 auto value = values_.find(event_name); | 91 auto value = values_.find(event_name); |
| 92 return value != values_.end() ? value->second : events::UNKNOWN; | 92 return value != values_.end() ? value->second : events::UNKNOWN; |
| 93 } | 93 } |
| 94 | 94 |
| 95 private: | 95 private: |
| 96 std::map<std::string, events::HistogramValue> values_; | 96 std::map<std::string, events::HistogramValue> values_; |
| 97 | 97 |
| 98 DISALLOW_COPY_AND_ASSIGN(EventMap); | 98 DISALLOW_COPY_AND_ASSIGN(EventMap); |
| 99 }; | 99 }; |
| 100 | 100 |
| 101 base::LazyInstance<EventMap> g_event_map = LAZY_INSTANCE_INITIALIZER; | 101 base::LazyInstance<EventMap>::DestructorAtExit g_event_map = |
| 102 LAZY_INSTANCE_INITIALIZER; |
| 102 | 103 |
| 103 } // namespace | 104 } // namespace |
| 104 | 105 |
| 105 events::HistogramValue GetEventHistogramValue(const std::string& event_name) { | 106 events::HistogramValue GetEventHistogramValue(const std::string& event_name) { |
| 106 return g_event_map.Get().Get(event_name); | 107 return g_event_map.Get().Get(event_name); |
| 107 } | 108 } |
| 108 | 109 |
| 109 } // namespace guest_view_events | 110 } // namespace guest_view_events |
| 110 } // namespace extensions | 111 } // namespace extensions |
| OLD | NEW |