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" | 7 #include "base/command_line.h" |
| 8 #include "base/debug/crash_logging.h" |
| 9 #include "base/debug/dump_without_crashing.h" |
8 #include "base/macros.h" | 10 #include "base/macros.h" |
9 #include "base/metrics/field_trial.h" | 11 #include "base/metrics/field_trial.h" |
10 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
11 #include "build/build_config.h" | 13 #include "build/build_config.h" |
12 #include "content/browser/bad_message.h" | 14 #include "content/browser/bad_message.h" |
13 #include "content/browser/child_process_security_policy_impl.h" | 15 #include "content/browser/child_process_security_policy_impl.h" |
14 #include "content/browser/frame_host/render_frame_host_impl.h" | 16 #include "content/browser/frame_host/render_frame_host_impl.h" |
15 #include "content/browser/gpu/gpu_data_manager_impl.h" | 17 #include "content/browser/gpu/gpu_data_manager_impl.h" |
16 #include "content/browser/renderer_host/render_widget_helper.h" | 18 #include "content/browser/renderer_host/render_widget_helper.h" |
17 #include "content/common/frame_messages.h" | 19 #include "content/common/frame_messages.h" |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 params.frame_owner_properties, *new_routing_id)); | 342 params.frame_owner_properties, *new_routing_id)); |
341 } | 343 } |
342 | 344 |
343 void RenderFrameMessageFilter::OnSetCookie(int render_frame_id, | 345 void RenderFrameMessageFilter::OnSetCookie(int render_frame_id, |
344 const GURL& url, | 346 const GURL& url, |
345 const GURL& first_party_for_cookies, | 347 const GURL& first_party_for_cookies, |
346 const std::string& cookie) { | 348 const std::string& cookie) { |
347 ChildProcessSecurityPolicyImpl* policy = | 349 ChildProcessSecurityPolicyImpl* policy = |
348 ChildProcessSecurityPolicyImpl::GetInstance(); | 350 ChildProcessSecurityPolicyImpl::GetInstance(); |
349 if (!policy->CanAccessDataForOrigin(render_process_id_, url)) { | 351 if (!policy->CanAccessDataForOrigin(render_process_id_, url)) { |
| 352 { |
| 353 // TODO(nick): Remove this once we understand http://crbug.com/600441 |
| 354 auto origin_lock = policy->GetOriginLockCrashKey(render_process_id_); |
| 355 base::debug::ScopedCrashKey("setcookies_url", url.spec()); |
| 356 base::debug::ScopedCrashKey("setcookies_first_party", |
| 357 first_party_for_cookies.spec()); |
| 358 base::debug::DumpWithoutCrashing(); |
| 359 } |
| 360 |
350 bad_message::ReceivedBadMessage(this, | 361 bad_message::ReceivedBadMessage(this, |
351 bad_message::RFMF_SET_COOKIE_BAD_ORIGIN); | 362 bad_message::RFMF_SET_COOKIE_BAD_ORIGIN); |
352 return; | 363 return; |
353 } | 364 } |
354 | 365 |
355 net::CookieOptions options; | 366 net::CookieOptions options; |
356 bool experimental_web_platform_features_enabled = | 367 bool experimental_web_platform_features_enabled = |
357 base::CommandLine::ForCurrentProcess()->HasSwitch( | 368 base::CommandLine::ForCurrentProcess()->HasSwitch( |
358 switches::kEnableExperimentalWebPlatformFeatures); | 369 switches::kEnableExperimentalWebPlatformFeatures); |
359 const std::string enforce_strict_secure_group = | 370 const std::string enforce_strict_secure_group = |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
660 net::URLRequestContext* context = | 671 net::URLRequestContext* context = |
661 GetContentClient()->browser()->OverrideRequestContextForURL( | 672 GetContentClient()->browser()->OverrideRequestContextForURL( |
662 url, resource_context_); | 673 url, resource_context_); |
663 if (!context) | 674 if (!context) |
664 context = request_context_->GetURLRequestContext(); | 675 context = request_context_->GetURLRequestContext(); |
665 | 676 |
666 return context; | 677 return context; |
667 } | 678 } |
668 | 679 |
669 } // namespace content | 680 } // namespace content |
OLD | NEW |