| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 #include "wtf/Assertions.h" | 32 #include "wtf/Assertions.h" |
| 33 #include "wtf/Functional.h" | 33 #include "wtf/Functional.h" |
| 34 #include "wtf/MainThread.h" | 34 #include "wtf/MainThread.h" |
| 35 #include "wtf/StdLibExtras.h" | 35 #include "wtf/StdLibExtras.h" |
| 36 #include "wtf/Threading.h" | 36 #include "wtf/Threading.h" |
| 37 | 37 |
| 38 namespace blink { | 38 namespace blink { |
| 39 | 39 |
| 40 NetworkStateNotifier& networkStateNotifier() | 40 NetworkStateNotifier& networkStateNotifier() |
| 41 { | 41 { |
| 42 AtomicallyInitializedStatic(NetworkStateNotifier*, networkStateNotifier = ne
w NetworkStateNotifier); | 42 AtomicallyInitializedStaticReference(NetworkStateNotifier, networkStateNotif
ier, new NetworkStateNotifier); |
| 43 return *networkStateNotifier; | 43 return networkStateNotifier; |
| 44 } | 44 } |
| 45 | 45 |
| 46 void NetworkStateNotifier::setOnLine(bool onLine) | 46 void NetworkStateNotifier::setOnLine(bool onLine) |
| 47 { | 47 { |
| 48 ASSERT(isMainThread()); | 48 ASSERT(isMainThread()); |
| 49 | 49 |
| 50 { | 50 { |
| 51 MutexLocker locker(m_mutex); | 51 MutexLocker locker(m_mutex); |
| 52 if (m_isOnLine == onLine) | 52 if (m_isOnLine == onLine) |
| 53 return; | 53 return; |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 | 172 |
| 173 list->zeroedObservers.clear(); | 173 list->zeroedObservers.clear(); |
| 174 | 174 |
| 175 if (list->observers.isEmpty()) { | 175 if (list->observers.isEmpty()) { |
| 176 MutexLocker locker(m_mutex); | 176 MutexLocker locker(m_mutex); |
| 177 m_observers.remove(context); // deletes list | 177 m_observers.remove(context); // deletes list |
| 178 } | 178 } |
| 179 } | 179 } |
| 180 | 180 |
| 181 } // namespace blink | 181 } // namespace blink |
| OLD | NEW |