Skip to content

Commit bf52c0e

Browse files
author
Steve Block
committed
SSL-related cleanup in BrowserFrame and SslCertLookupTable
- Fix a comment in BrowserFrame.certificate() - Simplify SslCertLookupTable by not storing 'deny' decisions. We only need to store 'allow' decisions, as we don't re-use 'deny' decisions. No change in behaviour. Bug: 5409251 Change-Id: I447cd1966fbb6c2dea8088b2e4c4e2de22405cb9
1 parent 270a3c8 commit bf52c0e

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

core/java/android/webkit/BrowserFrame.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -471,8 +471,6 @@ private void loadFinished(String url, int loadType, boolean isMainFrame) {
471471

472472
/**
473473
* We have received an SSL certificate for the main top-level page.
474-
*
475-
* !!!Called from the network thread!!!
476474
*/
477475
void certificate(SslCertificate certificate) {
478476
if (mIsMainFrame) {
@@ -1186,12 +1184,11 @@ private void reportSslCertError(final int handle, final int certError, byte cert
11861184
SslErrorHandler handler = new SslErrorHandler() {
11871185
@Override
11881186
public void proceed() {
1189-
SslCertLookupTable.getInstance().setIsAllowed(sslError, true);
1187+
SslCertLookupTable.getInstance().setIsAllowed(sslError);
11901188
nativeSslCertErrorProceed(handle);
11911189
}
11921190
@Override
11931191
public void cancel() {
1194-
SslCertLookupTable.getInstance().setIsAllowed(sslError, false);
11951192
nativeSslCertErrorCancel(handle, certError);
11961193
}
11971194
};

core/java/android/webkit/SslCertLookupTable.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
/**
2626
* Stores the user's decision of whether to allow or deny an invalid certificate.
2727
*
28-
* This class is not threadsafe. It is used only on the WebCore thread.
28+
* This class is not threadsafe. It is used only on the WebCore thread. Also, it
29+
* is used only by the Chromium HTTP stack.
2930
*/
3031
final class SslCertLookupTable {
3132
private static SslCertLookupTable sTable;
@@ -42,11 +43,11 @@ private SslCertLookupTable() {
4243
table = new Bundle();
4344
}
4445

45-
public void setIsAllowed(SslError sslError, boolean allow) {
46+
public void setIsAllowed(SslError sslError) {
4647
// TODO: We should key on just the host. See http://b/5409251.
4748
String errorString = sslErrorToString(sslError);
4849
if (errorString != null) {
49-
table.putBoolean(errorString, allow);
50+
table.putBoolean(errorString, true);
5051
}
5152
}
5253

0 commit comments

Comments
 (0)