summaryrefslogtreecommitdiffstats
path: root/chrome_frame/urlmon_url_request.cc
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-02 19:13:00 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-02 19:13:00 +0000
commit70daf0b18defd88e97f5f9ebcc9486c22898b66b (patch)
tree71e5c7cd9c7733ecafd589e8be81a67c67b2070a /chrome_frame/urlmon_url_request.cc
parent47b950579d39dc79127c1dc69f44c33c8ad269b0 (diff)
downloadchromium_src-70daf0b18defd88e97f5f9ebcc9486c22898b66b.zip
chromium_src-70daf0b18defd88e97f5f9ebcc9486c22898b66b.tar.gz
chromium_src-70daf0b18defd88e97f5f9ebcc9486c22898b66b.tar.bz2
ChromeFrame should honor the host browser's cookie policy. To achieve this we always read the cookies from
the host browser when the renderer requests them. This also cleans up the mess with the host network stack code parsing cookies from the host looking for persistent cookies. Fixes bug http://code.google.com/p/chromium/issues/detail?id=34151 Bug=34151 Test=Covered by existing host network stack tests and chrome frame cookie tests. Review URL: http://codereview.chromium.org/661290 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40402 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/urlmon_url_request.cc')
-rw-r--r--chrome_frame/urlmon_url_request.cc35
1 files changed, 3 insertions, 32 deletions
diff --git a/chrome_frame/urlmon_url_request.cc b/chrome_frame/urlmon_url_request.cc
index 149c94b..dbb50d6 100644
--- a/chrome_frame/urlmon_url_request.cc
+++ b/chrome_frame/urlmon_url_request.cc
@@ -477,34 +477,6 @@ STDMETHODIMP UrlmonUrlRequest::OnResponse(DWORD dwResponseCode,
}
}
- std::string url_for_persistent_cookies;
- std::string persistent_cookies;
-
- if (status_.was_redirected())
- url_for_persistent_cookies = status_.get_redirection().utf8_url;
-
- if (url_for_persistent_cookies.empty())
- url_for_persistent_cookies = url();
-
- // Grab cookies for the specific Url from WININET.
- {
- DWORD cookie_size = 0; // NOLINT
- std::wstring url = UTF8ToWide(url_for_persistent_cookies);
-
- // Note that there's really no way for us here to distinguish session
- // cookies from persistent cookies here. Session cookies should get
- // filtered out on the chrome side as to not be added again.
- InternetGetCookie(url.c_str(), NULL, NULL, &cookie_size);
- if (cookie_size) {
- scoped_array<wchar_t> cookies(new wchar_t[cookie_size + 1]);
- if (!InternetGetCookie(url.c_str(), NULL, cookies.get(), &cookie_size)) {
- NOTREACHED() << "InternetGetCookie failed. Error: " << GetLastError();
- } else {
- persistent_cookies = WideToUTF8(cookies.get());
- }
- }
- }
-
// Inform the delegate.
headers_received_ = true;
delegate_->OnResponseStarted(id(),
@@ -512,7 +484,6 @@ STDMETHODIMP UrlmonUrlRequest::OnResponse(DWORD dwResponseCode,
raw_headers.c_str(), // headers
0, // size
base::Time(), // last_modified
- persistent_cookies,
status_.get_redirection().utf8_url,
status_.get_redirection().http_code);
return S_OK;
@@ -991,12 +962,12 @@ void UrlmonUrlRequestManager::StopAllWorker() {
void UrlmonUrlRequestManager::OnResponseStarted(int request_id,
const char* mime_type, const char* headers, int size,
- base::Time last_modified, const std::string& peristent_cookies,
- const std::string& redirect_url, int redirect_status) {
+ base::Time last_modified, const std::string& redirect_url,
+ int redirect_status) {
DCHECK_EQ(worker_thread_.thread_id(), PlatformThread::CurrentId());
DCHECK(LookupRequest(request_id).get() != NULL);
delegate_->OnResponseStarted(request_id, mime_type, headers, size,
- last_modified, peristent_cookies, redirect_url, redirect_status);
+ last_modified, redirect_url, redirect_status);
}
void UrlmonUrlRequestManager::OnReadComplete(int request_id, const void* buffer,