| 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.support.annotation.IntDef; | 7 import android.support.annotation.IntDef; |
| 8 import android.util.Log; | 8 import android.util.Log; |
| 9 import android.util.Pair; | 9 import android.util.Pair; |
| 10 | 10 |
| (...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 * {@link UrlRequest#read read()} operation.) | 498 * {@link UrlRequest#read read()} operation.) |
| 499 */ | 499 */ |
| 500 public static final int READING_RESPONSE = 14; | 500 public static final int READING_RESPONSE = 14; |
| 501 | 501 |
| 502 private Status() {} | 502 private Status() {} |
| 503 | 503 |
| 504 /** | 504 /** |
| 505 * Convert a LoadState int to one of values listed above. | 505 * Convert a LoadState int to one of values listed above. |
| 506 * @param loadState a LoadState to convert. | 506 * @param loadState a LoadState to convert. |
| 507 * @return static int Status. | 507 * @return static int Status. |
| 508 * @hide only used by internal implementation. |
| 508 */ | 509 */ |
| 509 @StatusValues | 510 @StatusValues |
| 510 static int convertLoadState(int loadState) { | 511 public static int convertLoadState(int loadState) { |
| 511 assert loadState >= LoadState.IDLE && loadState <= LoadState.READING
_RESPONSE; | 512 assert loadState >= LoadState.IDLE && loadState <= LoadState.READING
_RESPONSE; |
| 512 switch (loadState) { | 513 switch (loadState) { |
| 513 case (LoadState.IDLE): | 514 case (LoadState.IDLE): |
| 514 return IDLE; | 515 return IDLE; |
| 515 | 516 |
| 516 case (LoadState.WAITING_FOR_STALLED_SOCKET_POOL): | 517 case (LoadState.WAITING_FOR_STALLED_SOCKET_POOL): |
| 517 return WAITING_FOR_STALLED_SOCKET_POOL; | 518 return WAITING_FOR_STALLED_SOCKET_POOL; |
| 518 | 519 |
| 519 case (LoadState.WAITING_FOR_AVAILABLE_SOCKET): | 520 case (LoadState.WAITING_FOR_AVAILABLE_SOCKET): |
| 520 return WAITING_FOR_AVAILABLE_SOCKET; | 521 return WAITING_FOR_AVAILABLE_SOCKET; |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 677 * the request's current status. {@code listener} will be invoked | 678 * the request's current status. {@code listener} will be invoked |
| 678 * back on the {@link Executor} passed in when the request was | 679 * back on the {@link Executor} passed in when the request was |
| 679 * created. | 680 * created. |
| 680 */ | 681 */ |
| 681 public void getStatus(final StatusListener listener); | 682 public void getStatus(final StatusListener listener); |
| 682 | 683 |
| 683 // Note: There are deliberately no accessors for the results of the request | 684 // Note: There are deliberately no accessors for the results of the request |
| 684 // here. Having none removes any ambiguity over when they are populated, | 685 // here. Having none removes any ambiguity over when they are populated, |
| 685 // particularly in the redirect case. | 686 // particularly in the redirect case. |
| 686 } | 687 } |
| OLD | NEW |