OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 package org.chromium.net.impl; | 4 package org.chromium.net.impl; |
5 | 5 |
6 import android.content.Context; | 6 import android.content.Context; |
7 import android.support.annotation.IntDef; | 7 import android.support.annotation.IntDef; |
8 import android.support.annotation.VisibleForTesting; | 8 import android.support.annotation.VisibleForTesting; |
9 import android.util.Log; | 9 import android.util.Log; |
10 | 10 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 final Date mExpirationDate; | 65 final Date mExpirationDate; |
66 | 66 |
67 Pkp(String host, byte[][] hashes, boolean includeSubdomains, Date expira
tionDate) { | 67 Pkp(String host, byte[][] hashes, boolean includeSubdomains, Date expira
tionDate) { |
68 mHost = host; | 68 mHost = host; |
69 mHashes = hashes; | 69 mHashes = hashes; |
70 mIncludeSubdomains = includeSubdomains; | 70 mIncludeSubdomains = includeSubdomains; |
71 mExpirationDate = expirationDate; | 71 mExpirationDate = expirationDate; |
72 } | 72 } |
73 } | 73 } |
74 | 74 |
75 private static final String TAG = "CronetEngineBuilder"; | 75 private static final String TAG = CronetEngineBuilderImpl.class.getSimpleNam
e(); |
76 private static final String NATIVE_CRONET_IMPL_CLASS = | 76 private static final String NATIVE_CRONET_IMPL_CLASS = |
77 "org.chromium.net.impl.CronetUrlRequestContext"; | 77 "org.chromium.net.impl.CronetUrlRequestContext"; |
78 private static final String JAVA_CRONET_IMPL_CLASS = "org.chromium.net.impl.
JavaCronetEngine"; | 78 private static final String JAVA_CRONET_IMPL_CLASS = "org.chromium.net.impl.
JavaCronetEngine"; |
79 private static final Pattern INVALID_PKP_HOST_NAME = Pattern.compile("^[0-9\
\.]*$"); | 79 private static final Pattern INVALID_PKP_HOST_NAME = Pattern.compile("^[0-9\
\.]*$"); |
80 | 80 |
81 // Private fields are simply storage of configuration for the resulting Cron
etEngine. | 81 // Private fields are simply storage of configuration for the resulting Cron
etEngine. |
82 // See setters below for verbose descriptions. | 82 // See setters below for verbose descriptions. |
83 private final Context mApplicationContext; | 83 private final Context mApplicationContext; |
84 private final List<QuicHint> mQuicHints = new LinkedList<>(); | 84 private final List<QuicHint> mQuicHints = new LinkedList<>(); |
85 private final List<Pkp> mPkps = new LinkedList<>(); | 85 private final List<Pkp> mPkps = new LinkedList<>(); |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 } catch (ClassNotFoundException e) { | 491 } catch (ClassNotFoundException e) { |
492 // Leave as null. | 492 // Leave as null. |
493 Log.i(TAG, "Class loader " + loader + " cannot find Cronet engine im
plementation: " | 493 Log.i(TAG, "Class loader " + loader + " cannot find Cronet engine im
plementation: " |
494 + name + ". Will try to find an alternative implemen
tation."); | 494 + name + ". Will try to find an alternative implemen
tation."); |
495 } catch (Exception e) { | 495 } catch (Exception e) { |
496 throw new IllegalStateException("Cannot instantiate: " + name, e); | 496 throw new IllegalStateException("Cannot instantiate: " + name, e); |
497 } | 497 } |
498 return cronetEngine; | 498 return cronetEngine; |
499 } | 499 } |
500 } | 500 } |
OLD | NEW |