OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/in_process_webkit/webkit_context.h" | 5 #include "content/browser/in_process_webkit/webkit_context.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "content/public/browser/browser_thread.h" | 9 #include "content/public/browser/browser_thread.h" |
10 | 10 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 if (!BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)) { | 61 if (!BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)) { |
62 BrowserThread::PostTask( | 62 BrowserThread::PostTask( |
63 BrowserThread::WEBKIT, FROM_HERE, | 63 BrowserThread::WEBKIT, FROM_HERE, |
64 base::Bind(&WebKitContext::DeleteDataModifiedSince, this, cutoff)); | 64 base::Bind(&WebKitContext::DeleteDataModifiedSince, this, cutoff)); |
65 return; | 65 return; |
66 } | 66 } |
67 | 67 |
68 dom_storage_context_->DeleteDataModifiedSince(cutoff); | 68 dom_storage_context_->DeleteDataModifiedSince(cutoff); |
69 } | 69 } |
70 | 70 |
71 void WebKitContext::DeleteSessionOnlyData() { | |
72 if (!BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)) { | |
73 BrowserThread::PostTask( | |
74 BrowserThread::WEBKIT, FROM_HERE, | |
75 base::Bind(&WebKitContext::DeleteSessionOnlyData, this)); | |
76 return; | |
77 } | |
78 | |
79 dom_storage_context_->DeleteSessionOnlyData(); | |
80 } | |
81 | |
82 void WebKitContext::DeleteSessionStorageNamespace( | 71 void WebKitContext::DeleteSessionStorageNamespace( |
83 int64 session_storage_namespace_id) { | 72 int64 session_storage_namespace_id) { |
84 if (!BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)) { | 73 if (!BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)) { |
85 BrowserThread::PostTask( | 74 BrowserThread::PostTask( |
86 BrowserThread::WEBKIT, FROM_HERE, | 75 BrowserThread::WEBKIT, FROM_HERE, |
87 base::Bind(&WebKitContext::DeleteSessionStorageNamespace, this, | 76 base::Bind(&WebKitContext::DeleteSessionStorageNamespace, this, |
88 session_storage_namespace_id)); | 77 session_storage_namespace_id)); |
89 return; | 78 return; |
90 } | 79 } |
91 | 80 |
92 dom_storage_context_->DeleteSessionStorageNamespace( | 81 dom_storage_context_->DeleteSessionStorageNamespace( |
93 session_storage_namespace_id); | 82 session_storage_namespace_id); |
94 } | 83 } |
| 84 |
| 85 void WebKitContext::SaveSessionState() { |
| 86 if (!BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)) { |
| 87 BrowserThread::PostTask( |
| 88 BrowserThread::WEBKIT, FROM_HERE, |
| 89 base::Bind(&WebKitContext::SaveSessionState, this)); |
| 90 return; |
| 91 } |
| 92 dom_storage_context_->SaveSessionState(); |
| 93 indexed_db_context_->SaveSessionState(); |
| 94 } |
OLD | NEW |