| 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.os.Build; | 8 import android.os.Build; |
| 9 | 9 |
| 10 import org.chromium.base.annotations.UsedByReflection; | 10 import org.chromium.base.annotations.UsedByReflection; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 // Cannot use config.getDefaultUserAgent() as config.mContext ma
y be null. | 29 // Cannot use config.getDefaultUserAgent() as config.mContext ma
y be null. |
| 30 userAgent = new CronetEngine.Builder(context).getDefaultUserAgen
t(); | 30 userAgent = new CronetEngine.Builder(context).getDefaultUserAgen
t(); |
| 31 } | 31 } |
| 32 mRequestContext = new ChromiumUrlRequestContext(context, | 32 mRequestContext = new ChromiumUrlRequestContext(context, |
| 33 userAgent, config); | 33 userAgent, config); |
| 34 } | 34 } |
| 35 } | 35 } |
| 36 | 36 |
| 37 @Override | 37 @Override |
| 38 public boolean isEnabled() { | 38 public boolean isEnabled() { |
| 39 return Build.VERSION.SDK_INT >= 14; | 39 return Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH; |
| 40 } | 40 } |
| 41 | 41 |
| 42 @Override | 42 @Override |
| 43 public String getName() { | 43 public String getName() { |
| 44 return "Chromium/" + ChromiumUrlRequestContext.getVersion(); | 44 return "Chromium/" + ChromiumUrlRequestContext.getVersion(); |
| 45 } | 45 } |
| 46 | 46 |
| 47 @Override | 47 @Override |
| 48 public ChromiumUrlRequest createRequest(String url, int requestPriority, | 48 public ChromiumUrlRequest createRequest(String url, int requestPriority, |
| 49 Map<String, String> headers, HttpUrlRequestListener listener) { | 49 Map<String, String> headers, HttpUrlRequestListener listener) { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 66 | 66 |
| 67 @Override | 67 @Override |
| 68 public void stopNetLog() { | 68 public void stopNetLog() { |
| 69 mRequestContext.stopNetLog(); | 69 mRequestContext.stopNetLog(); |
| 70 } | 70 } |
| 71 | 71 |
| 72 public ChromiumUrlRequestContext getRequestContext() { | 72 public ChromiumUrlRequestContext getRequestContext() { |
| 73 return mRequestContext; | 73 return mRequestContext; |
| 74 } | 74 } |
| 75 } | 75 } |
| OLD | NEW |