Chromium Code Reviews| OLD | NEW |
|---|---|
| 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.content.Context; | 7 import android.content.Context; |
| 8 import android.os.Build; | 8 import android.os.Build; |
| 9 import android.os.ConditionVariable; | 9 import android.os.ConditionVariable; |
| 10 import android.os.Handler; | 10 import android.os.Handler; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 75 @Override | 75 @Override |
| 76 public UrlRequest createRequest(String url, UrlRequestListener listener, | 76 public UrlRequest createRequest(String url, UrlRequestListener listener, |
| 77 Executor executor) { | 77 Executor executor) { |
| 78 synchronized (mLock) { | 78 synchronized (mLock) { |
| 79 checkHaveAdapter(); | 79 checkHaveAdapter(); |
| 80 return new CronetUrlRequest(this, mUrlRequestContextAdapter, url, | 80 return new CronetUrlRequest(this, mUrlRequestContextAdapter, url, |
| 81 UrlRequest.REQUEST_PRIORITY_MEDIUM, listener, executor); | 81 UrlRequest.REQUEST_PRIORITY_MEDIUM, listener, executor); |
| 82 } | 82 } |
| 83 } | 83 } |
| 84 | 84 |
| 85 public UrlRequest createRequest(String url, UrlRequestListener listener, | |
|
xunjieli
2015/06/05 15:02:51
@Override.
mkirsche
2015/06/05 15:12:21
Done.
| |
| 86 Executor executor, int priority) { | |
| 87 synchronized (mLock) { | |
| 88 checkHaveAdapter(); | |
| 89 return new CronetUrlRequest(this, mUrlRequestContextAdapter, url, | |
| 90 priority, listener, executor); | |
| 91 } | |
| 92 } | |
| 93 | |
| 85 @Override | 94 @Override |
| 86 public boolean isEnabled() { | 95 public boolean isEnabled() { |
| 87 return Build.VERSION.SDK_INT >= 14; | 96 return Build.VERSION.SDK_INT >= 14; |
| 88 } | 97 } |
| 89 | 98 |
| 90 @Override | 99 @Override |
| 91 public String getVersionString() { | 100 public String getVersionString() { |
| 92 return "Cronet/" + Version.getVersion(); | 101 return "Cronet/" + Version.getVersion(); |
| 93 } | 102 } |
| 94 | 103 |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 210 @NativeClassQualifiedName("CronetURLRequestContextAdapter") | 219 @NativeClassQualifiedName("CronetURLRequestContextAdapter") |
| 211 private native void nativeStartNetLogToFile(long nativePtr, | 220 private native void nativeStartNetLogToFile(long nativePtr, |
| 212 String fileName, boolean logAll); | 221 String fileName, boolean logAll); |
| 213 | 222 |
| 214 @NativeClassQualifiedName("CronetURLRequestContextAdapter") | 223 @NativeClassQualifiedName("CronetURLRequestContextAdapter") |
| 215 private native void nativeStopNetLog(long nativePtr); | 224 private native void nativeStopNetLog(long nativePtr); |
| 216 | 225 |
| 217 @NativeClassQualifiedName("CronetURLRequestContextAdapter") | 226 @NativeClassQualifiedName("CronetURLRequestContextAdapter") |
| 218 private native void nativeInitRequestContextOnMainThread(long nativePtr); | 227 private native void nativeInitRequestContextOnMainThread(long nativePtr); |
| 219 } | 228 } |
| OLD | NEW |