OLD | NEW |
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.annotation.SuppressLint; |
7 import android.content.Context; | 8 import android.content.Context; |
8 import android.os.AsyncTask; | 9 import android.os.AsyncTask; |
9 import android.os.StrictMode; | 10 import android.os.StrictMode; |
10 import android.view.ContextThemeWrapper; | 11 import android.view.ContextThemeWrapper; |
11 import android.view.InflateException; | 12 import android.view.InflateException; |
12 import android.view.LayoutInflater; | 13 import android.view.LayoutInflater; |
13 import android.view.View; | 14 import android.view.View; |
14 import android.view.ViewGroup; | 15 import android.view.ViewGroup; |
15 import android.view.ViewStub; | 16 import android.view.ViewStub; |
16 import android.widget.FrameLayout; | 17 import android.widget.FrameLayout; |
(...skipping 19 matching lines...) Expand all Loading... |
36 | 37 |
37 /** | 38 /** |
38 * This class is a singleton that holds utilities for warming up Chrome and prer
endering urls | 39 * This class is a singleton that holds utilities for warming up Chrome and prer
endering urls |
39 * without creating the Activity. | 40 * without creating the Activity. |
40 * | 41 * |
41 * This class is not thread-safe and must only be used on the UI thread. | 42 * This class is not thread-safe and must only be used on the UI thread. |
42 */ | 43 */ |
43 public final class WarmupManager { | 44 public final class WarmupManager { |
44 private static final String TAG = "WarmupManager"; | 45 private static final String TAG = "WarmupManager"; |
45 | 46 |
| 47 @SuppressLint("StaticFieldLeak") |
46 private static WarmupManager sWarmupManager; | 48 private static WarmupManager sWarmupManager; |
47 | 49 |
48 private final Set<String> mDnsRequestsInFlight; | 50 private final Set<String> mDnsRequestsInFlight; |
49 private final Map<String, Profile> mPendingPreconnectWithProfile; | 51 private final Map<String, Profile> mPendingPreconnectWithProfile; |
50 | 52 |
51 private int mToolbarContainerId; | 53 private int mToolbarContainerId; |
52 private ViewGroup mMainView; | 54 private ViewGroup mMainView; |
53 private WebContents mSpareWebContents; | 55 private WebContents mSpareWebContents; |
54 | 56 |
55 /** | 57 /** |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 | 252 |
251 /** | 253 /** |
252 * @return Whether a spare renderer is available. | 254 * @return Whether a spare renderer is available. |
253 */ | 255 */ |
254 public boolean hasSpareWebContents() { | 256 public boolean hasSpareWebContents() { |
255 return mSpareWebContents != null; | 257 return mSpareWebContents != null; |
256 } | 258 } |
257 | 259 |
258 private static native void nativePreconnectUrlAndSubresources(Profile profil
e, String url); | 260 private static native void nativePreconnectUrlAndSubresources(Profile profil
e, String url); |
259 } | 261 } |
OLD | NEW |