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

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

Issue 2339223002: Cronet API Refactoring (Closed)
Patch Set: Rebase & Conflict Resolution Created 4 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.urlconnection; 5 package org.chromium.net.urlconnection;
6 6
7 import android.util.Pair; 7 import android.util.Pair;
8 8
9 import org.chromium.base.Log; 9 import org.chromium.base.Log;
10 import org.chromium.net.CronetEngine; 10 import org.chromium.net.CronetEngine;
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 return contentLength; 244 return contentLength;
245 } 245 }
246 246
247 /** 247 /**
248 * Starts the request if {@code connected} is false. 248 * Starts the request if {@code connected} is false.
249 */ 249 */
250 private void startRequest() throws IOException { 250 private void startRequest() throws IOException {
251 if (connected) { 251 if (connected) {
252 return; 252 return;
253 } 253 }
254 final UrlRequest.Builder requestBuilder = new UrlRequest.Builder( 254 final UrlRequest.Builder requestBuilder = mCronetEngine.newUrlRequestBui lder(
255 getURL().toString(), new CronetUrlRequestCallback(), mMessageLoo p, mCronetEngine); 255 getURL().toString(), new CronetUrlRequestCallback(), mMessageLoo p);
256 if (doOutput) { 256 if (doOutput) {
257 if (method.equals("GET")) { 257 if (method.equals("GET")) {
258 method = "POST"; 258 method = "POST";
259 } 259 }
260 if (mOutputStream != null) { 260 if (mOutputStream != null) {
261 requestBuilder.setUploadDataProvider( 261 requestBuilder.setUploadDataProvider(
262 mOutputStream.getUploadDataProvider(), mMessageLoop); 262 mOutputStream.getUploadDataProvider(), mMessageLoop);
263 if (getRequestProperty(CONTENT_LENGTH) == null && !isChunkedUplo ad()) { 263 if (getRequestProperty(CONTENT_LENGTH) == null && !isChunkedUplo ad()) {
264 addRequestProperty(CONTENT_LENGTH, 264 addRequestProperty(CONTENT_LENGTH,
265 Long.toString(mOutputStream.getUploadDataProvider(). getLength())); 265 Long.toString(mOutputStream.getUploadDataProvider(). getLength()));
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 // Strips Content-Encoding response header. See crbug.com/592700. 601 // Strips Content-Encoding response header. See crbug.com/592700.
602 if (!entry.getKey().equalsIgnoreCase("Content-Encoding")) { 602 if (!entry.getKey().equalsIgnoreCase("Content-Encoding")) {
603 mResponseHeadersList.add( 603 mResponseHeadersList.add(
604 new AbstractMap.SimpleImmutableEntry<String, String>(ent ry)); 604 new AbstractMap.SimpleImmutableEntry<String, String>(ent ry));
605 } 605 }
606 } 606 }
607 mResponseHeadersList = Collections.unmodifiableList(mResponseHeadersList ); 607 mResponseHeadersList = Collections.unmodifiableList(mResponseHeadersList );
608 return mResponseHeadersList; 608 return mResponseHeadersList;
609 } 609 }
610 } 610 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698