Chromium Code Reviews| Index: content/renderer/dom_storage/local_storage_cached_area.cc |
| diff --git a/content/renderer/dom_storage/local_storage_cached_area.cc b/content/renderer/dom_storage/local_storage_cached_area.cc |
| index a7ba25ed57f06cf00d6ece81ee364c866c84134d..7721c79ac6fcd196a0920f51f2ff21e9094adec7 100644 |
| --- a/content/renderer/dom_storage/local_storage_cached_area.cc |
| +++ b/content/renderer/dom_storage/local_storage_cached_area.cc |
| @@ -150,7 +150,15 @@ void LocalStorageCachedArea::RemoveItem(const base::string16& key, |
| void LocalStorageCachedArea::Clear(const GURL& page_url, |
| const std::string& storage_area_id) { |
| - // No need to prime the cache in this case. |
| + // No need to prime the cache in this case. We still need to make sure the |
| + // LevelDBWrapper is actually ready and connected to a database to ensure |
| + // changes will get written to the database if the browser quits soon. |
| + if (!map_) { |
| + base::TimeTicks before = base::TimeTicks::Now(); |
| + leveldb_->Sync(); |
|
michaeln
2017/01/25 02:28:38
that's unfortunate?
would an async call to storag
Marijn Kruisselbrink
2017/01/25 22:00:07
Yes, it is. I don't really see a way around it tho
michaeln
2017/01/25 23:53:28
I see, the problem is not the renderer-to-browser
|
| + base::TimeDelta time_to_prime = base::TimeTicks::Now() - before; |
| + UMA_HISTOGRAM_TIMES("LocalStorage.MojoTimeToPrimeClear", time_to_prime); |
| + } |
| Reset(); |
| map_ = new DOMStorageMap(kPerStorageAreaQuota); |