Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 package org.chromium.net.impl; | |
| 6 | |
| 7 import android.content.Context; | |
| 8 | |
| 9 import org.chromium.net.CronetEngine; | |
| 10 import org.chromium.net.CronetProvider; | |
| 11 import org.chromium.net.ExperimentalCronetEngine; | |
| 12 import org.chromium.net.ICronetEngineBuilder; | |
| 13 | |
| 14 /** | |
| 15 * Implementation of {@link CronetProvider} that creates {@link CronetEngine.Bui lder} | |
| 16 * for building the native implementation of {@link CronetEngine}. | |
| 17 */ | |
| 18 public class NativeCronetProvider extends CronetProvider { | |
| 19 public static final String PROVIDER_NAME = "Native-Cronet-Provider"; | |
|
pauljensen
2017/01/18 17:03:05
private?
pauljensen
2017/01/18 17:03:05
perhaps we should differentiate this from other na
kapishnikov
2017/01/19 01:25:24
Done.
kapishnikov
2017/01/19 01:25:24
We don't have any other native providers. If one a
| |
| 20 | |
| 21 /** | |
| 22 * Constructor. | |
| 23 * | |
| 24 * @param context Android context to use. | |
| 25 */ | |
| 26 public NativeCronetProvider(Context context) { | |
| 27 super(context); | |
| 28 } | |
| 29 | |
| 30 @Override | |
| 31 public CronetEngine.Builder createBuilder() { | |
| 32 ICronetEngineBuilder impl = new NativeCronetEngineBuilder(mContext); | |
| 33 return new ExperimentalCronetEngine.Builder(impl); | |
| 34 } | |
| 35 | |
| 36 @Override | |
| 37 public String getName() { | |
| 38 return PROVIDER_NAME; | |
| 39 } | |
| 40 | |
| 41 @Override | |
| 42 public String getVersion() { | |
| 43 return ImplVersion.getCronetVersion(); | |
| 44 } | |
| 45 | |
| 46 @Override | |
| 47 public boolean isEnabled() { | |
| 48 return true; | |
| 49 } | |
| 50 } | |
| OLD | NEW |