From b3c4b79861ac4ea52f2029cdb51a461868e22e0c Mon Sep 17 00:00:00 2001 From: "isherman@chromium.org" Date: Thu, 5 Apr 2012 08:28:29 +0000 Subject: [PATCH] Migrate AutofillManager to use the SequencedWorkerPool rather than the FILE thread. BUG=none TEST=Autofill should continue to work, server should continue to get Autofill uploads Review URL: http://codereview.chromium.org/9950142 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@130868 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/autofill/autofill_manager.cc | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/chrome/browser/autofill/autofill_manager.cc b/chrome/browser/autofill/autofill_manager.cc index 902cb5f622aa..e15e06c65709 100644 --- a/chrome/browser/autofill/autofill_manager.cc +++ b/chrome/browser/autofill/autofill_manager.cc @@ -16,6 +16,7 @@ #include "base/logging.h" #include "base/string16.h" #include "base/string_util.h" +#include "base/threading/sequenced_worker_pool.h" #include "base/utf_string_conversions.h" #include "chrome/browser/autocomplete_history_manager.h" #include "chrome/browser/autofill/autofill_cc_infobar_delegate.h" @@ -146,7 +147,7 @@ void DeterminePossibleFieldTypesForUpload( const std::vector& profiles, const std::vector& credit_cards, FormStructure* submitted_form) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); + DCHECK(BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread()); // For each field in the |submitted_form|, extract the value. Then for each // profile or credit card, identify any stored types that match the value. @@ -360,15 +361,11 @@ bool AutofillManager::OnFormSubmitted(const FormData& form, copied_credit_cards.push_back(**it); } - // TODO(isherman): Ideally, we should not be using the FILE thread here. - // Per jar@, this is a good compromise for now, as we don't currently have a - // broad consensus on how to support such one-off background tasks. - // Note that ownership of |submitted_form| is passed to the second task, // using |base::Owned|. FormStructure* raw_submitted_form = submitted_form.get(); - BrowserThread::PostTaskAndReply( - BrowserThread::FILE, FROM_HERE, + BrowserThread::GetBlockingPool()->PostTaskAndReply( + FROM_HERE, base::Bind(&DeterminePossibleFieldTypesForUpload, copied_profiles, copied_credit_cards, -- 2.11.4.GIT