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

Side by Side Diff: components/cronet/android/java/src/org/chromium/net/impl/CronetLibraryLoader.java

Issue 2109293005: [Cronet] Fix up log TAGs to be accurate and prevent future inaccuracies. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: switch sample to android.util.Log Created 3 years, 11 months 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.net.impl; 5 package org.chromium.net.impl;
6 6
7 import android.content.Context; 7 import android.content.Context;
8 import android.os.Handler; 8 import android.os.Handler;
9 import android.os.Looper; 9 import android.os.Looper;
10 10
11 import org.chromium.base.ContextUtils; 11 import org.chromium.base.ContextUtils;
12 import org.chromium.base.Log; 12 import org.chromium.base.Log;
13 import org.chromium.base.VisibleForTesting; 13 import org.chromium.base.VisibleForTesting;
14 import org.chromium.base.annotations.JNINamespace; 14 import org.chromium.base.annotations.JNINamespace;
15 import org.chromium.net.NetworkChangeNotifier; 15 import org.chromium.net.NetworkChangeNotifier;
16 16
17 /** 17 /**
18 * CronetLibraryLoader loads and initializes native library on main thread. 18 * CronetLibraryLoader loads and initializes native library on main thread.
19 */ 19 */
20 @JNINamespace("cronet") 20 @JNINamespace("cronet")
21 @VisibleForTesting 21 @VisibleForTesting
22 public class CronetLibraryLoader { 22 public class CronetLibraryLoader {
23 // Synchronize initialization. 23 // Synchronize initialization.
24 private static final Object sLoadLock = new Object(); 24 private static final Object sLoadLock = new Object();
25 private static final String LIBRARY_NAME = "cronet"; 25 private static final String LIBRARY_NAME = "cronet";
26 private static final String TAG = "CronetLibraryLoader"; 26 private static final String TAG = CronetLibraryLoader.class.getSimpleName();
27 // Has library loading commenced? Setting guarded by sLoadLock. 27 // Has library loading commenced? Setting guarded by sLoadLock.
28 private static volatile boolean sInitStarted = false; 28 private static volatile boolean sInitStarted = false;
29 // Has ensureMainThreadInitialized() completed? Only accessed on main threa d. 29 // Has ensureMainThreadInitialized() completed? Only accessed on main threa d.
30 private static boolean sMainThreadInitDone = false; 30 private static boolean sMainThreadInitDone = false;
31 31
32 /** 32 /**
33 * Ensure that native library is loaded and initialized. Can be called from 33 * Ensure that native library is loaded and initialized. Can be called from
34 * any thread, the load and initialization is performed on main thread. 34 * any thread, the load and initialization is performed on main thread.
35 */ 35 */
36 public static void ensureInitialized( 36 public static void ensureInitialized(
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 // the undesired initial network change observer notification, which 95 // the undesired initial network change observer notification, which
96 // will cause active requests to fail with ERR_NETWORK_CHANGED. 96 // will cause active requests to fail with ERR_NETWORK_CHANGED.
97 nativeCronetInitOnMainThread(); 97 nativeCronetInitOnMainThread();
98 sMainThreadInitDone = true; 98 sMainThreadInitDone = true;
99 } 99 }
100 100
101 // Native methods are implemented in cronet_library_loader.cc. 101 // Native methods are implemented in cronet_library_loader.cc.
102 private static native void nativeCronetInitOnMainThread(); 102 private static native void nativeCronetInitOnMainThread();
103 private static native String nativeGetCronetVersion(); 103 private static native String nativeGetCronetVersion();
104 } 104 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698