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