Hello nicolasroard,
I'd like you to do a code review. Please execute
g4 diff -c 10430061
or point your web browser to
http://mondrian/10430061
to review the following code:
Change 10430061 by stevebl...@steveblock-gears2 on 2009/03/10 18:44:43 *pending*
Modifies AndroidWifiDataProvider to use updated WifiData struct.
R=nicolasroard
[email protected]
DELTA=20 (10 added, 7 deleted, 3 changed)
OCL=10430061
Affected files ...
...
//depot/googleclient/gears/opensource/gears/geolocation/wifi_data_provider_android.cc#5
edit
...
//depot/googleclient/gears/opensource/gears/geolocation/wifi_data_provider_common.cc#8
edit
20 delta lines: 10 added, 7 deleted, 3 changed
Also consider running:
g4 lint -c 10430061
which verifies that the changelist doesn't introduce new style violations.
If you can't do the review, please let me know as soon as possible. During
your review, please ensure that all new code has corresponding unit tests and
that existing unit tests are updated appropriately. Visit
http://www/eng/code_review.html for more information.
This is a semiautomated message from "g4 mail". Complaints or suggestions?
Mail [email protected].
Change 10430061 by stevebl...@steveblock-gears2 on 2009/03/10 18:44:43 *pending*
Modifies AndroidWifiDataProvider to use updated WifiData struct.
Affected files ...
...
//depot/googleclient/gears/opensource/gears/geolocation/wifi_data_provider_android.cc#5
edit
...
//depot/googleclient/gears/opensource/gears/geolocation/wifi_data_provider_common.cc#8
edit
====
//depot/googleclient/gears/opensource/gears/geolocation/wifi_data_provider_android.cc#5
-
c:\MyDocs\Gears2/googleclient/gears/opensource/gears/geolocation/wifi_data_provider_android.cc
====
# action=edit type=text
---
googleclient/gears/opensource/gears/geolocation/wifi_data_provider_android.cc
2009-03-10 18:45:17.000000000 +0000
+++
googleclient/gears/opensource/gears/geolocation/wifi_data_provider_android.cc
2009-03-10 18:49:29.000000000 +0000
@@ -131,15 +131,13 @@
assert(new_wifi_data);
bool is_update_available = false;
data_mutex_.Lock();
- if (!wifi_data_.Matches(*new_wifi_data)) {
- wifi_data_ = *new_wifi_data;
- is_update_available = true;
- is_first_scan_complete_ = true;
- }
+ is_update_available = wifi_data_.DiffersSignificantly(*new_wifi_data);
+ wifi_data_ = *new_wifi_data;
// Avoid holding the mutex locked while notifying observers.
data_mutex_.Unlock();
if (is_update_available) {
+ is_first_scan_complete_ = true;
NotifyListeners();
}
@@ -272,7 +270,7 @@
// Convert it to an AccessPointData.
AccessPointData data;
if (InitFromJavaScanResult(scan_result, &data)) {
- new_wifi_data_out->access_point_data.push_back(data);
+ new_wifi_data_out->access_point_data.insert(data);
}
JniGetEnv()->DeleteLocalRef(scan_result);
}
====
//depot/googleclient/gears/opensource/gears/geolocation/wifi_data_provider_common.cc#8
-
c:\MyDocs\Gears2/googleclient/gears/opensource/gears/geolocation/wifi_data_provider_common.cc
====
# action=edit type=text
---
googleclient/gears/opensource/gears/geolocation/wifi_data_provider_common.cc
2009-03-10 19:03:33.000000000 +0000
+++
googleclient/gears/opensource/gears/geolocation/wifi_data_provider_common.cc
2009-03-10 18:56:09.000000000 +0000
@@ -25,10 +25,6 @@
#include "gears/geolocation/wifi_data_provider_common.h"
-// These constants are defined for each platfrom in wifi_data_provider_xxx.cc.
-extern const int kDefaultPollingInterval;
-extern const int kNoChangePollingInterval;
-extern const int kTwoNoChangePollingInterval;
#if defined(WIN32) || defined(OS_MACOSX)
@@ -76,6 +72,13 @@
#endif // WIN32 || OS_MACOSX
+#if defined(WIN32) || defined(OS_MACOSX) || defined(LINUX)
+
+// These constants are defined for each platfrom in wifi_data_provider_xxx.cc.
+extern const int kDefaultPollingInterval;
+extern const int kNoChangePollingInterval;
+extern const int kTwoNoChangePollingInterval;
+
int UpdatePollingInterval(int polling_interval, bool scan_results_differ) {
if (scan_results_differ) {
return kDefaultPollingInterval;
@@ -88,3 +91,5 @@
return kTwoNoChangePollingInterval;
}
}
+
+#endif // WIN32 || OS_MACOSX || LINUX