diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-26 23:28:40 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-26 23:28:40 +0000 |
commit | c82d09a2c37cfcf286fd1a82f18c08d5d52bbc5e (patch) | |
tree | b77563ef856664ce69ebd9678157eb3c5318e63a /chrome_frame/chrome_frame_activex_base.h | |
parent | 65567155035ec2cb68b6e8aac576bda6a0ed4f35 (diff) | |
download | chromium_src-c82d09a2c37cfcf286fd1a82f18c08d5d52bbc5e.zip chromium_src-c82d09a2c37cfcf286fd1a82f18c08d5d52bbc5e.tar.gz chromium_src-c82d09a2c37cfcf286fd1a82f18c08d5d52bbc5e.tar.bz2 |
Reenable the ChromeFrame unload event test which basically loads a page which in its unload handler sets
a cookie which the new page attempts to read. This does not work as expected in ChromeFrame as the cookie
reading and writing attempts are routed to the host browser, in this case IE which is waiting for the
WM_DESTROY message sent to the external tab to return.
Fix is to process the AutomationMsg_GetCookiesFromHost and AutomationMsg_SetCookieAsync IPC messages
in the background thread which works in IE. For Firefox they continue to be processed on the UI thread
as before.
Fixes bug http://code.google.com/p/chromium/issues/detail?id=37231
Bug=37231
Review URL: http://codereview.chromium.org/1342004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42855 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/chrome_frame_activex_base.h')
-rw-r--r-- | chrome_frame/chrome_frame_activex_base.h | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/chrome_frame/chrome_frame_activex_base.h b/chrome_frame/chrome_frame_activex_base.h index ebb57b0..5d663c6 100644 --- a/chrome_frame/chrome_frame_activex_base.h +++ b/chrome_frame/chrome_frame_activex_base.h @@ -442,79 +442,6 @@ END_MSG_MAP() return TRUE; } - virtual void OnSetCookieAsync(int tab_handle, const GURL& url, - const std::string& cookie) { - std::string name; - std::string data; - - size_t name_end = cookie.find('='); - if (std::string::npos != name_end) { - net::CookieMonster::ParsedCookie parsed_cookie = cookie; - name = parsed_cookie.Name(); - // Verify if the cookie is being deleted. The cookie format is as below - // value[; expires=date][; domain=domain][; path=path][; secure] - // If the first semicolon appears immediately after the name= string, - // it means that the cookie is being deleted, in which case we should - // pass the data as is to the InternetSetCookie function. - if (!parsed_cookie.Value().empty()) { - name.clear(); - data = cookie; - } else { - data = cookie.substr(name_end + 1); - } - } else { - data = cookie; - } - - int32 flags = INTERNET_COOKIE_EVALUATE_P3P; - - InternetCookieState cookie_state = static_cast<InternetCookieState>( - InternetSetCookieExA(url.spec().c_str(), name.c_str(), data.c_str(), - flags, NULL)); - - int32 cookie_action = MapCookieStateToCookieAction(cookie_state); - url_fetcher_.AddPrivacyDataForUrl(url.spec(), "", cookie_action); - } - - virtual void OnGetCookiesFromHost(int tab_handle, const GURL& url, - int cookie_id) { - DWORD cookie_size = 0; - bool success = true; - std::string cookie_string; - - int32 cookie_action = COOKIEACTION_READ; - BOOL result = InternetGetCookieA(url.spec().c_str(), NULL, NULL, - &cookie_size); - DWORD error = 0; - if (cookie_size) { - scoped_array<char> cookies(new char[cookie_size + 1]); - if (!InternetGetCookieA(url.spec().c_str(), NULL, cookies.get(), - &cookie_size)) { - success = false; - error = GetLastError(); - NOTREACHED() << "InternetGetCookie failed. Error: " << error; - } else { - cookie_string = cookies.get(); - } - } else { - success = false; - error = GetLastError(); - DLOG(INFO) << "InternetGetCookie failed. Error: " << error; - } - - if (automation_client_->automation_server()) { - automation_client_->automation_server()->Send( - new AutomationMsg_GetCookiesHostResponse(0, tab_handle, success, - url, cookie_string, - cookie_id)); - } - - if (!success && !error) - cookie_action = COOKIEACTION_SUPPRESS; - - url_fetcher_.AddPrivacyDataForUrl(url.spec(), "", cookie_action); - } - virtual void OnAttachExternalTab(int tab_handle, const IPC::AttachExternalTabParams& params) { std::string url; |