| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef BASE_OBSERVER_LIST_THREADSAFE_H_ | 5 #ifndef BASE_OBSERVER_LIST_THREADSAFE_H_ |
| 6 #define BASE_OBSERVER_LIST_THREADSAFE_H_ | 6 #define BASE_OBSERVER_LIST_THREADSAFE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <map> | 10 #include <map> |
| 11 #include <vector> | |
| 12 | 11 |
| 13 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 14 #include "base/callback.h" | 13 #include "base/callback.h" |
| 15 #include "base/logging.h" | 14 #include "base/logging.h" |
| 16 #include "base/message_loop.h" | 15 #include "base/message_loop.h" |
| 17 #include "base/observer_list.h" | 16 #include "base/observer_list.h" |
| 18 #include "base/ref_counted.h" | 17 #include "base/ref_counted.h" |
| 19 #include "base/task.h" | 18 #include "base/task.h" |
| 20 | 19 |
| 21 /////////////////////////////////////////////////////////////////////////////// | 20 /////////////////////////////////////////////////////////////////////////////// |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 typedef std::map<MessageLoop*, ObserverList<ObserverType>*> ObserversListMap; | 193 typedef std::map<MessageLoop*, ObserverList<ObserverType>*> ObserversListMap; |
| 195 | 194 |
| 196 // These are marked mutable to facilitate having NotifyAll be const. | 195 // These are marked mutable to facilitate having NotifyAll be const. |
| 197 Lock list_lock_; // Protects the observer_lists_. | 196 Lock list_lock_; // Protects the observer_lists_. |
| 198 ObserversListMap observer_lists_; | 197 ObserversListMap observer_lists_; |
| 199 | 198 |
| 200 DISALLOW_COPY_AND_ASSIGN(ObserverListThreadSafe); | 199 DISALLOW_COPY_AND_ASSIGN(ObserverListThreadSafe); |
| 201 }; | 200 }; |
| 202 | 201 |
| 203 #endif // BASE_OBSERVER_LIST_THREADSAFE_H_ | 202 #endif // BASE_OBSERVER_LIST_THREADSAFE_H_ |
| OLD | NEW |