Chromium Code Reviews| Index: content/browser/frame_host/render_frame_message_filter.cc |
| diff --git a/content/browser/frame_host/render_frame_message_filter.cc b/content/browser/frame_host/render_frame_message_filter.cc |
| index 21a811a85a908f35bf29fc5a07096680dff3fc47..d0c7cdae8f039e9f7b0f635c65aae3f664f9997f 100644 |
| --- a/content/browser/frame_host/render_frame_message_filter.cc |
| +++ b/content/browser/frame_host/render_frame_message_filter.cc |
| @@ -21,6 +21,7 @@ |
| #include "content/public/common/content_constants.h" |
| #include "content/public/common/content_switches.h" |
| #include "gpu/GLES2/gl2extchromium.h" |
| +#include "net/cookies/cookie_options.h" |
| #include "net/cookies/cookie_store.h" |
| #include "net/url_request/url_request_context.h" |
| #include "net/url_request/url_request_context_getter.h" |
| @@ -393,10 +394,15 @@ void RenderFrameMessageFilter::OnGetCookies(int render_frame_id, |
| base::debug::Alias(url_buf); |
| net::URLRequestContext* context = GetRequestContextForURL(url); |
| - context->cookie_store()->GetAllCookiesForURLAsync( |
| - url, base::Bind(&RenderFrameMessageFilter::CheckPolicyForCookies, this, |
| - render_frame_id, url, first_party_for_cookies, |
| - reply_msg)); |
| + |
| + // We're going to give these cookies back to the renderer to expose via |
| + // 'document.cookie', so do not include http-only cookies. |
|
mmenke
2016/02/19 17:34:42
nit: Avoid "we" in comments.
Mike West
2016/02/22 10:06:15
Done.
|
| + net::CookieOptions options; |
| + options.set_include_same_site(); |
| + context->cookie_store()->GetCookieListWithOptionsAsync( |
| + url, options, |
| + base::Bind(&RenderFrameMessageFilter::CheckPolicyForCookies, this, |
| + render_frame_id, url, first_party_for_cookies, reply_msg)); |
| } |
| void RenderFrameMessageFilter::OnCookiesEnabled( |
| @@ -425,11 +431,8 @@ void RenderFrameMessageFilter::CheckPolicyForCookies( |
| GetContentClient()->browser()->AllowGetCookie( |
| url, first_party_for_cookies, cookie_list, resource_context_, |
| render_process_id_, render_frame_id)) { |
| - // Gets the cookies from cookie store if allowed. |
| - context->cookie_store()->GetCookiesWithOptionsAsync( |
| - url, net::CookieOptions(), |
| - base::Bind(&RenderFrameMessageFilter::SendGetCookiesResponse, |
| - this, reply_msg)); |
| + SendGetCookiesResponse(reply_msg, |
| + net::CookieStore::BuildCookieLine(cookie_list)); |
| } else { |
| SendGetCookiesResponse(reply_msg, std::string()); |
| } |