Changeset 61554 in webkit


Ignore:
Timestamp:
Jun 21, 2010 10:43:39 AM (14 years ago)
Author:
Adam Roben
Message:

Call NotifyAddrChange again each time we are notified of a change

NotifyAddrChange only notifies you of a single change. If you want to
listen for subsequent changes, you have to call it again.

Fixes <http://webkit.org/b/33004> NetworkStateNotifier ignores all
state changes after the first.

No test possible, as we don't have a way to modify the system's
network adapters when running tests.

Reviewed by Anders Carlsson.

  • platform/network/win/NetworkStateNotifierWin.cpp:

(WebCore::NetworkStateNotifier::addrChangeCallback): Call
registerForAddressChange as soon as we're notified of an address
change, so we'll also get notified of the *next* address change. I
added the call here instead of in addressChanged (which is called
later on the main thread) to minimize the time between the callback
and registering again (so that we won't miss changes that happen in
rapid succession).

Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r61552 r61554  
     12010-06-21  Adam Roben  <aroben@apple.com>
     2
     3        Call NotifyAddrChange again each time we are notified of a change
     4
     5        NotifyAddrChange only notifies you of a single change. If you want to
     6        listen for subsequent changes, you have to call it again.
     7
     8        Fixes <http://webkit.org/b/33004> NetworkStateNotifier ignores all
     9        state changes after the first.
     10
     11        No test possible, as we don't have a way to modify the system's
     12        network adapters when running tests.
     13
     14        Reviewed by Anders Carlsson.
     15
     16        * platform/network/win/NetworkStateNotifierWin.cpp:
     17        (WebCore::NetworkStateNotifier::addrChangeCallback): Call
     18        registerForAddressChange as soon as we're notified of an address
     19        change, so we'll also get notified of the *next* address change. I
     20        added the call here instead of in addressChanged (which is called
     21        later on the main thread) to minimize the time between the callback
     22        and registering again (so that we won't miss changes that happen in
     23        rapid succession).
     24
    1252010-06-21  Dan Bernstein  <mitz@apple.com>
    226
  • trunk/WebCore/platform/network/win/NetworkStateNotifierWin.cpp

    r38197 r61554  
    8989void CALLBACK NetworkStateNotifier::addrChangeCallback(void* context, BOOLEAN timedOut)
    9090{
     91    // NotifyAddrChange only notifies us of a single address change. Now that we've been notified,
     92    // we need to call it again so we'll get notified the *next* time.
     93    static_cast<NetworkStateNotifier*>(context)->registerForAddressChange();
     94
    9195    callOnMainThread(callAddressChanged, context);
    9296}
Note: See TracChangeset for help on using the changeset viewer.