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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/init/ChromeLifetimeController.java

Issue 2548013002: Remove redundant field initialization in Java code. (Closed)
Patch Set: rebase Created 4 years 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.chrome.browser.init; 5 package org.chromium.chrome.browser.init;
6 6
7 import android.app.Activity; 7 import android.app.Activity;
8 import android.content.Context; 8 import android.content.Context;
9 import android.content.Intent; 9 import android.content.Intent;
10 import android.os.Process; 10 import android.os.Process;
(...skipping 17 matching lines...) Expand all
28 * https://crbug.com/515919 details why another Activity is used instead of usin g the AlarmManager. 28 * https://crbug.com/515919 details why another Activity is used instead of usin g the AlarmManager.
29 * https://crbug.com/545453 details why the BrowserRestartActivity handles the p rocess killing. 29 * https://crbug.com/545453 details why the BrowserRestartActivity handles the p rocess killing.
30 */ 30 */
31 class ChromeLifetimeController implements ApplicationLifetime.Observer, 31 class ChromeLifetimeController implements ApplicationLifetime.Observer,
32 ApplicationStatus.ActivityStateListener { 32 ApplicationStatus.ActivityStateListener {
33 private static final String TAG = "LifetimeController"; 33 private static final String TAG = "LifetimeController";
34 34
35 private static ChromeLifetimeController sInstance; 35 private static ChromeLifetimeController sInstance;
36 36
37 private boolean mRestartChromeOnDestroy; 37 private boolean mRestartChromeOnDestroy;
38 private int mRemainingActivitiesCount = 0; 38 private int mRemainingActivitiesCount;
39 39
40 /** 40 /**
41 * Initialize the ChromeLifetimeController; 41 * Initialize the ChromeLifetimeController;
42 */ 42 */
43 @SuppressFBWarnings("LI_LAZY_INIT_UPDATE_STATIC") 43 @SuppressFBWarnings("LI_LAZY_INIT_UPDATE_STATIC")
44 public static void initialize() { 44 public static void initialize() {
45 ThreadUtils.assertOnUiThread(); 45 ThreadUtils.assertOnUiThread();
46 if (sInstance != null) return; 46 if (sInstance != null) return;
47 sInstance = new ChromeLifetimeController(); 47 sInstance = new ChromeLifetimeController();
48 ApplicationLifetime.addObserver(sInstance); 48 ApplicationLifetime.addObserver(sInstance);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 Intent intent = new Intent(); 83 Intent intent = new Intent();
84 intent.setAction(action); 84 intent.setAction(action);
85 intent.setClassName( 85 intent.setClassName(
86 context.getPackageName(), BrowserRestartActivity.class.getName() ); 86 context.getPackageName(), BrowserRestartActivity.class.getName() );
87 intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 87 intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
88 intent.putExtra(BrowserRestartActivity.EXTRA_MAIN_PID, Process.myPid()); 88 intent.putExtra(BrowserRestartActivity.EXTRA_MAIN_PID, Process.myPid());
89 intent.putExtra(BrowserRestartActivity.EXTRA_RESTART, mRestartChromeOnDe stroy); 89 intent.putExtra(BrowserRestartActivity.EXTRA_RESTART, mRestartChromeOnDe stroy);
90 context.startActivity(intent); 90 context.startActivity(intent);
91 } 91 }
92 } 92 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698