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

Side by Side Diff: chrome/browser/sync/test/integration/autofill_helper.cc

Issue 12543034: Move creation of the various WebDatabaseTable types out of WebDatabase. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Self review. Created 7 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/sync/test/integration/autofill_helper.h" 5 #include "chrome/browser/sync/test/integration/autofill_helper.h"
6 6
7 #include "chrome/browser/autofill/personal_data_manager_factory.h" 7 #include "chrome/browser/autofill/personal_data_manager_factory.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/sync/profile_sync_service.h" 9 #include "chrome/browser/sync/profile_sync_service.h"
10 #include "chrome/browser/sync/profile_sync_test_util.h" 10 #include "chrome/browser/sync/profile_sync_test_util.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 WaitableEvent done_event(false, false); 80 WaitableEvent done_event(false, false);
81 BrowserThread::PostTask(BrowserThread::DB, 81 BrowserThread::PostTask(BrowserThread::DB,
82 FROM_HERE, 82 FROM_HERE,
83 Bind(&RunOnDBThreadAndSignal, task, &done_event)); 83 Bind(&RunOnDBThreadAndSignal, task, &done_event));
84 done_event.Wait(); 84 done_event.Wait();
85 } 85 }
86 86
87 void GetAllAutofillEntriesOnDBThread(WebDataService* wds, 87 void GetAllAutofillEntriesOnDBThread(WebDataService* wds,
88 std::vector<AutofillEntry>* entries) { 88 std::vector<AutofillEntry>* entries) {
89 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); 89 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
90 wds->GetDatabase()->GetAutofillTable()->GetAllAutofillEntries(entries); 90 AutofillTable::FromWebDatabase(
91 wds->GetDatabase())->GetAllAutofillEntries(entries);
91 } 92 }
92 93
93 std::vector<AutofillEntry> GetAllAutofillEntries(WebDataService* wds) { 94 std::vector<AutofillEntry> GetAllAutofillEntries(WebDataService* wds) {
94 std::vector<AutofillEntry> entries; 95 std::vector<AutofillEntry> entries;
95 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 96 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
96 RunOnDBThreadAndBlock(Bind(&GetAllAutofillEntriesOnDBThread, 97 RunOnDBThreadAndBlock(Bind(&GetAllAutofillEntriesOnDBThread,
97 Unretained(wds), 98 Unretained(wds),
98 &entries)); 99 &entries));
99 return entries; 100 return entries;
100 } 101 }
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 if (!ProfilesMatch(0, i)) { 328 if (!ProfilesMatch(0, i)) {
328 LOG(ERROR) << "Profile " << i << "does not contain the same autofill " 329 LOG(ERROR) << "Profile " << i << "does not contain the same autofill "
329 "profiles as profile 0."; 330 "profiles as profile 0.";
330 return false; 331 return false;
331 } 332 }
332 } 333 }
333 return true; 334 return true;
334 } 335 }
335 336
336 } // namespace autofill_helper 337 } // namespace autofill_helper
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698