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

Unified Diff: chrome/browser/safe_browsing/protocol_manager.cc

Issue 302603008: [Android] Only update safe-browsing database on WiFi (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/safe_browsing/protocol_manager.cc
diff --git a/chrome/browser/safe_browsing/protocol_manager.cc b/chrome/browser/safe_browsing/protocol_manager.cc
index 78d96ca102abcf7cb20ffa97c408eec0a222f946..af72cb22b33d8cf78dfbb075c4cafef433809a20 100644
--- a/chrome/browser/safe_browsing/protocol_manager.cc
+++ b/chrome/browser/safe_browsing/protocol_manager.cc
@@ -22,6 +22,9 @@
#include "net/base/escape.h"
#include "net/base/load_flags.h"
#include "net/base/net_errors.h"
+#if defined(OS_ANDROID)
+#include "net/base/network_change_notifier.h"
+#endif
Scott Hess - ex-Googler 2014/05/30 16:21:07 The OS-specific section should come after the main
#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_request_context_getter.h"
#include "net/url_request/url_request_status.h"
@@ -197,8 +200,19 @@ void SafeBrowsingProtocolManager::GetFullHash(
void SafeBrowsingProtocolManager::GetNextUpdate() {
DCHECK(CalledOnValidThread());
- if (!request_.get() && request_type_ == NO_REQUEST)
+ if (!request_.get() && request_type_ == NO_REQUEST) {
+#if !defined(OS_ANDROID)
IssueUpdateRequest();
Scott Hess - ex-Googler 2014/05/30 16:21:07 This function could be restructured as: { if (r
+#else
+ net::NetworkChangeNotifier::ConnectionType type =
+ net::NetworkChangeNotifier::GetConnectionType();
+ if (type == net::NetworkChangeNotifier::CONNECTION_WIFI) {
+ IssueUpdateRequest();
+ } else {
+ ScheduleNextUpdate(false /* no back off */);
klobag.chromium 2014/05/30 05:50:15 What is next_update_interval_ look like in common
Scott Hess - ex-Googler 2014/05/30 16:21:07 The server sends things down, it generally seems t
Feng Qian 2014/05/30 17:15:59 If a user is off WiFi for awhile, it will use the
Scott Hess - ex-Googler 2014/05/30 17:24:57 I don't think backoff is right for this case. I t
+ }
+#endif
+ }
}
// net::URLFetcherDelegate implementation ----------------------------------
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698