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/renderer/render_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 2335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2346 void RenderFrameImpl::willSendRequest( | 2346 void RenderFrameImpl::willSendRequest( |
2347 blink::WebLocalFrame* frame, | 2347 blink::WebLocalFrame* frame, |
2348 unsigned identifier, | 2348 unsigned identifier, |
2349 blink::WebURLRequest& request, | 2349 blink::WebURLRequest& request, |
2350 const blink::WebURLResponse& redirect_response) { | 2350 const blink::WebURLResponse& redirect_response) { |
2351 DCHECK(!frame_ || frame_ == frame); | 2351 DCHECK(!frame_ || frame_ == frame); |
2352 // The request my be empty during tests. | 2352 // The request my be empty during tests. |
2353 if (request.url().isEmpty()) | 2353 if (request.url().isEmpty()) |
2354 return; | 2354 return; |
2355 | 2355 |
| 2356 // Set the first party for cookies url if it has not been set yet (new |
| 2357 // requests). For redirects, it is updated by WebURLLoaderImpl. |
| 2358 if (request.firstPartyForCookies().isEmpty()) { |
| 2359 if (request.targetType() == blink::WebURLRequest::TargetIsMainFrame) { |
| 2360 request.setFirstPartyForCookies(request.url()); |
| 2361 } else { |
| 2362 request.setFirstPartyForCookies( |
| 2363 frame->top()->document().firstPartyForCookies()); |
| 2364 } |
| 2365 } |
| 2366 |
2356 WebFrame* top_frame = frame->top(); | 2367 WebFrame* top_frame = frame->top(); |
2357 if (!top_frame) | 2368 if (!top_frame) |
2358 top_frame = frame; | 2369 top_frame = frame; |
2359 WebDataSource* provisional_data_source = top_frame->provisionalDataSource(); | 2370 WebDataSource* provisional_data_source = top_frame->provisionalDataSource(); |
2360 WebDataSource* top_data_source = top_frame->dataSource(); | 2371 WebDataSource* top_data_source = top_frame->dataSource(); |
2361 WebDataSource* data_source = | 2372 WebDataSource* data_source = |
2362 provisional_data_source ? provisional_data_source : top_data_source; | 2373 provisional_data_source ? provisional_data_source : top_data_source; |
2363 | 2374 |
2364 PageTransition transition_type = PAGE_TRANSITION_LINK; | 2375 PageTransition transition_type = PAGE_TRANSITION_LINK; |
2365 DocumentState* document_state = DocumentState::FromDataSource(data_source); | 2376 DocumentState* document_state = DocumentState::FromDataSource(data_source); |
(...skipping 1177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3543 | 3554 |
3544 RendererCdmManager* RenderFrameImpl::GetCdmManager() { | 3555 RendererCdmManager* RenderFrameImpl::GetCdmManager() { |
3545 if (!cdm_manager_) | 3556 if (!cdm_manager_) |
3546 cdm_manager_ = new RendererCdmManager(this); | 3557 cdm_manager_ = new RendererCdmManager(this); |
3547 return cdm_manager_; | 3558 return cdm_manager_; |
3548 } | 3559 } |
3549 | 3560 |
3550 #endif // defined(OS_ANDROID) | 3561 #endif // defined(OS_ANDROID) |
3551 | 3562 |
3552 } // namespace content | 3563 } // namespace content |
OLD | NEW |