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

Unified Diff: android_webview/browser/net/aw_web_resource_request.h

Issue 2558223002: Move onReceivedError and onReceivedHttpError out of AwContentsIoThreadClientImpl (Closed)
Patch Set: add move assignment Created 4 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 side-by-side diff with in-line comments
Download patch
Index: android_webview/browser/net/aw_web_resource_request.h
diff --git a/android_webview/browser/net/aw_web_resource_request.h b/android_webview/browser/net/aw_web_resource_request.h
new file mode 100644
index 0000000000000000000000000000000000000000..53dca708f29f56d1e47cc2cd5aad1301c31e642e
--- /dev/null
+++ b/android_webview/browser/net/aw_web_resource_request.h
@@ -0,0 +1,57 @@
+// Copyright 2016 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 ANDROID_WEBVIEW_BROWSER_NET_AW_WEB_RESOURCE_REQUEST_H_
+#define ANDROID_WEBVIEW_BROWSER_NET_AW_WEB_RESOURCE_REQUEST_H_
+
+#include <string>
+#include <vector>
+
+#include "base/android/jni_array.h"
+#include "base/android/jni_string.h"
+
+namespace net {
+class URLRequest;
+}
+
+namespace android_webview {
+
+// A passive data structure only used to carry request information. This
+// class should be copyable.
+struct AwWebResourceRequest final {
+ explicit AwWebResourceRequest(const net::URLRequest& request);
+
+ // Add default copy/move/assign operators. Adding explicit destructor
+ // prevents generating move operator.
+ AwWebResourceRequest(AwWebResourceRequest&& other);
+ AwWebResourceRequest& operator=(AwWebResourceRequest&& other);
+ ~AwWebResourceRequest();
+
+ // The java equivalent
+ struct AwJavaWebResourceRequest {
+ AwJavaWebResourceRequest();
+ ~AwJavaWebResourceRequest();
+
+ base::android::ScopedJavaLocalRef<jstring> jurl;
+ base::android::ScopedJavaLocalRef<jstring> jmethod;
+ base::android::ScopedJavaLocalRef<jobjectArray> jheader_names;
+ base::android::ScopedJavaLocalRef<jobjectArray> jheader_values;
+ };
+
+ // Convenience method to convert AwWebResourceRequest to Java equivalent.
+ static void ConvertToJava(JNIEnv* env,
+ const AwWebResourceRequest& request,
+ AwJavaWebResourceRequest* jRequest);
+
+ std::string url;
+ std::string method;
+ bool is_main_frame;
+ bool has_user_gesture;
+ std::vector<std::string> header_names;
+ std::vector<std::string> header_values;
+};
+
+} // namespace android_webview
+
+#endif // ANDROID_WEBVIEW_BROWSER_NET_AW_WEB_RESOURCE_REQUEST_H_
« no previous file with comments | « android_webview/browser/net/aw_network_delegate.cc ('k') | android_webview/browser/net/aw_web_resource_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698