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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 @Override | 85 @Override |
| 86 public UrlRequest createRequest(String url, UrlRequestListener listener, |
| 87 Executor executor, int priority) { |
| 88 synchronized (mLock) { |
| 89 checkHaveAdapter(); |
| 90 return new CronetUrlRequest(this, mUrlRequestContextAdapter, url, |
| 91 priority, listener, executor); |
| 92 } |
| 93 } |
| 94 |
| 95 @Override |
86 public boolean isEnabled() { | 96 public boolean isEnabled() { |
87 return Build.VERSION.SDK_INT >= 14; | 97 return Build.VERSION.SDK_INT >= 14; |
88 } | 98 } |
89 | 99 |
90 @Override | 100 @Override |
91 public String getVersionString() { | 101 public String getVersionString() { |
92 return "Cronet/" + Version.getVersion(); | 102 return "Cronet/" + Version.getVersion(); |
93 } | 103 } |
94 | 104 |
95 @Override | 105 @Override |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 @NativeClassQualifiedName("CronetURLRequestContextAdapter") | 220 @NativeClassQualifiedName("CronetURLRequestContextAdapter") |
211 private native void nativeStartNetLogToFile(long nativePtr, | 221 private native void nativeStartNetLogToFile(long nativePtr, |
212 String fileName, boolean logAll); | 222 String fileName, boolean logAll); |
213 | 223 |
214 @NativeClassQualifiedName("CronetURLRequestContextAdapter") | 224 @NativeClassQualifiedName("CronetURLRequestContextAdapter") |
215 private native void nativeStopNetLog(long nativePtr); | 225 private native void nativeStopNetLog(long nativePtr); |
216 | 226 |
217 @NativeClassQualifiedName("CronetURLRequestContextAdapter") | 227 @NativeClassQualifiedName("CronetURLRequestContextAdapter") |
218 private native void nativeInitRequestContextOnMainThread(long nativePtr); | 228 private native void nativeInitRequestContextOnMainThread(long nativePtr); |
219 } | 229 } |
OLD | NEW |