Chromium Code Reviews
DescriptionRefactor NetworkChangeNotifierAndroid
Cleanup and simplify NCNAndroid in a few ways:
1. Move convertToConnectionType() and convertToConnectionSubtype() from NCNAutoDetect to NetworkState accessors as this is where they make the most sense.
2. Pass around connection type and subtype, instead of connection bandwidth which is just computed from the subtype. This reduces the number of JNI calls to convert between the subtype and bandwidth.
3. Instead of keeping four different state variables in NCNAutoDetect, just keep one, the NetworkState, which contains the different state characteristics.
These cleanups have the convenient byproduct of avoiding all JNI calls from NCNAndroid until there are incoming JNI calls to register native observers; this ensures NCNAndroid initialization can be done without JNI, which facilitates crrev.com/2863093003.
Review-Url: https://codereview.chromium.org/2866253002
Cr-Commit-Position: refs/heads/master@{#471599}
Committed: https://chromium.googlesource.com/chromium/src/+/82afc22a4146e58caddfb33496c1ff3e15307854
Patch Set 1 #Patch Set 2 : fix #Patch Set 3 : fix #Patch Set 4 : fix #Patch Set 5 : fix #Patch Set 6 : fix #Patch Set 7 : fix #Patch Set 8 : fix #Patch Set 9 : fix #
Total comments: 7
Patch Set 10 : address comments #Patch Set 11 : rename MaxBandwidth signals to ConnectionSubtype #Patch Set 12 : Add test to make sure NCN doesn't call native functions during startup #
Total comments: 1
Messages
Total messages: 25 (10 generated)
|