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 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
390 public String getContentType() { | 390 public String getContentType() { |
391 return mContentType; | 391 return mContentType; |
392 } | 392 } |
393 | 393 |
394 public String getHeader(String name) { | 394 public String getHeader(String name) { |
395 validateHeadersAvailable(); | 395 validateHeadersAvailable(); |
396 return nativeGetHeader(mUrlRequestAdapter, name); | 396 return nativeGetHeader(mUrlRequestAdapter, name); |
397 } | 397 } |
398 | 398 |
399 // All response headers. | 399 // All response headers. |
400 @SuppressWarnings("unused") | |
mmenke
2014/08/25 19:46:44
Should this be using the called by native thing?
mef
2014/08/25 20:26:18
Well, it isn't really called by native.
Per discu
mef
2014/08/25 22:12:42
Per discussion with clm@ this is not a fix, but ju
| |
400 public Map<String, List<String>> getAllHeaders() { | 401 public Map<String, List<String>> getAllHeaders() { |
401 validateHeadersAvailable(); | 402 validateHeadersAvailable(); |
402 ResponseHeadersMap result = new ResponseHeadersMap(); | 403 ResponseHeadersMap result = new ResponseHeadersMap(); |
403 nativeGetAllHeaders(mUrlRequestAdapter, result); | 404 nativeGetAllHeaders(mUrlRequestAdapter, result); |
404 return result; | 405 return result; |
405 } | 406 } |
406 | 407 |
407 public String getUrl() { | 408 public String getUrl() { |
408 return mUrl; | 409 return mUrl; |
409 } | 410 } |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
675 | 676 |
676 private native String nativeGetHeader(long urlRequestAdapter, String name); | 677 private native String nativeGetHeader(long urlRequestAdapter, String name); |
677 | 678 |
678 private native void nativeGetAllHeaders(long urlRequestAdapter, | 679 private native void nativeGetAllHeaders(long urlRequestAdapter, |
679 ResponseHeadersMap headers); | 680 ResponseHeadersMap headers); |
680 | 681 |
681 // Explicit class to work around JNI-generator generics confusion. | 682 // Explicit class to work around JNI-generator generics confusion. |
682 private class ResponseHeadersMap extends HashMap<String, List<String>> { | 683 private class ResponseHeadersMap extends HashMap<String, List<String>> { |
683 } | 684 } |
684 } | 685 } |
OLD | NEW |