Skip to content

Commit 90ea4c4

Browse files
Ben MurdochAndroid (Google) Code Review
authored andcommitted
Merge "Fix crash with HTML5 video." into ics-mr1
2 parents 2a40d0d + d3f18b8 commit 90ea4c4

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

core/java/android/webkit/CookieManager.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,11 @@ public void setCookie(String url, String value, boolean privateBrowsing) {
345345
* a system private class.
346346
*/
347347
public synchronized void setCookie(WebAddress uri, String value) {
348+
if (JniUtil.useChromiumHttpStack()) {
349+
nativeSetCookie(uri.toString(), value, false);
350+
return;
351+
}
352+
348353
if (value != null && value.length() > MAX_COOKIE_LENGTH) {
349354
return;
350355
}
@@ -500,6 +505,10 @@ public String getCookie(String url, boolean privateBrowsing) {
500505
* is a system private class.
501506
*/
502507
public synchronized String getCookie(WebAddress uri) {
508+
if (JniUtil.useChromiumHttpStack()) {
509+
return nativeGetCookie(uri.toString(), false);
510+
}
511+
503512
if (!mAcceptCookie || uri == null) {
504513
return null;
505514
}
@@ -573,6 +582,8 @@ public synchronized String getCookie(WebAddress uri) {
573582
* {@hide} Too late to release publically.
574583
*/
575584
public void waitForCookieOperationsToComplete() {
585+
// Note that this function is applicable for both the java
586+
// and native http stacks, and works correctly with either.
576587
synchronized (this) {
577588
while (pendingCookieOperations > 0) {
578589
try {

0 commit comments

Comments
 (0)