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

Side by Side Diff: Source/core/page/NetworkStateNotifier.cpp

Issue 291203002: Adds NetInfo v3 Web API to Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@netinfo1
Patch Set: Comment typo Created 6 years, 6 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
« no previous file with comments | « Source/core/page/NetworkStateNotifier.h ('k') | Source/modules/EventTargetModulesFactory.in » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 ASSERT(isMainThread()); 62 ASSERT(isMainThread());
63 if (m_testUpdatesOnly) 63 if (m_testUpdatesOnly)
64 return; 64 return;
65 65
66 setWebConnectionTypeImpl(type); 66 setWebConnectionTypeImpl(type);
67 } 67 }
68 68
69 void NetworkStateNotifier::setWebConnectionTypeImpl(blink::WebConnectionType typ e) 69 void NetworkStateNotifier::setWebConnectionTypeImpl(blink::WebConnectionType typ e)
70 { 70 {
71 ASSERT(isMainThread()); 71 ASSERT(isMainThread());
72 ASSERT(!m_testUpdatesOnly);
73 72
74 MutexLocker locker(m_mutex); 73 MutexLocker locker(m_mutex);
75 if (m_type == type) 74 if (m_type == type)
76 return; 75 return;
77 m_type = type; 76 m_type = type;
78 77
79 for (ObserverListMap::iterator it = m_observers.begin(); it != m_observers.e nd(); ++it) { 78 for (ObserverListMap::iterator it = m_observers.begin(); it != m_observers.e nd(); ++it) {
80 ExecutionContext* context = it->key; 79 ExecutionContext* context = it->key;
81 context->postTask(bind(&NetworkStateNotifier::notifyObserversOnContext, this, context, type)); 80 context->postTask(bind(&NetworkStateNotifier::notifyObserversOnContext, this, context, type));
82 } 81 }
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 171
173 list->zeroedObservers.clear(); 172 list->zeroedObservers.clear();
174 173
175 if (list->observers.isEmpty()) { 174 if (list->observers.isEmpty()) {
176 MutexLocker locker(m_mutex); 175 MutexLocker locker(m_mutex);
177 m_observers.remove(context); // deletes list 176 m_observers.remove(context); // deletes list
178 } 177 }
179 } 178 }
180 179
181 } // namespace WebCore 180 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/page/NetworkStateNotifier.h ('k') | Source/modules/EventTargetModulesFactory.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698