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

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

Issue 544223003: Add SetSupportsQuic method to explicitly specify server that supports QUIC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync Created 6 years, 3 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; 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
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 "";
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698