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

Unified Diff: net/cronet/android/java/src/org/chromium/net/UrlRequestContext.java

Issue 183333002: Cronet Java wrappers to fallback to HttpUrlConnection if Cronet is not available. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address formatting comments. Created 6 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 side-by-side diff with in-line comments
Download patch
Index: net/cronet/android/java/src/org/chromium/net/UrlRequestContext.java
diff --git a/net/cronet/android/java/src/org/chromium/net/UrlRequestContext.java b/net/cronet/android/java/src/org/chromium/net/UrlRequestContext.java
index 8b41a1f99b00e344b0a87a382977cde3621407cc..3a42e0705962968a1f93cc0c43f64b5ca6520bec 100644
--- a/net/cronet/android/java/src/org/chromium/net/UrlRequestContext.java
+++ b/net/cronet/android/java/src/org/chromium/net/UrlRequestContext.java
@@ -15,52 +15,53 @@ import org.chromium.base.CalledByNative;
* Provides context for the native HTTP operations.
*/
public class UrlRequestContext {
- protected static final int LOG_NONE = 0;
- protected static final int LOG_DEBUG = 1;
- protected static final int LOG_VERBOSE = 2;
+ protected static final int LOG_NONE = 0;
- /**
- * This field is accessed exclusively from the native layer.
- */
- @AccessedByNative
- private long mRequestContext;
+ protected static final int LOG_DEBUG = 1;
- private final ConditionVariable mStarted = new ConditionVariable();
+ protected static final int LOG_VERBOSE = 2;
- /**
- * Constructor.
- *
- * @param loggingLevel see {@link #LOG_NONE}, {@link #LOG_DEBUG} and
- * {@link #LOG_VERBOSE}.
- */
- protected UrlRequestContext(Context context,
- String userAgent,
- int loggingLevel) {
- nativeInitialize(context, userAgent, loggingLevel);
- mStarted.block(2000);
- }
+ /**
+ * This field is accessed exclusively from the native layer.
+ */
+ @AccessedByNative
+ private long mRequestContext;
- /**
- * Returns the version of this network stack formatted as N.N.N.N/X where
- * N.N.N.N is the version of Chromium and X is the version of the JNI layer.
- */
- public static native String getVersion();
+ private final ConditionVariable mStarted = new ConditionVariable();
- @CalledByNative
- private void initNetworkThread() {
- Thread.currentThread().setName("ChromiumNet");
- Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND);
- mStarted.open();
- }
+ /**
+ * Constructor.
+ *
+ * @param loggingLevel see {@link #LOG_NONE}, {@link #LOG_DEBUG} and
+ * {@link #LOG_VERBOSE}.
+ */
+ protected UrlRequestContext(Context context, String userAgent,
+ int loggingLevel) {
+ nativeInitialize(context, userAgent, loggingLevel);
+ mStarted.block(2000);
+ }
- @Override
- protected void finalize() throws Throwable {
- nativeFinalize();
- super.finalize();
- }
+ /**
+ * Returns the version of this network stack formatted as N.N.N.N/X where
+ * N.N.N.N is the version of Chromium and X is the version of the JNI layer.
+ */
+ public static native String getVersion();
- private native void nativeInitialize(Context context,
- String userAgent,
- int loggingLevel);
- private native void nativeFinalize();
+ @CalledByNative
+ private void initNetworkThread() {
+ Thread.currentThread().setName("ChromiumNet");
+ Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND);
+ mStarted.open();
+ }
+
+ @Override
+ protected void finalize() throws Throwable {
+ nativeFinalize();
+ super.finalize();
+ }
+
+ private native void nativeInitialize(Context context, String userAgent,
+ int loggingLevel);
+
+ private native void nativeFinalize();
}

Powered by Google App Engine
This is Rietveld 408576698