Commit 768a502b authored by cmumford's avatar cmumford Committed by Commit bot

Service Worker: Deleting db iterator before closing db.

Common practice is to call Handle{Open/Read/Write}Result() when
using the leveldb database. Those functions will close the db
upon error - invalidating any open iterators. These calling
functions use scoped_ptr's for iterators which, upon error,
would delete an invalid leveldb::Iterator instance.

ServiceWorkerDatabase::DeleteResourceRecords()
ServiceWorkerDatabase::DeleteUserDataForRegistration()
ServiceWorkerDatabase::GetAllRegistrations()
ServiceWorkerDatabase::GetOriginsWithForeignFetchRegistrations()
ServiceWorkerDatabase::GetOriginsWithRegistrations()
ServiceWorkerDatabase::GetRegistrationsForOrigin()
ServiceWorkerDatabase::ReadResourceIds()
ServiceWorkerDatabase::ReadResourceRecords()
ServiceWorkerDatabase::ReadUserDataForAllRegistrations()

BUG=579624

Review URL: https://codereview.chromium.org/1635223002

Cr-Commit-Position: refs/heads/master@{#371718}
parent 94dbb0e5
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment