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

Side by Side Diff: chrome/browser/browsing_data_indexed_db_helper.cc

Issue 6670033: Use copies of canned browsing data helpers to populate the cookies tree model. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 9 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) 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_indexed_db_helper.h" 5 #include "chrome/browser/browsing_data_indexed_db_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/scoped_ptr.h" 9 #include "base/scoped_ptr.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 } 201 }
202 202
203 CannedBrowsingDataIndexedDBHelper::CannedBrowsingDataIndexedDBHelper( 203 CannedBrowsingDataIndexedDBHelper::CannedBrowsingDataIndexedDBHelper(
204 Profile* profile) 204 Profile* profile)
205 : profile_(profile), 205 : profile_(profile),
206 completion_callback_(NULL), 206 completion_callback_(NULL),
207 is_fetching_(false) { 207 is_fetching_(false) {
208 DCHECK(profile); 208 DCHECK(profile);
209 } 209 }
210 210
211 CannedBrowsingDataIndexedDBHelper* CannedBrowsingDataIndexedDBHelper::Clone() {
212 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
213 CannedBrowsingDataIndexedDBHelper* clone =
214 new CannedBrowsingDataIndexedDBHelper(profile_);
215
216 base::AutoLock auto_lock(lock_);
217 clone->pending_indexed_db_info_ = pending_indexed_db_info_;
218 clone->indexed_db_info_ = indexed_db_info_;
219 return clone;
220 }
221
211 void CannedBrowsingDataIndexedDBHelper::AddIndexedDB( 222 void CannedBrowsingDataIndexedDBHelper::AddIndexedDB(
212 const GURL& origin, const string16& description) { 223 const GURL& origin, const string16& description) {
213 base::AutoLock auto_lock(lock_); 224 base::AutoLock auto_lock(lock_);
214 pending_indexed_db_info_.push_back(PendingIndexedDBInfo(origin, description)); 225 pending_indexed_db_info_.push_back(PendingIndexedDBInfo(origin, description));
215 } 226 }
216 227
217 void CannedBrowsingDataIndexedDBHelper::Reset() { 228 void CannedBrowsingDataIndexedDBHelper::Reset() {
218 base::AutoLock auto_lock(lock_); 229 base::AutoLock auto_lock(lock_);
219 indexed_db_info_.clear(); 230 indexed_db_info_.clear();
220 pending_indexed_db_info_.clear(); 231 pending_indexed_db_info_.clear();
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 295 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
285 DCHECK(is_fetching_); 296 DCHECK(is_fetching_);
286 // Note: completion_callback_ mutates only in the UI thread, so it's safe to 297 // Note: completion_callback_ mutates only in the UI thread, so it's safe to
287 // test it here. 298 // test it here.
288 if (completion_callback_ != NULL) { 299 if (completion_callback_ != NULL) {
289 completion_callback_->Run(indexed_db_info_); 300 completion_callback_->Run(indexed_db_info_);
290 completion_callback_.reset(); 301 completion_callback_.reset();
291 } 302 }
292 is_fetching_ = false; 303 is_fetching_ = false;
293 } 304 }
OLDNEW
« no previous file with comments | « chrome/browser/browsing_data_indexed_db_helper.h ('k') | chrome/browser/browsing_data_local_storage_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698