diff options
author | levin@chromium.org <levin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-13 07:50:13 +0000 |
---|---|---|
committer | levin@chromium.org <levin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-13 07:50:13 +0000 |
commit | 149717b8dbe8c7abf65b600ecf3279b195fe9bd8 (patch) | |
tree | 14c8ac0d1bd940a272616865b84b3c2f7c84f625 | |
parent | 60cba79ac19628c205fce7cfdfd7845c1c3b6b60 (diff) | |
download | chromium_src-149717b8dbe8c7abf65b600ecf3279b195fe9bd8.zip chromium_src-149717b8dbe8c7abf65b600ecf3279b195fe9bd8.tar.gz chromium_src-149717b8dbe8c7abf65b600ecf3279b195fe9bd8.tar.bz2 |
Revert 31873 - Revert 31862 Ensure AutomationMsg_SetCookieAsync is sent on IO thread.
Restoring this change as it seems the blame list was incorrect on
some bot and this change wasn't to blame but r31865 was in fact the
real culprit.
TBR=stoyan@chromium.org
Review URL: http://codereview.chromium.org/384116
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31892 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/automation/automation_profile_impl.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/chrome/browser/automation/automation_profile_impl.cc b/chrome/browser/automation/automation_profile_impl.cc index 4d217d6..bb9b106 100644 --- a/chrome/browser/automation/automation_profile_impl.cc +++ b/chrome/browser/automation/automation_profile_impl.cc @@ -63,7 +63,7 @@ class AutomationCookieStore : public net::CookieStore { if (cookie_set) { // TODO(eroman): Should NOT be accessing the profile from here, as this // is running on the IO thread. - automation_client_->Send(new AutomationMsg_SetCookieAsync(0, + SendIPCMessageOnIOThread(new AutomationMsg_SetCookieAsync(0, profile_->tab_handle(), url, cookie_line)); } return cookie_set; @@ -106,6 +106,16 @@ class AutomationCookieStore : public net::CookieStore { } protected: + void SendIPCMessageOnIOThread(IPC::Message* m) { + if (ChromeThread::CurrentlyOn(ChromeThread::IO)) { + automation_client_->Send(m); + } else { + Task* task = NewRunnableMethod(this, + &AutomationCookieStore::SendIPCMessageOnIOThread, m); + ChromeThread::PostTask(ChromeThread::IO, FROM_HERE, task); + } + } + AutomationProfileImpl* profile_; net::CookieStore* original_cookie_store_; IPC::Message::Sender* automation_client_; |