Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(533)

Side by Side Diff: content/browser/frame_host/render_frame_message_filter.cc

Issue 1393193005: Implement $Secure- cookie prefix (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add test Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698