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

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

Issue 1085903002: Enable Sdch in Cronet (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: constants Created 5 years, 7 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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698