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

Unified Diff: components/cronet/android/cronet_url_request.h

Issue 586143002: Initial implementation of Cronet Async API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address Helen's comments, add CronetUrlRequestContextTest. Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: components/cronet/android/cronet_url_request.h
diff --git a/components/cronet/android/cronet_url_request.h b/components/cronet/android/cronet_url_request.h
new file mode 100644
index 0000000000000000000000000000000000000000..2e0d5ed537e468a7e20b3b49d88f3e33f9a9863e
--- /dev/null
+++ b/components/cronet/android/cronet_url_request.h
@@ -0,0 +1,46 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_CRONET_ANDROID_CRONET_URL_REQUEST_H_
+#define COMPONENTS_CRONET_ANDROID_CRONET_URL_REQUEST_H_
+
+#include <jni.h>
+
+namespace cronet {
+
+// Define request priority values like CRONET_REQUEST_PRIORITY_IDLE in a
+// way that ensures they're always the same than their Java counterpart.
+//
+// A Java counterpart will be generated for this enum.
+// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.net
+// GENERATED_JAVA_CLASS_NAME_OVERRIDE: CronetUrlRequestPriority
+// GENERATED_JAVA_PREFIX_TO_STRIP: CRONET_REQUEST_PRIORITY_
+enum CronetUrlRequestPriority {
+ CRONET_REQUEST_PRIORITY_IDLE = 0,
+ CRONET_REQUEST_PRIORITY_LOWEST = 1,
+ CRONET_REQUEST_PRIORITY_LOW = 2,
+ CRONET_REQUEST_PRIORITY_MEDIUM = 3,
+ CRONET_REQUEST_PRIORITY_HIGHEST = 4,
+};
+
+// Define request priority values like CRONET_REQUEST_ERROR_SUCCESS in a
+// way that ensures they're always the same than their Java counterpart.
+//
+// A Java counterpart will be generated for this enum.
+// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.net
+// GENERATED_JAVA_CLASS_NAME_OVERRIDE: CronetUrlRequestError
+// GENERATED_JAVA_PREFIX_TO_STRIP: CRONET_REQUEST_ERROR_
+enum CronetUrlRequestError {
+ CRONET_REQUEST_ERROR_SUCCESS = 0,
+ CRONET_REQUEST_ERROR_UNKNOWN = 1,
+ CRONET_REQUEST_ERROR_MALFORMED_URL = 2,
+ CRONET_REQUEST_ERROR_CONNECTION_TIMED_OUT = 3,
+ CRONET_REQUEST_ERROR_UNKNOWN_HOST = 4,
+};
+
+bool CronetUrlRequestRegisterJni(JNIEnv* env);
+
+} // namespace cronet
+
+#endif // COMPONENTS_CRONET_ANDROID_CRONET_URL_REQUEST_H_

Powered by Google App Engine
This is Rietveld 408576698