am 940718d8: am a6854579: am fa1f7d21: am 07c9c291: am a2b0b35e: am 5fba3404: am 3c4fa654: am 679c8f68: am 38915fd4: Revert "Add a delimiter between scheme and host"

* commit '940718d8598e4b8da3009b46e8edba9d1dc6ed40':
  Revert "Add a delimiter between scheme and host"
This commit is contained in:
Selim Gurun
2013-04-20 21:34:55 -07:00
committed by Android Git Automerger
3 changed files with 7 additions and 26 deletions

View File

@@ -70,7 +70,6 @@ class BrowserFrame extends Handler {
* request's LoadListener * request's LoadListener
*/ */
private final static int MAX_OUTSTANDING_REQUESTS = 300; private final static int MAX_OUTSTANDING_REQUESTS = 300;
private final static String SCHEME_HOST_DELIMITER = "://";
private final CallbackProxy mCallbackProxy; private final CallbackProxy mCallbackProxy;
private final WebSettingsClassic mSettings; private final WebSettingsClassic mSettings;
@@ -499,14 +498,10 @@ class BrowserFrame extends Handler {
.getCurrentItem(); .getCurrentItem();
if (item != null) { if (item != null) {
WebAddress uri = new WebAddress(item.getUrl()); WebAddress uri = new WebAddress(item.getUrl());
String schemePlusHost = uri.getScheme() + SCHEME_HOST_DELIMITER + String schemePlusHost = uri.getScheme() + uri.getHost();
uri.getHost(); String[] up =
String[] up = mDatabase.getUsernamePassword( WebViewDatabaseClassic.getInstance(mContext)
schemePlusHost); .getUsernamePassword(schemePlusHost);
if (up == null) { // no row found, try again using the legacy method
schemePlusHost = uri.getScheme() + uri.getHost();
up = mDatabase.getUsernamePassword(schemePlusHost);
}
if (up != null && up[0] != null) { if (up != null && up[0] != null) {
setUsernamePassword(up[0], up[1]); setUsernamePassword(up[0], up[1]);
} }
@@ -821,7 +816,7 @@ class BrowserFrame extends Handler {
} }
WebAddress uri = new WebAddress(mCallbackProxy WebAddress uri = new WebAddress(mCallbackProxy
.getBackForwardList().getCurrentItem().getUrl()); .getBackForwardList().getCurrentItem().getUrl());
String schemePlusHost = uri.getScheme() + SCHEME_HOST_DELIMITER + uri.getHost(); String schemePlusHost = uri.getScheme() + uri.getHost();
// Check to see if the username & password appear in // Check to see if the username & password appear in
// the post data (there could be another form on the // the post data (there could be another form on the
// page and that was posted instead. // page and that was posted instead.

View File

@@ -581,8 +581,7 @@ public class WebView extends AbsoluteLayout
* forms. Note that this is unrelated to the credentials used for HTTP * forms. Note that this is unrelated to the credentials used for HTTP
* authentication. * authentication.
* *
* @param host the host that required the credentials. It is recommended that * @param host the host that required the credentials
* the host is given using scheme://hostname format.
* @param username the username for the given host * @param username the username for the given host
* @param password the password for the given host * @param password the password for the given host
* @see WebViewDatabase#clearUsernamePassword * @see WebViewDatabase#clearUsernamePassword

View File

@@ -37,7 +37,7 @@ final class WebViewDatabaseClassic extends WebViewDatabase {
private static final String DATABASE_FILE = "webview.db"; private static final String DATABASE_FILE = "webview.db";
private static final String CACHE_DATABASE_FILE = "webviewCache.db"; private static final String CACHE_DATABASE_FILE = "webviewCache.db";
private static final int DATABASE_VERSION = 12; private static final int DATABASE_VERSION = 11;
// 2 -> 3 Modified Cache table to allow cache of redirects // 2 -> 3 Modified Cache table to allow cache of redirects
// 3 -> 4 Added Oma-Downloads table // 3 -> 4 Added Oma-Downloads table
// 4 -> 5 Modified Cache table to support persistent contentLength // 4 -> 5 Modified Cache table to support persistent contentLength
@@ -50,7 +50,6 @@ final class WebViewDatabaseClassic extends WebViewDatabase {
// 10 -> 11 Drop cookies and cache now managed by the chromium stack, // 10 -> 11 Drop cookies and cache now managed by the chromium stack,
// and update the form data table to use the new format // and update the form data table to use the new format
// implemented for b/5265606. // implemented for b/5265606.
// 11 -> 12 Add a delimiter between scheme and host when storing passwords
private static WebViewDatabaseClassic sInstance = null; private static WebViewDatabaseClassic sInstance = null;
private static final Object sInstanceLock = new Object(); private static final Object sInstanceLock = new Object();
@@ -170,23 +169,11 @@ final class WebViewDatabaseClassic extends WebViewDatabase {
private static void upgradeDatabase() { private static void upgradeDatabase() {
upgradeDatabaseToV10(); upgradeDatabaseToV10();
upgradeDatabaseFromV10ToV11(); upgradeDatabaseFromV10ToV11();
upgradeDatabaseFromV11ToV12();
// Add future database upgrade functions here, one version at a // Add future database upgrade functions here, one version at a
// time. // time.
sDatabase.setVersion(DATABASE_VERSION); sDatabase.setVersion(DATABASE_VERSION);
} }
private static void upgradeDatabaseFromV11ToV12() {
int oldVersion = sDatabase.getVersion();
if (oldVersion >= 12) {
// Nothing to do.
return;
}
// delete the rows in the database.
sDatabase.delete(mTableNames[TABLE_PASSWORD_ID], null, null);
}
private static void upgradeDatabaseFromV10ToV11() { private static void upgradeDatabaseFromV10ToV11() {
int oldVersion = sDatabase.getVersion(); int oldVersion = sDatabase.getVersion();