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 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
415 } | 415 } |
416 | 416 |
417 @Override | 417 @Override |
418 public boolean isCanceled() { | 418 public boolean isCanceled() { |
419 synchronized (mLock) { | 419 synchronized (mLock) { |
420 return mCanceled; | 420 return mCanceled; |
421 } | 421 } |
422 } | 422 } |
423 | 423 |
424 @Override | 424 @Override |
425 public String getNegotiatedProtocol() { | |
426 return ""; | |
Charles
2014/09/09 17:03:56
http/1.1?
mef
2014/09/10 16:48:17
From what I see Chromium stack returns empty strin
| |
427 } | |
428 | |
429 @Override | |
425 public int getHttpStatusCode() { | 430 public int getHttpStatusCode() { |
426 int httpStatusCode = mHttpStatusCode; | 431 int httpStatusCode = mHttpStatusCode; |
427 | 432 |
428 // If we have been able to successfully resume a previously interrupted | 433 // If we have been able to successfully resume a previously interrupted |
429 // download, | 434 // download, |
430 // the status code will be 206, not 200. Since the rest of the | 435 // the status code will be 206, not 200. Since the rest of the |
431 // application is | 436 // application is |
432 // expecting 200 to indicate success, we need to fake it. | 437 // expecting 200 to indicate success, we need to fake it. |
433 if (httpStatusCode == HttpStatus.SC_PARTIAL_CONTENT) { | 438 if (httpStatusCode == HttpStatus.SC_PARTIAL_CONTENT) { |
434 httpStatusCode = HttpStatus.SC_OK; | 439 httpStatusCode = HttpStatus.SC_OK; |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
498 } | 503 } |
499 return mConnection.getHeaderFields(); | 504 return mConnection.getHeaderFields(); |
500 } | 505 } |
501 | 506 |
502 private void validateNotStarted() { | 507 private void validateNotStarted() { |
503 if (mStarted) { | 508 if (mStarted) { |
504 throw new IllegalStateException("Request already started"); | 509 throw new IllegalStateException("Request already started"); |
505 } | 510 } |
506 } | 511 } |
507 } | 512 } |
OLD | NEW |