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

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

Issue 2131323002: [Cronet] Check whether request is done before spinning up message loop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comment Created 4 years, 5 months 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 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 /** 499 /**
500 * Notifies {@link #mInputStream} that transferring of response data has 500 * Notifies {@link #mInputStream} that transferring of response data has
501 * completed. 501 * completed.
502 * @param exception if not {@code null}, it is the exception to report w hen 502 * @param exception if not {@code null}, it is the exception to report w hen
503 * caller tries to read more data. 503 * caller tries to read more data.
504 */ 504 */
505 private void setResponseDataCompleted(IOException exception) { 505 private void setResponseDataCompleted(IOException exception) {
506 if (mInputStream != null) { 506 if (mInputStream != null) {
507 mInputStream.setResponseDataCompleted(exception); 507 mInputStream.setResponseDataCompleted(exception);
508 } 508 }
509 if (mOutputStream != null) {
510 mOutputStream.setRequestCompleted(exception);
511 }
509 mMessageLoop.quit(); 512 mMessageLoop.quit();
510 } 513 }
511 } 514 }
512 515
513 /** 516 /**
514 * Blocks until the respone headers are received. 517 * Blocks until the respone headers are received.
515 */ 518 */
516 private void getResponse() throws IOException { 519 private void getResponse() throws IOException {
517 // Check to see if enough data has been received. 520 // Check to see if enough data has been received.
518 if (mOutputStream != null) { 521 if (mOutputStream != null) {
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 // Strips Content-Encoding response header. See crbug.com/592700. 600 // Strips Content-Encoding response header. See crbug.com/592700.
598 if (!entry.getKey().equalsIgnoreCase("Content-Encoding")) { 601 if (!entry.getKey().equalsIgnoreCase("Content-Encoding")) {
599 mResponseHeadersList.add( 602 mResponseHeadersList.add(
600 new AbstractMap.SimpleImmutableEntry<String, String>(ent ry)); 603 new AbstractMap.SimpleImmutableEntry<String, String>(ent ry));
601 } 604 }
602 } 605 }
603 mResponseHeadersList = Collections.unmodifiableList(mResponseHeadersList ); 606 mResponseHeadersList = Collections.unmodifiableList(mResponseHeadersList );
604 return mResponseHeadersList; 607 return mResponseHeadersList;
605 } 608 }
606 } 609 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698