Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 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; | |
| 6 | |
| 7 import org.chromium.base.annotations.JNINamespace; | |
| 8 | |
| 9 /** | |
| 10 * A Java wrapper to supply a net::MockCertVerifier which can be then passed | |
| 11 * into {@link CronetEngine.Builder#setMockCertVerifierForTesting}. | |
| 12 * The native pointer will be freed when the CronetEngine is torn down. | |
| 13 */ | |
| 14 @JNINamespace("cronet") | |
| 15 public class MockCertVerifier { | |
| 16 private MockCertVerifier() {} | |
|
mef
2015/10/20 20:43:34
Maybe constructor should call nativeCreateMockCert
xunjieli
2015/10/20 20:57:26
I had that initially, but Paul suggested using a s
| |
| 17 | |
| 18 /** | |
| 19 * Creates a new net::MockCertVerifier, and returns a pointer to it. | |
| 20 * @param certs a String array of certificate filenames in | |
| 21 * net::GetTestCertsDirectory() to accept in testing. | |
| 22 */ | |
| 23 public static long getNativePointer(String[] certs) { | |
|
mef
2015/10/20 20:43:34
Given that native cert verifier is not a singleton
xunjieli
2015/10/20 20:57:26
Done. createMockCertVerifier sgtm. Agreed, the get
| |
| 24 return nativeCreateMockCertVerifier(certs); | |
| 25 } | |
| 26 | |
| 27 private static native long nativeCreateMockCertVerifier(String[] certs); | |
| 28 } | |
| OLD | NEW |