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

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: test fix 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 "base/command_line.h"
7 #include "content/browser/bad_message.h" 8 #include "content/browser/bad_message.h"
8 #include "content/browser/child_process_security_policy_impl.h" 9 #include "content/browser/child_process_security_policy_impl.h"
9 #include "content/browser/frame_host/render_frame_host_impl.h" 10 #include "content/browser/frame_host/render_frame_host_impl.h"
10 #include "content/browser/gpu/gpu_data_manager_impl.h" 11 #include "content/browser/gpu/gpu_data_manager_impl.h"
11 #include "content/browser/renderer_host/render_widget_helper.h" 12 #include "content/browser/renderer_host/render_widget_helper.h"
12 #include "content/common/frame_messages.h" 13 #include "content/common/frame_messages.h"
13 #include "content/common/view_messages.h" 14 #include "content/common/view_messages.h"
14 #include "content/public/browser/browser_context.h" 15 #include "content/public/browser/browser_context.h"
15 #include "content/public/browser/browser_thread.h" 16 #include "content/public/browser/browser_thread.h"
16 #include "content/public/common/content_constants.h" 17 #include "content/public/common/content_constants.h"
18 #include "content/public/common/content_switches.h"
17 #include "gpu/GLES2/gl2extchromium.h" 19 #include "gpu/GLES2/gl2extchromium.h"
18 #include "net/cookies/cookie_store.h" 20 #include "net/cookies/cookie_store.h"
19 #include "net/url_request/url_request_context.h" 21 #include "net/url_request/url_request_context.h"
20 #include "net/url_request/url_request_context_getter.h" 22 #include "net/url_request/url_request_context_getter.h"
21 #include "url/gurl.h" 23 #include "url/gurl.h"
22 24
23 #if !defined(OS_MACOSX) 25 #if !defined(OS_MACOSX)
24 #include "third_party/khronos/GLES2/gl2.h" 26 #include "third_party/khronos/GLES2/gl2.h"
25 #include "third_party/khronos/GLES2/gl2ext.h" 27 #include "third_party/khronos/GLES2/gl2ext.h"
26 #endif 28 #endif
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 bad_message::ReceivedBadMessage(this, 337 bad_message::ReceivedBadMessage(this,
336 bad_message::RFMF_SET_COOKIE_BAD_ORIGIN); 338 bad_message::RFMF_SET_COOKIE_BAD_ORIGIN);
337 return; 339 return;
338 } 340 }
339 341
340 net::CookieOptions options; 342 net::CookieOptions options;
341 if (GetContentClient()->browser()->AllowSetCookie( 343 if (GetContentClient()->browser()->AllowSetCookie(
342 url, first_party_for_cookies, cookie, resource_context_, 344 url, first_party_for_cookies, cookie, resource_context_,
343 render_process_id_, render_frame_id, &options)) { 345 render_process_id_, render_frame_id, &options)) {
344 net::URLRequestContext* context = GetRequestContextForURL(url); 346 net::URLRequestContext* context = GetRequestContextForURL(url);
347 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
348 switches::kEnableExperimentalWebPlatformFeatures)) {
349 options.set_enforce_prefixes();
350 }
345 // Pass a null callback since we don't care about when the 'set' completes. 351 // Pass a null callback since we don't care about when the 'set' completes.
346 context->cookie_store()->SetCookieWithOptionsAsync( 352 context->cookie_store()->SetCookieWithOptionsAsync(
347 url, cookie, options, net::CookieStore::SetCookiesCallback()); 353 url, cookie, options, net::CookieStore::SetCookiesCallback());
348 } 354 }
349 } 355 }
350 356
351 void RenderFrameMessageFilter::OnGetCookies(int render_frame_id, 357 void RenderFrameMessageFilter::OnGetCookies(int render_frame_id,
352 const GURL& url, 358 const GURL& url,
353 const GURL& first_party_for_cookies, 359 const GURL& first_party_for_cookies,
354 IPC::Message* reply_msg) { 360 IPC::Message* reply_msg) {
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 net::URLRequestContext* context = 621 net::URLRequestContext* context =
616 GetContentClient()->browser()->OverrideRequestContextForURL( 622 GetContentClient()->browser()->OverrideRequestContextForURL(
617 url, resource_context_); 623 url, resource_context_);
618 if (!context) 624 if (!context)
619 context = request_context_->GetURLRequestContext(); 625 context = request_context_->GetURLRequestContext();
620 626
621 return context; 627 return context;
622 } 628 }
623 629
624 } // namespace content 630 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698