| 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 #include "base/metrics/user_metrics.h" | 5 #include "base/metrics/user_metrics.h" |
| 6 | 6 |
| 7 #include <stddef.h> |
| 8 |
| 7 #include <vector> | 9 #include <vector> |
| 8 | 10 |
| 9 #include "base/lazy_instance.h" | 11 #include "base/lazy_instance.h" |
| 12 #include "base/macros.h" |
| 10 #include "base/threading/thread_checker.h" | 13 #include "base/threading/thread_checker.h" |
| 11 | 14 |
| 12 namespace base { | 15 namespace base { |
| 13 namespace { | 16 namespace { |
| 14 | 17 |
| 15 // A helper class for tracking callbacks and ensuring thread-safety. | 18 // A helper class for tracking callbacks and ensuring thread-safety. |
| 16 class Callbacks { | 19 class Callbacks { |
| 17 public: | 20 public: |
| 18 Callbacks() {} | 21 Callbacks() {} |
| 19 | 22 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 void AddActionCallback(const ActionCallback& callback) { | 68 void AddActionCallback(const ActionCallback& callback) { |
| 66 g_callbacks.Get().AddCallback(callback); | 69 g_callbacks.Get().AddCallback(callback); |
| 67 } | 70 } |
| 68 | 71 |
| 69 void RemoveActionCallback(const ActionCallback& callback) { | 72 void RemoveActionCallback(const ActionCallback& callback) { |
| 70 g_callbacks.Get().RemoveCallback(callback); | 73 g_callbacks.Get().RemoveCallback(callback); |
| 71 | 74 |
| 72 } | 75 } |
| 73 | 76 |
| 74 } // namespace base | 77 } // namespace base |
| OLD | NEW |