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.content.Context; | 7 import android.content.Context; |
8 import android.text.TextUtils; | 8 import android.text.TextUtils; |
9 | 9 |
10 import org.apache.http.HttpStatus; | 10 import org.apache.http.HttpStatus; |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 return mCanceled; | 427 return mCanceled; |
428 } | 428 } |
429 } | 429 } |
430 | 430 |
431 @Override | 431 @Override |
432 public String getNegotiatedProtocol() { | 432 public String getNegotiatedProtocol() { |
433 return ""; | 433 return ""; |
434 } | 434 } |
435 | 435 |
436 @Override | 436 @Override |
| 437 public boolean wasCached() { |
| 438 return false; |
| 439 } |
| 440 |
| 441 @Override |
437 public int getHttpStatusCode() { | 442 public int getHttpStatusCode() { |
438 int httpStatusCode = mHttpStatusCode; | 443 int httpStatusCode = mHttpStatusCode; |
439 | 444 |
440 // If we have been able to successfully resume a previously interrupted | 445 // If we have been able to successfully resume a previously interrupted |
441 // download, | 446 // download, |
442 // the status code will be 206, not 200. Since the rest of the | 447 // the status code will be 206, not 200. Since the rest of the |
443 // application is | 448 // application is |
444 // expecting 200 to indicate success, we need to fake it. | 449 // expecting 200 to indicate success, we need to fake it. |
445 if (httpStatusCode == HttpStatus.SC_PARTIAL_CONTENT) { | 450 if (httpStatusCode == HttpStatus.SC_PARTIAL_CONTENT) { |
446 httpStatusCode = HttpStatus.SC_OK; | 451 httpStatusCode = HttpStatus.SC_OK; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
515 } | 520 } |
516 return mConnection.getHeaderFields(); | 521 return mConnection.getHeaderFields(); |
517 } | 522 } |
518 | 523 |
519 private void validateNotStarted() { | 524 private void validateNotStarted() { |
520 if (mStarted) { | 525 if (mStarted) { |
521 throw new IllegalStateException("Request already started"); | 526 throw new IllegalStateException("Request already started"); |
522 } | 527 } |
523 } | 528 } |
524 } | 529 } |
OLD | NEW |