OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/frame_host/render_frame_message_filter.h" | 5 #include "content/browser/frame_host/render_frame_message_filter.h" |
6 | 6 |
7 #include "content/browser/bad_message.h" | 7 #include "content/browser/bad_message.h" |
8 #include "content/browser/child_process_security_policy_impl.h" | 8 #include "content/browser/child_process_security_policy_impl.h" |
9 #include "content/browser/frame_host/render_frame_host_impl.h" | 9 #include "content/browser/frame_host/render_frame_host_impl.h" |
10 #include "content/browser/gpu/gpu_data_manager_impl.h" | 10 #include "content/browser/gpu/gpu_data_manager_impl.h" |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 bad_message::ReceivedBadMessage(this, | 335 bad_message::ReceivedBadMessage(this, |
336 bad_message::RFMF_SET_COOKIE_BAD_ORIGIN); | 336 bad_message::RFMF_SET_COOKIE_BAD_ORIGIN); |
337 return; | 337 return; |
338 } | 338 } |
339 | 339 |
340 net::CookieOptions options; | 340 net::CookieOptions options; |
341 if (GetContentClient()->browser()->AllowSetCookie( | 341 if (GetContentClient()->browser()->AllowSetCookie( |
342 url, first_party_for_cookies, cookie, resource_context_, | 342 url, first_party_for_cookies, cookie, resource_context_, |
343 render_process_id_, render_frame_id, &options)) { | 343 render_process_id_, render_frame_id, &options)) { |
344 net::URLRequestContext* context = GetRequestContextForURL(url); | 344 net::URLRequestContext* context = GetRequestContextForURL(url); |
| 345 if (GetContentClient()->browser()->ExperimentalCookieFeaturesEnabled()) |
| 346 options.set_enforce_prefixes(); |
345 // Pass a null callback since we don't care about when the 'set' completes. | 347 // Pass a null callback since we don't care about when the 'set' completes. |
346 context->cookie_store()->SetCookieWithOptionsAsync( | 348 context->cookie_store()->SetCookieWithOptionsAsync( |
347 url, cookie, options, net::CookieStore::SetCookiesCallback()); | 349 url, cookie, options, net::CookieStore::SetCookiesCallback()); |
348 } | 350 } |
349 } | 351 } |
350 | 352 |
351 void RenderFrameMessageFilter::OnGetCookies(int render_frame_id, | 353 void RenderFrameMessageFilter::OnGetCookies(int render_frame_id, |
352 const GURL& url, | 354 const GURL& url, |
353 const GURL& first_party_for_cookies, | 355 const GURL& first_party_for_cookies, |
354 IPC::Message* reply_msg) { | 356 IPC::Message* reply_msg) { |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
615 net::URLRequestContext* context = | 617 net::URLRequestContext* context = |
616 GetContentClient()->browser()->OverrideRequestContextForURL( | 618 GetContentClient()->browser()->OverrideRequestContextForURL( |
617 url, resource_context_); | 619 url, resource_context_); |
618 if (!context) | 620 if (!context) |
619 context = request_context_->GetURLRequestContext(); | 621 context = request_context_->GetURLRequestContext(); |
620 | 622 |
621 return context; | 623 return context; |
622 } | 624 } |
623 | 625 |
624 } // namespace content | 626 } // namespace content |
OLD | NEW |