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 "chrome/browser/browsing_data_local_storage_helper.h" | 5 #include "chrome/browser/browsing_data_local_storage_helper.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 | 140 |
141 void BrowsingDataLocalStorageHelper::DeleteLocalStorageFileInWebKitThread( | 141 void BrowsingDataLocalStorageHelper::DeleteLocalStorageFileInWebKitThread( |
142 const FilePath& file_path) { | 142 const FilePath& file_path) { |
143 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); | 143 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); |
144 profile_->GetWebKitContext()->dom_storage_context()->DeleteLocalStorageFile( | 144 profile_->GetWebKitContext()->dom_storage_context()->DeleteLocalStorageFile( |
145 file_path); | 145 file_path); |
146 } | 146 } |
147 | 147 |
148 CannedBrowsingDataLocalStorageHelper::CannedBrowsingDataLocalStorageHelper( | 148 CannedBrowsingDataLocalStorageHelper::CannedBrowsingDataLocalStorageHelper( |
149 Profile* profile) | 149 Profile* profile) |
150 : BrowsingDataLocalStorageHelper(profile) { | 150 : BrowsingDataLocalStorageHelper(profile), |
| 151 profile_(profile) { |
| 152 } |
| 153 |
| 154 CannedBrowsingDataLocalStorageHelper* |
| 155 CannedBrowsingDataLocalStorageHelper::Clone() { |
| 156 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 157 CannedBrowsingDataLocalStorageHelper* clone = |
| 158 new CannedBrowsingDataLocalStorageHelper(profile_); |
| 159 |
| 160 base::AutoLock auto_lock(lock_); |
| 161 clone->pending_local_storage_info_ = pending_local_storage_info_; |
| 162 clone->local_storage_info_ = local_storage_info_; |
| 163 return clone; |
151 } | 164 } |
152 | 165 |
153 void CannedBrowsingDataLocalStorageHelper::AddLocalStorage( | 166 void CannedBrowsingDataLocalStorageHelper::AddLocalStorage( |
154 const GURL& origin) { | 167 const GURL& origin) { |
155 base::AutoLock auto_lock(lock_); | 168 base::AutoLock auto_lock(lock_); |
156 pending_local_storage_info_.push_back(origin); | 169 pending_local_storage_info_.push_back(origin); |
157 } | 170 } |
158 | 171 |
159 void CannedBrowsingDataLocalStorageHelper::Reset() { | 172 void CannedBrowsingDataLocalStorageHelper::Reset() { |
160 base::AutoLock auto_lock(lock_); | 173 base::AutoLock auto_lock(lock_); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 0, | 229 0, |
217 base::Time())); | 230 base::Time())); |
218 } | 231 } |
219 pending_local_storage_info_.clear(); | 232 pending_local_storage_info_.clear(); |
220 | 233 |
221 BrowserThread::PostTask( | 234 BrowserThread::PostTask( |
222 BrowserThread::UI, FROM_HERE, | 235 BrowserThread::UI, FROM_HERE, |
223 NewRunnableMethod( | 236 NewRunnableMethod( |
224 this, &CannedBrowsingDataLocalStorageHelper::NotifyInUIThread)); | 237 this, &CannedBrowsingDataLocalStorageHelper::NotifyInUIThread)); |
225 } | 238 } |
OLD | NEW |