Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(189)

Side by Side Diff: content/browser/dom_storage/dom_storage_context_impl.cc

Issue 16294003: Update content/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/dom_storage/dom_storage_context_impl.h" 5 #include "content/browser/dom_storage/dom_storage_context_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/message_loop_proxy.h" 10 #include "base/message_loop_proxy.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 worker_pool->GetNamedSequenceToken("dom_storage_primary"), 80 worker_pool->GetNamedSequenceToken("dom_storage_primary"),
81 worker_pool->GetNamedSequenceToken("dom_storage_commit"), 81 worker_pool->GetNamedSequenceToken("dom_storage_commit"),
82 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))); 82 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)));
83 } 83 }
84 84
85 DOMStorageContextImpl::~DOMStorageContextImpl() { 85 DOMStorageContextImpl::~DOMStorageContextImpl() {
86 } 86 }
87 87
88 void DOMStorageContextImpl::GetLocalStorageUsage( 88 void DOMStorageContextImpl::GetLocalStorageUsage(
89 const GetLocalStorageUsageCallback& callback) { 89 const GetLocalStorageUsageCallback& callback) {
90 DCHECK(context_); 90 DCHECK(context_.get());
91 context_->task_runner()->PostShutdownBlockingTask( 91 context_->task_runner()
92 FROM_HERE, 92 ->PostShutdownBlockingTask(FROM_HERE,
93 DomStorageTaskRunner::PRIMARY_SEQUENCE, 93 DomStorageTaskRunner::PRIMARY_SEQUENCE,
94 base::Bind(&GetLocalStorageUsageHelper, 94 base::Bind(&GetLocalStorageUsageHelper,
95 base::MessageLoopProxy::current(), 95 base::MessageLoopProxy::current(),
96 context_, callback)); 96 context_,
97 callback));
97 } 98 }
98 99
99 void DOMStorageContextImpl::GetSessionStorageUsage( 100 void DOMStorageContextImpl::GetSessionStorageUsage(
100 const GetSessionStorageUsageCallback& callback) { 101 const GetSessionStorageUsageCallback& callback) {
101 DCHECK(context_); 102 DCHECK(context_.get());
103 context_->task_runner()
104 ->PostShutdownBlockingTask(FROM_HERE,
105 DomStorageTaskRunner::PRIMARY_SEQUENCE,
106 base::Bind(&GetSessionStorageUsageHelper,
107 base::MessageLoopProxy::current(),
108 context_,
109 callback));
110 }
111
112 void DOMStorageContextImpl::DeleteLocalStorage(const GURL& origin) {
113 DCHECK(context_.get());
102 context_->task_runner()->PostShutdownBlockingTask( 114 context_->task_runner()->PostShutdownBlockingTask(
103 FROM_HERE, 115 FROM_HERE,
104 DomStorageTaskRunner::PRIMARY_SEQUENCE, 116 DomStorageTaskRunner::PRIMARY_SEQUENCE,
105 base::Bind(&GetSessionStorageUsageHelper,
106 base::MessageLoopProxy::current(),
107 context_, callback));
108 }
109
110 void DOMStorageContextImpl::DeleteLocalStorage(const GURL& origin) {
111 DCHECK(context_);
112 context_->task_runner()->PostShutdownBlockingTask(
113 FROM_HERE,
114 DomStorageTaskRunner::PRIMARY_SEQUENCE,
115 base::Bind(&DomStorageContext::DeleteLocalStorage, context_, origin)); 117 base::Bind(&DomStorageContext::DeleteLocalStorage, context_, origin));
116 } 118 }
117 119
118 void DOMStorageContextImpl::DeleteSessionStorage( 120 void DOMStorageContextImpl::DeleteSessionStorage(
119 const dom_storage::SessionStorageUsageInfo& usage_info) { 121 const dom_storage::SessionStorageUsageInfo& usage_info) {
120 DCHECK(context_); 122 DCHECK(context_.get());
121 context_->task_runner()->PostShutdownBlockingTask( 123 context_->task_runner()->PostShutdownBlockingTask(
122 FROM_HERE, 124 FROM_HERE,
123 DomStorageTaskRunner::PRIMARY_SEQUENCE, 125 DomStorageTaskRunner::PRIMARY_SEQUENCE,
124 base::Bind(&DomStorageContext::DeleteSessionStorage, context_, 126 base::Bind(
125 usage_info)); 127 &DomStorageContext::DeleteSessionStorage, context_, usage_info));
126 } 128 }
127 129
128 void DOMStorageContextImpl::SetSaveSessionStorageOnDisk() { 130 void DOMStorageContextImpl::SetSaveSessionStorageOnDisk() {
129 DCHECK(context_); 131 DCHECK(context_.get());
130 context_->SetSaveSessionStorageOnDisk(); 132 context_->SetSaveSessionStorageOnDisk();
131 } 133 }
132 134
133 scoped_refptr<SessionStorageNamespace> 135 scoped_refptr<SessionStorageNamespace>
134 DOMStorageContextImpl::RecreateSessionStorage( 136 DOMStorageContextImpl::RecreateSessionStorage(
135 const std::string& persistent_id) { 137 const std::string& persistent_id) {
136 return scoped_refptr<SessionStorageNamespace>( 138 return scoped_refptr<SessionStorageNamespace>(
137 new SessionStorageNamespaceImpl(this, persistent_id)); 139 new SessionStorageNamespaceImpl(this, persistent_id));
138 } 140 }
139 141
140 void DOMStorageContextImpl::StartScavengingUnusedSessionStorage() { 142 void DOMStorageContextImpl::StartScavengingUnusedSessionStorage() {
141 DCHECK(context_); 143 DCHECK(context_.get());
142 context_->task_runner()->PostShutdownBlockingTask( 144 context_->task_runner()->PostShutdownBlockingTask(
143 FROM_HERE, 145 FROM_HERE,
144 DomStorageTaskRunner::PRIMARY_SEQUENCE, 146 DomStorageTaskRunner::PRIMARY_SEQUENCE,
145 base::Bind(&DomStorageContext::StartScavengingUnusedSessionStorage, 147 base::Bind(&DomStorageContext::StartScavengingUnusedSessionStorage,
146 context_)); 148 context_));
147 } 149 }
148 150
149 void DOMStorageContextImpl::PurgeMemory() { 151 void DOMStorageContextImpl::PurgeMemory() {
150 DCHECK(context_); 152 DCHECK(context_.get());
151 context_->task_runner()->PostShutdownBlockingTask( 153 context_->task_runner()->PostShutdownBlockingTask(
152 FROM_HERE, 154 FROM_HERE,
153 DomStorageTaskRunner::PRIMARY_SEQUENCE, 155 DomStorageTaskRunner::PRIMARY_SEQUENCE,
154 base::Bind(&DomStorageContext::PurgeMemory, context_)); 156 base::Bind(&DomStorageContext::PurgeMemory, context_));
155 } 157 }
156 158
157 void DOMStorageContextImpl::SetForceKeepSessionState() { 159 void DOMStorageContextImpl::SetForceKeepSessionState() {
158 DCHECK(context_); 160 DCHECK(context_.get());
159 context_->task_runner()->PostShutdownBlockingTask( 161 context_->task_runner()->PostShutdownBlockingTask(
160 FROM_HERE, 162 FROM_HERE,
161 DomStorageTaskRunner::PRIMARY_SEQUENCE, 163 DomStorageTaskRunner::PRIMARY_SEQUENCE,
162 base::Bind(&DomStorageContext::SetForceKeepSessionState, context_)); 164 base::Bind(&DomStorageContext::SetForceKeepSessionState, context_));
163 } 165 }
164 166
165 void DOMStorageContextImpl::Shutdown() { 167 void DOMStorageContextImpl::Shutdown() {
166 DCHECK(context_); 168 DCHECK(context_.get());
167 context_->task_runner()->PostShutdownBlockingTask( 169 context_->task_runner()->PostShutdownBlockingTask(
168 FROM_HERE, 170 FROM_HERE,
169 DomStorageTaskRunner::PRIMARY_SEQUENCE, 171 DomStorageTaskRunner::PRIMARY_SEQUENCE,
170 base::Bind(&DomStorageContext::Shutdown, context_)); 172 base::Bind(&DomStorageContext::Shutdown, context_));
171 } 173 }
172 174
173 } // namespace content 175 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/devtools/tethering_handler.cc ('k') | content/browser/dom_storage/dom_storage_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698