summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorpiman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-07 00:28:14 +0000
committerpiman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-07 00:28:14 +0000
commit4b3dcfaecb4e51f51780e66b2290ba9a8f880772 (patch)
tree4185cb7cdd750ac42f80c114d5a3c7674bb1d55c /webkit
parenta8473d9ff0b710b676020ad78b2d9121e152d7bf (diff)
downloadchromium_src-4b3dcfaecb4e51f51780e66b2290ba9a8f880772.zip
chromium_src-4b3dcfaecb4e51f51780e66b2290ba9a8f880772.tar.gz
chromium_src-4b3dcfaecb4e51f51780e66b2290ba9a8f880772.tar.bz2
Preparing webkit/dom_storage for the removal of scoped_refptr::release()
BUG=None Review URL: https://chromiumcodereview.appspot.com/11447030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171654 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/dom_storage/dom_storage_context.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/webkit/dom_storage/dom_storage_context.cc b/webkit/dom_storage/dom_storage_context.cc
index 6a67e8a..3d32243 100644
--- a/webkit/dom_storage/dom_storage_context.cc
+++ b/webkit/dom_storage/dom_storage_context.cc
@@ -46,14 +46,15 @@ DomStorageContext::~DomStorageContext() {
if (session_storage_database_.get()) {
// SessionStorageDatabase shouldn't be deleted right away: deleting it will
// potentially involve waiting in leveldb::DBImpl::~DBImpl, and waiting
- // shouldn't happen on this thread. This will unassign the ref counted
- // pointer without decreasing the ref count, and is balanced by the Release
- // that happens later.
+ // shouldn't happen on this thread.
+ SessionStorageDatabase* to_release = session_storage_database_.get();
+ to_release->AddRef();
+ session_storage_database_ = NULL;
task_runner_->PostShutdownBlockingTask(
FROM_HERE,
DomStorageTaskRunner::COMMIT_SEQUENCE,
base::Bind(&SessionStorageDatabase::Release,
- base::Unretained(session_storage_database_.release())));
+ base::Unretained(to_release)));
}
}