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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/ChromeStrictMode.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; 5 package org.chromium.chrome.browser;
6 6
7 import android.app.ApplicationErrorReport; 7 import android.app.ApplicationErrorReport;
8 import android.os.Build; 8 import android.os.Build;
9 import android.os.Looper; 9 import android.os.Looper;
10 import android.os.MessageQueue; 10 import android.os.MessageQueue;
(...skipping 14 matching lines...) Expand all
25 import java.util.concurrent.atomic.AtomicInteger; 25 import java.util.concurrent.atomic.AtomicInteger;
26 26
27 /** 27 /**
28 * Initialize application-level StrictMode reporting. 28 * Initialize application-level StrictMode reporting.
29 */ 29 */
30 public class ChromeStrictMode { 30 public class ChromeStrictMode {
31 private static final String TAG = "ChromeStrictMode"; 31 private static final String TAG = "ChromeStrictMode";
32 private static final double UPLOAD_PROBABILITY = 0.01; 32 private static final double UPLOAD_PROBABILITY = 0.01;
33 private static final double MAX_UPLOADS_PER_SESSION = 3; 33 private static final double MAX_UPLOADS_PER_SESSION = 3;
34 34
35 private static boolean sIsStrictModeAlreadyConfigured = false; 35 private static boolean sIsStrictModeAlreadyConfigured;
36 private static List<Object> sCachedStackTraces = 36 private static List<Object> sCachedStackTraces =
37 Collections.synchronizedList(new ArrayList<Object>()); 37 Collections.synchronizedList(new ArrayList<Object>());
38 private static AtomicInteger sNumUploads = new AtomicInteger(); 38 private static AtomicInteger sNumUploads = new AtomicInteger();
39 39
40 private static class SnoopingArrayList<T> extends ArrayList<T> { 40 private static class SnoopingArrayList<T> extends ArrayList<T> {
41 @Override 41 @Override
42 public void clear() { 42 public void clear() {
43 for (int i = 0; i < size(); i++) { 43 for (int i = 0; i < size(); i++) {
44 // It is likely that we have at most one violation pass this che ck each time around. 44 // It is likely that we have at most one violation pass this che ck each time around.
45 if (Math.random() < UPLOAD_PROBABILITY) { 45 if (Math.random() < UPLOAD_PROBABILITY) {
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 if ((ChromeVersionInfo.isLocalBuild() && !BuildConfig.DCHECK_IS_ON) 198 if ((ChromeVersionInfo.isLocalBuild() && !BuildConfig.DCHECK_IS_ON)
199 || enableStrictModeWatch) { 199 || enableStrictModeWatch) {
200 turnOnDetection(threadPolicy, vmPolicy); 200 turnOnDetection(threadPolicy, vmPolicy);
201 initializeStrictModeWatch(); 201 initializeStrictModeWatch();
202 } 202 }
203 203
204 StrictMode.setThreadPolicy(threadPolicy.build()); 204 StrictMode.setThreadPolicy(threadPolicy.build());
205 StrictMode.setVmPolicy(vmPolicy.build()); 205 StrictMode.setVmPolicy(vmPolicy.build());
206 } 206 }
207 } 207 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698