Commit ab09c809 authored by kcarattini's avatar kcarattini Committed by Commit bot

Remove unused foreground member variable from SB Protocol Manager.

BUG=543161,561867

Review URL: https://codereview.chromium.org/1640503003

Cr-Commit-Position: refs/heads/master@{#371897}
parent a8960461
...@@ -262,7 +262,6 @@ public class ChromeApplication extends ContentApplication { ...@@ -262,7 +262,6 @@ public class ChromeApplication extends ContentApplication {
updatePasswordEchoState(); updatePasswordEchoState();
updateFontSize(); updateFontSize();
updateAcceptLanguages(); updateAcceptLanguages();
changeAppStatus(true);
mVariationsSession.start(getApplicationContext()); mVariationsSession.start(getApplicationContext());
mPowerBroadcastReceiver.onForegroundSessionStart(); mPowerBroadcastReceiver.onForegroundSessionStart();
...@@ -284,7 +283,6 @@ public class ChromeApplication extends ContentApplication { ...@@ -284,7 +283,6 @@ public class ChromeApplication extends ContentApplication {
mBackgroundProcessing.suspendTimers(); mBackgroundProcessing.suspendTimers();
flushPersistentData(); flushPersistentData();
mIsStarted = false; mIsStarted = false;
changeAppStatus(false);
mPowerBroadcastReceiver.onForegroundSessionEnd(); mPowerBroadcastReceiver.onForegroundSessionEnd();
ChildProcessLauncher.onSentToBackground(); ChildProcessLauncher.onSentToBackground();
...@@ -602,12 +600,7 @@ public class ChromeApplication extends ContentApplication { ...@@ -602,12 +600,7 @@ public class ChromeApplication extends ContentApplication {
} }
} }
protected void changeAppStatus(boolean inForeground) {
nativeChangeAppStatus(inForeground);
}
private static native void nativeRemoveSessionCookies(); private static native void nativeRemoveSessionCookies();
private static native void nativeChangeAppStatus(boolean inForeground);
private static native String nativeGetBrowserUserAgent(); private static native String nativeGetBrowserUserAgent();
private static native void nativeFlushPersistentData(); private static native void nativeFlushPersistentData();
......
...@@ -15,8 +15,6 @@ ...@@ -15,8 +15,6 @@
#include "chrome/browser/net/predictor.h" #include "chrome/browser/net/predictor.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/safe_browsing/protocol_manager.h"
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
#include "chrome/common/chrome_content_client.h" #include "chrome/common/chrome_content_client.h"
#include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread.h"
#include "content/public/browser/storage_partition.h" #include "content/public/browser/storage_partition.h"
...@@ -68,15 +66,6 @@ void RemoveSessionCookiesForProfile(Profile* profile) { ...@@ -68,15 +66,6 @@ void RemoveSessionCookiesForProfile(Profile* profile) {
make_scoped_refptr(profile->GetRequestContext()))); make_scoped_refptr(profile->GetRequestContext())));
} }
void ChangeAppStatusOnIOThread(safe_browsing::SafeBrowsingService* sb_service,
jboolean foreground) {
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
safe_browsing::SafeBrowsingProtocolManager* proto_manager =
sb_service->protocol_manager();
if (proto_manager)
proto_manager->SetAppInForeground(foreground);
}
} // namespace } // namespace
static ScopedJavaLocalRef<jstring> GetBrowserUserAgent( static ScopedJavaLocalRef<jstring> GetBrowserUserAgent(
...@@ -103,16 +92,6 @@ static void RemoveSessionCookies(JNIEnv* env, const JavaParamRef<jclass>& obj) { ...@@ -103,16 +92,6 @@ static void RemoveSessionCookies(JNIEnv* env, const JavaParamRef<jclass>& obj) {
RemoveSessionCookiesForProfile); RemoveSessionCookiesForProfile);
} }
static void ChangeAppStatus(JNIEnv* env,
const JavaParamRef<jclass>& obj,
jboolean foreground) {
content::BrowserThread::PostTask(
content::BrowserThread::IO, FROM_HERE,
base::Bind(&ChangeAppStatusOnIOThread,
base::Unretained(g_browser_process->safe_browsing_service()),
foreground));
}
namespace chrome { namespace chrome {
namespace android { namespace android {
......
...@@ -219,8 +219,7 @@ SafeBrowsingProtocolManager::SafeBrowsingProtocolManager( ...@@ -219,8 +219,7 @@ SafeBrowsingProtocolManager::SafeBrowsingProtocolManager(
url_prefix_(config.url_prefix), url_prefix_(config.url_prefix),
backup_update_reason_(BACKUP_UPDATE_REASON_MAX), backup_update_reason_(BACKUP_UPDATE_REASON_MAX),
disable_auto_update_(config.disable_auto_update), disable_auto_update_(config.disable_auto_update),
url_fetcher_id_(0), url_fetcher_id_(0) {
app_in_foreground_(true) {
DCHECK(!url_prefix_.empty()); DCHECK(!url_prefix_.empty());
backup_url_prefixes_[BACKUP_UPDATE_REASON_CONNECT] = backup_url_prefixes_[BACKUP_UPDATE_REASON_CONNECT] =
......
...@@ -191,11 +191,6 @@ class SafeBrowsingProtocolManager : public net::URLFetcherDelegate, ...@@ -191,11 +191,6 @@ class SafeBrowsingProtocolManager : public net::URLFetcherDelegate,
// Returns whether another update is currently scheduled. // Returns whether another update is currently scheduled.
bool IsUpdateScheduled() const; bool IsUpdateScheduled() const;
// Called when app changes status of foreground or background.
void SetAppInForeground(bool foreground) {
app_in_foreground_ = foreground;
}
protected: protected:
// Constructs a SafeBrowsingProtocolManager for |delegate| that issues // Constructs a SafeBrowsingProtocolManager for |delegate| that issues
// network requests using |request_context_getter|. // network requests using |request_context_getter|.
...@@ -469,9 +464,6 @@ class SafeBrowsingProtocolManager : public net::URLFetcherDelegate, ...@@ -469,9 +464,6 @@ class SafeBrowsingProtocolManager : public net::URLFetcherDelegate,
// ID for URLFetchers for testing. // ID for URLFetchers for testing.
int url_fetcher_id_; int url_fetcher_id_;
// Whether the app is in foreground or background.
bool app_in_foreground_;
DISALLOW_COPY_AND_ASSIGN(SafeBrowsingProtocolManager); DISALLOW_COPY_AND_ASSIGN(SafeBrowsingProtocolManager);
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment