OLD | NEW |
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; | 5 package org.chromium.net; |
6 | 6 |
7 import static android.os.Process.THREAD_PRIORITY_BACKGROUND; | 7 import static android.os.Process.THREAD_PRIORITY_BACKGROUND; |
8 import static android.os.Process.THREAD_PRIORITY_MORE_FAVORABLE; | 8 import static android.os.Process.THREAD_PRIORITY_MORE_FAVORABLE; |
9 | 9 |
10 import java.io.IOException; | 10 import java.io.IOException; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 } | 51 } |
52 }); | 52 }); |
53 | 53 |
54 JavaCronetEngine(String userAgent) { | 54 JavaCronetEngine(String userAgent) { |
55 this.mUserAgent = userAgent; | 55 this.mUserAgent = userAgent; |
56 } | 56 } |
57 | 57 |
58 @Override | 58 @Override |
59 public UrlRequest createRequest(String url, UrlRequest.Callback callback, Ex
ecutor executor, | 59 public UrlRequest createRequest(String url, UrlRequest.Callback callback, Ex
ecutor executor, |
60 int priority, Collection<Object> connectionAnnotations, boolean disa
bleCache, | 60 int priority, Collection<Object> connectionAnnotations, boolean disa
bleCache, |
61 boolean disableConnectionMigration) { | 61 boolean disableConnectionMigration, boolean allowDirectExecutor) { |
62 return new JavaUrlRequest(callback, mExecutorService, executor, url, mUs
erAgent); | 62 return new JavaUrlRequest( |
| 63 callback, mExecutorService, executor, url, mUserAgent, allowDire
ctExecutor); |
63 } | 64 } |
64 | 65 |
65 @Override | 66 @Override |
66 public BidirectionalStream createBidirectionalStream(String url, | 67 public BidirectionalStream createBidirectionalStream(String url, |
67 BidirectionalStream.Callback callback, Executor executor, String htt
pMethod, | 68 BidirectionalStream.Callback callback, Executor executor, String htt
pMethod, |
68 List<Map.Entry<String, String>> requestHeaders, | 69 List<Map.Entry<String, String>> requestHeaders, |
69 @BidirectionalStream.Builder.StreamPriority int priority, | 70 @BidirectionalStream.Builder.StreamPriority int priority, |
70 boolean delayRequestHeadersUntilFirstFlush) { | 71 boolean delayRequestHeadersUntilFirstFlush) { |
71 throw new UnsupportedOperationException( | 72 throw new UnsupportedOperationException( |
72 "Can't create a bidi stream - httpurlconnection doesn't have tho
se APIs"); | 73 "Can't create a bidi stream - httpurlconnection doesn't have tho
se APIs"); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 // Returning null causes this factory to pass though, which ends up usin
g the platform's | 149 // Returning null causes this factory to pass though, which ends up usin
g the platform's |
149 // implementation. | 150 // implementation. |
150 return new URLStreamHandlerFactory() { | 151 return new URLStreamHandlerFactory() { |
151 @Override | 152 @Override |
152 public URLStreamHandler createURLStreamHandler(String protocol) { | 153 public URLStreamHandler createURLStreamHandler(String protocol) { |
153 return null; | 154 return null; |
154 } | 155 } |
155 }; | 156 }; |
156 } | 157 } |
157 } | 158 } |
OLD | NEW |