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

Unified Diff: android_webview/java/src/org/chromium/android_webview/AwWebResourceResponse.java

Issue 284123004: [android_webview] Add more params to request intercepting. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix accidentally broken test Created 6 years, 6 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: android_webview/java/src/org/chromium/android_webview/AwWebResourceResponse.java
diff --git a/android_webview/java/src/org/chromium/android_webview/AwWebResourceResponse.java b/android_webview/java/src/org/chromium/android_webview/AwWebResourceResponse.java
new file mode 100644
index 0000000000000000000000000000000000000000..a057efdc96f2f9c40667120ccaec767a664693cc
--- /dev/null
+++ b/android_webview/java/src/org/chromium/android_webview/AwWebResourceResponse.java
@@ -0,0 +1,83 @@
+// Copyright 2012 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.
+
+package org.chromium.android_webview;
+
+import org.chromium.base.CalledByNative;
+import org.chromium.base.JNINamespace;
+
+import java.io.InputStream;
+import java.util.Map;
+
+/**
+ * The response information that is to be returned for a particular resource fetch.
+ */
+@JNINamespace("android_webview")
+public class AwWebResourceResponse {
+ private String mMimeType;
+ private String mCharset;
+ private InputStream mData;
+ private int mStatusCode;
+ private String mReasonPhrase;
+ private String[] mResponseHeaderNames;
+ private String[] mResponseHeaderValues;
+
+ public AwWebResourceResponse(String mimeType, String encoding, InputStream data) {
+ mMimeType = mimeType;
+ mCharset = encoding;
+ mData = data;
+ }
+
+ public AwWebResourceResponse(String mimeType, String encoding, InputStream data,
+ int statusCode, String reasonPhrase, Map<String, String> responseHeaders) {
+ this(mimeType, encoding, data);
+
+ mStatusCode = statusCode;
+ mReasonPhrase = reasonPhrase;
+
+ mResponseHeaderNames = new String[responseHeaders.size()];
+ mResponseHeaderValues = new String[responseHeaders.size()];
+ int i = 0;
+ for (Map.Entry<String, String> entry : responseHeaders.entrySet()) {
+ mResponseHeaderNames[i] = entry.getKey();
+ mResponseHeaderValues[i] = entry.getValue();
+ i++;
+ }
+ }
+
+ @CalledByNative
+ public String getMimeType() {
+ return mMimeType;
+ }
+
+ @CalledByNative
+ public String getCharset() {
+ return mCharset;
+ }
+
+ @CalledByNative
+ public InputStream getData() {
+ return mData;
+ }
+
+ @CalledByNative
+ public int getStatusCode() {
+ return mStatusCode;
+ }
+
+ @CalledByNative
+ public String getReasonPhrase() {
+ return mReasonPhrase;
+ }
+
+ @CalledByNative
+ public String[] getResponseHeaderNames() {
+ return mResponseHeaderNames;
+ }
+
+ @CalledByNative
+ public String[] getResponseHeaderValues() {
+ return mResponseHeaderValues;
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698