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

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

Issue 1424193003: [Cronet] Remove CronetEngine.Builder JSON serial/deserialization APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address Helen's comment Created 5 years, 1 month 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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; 5 package org.chromium.net;
6 6
7 import android.os.Build; 7 import android.os.Build;
8 import android.os.ConditionVariable; 8 import android.os.ConditionVariable;
9 import android.os.Handler; 9 import android.os.Handler;
10 import android.os.Looper; 10 import android.os.Looper;
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 new ObserverList<NetworkQualityRttListener>(); 66 new ObserverList<NetworkQualityRttListener>();
67 67
68 @GuardedBy("mNetworkQualityLock") 68 @GuardedBy("mNetworkQualityLock")
69 private final ObserverList<NetworkQualityThroughputListener> mThroughputList enerList = 69 private final ObserverList<NetworkQualityThroughputListener> mThroughputList enerList =
70 new ObserverList<NetworkQualityThroughputListener>(); 70 new ObserverList<NetworkQualityThroughputListener>();
71 71
72 @UsedByReflection("CronetEngine.java") 72 @UsedByReflection("CronetEngine.java")
73 public CronetUrlRequestContext(CronetEngine.Builder builder) { 73 public CronetUrlRequestContext(CronetEngine.Builder builder) {
74 CronetLibraryLoader.ensureInitialized(builder.getContext(), builder); 74 CronetLibraryLoader.ensureInitialized(builder.getContext(), builder);
75 nativeSetMinLogLevel(getLoggingLevel()); 75 nativeSetMinLogLevel(getLoggingLevel());
76 mUrlRequestContextAdapter = nativeCreateRequestContextAdapter(builder.to String()); 76 mUrlRequestContextAdapter = nativeCreateRequestContextAdapter(builder.to JSONString());
77 if (mUrlRequestContextAdapter == 0) { 77 if (mUrlRequestContextAdapter == 0) {
78 throw new NullPointerException("Context Adapter creation failed."); 78 throw new NullPointerException("Context Adapter creation failed.");
79 } 79 }
80 80
81 // Init native Chromium URLRequestContext on main UI thread. 81 // Init native Chromium URLRequestContext on main UI thread.
82 Runnable task = new Runnable() { 82 Runnable task = new Runnable() {
83 @Override 83 @Override
84 public void run() { 84 public void run() {
85 synchronized (mLock) { 85 synchronized (mLock) {
86 // mUrlRequestContextAdapter is guaranteed to exist until 86 // mUrlRequestContextAdapter is guaranteed to exist until
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 @NativeClassQualifiedName("CronetURLRequestContextAdapter") 413 @NativeClassQualifiedName("CronetURLRequestContextAdapter")
414 private native void nativeEnableNetworkQualityEstimator( 414 private native void nativeEnableNetworkQualityEstimator(
415 long nativePtr, boolean useLocalHostRequests, boolean useSmallerResp onses); 415 long nativePtr, boolean useLocalHostRequests, boolean useSmallerResp onses);
416 416
417 @NativeClassQualifiedName("CronetURLRequestContextAdapter") 417 @NativeClassQualifiedName("CronetURLRequestContextAdapter")
418 private native void nativeProvideRTTObservations(long nativePtr, boolean sho uld); 418 private native void nativeProvideRTTObservations(long nativePtr, boolean sho uld);
419 419
420 @NativeClassQualifiedName("CronetURLRequestContextAdapter") 420 @NativeClassQualifiedName("CronetURLRequestContextAdapter")
421 private native void nativeProvideThroughputObservations(long nativePtr, bool ean should); 421 private native void nativeProvideThroughputObservations(long nativePtr, bool ean should);
422 } 422 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698