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

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

Issue 2741773003: [Cronet] Append version to libcronet library name. (Closed)
Patch Set: address comment Created 3 years, 9 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
« no previous file with comments | « components/cronet/android/BUILD.gn ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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." + ImplVersion.getCronet Version();
26 private static final String TAG = CronetLibraryLoader.class.getSimpleName(); 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 sLibraryLoaded = false; 28 private static volatile boolean sLibraryLoaded = false;
29 // Has ensureMainThreadInitialized() completed? Only accessed on main threa d. 29 // Has ensureMainThreadInitialized() completed? Only accessed on main threa d.
30 private static volatile boolean sMainThreadInitDone = false; 30 private static volatile 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 */
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 // the undesired initial network change observer notification, which 98 // the undesired initial network change observer notification, which
99 // will cause active requests to fail with ERR_NETWORK_CHANGED. 99 // will cause active requests to fail with ERR_NETWORK_CHANGED.
100 nativeCronetInitOnMainThread(); 100 nativeCronetInitOnMainThread();
101 sMainThreadInitDone = true; 101 sMainThreadInitDone = true;
102 } 102 }
103 103
104 // Native methods are implemented in cronet_library_loader.cc. 104 // Native methods are implemented in cronet_library_loader.cc.
105 private static native void nativeCronetInitOnMainThread(); 105 private static native void nativeCronetInitOnMainThread();
106 private static native String nativeGetCronetVersion(); 106 private static native String nativeGetCronetVersion();
107 } 107 }
OLDNEW
« no previous file with comments | « components/cronet/android/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698