| Index: chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappDataStorage.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappDataStorage.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappDataStorage.java
|
| index 37511a3ccab40c6e2f30e3e24c989cb5a3750a48..f9e7d44aa60a36b617ff5c0370cba7c1c0484f40 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappDataStorage.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappDataStorage.java
|
| @@ -79,6 +79,17 @@ public class WebappDataStorage {
|
| }
|
|
|
| /**
|
| + * Deletes the data for a webapp by clearing all the information inside the SharedPreference
|
| + * file. This does NOT delete the file itself but the file is left empty.
|
| + * @param context The context to read the SharedPreferences file.
|
| + * @param webappId The ID of the webapp being deleted.
|
| + */
|
| + static void deleteDataForWebapp(final Context context, final String webappId) {
|
| + assert !ThreadUtils.runningOnUiThread();
|
| + openSharedPreferences(context, webappId).edit().clear().commit();
|
| + }
|
| +
|
| + /**
|
| * Sets the factory used to generate WebappDataStorage objects.
|
| */
|
| @VisibleForTesting
|
| @@ -86,11 +97,15 @@ public class WebappDataStorage {
|
| sFactory = factory;
|
| }
|
|
|
| - protected WebappDataStorage(Context context, String webappId) {
|
| - mPreferences = context.getApplicationContext().getSharedPreferences(
|
| + private static SharedPreferences openSharedPreferences(Context context, String webappId) {
|
| + return context.getApplicationContext().getSharedPreferences(
|
| SHARED_PREFS_FILE_PREFIX + webappId, Context.MODE_PRIVATE);
|
| }
|
|
|
| + protected WebappDataStorage(Context context, String webappId) {
|
| + mPreferences = openSharedPreferences(context, webappId);
|
| + }
|
| +
|
| /*
|
| * Asynchronously retrieves the splash screen image associated with the
|
| * current web app.
|
|
|