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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappAuthenticator.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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.webapps; 5 package org.chromium.chrome.browser.webapps;
6 6
7 import android.annotation.SuppressLint; 7 import android.annotation.SuppressLint;
8 import android.content.Context; 8 import android.content.Context;
9 import android.os.AsyncTask; 9 import android.os.AsyncTask;
10 import android.os.StrictMode; 10 import android.os.StrictMode;
(...skipping 29 matching lines...) Expand all
40 * installed web apps and arbitrary other URLs. 40 * installed web apps and arbitrary other URLs.
41 */ 41 */
42 public class WebappAuthenticator { 42 public class WebappAuthenticator {
43 private static final String TAG = "WebappAuthenticator"; 43 private static final String TAG = "WebappAuthenticator";
44 private static final String MAC_ALGORITHM_NAME = "HmacSHA256"; 44 private static final String MAC_ALGORITHM_NAME = "HmacSHA256";
45 private static final String MAC_KEY_BASENAME = "webapp-authenticator"; 45 private static final String MAC_KEY_BASENAME = "webapp-authenticator";
46 private static final int MAC_KEY_BYTE_COUNT = 32; 46 private static final int MAC_KEY_BYTE_COUNT = 32;
47 private static final Object sLock = new Object(); 47 private static final Object sLock = new Object();
48 48
49 private static FutureTask<SecretKey> sMacKeyGenerator; 49 private static FutureTask<SecretKey> sMacKeyGenerator;
50 private static SecretKey sKey = null; 50 private static SecretKey sKey;
51 51
52 private static final TimesHistogramSample sWebappValidationTimes = new Times HistogramSample( 52 private static final TimesHistogramSample sWebappValidationTimes = new Times HistogramSample(
53 "Android.StrictMode.WebappAuthenticatorMac", TimeUnit.MILLISECONDS); 53 "Android.StrictMode.WebappAuthenticatorMac", TimeUnit.MILLISECONDS);
54 54
55 /** 55 /**
56 * @see #getMacForUrl 56 * @see #getMacForUrl
57 * 57 *
58 * @param url The URL to validate. 58 * @param url The URL to validate.
59 * @param mac The bytes of a previously-calculated MAC. 59 * @param mac The bytes of a previously-calculated MAC.
60 * 60 *
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 } 236 }
237 Mac mac = Mac.getInstance(MAC_ALGORITHM_NAME); 237 Mac mac = Mac.getInstance(MAC_ALGORITHM_NAME);
238 mac.init(key); 238 mac.init(key);
239 return mac; 239 return mac;
240 } catch (GeneralSecurityException e) { 240 } catch (GeneralSecurityException e) {
241 Log.w(TAG, "Error in creating MAC instance", e); 241 Log.w(TAG, "Error in creating MAC instance", e);
242 return null; 242 return null;
243 } 243 }
244 } 244 }
245 } 245 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698