| Index: content/browser/in_process_webkit/dom_storage_context_impl.cc
|
| ===================================================================
|
| --- content/browser/in_process_webkit/dom_storage_context_impl.cc (revision 127292)
|
| +++ content/browser/in_process_webkit/dom_storage_context_impl.cc (working copy)
|
| @@ -198,6 +198,13 @@
|
| }
|
|
|
| void DOMStorageContextImpl::PurgeMemory() {
|
| + if (!webkit_message_loop_->RunsTasksOnCurrentThread()) {
|
| + webkit_message_loop_->PostTask(
|
| + FROM_HERE,
|
| + base::Bind(&DOMStorageContextImpl::PurgeMemory, this));
|
| + return;
|
| + }
|
| +
|
| // It is only safe to purge the memory from the LocalStorage namespace,
|
| // because it is backed by disk and can be reloaded later. If we purge a
|
| // SessionStorage namespace, its data will be gone forever, because it isn't
|
| @@ -277,6 +284,28 @@
|
| }
|
| }
|
|
|
| +void DOMStorageContextImpl::SetClearLocalState(bool clear_local_state) {
|
| + if (!webkit_message_loop_->RunsTasksOnCurrentThread()) {
|
| + webkit_message_loop_->PostTask(
|
| + FROM_HERE,
|
| + base::Bind(
|
| + &DOMStorageContextImpl::SetClearLocalState,
|
| + this, clear_local_state));
|
| + return;
|
| + }
|
| + clear_local_state_on_exit_ = clear_local_state;
|
| +}
|
| +
|
| +void DOMStorageContextImpl::SaveSessionState() {
|
| + if (!webkit_message_loop_->RunsTasksOnCurrentThread()) {
|
| + webkit_message_loop_->PostTask(
|
| + FROM_HERE,
|
| + base::Bind(&DOMStorageContextImpl::SaveSessionState, this));
|
| + return;
|
| + }
|
| + save_session_state_ = true;
|
| +}
|
| +
|
| DOMStorageNamespace* DOMStorageContextImpl::CreateLocalStorage() {
|
| FilePath dir_path;
|
| if (!data_path_.empty())
|
| @@ -316,6 +345,7 @@
|
| void DOMStorageContextImpl::GetAllStorageFiles(
|
| const GetAllStorageFilesCallback& callback) {
|
| if (!webkit_message_loop_->RunsTasksOnCurrentThread()) {
|
| + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| webkit_message_loop_->PostTask(
|
| FROM_HERE,
|
| base::Bind(
|
| @@ -352,4 +382,3 @@
|
| }
|
|
|
| #endif // ENABLE_NEW_DOM_STORAGE_BACKEND
|
| -
|
|
|