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.util.Log; | 7 import android.util.Log; |
8 | 8 |
9 import org.apache.http.conn.ConnectTimeoutException; | 9 import org.apache.http.conn.ConnectTimeoutException; |
10 import org.chromium.base.CalledByNative; | 10 import org.chromium.base.CalledByNative; |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
383 return mCanceled; | 383 return mCanceled; |
384 } | 384 } |
385 } | 385 } |
386 | 386 |
387 public boolean isRecycled() { | 387 public boolean isRecycled() { |
388 synchronized (mLock) { | 388 synchronized (mLock) { |
389 return mRecycled; | 389 return mRecycled; |
390 } | 390 } |
391 } | 391 } |
392 | 392 |
393 @Override | |
394 public String getNegotiatedProtocol() { | |
Charles
2014/09/09 17:03:56
Check to make sure we've received headers first, a
mef
2014/09/10 16:48:17
Done.
| |
395 return nativeGetNegotiatedProtocol(mUrlRequestAdapter); | |
396 } | |
397 | |
393 public String getContentType() { | 398 public String getContentType() { |
394 return mContentType; | 399 return mContentType; |
395 } | 400 } |
396 | 401 |
397 public String getHeader(String name) { | 402 public String getHeader(String name) { |
398 validateHeadersAvailable(); | 403 validateHeadersAvailable(); |
399 return nativeGetHeader(mUrlRequestAdapter, name); | 404 return nativeGetHeader(mUrlRequestAdapter, name); |
400 } | 405 } |
401 | 406 |
402 // All response headers. | 407 // All response headers. |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
680 | 685 |
681 private native String nativeGetContentType(long urlRequestAdapter); | 686 private native String nativeGetContentType(long urlRequestAdapter); |
682 | 687 |
683 private native long nativeGetContentLength(long urlRequestAdapter); | 688 private native long nativeGetContentLength(long urlRequestAdapter); |
684 | 689 |
685 private native String nativeGetHeader(long urlRequestAdapter, String name); | 690 private native String nativeGetHeader(long urlRequestAdapter, String name); |
686 | 691 |
687 private native void nativeGetAllHeaders(long urlRequestAdapter, | 692 private native void nativeGetAllHeaders(long urlRequestAdapter, |
688 ResponseHeadersMap headers); | 693 ResponseHeadersMap headers); |
689 | 694 |
695 private native String nativeGetNegotiatedProtocol(long urlRequestAdapter); | |
696 | |
690 // Explicit class to work around JNI-generator generics confusion. | 697 // Explicit class to work around JNI-generator generics confusion. |
691 private class ResponseHeadersMap extends HashMap<String, List<String>> { | 698 private class ResponseHeadersMap extends HashMap<String, List<String>> { |
692 } | 699 } |
693 } | 700 } |
OLD | NEW |