示例#1
0
 public long getTotalUsage() {
   long usage = 0;
   if (mLocalStorageInfo != null) {
     usage += mLocalStorageInfo.getSize();
   }
   for (StorageInfo info : mStorageInfo) {
     usage += info.getSize();
   }
   return usage;
 }
示例#2
0
 public void clearAllStoredData(final StoredDataClearedCallback callback) {
   if (mLocalStorageInfo != null) {
     mLocalStorageInfo.clear();
     mLocalStorageInfo = null;
   }
   mStorageInfoCallbacksLeft = mStorageInfo.size();
   if (mStorageInfoCallbacksLeft > 0) {
     for (StorageInfo info : mStorageInfo) {
       info.clear(
           new WebsitePreferenceBridge.StorageInfoClearedCallback() {
             @Override
             public void onStorageInfoCleared() {
               if (--mStorageInfoCallbacksLeft == 0) callback.onStoredDataCleared();
             }
           });
     }
     mStorageInfo.clear();
   } else {
     callback.onStoredDataCleared();
   }
 }