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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/LoadUrlParams.java

Issue 183563002: Adapt the Java LoadUrlParams for the Chrome embedder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Suppress the findbugs warning about postData() getter, matching existing suppresion for the setter 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/android/findbugs_filter/findbugs_known_bugs.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/android/java/src/org/chromium/content/browser/LoadUrlParams.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/LoadUrlParams.java b/content/public/android/java/src/org/chromium/content/browser/LoadUrlParams.java
index 9e8cfd33fc6ccab52707f90ad3a3af40eeaaa2c5..eb90a0e7cfb45d47ca8e1d807c1c169a98b685b9 100644
--- a/content/public/android/java/src/org/chromium/content/browser/LoadUrlParams.java
+++ b/content/public/android/java/src/org/chromium/content/browser/LoadUrlParams.java
@@ -34,11 +34,12 @@ public class LoadUrlParams {
// Package private so that ContentViewCore.loadUrl can pass them down to
// native code. Should not be accessed directly anywhere else outside of
// this class.
- final String mUrl;
+ String mUrl;
int mLoadUrlType;
int mTransitionType;
int mUaOverrideOption;
private Map<String, String> mExtraHeaders;
+ private String mVerbatimHeaders;
byte[] mPostData;
String mBaseUrlForDataUrl;
String mVirtualUrlForDataUrl;
@@ -161,6 +162,13 @@ public class LoadUrlParams {
}
/**
+ * Sets the url.
+ */
+ public void setUrl(String url) {
+ mUrl = url;
+ }
+
+ /**
* Return the url.
*/
public String getUrl() {
@@ -215,9 +223,11 @@ public class LoadUrlParams {
}
/**
- * Return the extra headers as a single String separated by "\n", or null if no extra header
- * is set. This form is suitable for passing to native
- * NavigationController::LoadUrlParams::extra_headers.
+ * Return the extra headers as a single String separated by "\n", or null if no extra header is
+ * set. This form is suitable for passing to native
+ * NavigationController::LoadUrlParams::extra_headers. This will return the headers set in an
+ * exploded form through setExtraHeaders(). Embedders that work with extra headers in opaque
+ * collapsed form can use the setVerbatimHeaders() / getVerbatimHeaders() instead.
*/
String getExtraHeadersString() {
return getExtraHeadersString("\n", false);
@@ -251,6 +261,21 @@ public class LoadUrlParams {
}
/**
+ * Sets the verbatim extra headers string. This is an alternative to storing the headers in
+ * a map (setExtraHeaders()) for the embedders that use collapsed headers strings.
+ */
+ public void setVerbatimHeaders(String headers) {
+ mVerbatimHeaders = headers;
+ }
+
+ /**
+ * @return the verbatim extra headers string
+ */
+ public String getVerbatimHeaders() {
+ return mVerbatimHeaders;
+ }
+
+ /**
* Set the post data of this load. This field is ignored unless load type is
* LOAD_TYPE_BROWSER_INITIATED_HTTP_POST.
* @param postData Post data for this http post load.
@@ -260,6 +285,13 @@ public class LoadUrlParams {
}
/**
+ * @return the data to be sent through POST
+ */
+ public byte[] getPostData() {
+ return mPostData;
+ }
+
+ /**
* Set the base url for data load. It is used both to resolve relative URLs
* and when applying JavaScript's same origin policy. It is ignored unless
* load type is LOAD_TYPE_DATA.
« no previous file with comments | « build/android/findbugs_filter/findbugs_known_bugs.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698