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.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 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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) { | 509 if (mOutputStream != null) { |
| 510 mOutputStream.setRequestCompleted(exception); | 510 mOutputStream.setRequestCompleted(exception); |
| 511 } | 511 } |
| 512 mHasResponse = true; | |
|
xunjieli
2016/07/22 20:15:24
Without this line, both tests will get stuck at ge
| |
| 512 mMessageLoop.quit(); | 513 mMessageLoop.quit(); |
| 513 } | 514 } |
| 514 } | 515 } |
| 515 | 516 |
| 516 /** | 517 /** |
| 517 * Blocks until the respone headers are received. | 518 * Blocks until the respone headers are received. |
| 518 */ | 519 */ |
| 519 private void getResponse() throws IOException { | 520 private void getResponse() throws IOException { |
| 520 // Check to see if enough data has been received. | 521 // Check to see if enough data has been received. |
| 521 if (mOutputStream != null) { | 522 if (mOutputStream != null) { |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 600 // Strips Content-Encoding response header. See crbug.com/592700. | 601 // Strips Content-Encoding response header. See crbug.com/592700. |
| 601 if (!entry.getKey().equalsIgnoreCase("Content-Encoding")) { | 602 if (!entry.getKey().equalsIgnoreCase("Content-Encoding")) { |
| 602 mResponseHeadersList.add( | 603 mResponseHeadersList.add( |
| 603 new AbstractMap.SimpleImmutableEntry<String, String>(ent ry)); | 604 new AbstractMap.SimpleImmutableEntry<String, String>(ent ry)); |
| 604 } | 605 } |
| 605 } | 606 } |
| 606 mResponseHeadersList = Collections.unmodifiableList(mResponseHeadersList ); | 607 mResponseHeadersList = Collections.unmodifiableList(mResponseHeadersList ); |
| 607 return mResponseHeadersList; | 608 return mResponseHeadersList; |
| 608 } | 609 } |
| 609 } | 610 } |
| OLD | NEW |