Skip to content

Commit aae19fb

Browse files
Steve BlockAndroid (Google) Code Review
authored andcommitted
Merge "Hook up WebView.clearSslPreferences() for the Chromium HTTP stack"
2 parents d0e8fb4 + d9151bf commit aae19fb

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

core/java/android/webkit/SslCertLookupTable.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,8 @@ public void setIsAllowed(SslError sslError, boolean allow) {
4646
public boolean isAllowed(SslError sslError) {
4747
return table.getBoolean(sslError.toString());
4848
}
49+
50+
public void clear() {
51+
table.clear();
52+
}
4953
}

core/java/android/webkit/WebViewCore.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1349,8 +1349,14 @@ public void handleMessage(Message msg) {
13491349
}
13501350

13511351
case CLEAR_SSL_PREF_TABLE:
1352-
Network.getInstance(mContext)
1353-
.clearUserSslPrefTable();
1352+
if (JniUtil.useChromiumHttpStack()) {
1353+
// FIXME: This will not work for connections currently in use, as
1354+
// they cache the certificate responses. See http://b/5324235.
1355+
SslCertLookupTable.getInstance().clear();
1356+
nativeCloseIdleConnections();
1357+
} else {
1358+
Network.getInstance(mContext).clearUserSslPrefTable();
1359+
}
13541360
break;
13551361

13561362
case TOUCH_UP:

0 commit comments

Comments
 (0)