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

Side by Side Diff: net/cronet/android/org_chromium_net_UrlRequest.h

Issue 145213003: Initial upload of cronet for Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added cronet_package target to copy cronet.jar and stripped libcronet.so Created 6 years, 10 months 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 | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef NET_CRONET_ANDROID_URLREQUEST_H_
6 #define NET_CRONET_ANDROID_URLREQUEST_H_
7
8 #include <jni.h>
9
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13
14 /*
15 * Native method implementations of the org.chromium.netjni.UrlRequest class.
16 */
17
18 // Request priorities. Also declared in UrlRequest.java
19 #define REQUEST_PRIORITY_IDLE 0
20 #define REQUEST_PRIORITY_LOWEST 1
21 #define REQUEST_PRIORITY_LOW 2
22 #define REQUEST_PRIORITY_MEDIUM 3
23 #define REQUEST_PRIORITY_HIGHEST 4
24
25 // Error codes. Also declared in UrlRequest.java
26 #define ERROR_SUCCESS 0
27 #define ERROR_UNKNOWN 1
28 #define ERROR_MALFORMED_URL 2
29 #define ERROR_CONNECTION_TIMED_OUT 3
30 #define ERROR_UNKNOWN_HOST 4
31
32 JNIEXPORT void JNICALL
33 Java_org_chromium_net_UrlRequest_nativeInit(
34 JNIEnv* env, jobject object, jobject request_context, jstring url,
35 jint priority);
36
37 JNIEXPORT void JNICALL
38 Java_org_chromium_net_UrlRequest_nativeAddHeader(
39 JNIEnv* env, jobject object, jstring name, jstring value);
40
41 JNIEXPORT void JNICALL
42 Java_org_chromium_net_UrlRequest_nativeSetPostData(
43 JNIEnv* env, jobject object, jstring content_type, jbyteArray content);
44
45 JNIEXPORT void JNICALL
46 Java_org_chromium_net_UrlRequest_nativeStart(
47 JNIEnv* env, jobject object);
48
49 JNIEXPORT void JNICALL
50 Java_org_chromium_net_UrlRequest_nativeCancel(
51 JNIEnv* env, jobject object);
52
53 JNIEXPORT void JNICALL
54 Java_org_chromium_net_UrlRequest_nativeRecycle(
55 JNIEnv* env, jobject object);
56
57 JNIEXPORT jint JNICALL
58 Java_org_chromium_net_UrlRequest_nativeGetErrorCode(
59 JNIEnv* env, jobject object);
60
61 JNIEXPORT jstring JNICALL
62 Java_org_chromium_net_UrlRequest_nativeGetErrorString(
63 JNIEnv* env, jobject object);
64
65 JNIEXPORT jint JNICALL
66 Java_org_chromium_net_UrlRequest_getHttpStatusCode(
67 JNIEnv* env, jobject object);
68
69 JNIEXPORT jstring JNICALL
70 Java_org_chromium_net_UrlRequest_nativeGetContentType(
71 JNIEnv* env, jobject object);
72
73 JNIEXPORT jlong JNICALL
74 Java_org_chromium_net_UrlRequest_nativeGetContentLength(
75 JNIEnv* env, jobject object);
76
77 #ifdef __cplusplus
78 }
79 #endif
80
81 #endif // NET_CRONET_ANDROID_URLREQUEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698