Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1355)

Side by Side Diff: components/cronet/android/test/src/org/chromium/net/NativeTestServer.java

Issue 1536433002: [Cronet] Get Cronet performance test running again (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address Helen's comments Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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.ConditionVariable; 8 import android.os.ConditionVariable;
9 9
10 import org.chromium.base.annotations.CalledByNative; 10 import org.chromium.base.annotations.CalledByNative;
(...skipping 19 matching lines...) Expand all
30 public static void shutdownNativeTestServer() { 30 public static void shutdownNativeTestServer() {
31 nativeShutdownNativeTestServer(); 31 nativeShutdownNativeTestServer();
32 } 32 }
33 33
34 /** 34 /**
35 * Registers customized DNS mapping for {@link NativeTestServer}. 35 * Registers customized DNS mapping for {@link NativeTestServer}.
36 * @param contextAdapter native context adapter object that this 36 * @param contextAdapter native context adapter object that this
37 * mapping should apply to. 37 * mapping should apply to.
38 * @param isLegacyAPI {@code true} if this context adapter is a part of the 38 * @param isLegacyAPI {@code true} if this context adapter is a part of the
39 * old API. 39 * old API.
40 * @param destination host to map to (e.g. 127.0.0.1)
40 */ 41 */
41 public static void registerHostResolverProc(long contextAdapter, boolean isL egacyAPI) { 42 public static void registerHostResolverProc(
42 nativeRegisterHostResolverProc(contextAdapter, isLegacyAPI); 43 long contextAdapter, boolean isLegacyAPI, String destination) {
44 nativeRegisterHostResolverProc(contextAdapter, isLegacyAPI, destination) ;
43 sHostResolverBlock.block(); 45 sHostResolverBlock.block();
44 sHostResolverBlock.close(); 46 sHostResolverBlock.close();
45 } 47 }
46 48
47 public static String getEchoBodyURL() { 49 public static String getEchoBodyURL() {
48 return nativeGetEchoBodyURL(); 50 return nativeGetEchoBodyURL();
49 } 51 }
50 52
51 public static String getEchoHeaderURL(String header) { 53 public static String getEchoHeaderURL(String header) {
52 return nativeGetEchoHeaderURL(header); 54 return nativeGetEchoHeaderURL(header);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 } 102 }
101 103
102 @CalledByNative 104 @CalledByNative
103 private static void onHostResolverProcRegistered() { 105 private static void onHostResolverProcRegistered() {
104 sHostResolverBlock.open(); 106 sHostResolverBlock.open();
105 } 107 }
106 108
107 private static native boolean nativeStartNativeTestServer(String filePath); 109 private static native boolean nativeStartNativeTestServer(String filePath);
108 private static native void nativeShutdownNativeTestServer(); 110 private static native void nativeShutdownNativeTestServer();
109 private static native void nativeRegisterHostResolverProc( 111 private static native void nativeRegisterHostResolverProc(
110 long contextAdapter, boolean isLegacyAPI); 112 long contextAdapter, boolean isLegacyAPI, String destination);
111 private static native String nativeGetEchoBodyURL(); 113 private static native String nativeGetEchoBodyURL();
112 private static native String nativeGetEchoHeaderURL(String header); 114 private static native String nativeGetEchoHeaderURL(String header);
113 private static native String nativeGetEchoAllHeadersURL(); 115 private static native String nativeGetEchoAllHeadersURL();
114 private static native String nativeGetEchoMethodURL(); 116 private static native String nativeGetEchoMethodURL();
115 private static native String nativeGetRedirectToEchoBody(); 117 private static native String nativeGetRedirectToEchoBody();
116 private static native String nativeGetFileURL(String filePath); 118 private static native String nativeGetFileURL(String filePath);
117 private static native String nativeGetSdchURL(); 119 private static native String nativeGetSdchURL();
118 private static native String nativeGetHostPort(); 120 private static native String nativeGetHostPort();
119 private static native boolean nativeIsDataReductionProxySupported(); 121 private static native boolean nativeIsDataReductionProxySupported();
120 } 122 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698