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

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: Address code review comments. Created 6 years, 9 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 2013 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 // Native method implementations of the org.chromium.netjni.UrlRequest class.
11
12 // Request priorities. Also declared in UrlRequest.java
13 const jint REQUEST_PRIORITY_IDLE = 0;
14 const jint REQUEST_PRIORITY_LOWEST = 1;
15 const jint REQUEST_PRIORITY_LOW = 2;
16 const jint REQUEST_PRIORITY_MEDIUM = 3;
17 const jint REQUEST_PRIORITY_HIGHEST = 4;
18
19 // Error codes. Also declared in UrlRequest.java
20 const jint ERROR_SUCCESS = 0;
21 const jint ERROR_UNKNOWN = 1;
22 const jint ERROR_MALFORMED_URL = 2;
23 const jint ERROR_CONNECTION_TIMED_OUT = 3;
24 const jint ERROR_UNKNOWN_HOST = 4;
25
26 // TODO(mef): Replace following definitions with generated jni/UrlRequest_jni.h
27
28 bool UrlRequestRegisterJni(JNIEnv* env);
29
30 JNIEXPORT void JNICALL
31 Java_org_chromium_net_UrlRequest_nativeInit(JNIEnv* env,
32 jobject object,
33 jobject request_context,
34 jstring url,
35 jint priority);
36
37 JNIEXPORT void JNICALL
38 Java_org_chromium_net_UrlRequest_nativeAddHeader(JNIEnv* env,
39 jobject object,
40 jstring name,
41 jstring value);
42
43 JNIEXPORT void JNICALL
44 Java_org_chromium_net_UrlRequest_nativeSetPostData(JNIEnv* env,
45 jobject object,
46 jstring content_type,
47 jbyteArray content);
48
49 JNIEXPORT void JNICALL
50 Java_org_chromium_net_UrlRequest_nativeBeginChunkedUpload(
51 JNIEnv* env,
52 jobject object,
53 jstring content_type);
54
55 JNIEXPORT void JNICALL Java_org_chromium_net_UrlRequest_nativeAppendChunk(
56 JNIEnv* env,
57 jobject object,
58 jobject chunk_byte_buffer,
59 jint chunk_size,
60 jboolean is_last_chunk);
61
62 JNIEXPORT void JNICALL
63 Java_org_chromium_net_UrlRequest_nativeStart(JNIEnv* env, jobject object);
64
65 JNIEXPORT void JNICALL
66 Java_org_chromium_net_UrlRequest_nativeCancel(JNIEnv* env, jobject object);
67
68 JNIEXPORT void JNICALL
69 Java_org_chromium_net_UrlRequest_nativeRecycle(JNIEnv* env, jobject object);
70
71 JNIEXPORT jint JNICALL
72 Java_org_chromium_net_UrlRequest_nativeGetErrorCode(JNIEnv* env,
73 jobject object);
74
75 JNIEXPORT jstring JNICALL
76 Java_org_chromium_net_UrlRequest_nativeGetErrorString(JNIEnv* env,
77 jobject object);
78
79 JNIEXPORT jint JNICALL
80 Java_org_chromium_net_UrlRequest_getHttpStatusCode(JNIEnv* env,
81 jobject object);
82
83 JNIEXPORT jstring JNICALL
84 Java_org_chromium_net_UrlRequest_nativeGetContentType(JNIEnv* env,
85 jobject object);
86
87 JNIEXPORT jlong JNICALL
88 Java_org_chromium_net_UrlRequest_nativeGetContentLength(JNIEnv* env,
89 jobject object);
90
91 #endif // NET_CRONET_ANDROID_URLREQUEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698