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_database_helper.h" | 5 #include "chrome/browser/browsing_data_database_helper.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 const std::string& description) | 150 const std::string& description) |
151 : origin(origin), | 151 : origin(origin), |
152 name(name), | 152 name(name), |
153 description(description) { | 153 description(description) { |
154 } | 154 } |
155 | 155 |
156 CannedBrowsingDataDatabaseHelper::PendingDatabaseInfo::~PendingDatabaseInfo() {} | 156 CannedBrowsingDataDatabaseHelper::PendingDatabaseInfo::~PendingDatabaseInfo() {} |
157 | 157 |
158 CannedBrowsingDataDatabaseHelper::CannedBrowsingDataDatabaseHelper( | 158 CannedBrowsingDataDatabaseHelper::CannedBrowsingDataDatabaseHelper( |
159 Profile* profile) | 159 Profile* profile) |
160 : BrowsingDataDatabaseHelper(profile) { | 160 : BrowsingDataDatabaseHelper(profile), |
| 161 profile_(profile) { |
| 162 } |
| 163 |
| 164 CannedBrowsingDataDatabaseHelper* CannedBrowsingDataDatabaseHelper::Clone() { |
| 165 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 166 CannedBrowsingDataDatabaseHelper* clone = |
| 167 new CannedBrowsingDataDatabaseHelper(profile_); |
| 168 |
| 169 base::AutoLock auto_lock(lock_); |
| 170 clone->pending_database_info_ = pending_database_info_; |
| 171 clone->database_info_ = database_info_; |
| 172 return clone; |
161 } | 173 } |
162 | 174 |
163 void CannedBrowsingDataDatabaseHelper::AddDatabase( | 175 void CannedBrowsingDataDatabaseHelper::AddDatabase( |
164 const GURL& origin, | 176 const GURL& origin, |
165 const std::string& name, | 177 const std::string& name, |
166 const std::string& description) { | 178 const std::string& description) { |
167 base::AutoLock auto_lock(lock_); | 179 base::AutoLock auto_lock(lock_); |
168 pending_database_info_.push_back(PendingDatabaseInfo( | 180 pending_database_info_.push_back(PendingDatabaseInfo( |
169 origin, name, description)); | 181 origin, name, description)); |
170 } | 182 } |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 info->description, | 235 info->description, |
224 web_security_origin.toString().utf8(), | 236 web_security_origin.toString().utf8(), |
225 0, | 237 0, |
226 base::Time())); | 238 base::Time())); |
227 } | 239 } |
228 pending_database_info_.clear(); | 240 pending_database_info_.clear(); |
229 | 241 |
230 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, NewRunnableMethod( | 242 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, NewRunnableMethod( |
231 this, &CannedBrowsingDataDatabaseHelper::NotifyInUIThread)); | 243 this, &CannedBrowsingDataDatabaseHelper::NotifyInUIThread)); |
232 } | 244 } |
OLD | NEW |