| 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 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 3528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3539 blink::WebLocalFrame* frame, | 3539 blink::WebLocalFrame* frame, |
| 3540 unsigned identifier, | 3540 unsigned identifier, |
| 3541 blink::WebURLRequest& request, | 3541 blink::WebURLRequest& request, |
| 3542 const blink::WebURLResponse& redirect_response) { | 3542 const blink::WebURLResponse& redirect_response) { |
| 3543 DCHECK(!frame_ || frame_ == frame); | 3543 DCHECK(!frame_ || frame_ == frame); |
| 3544 // The request my be empty during tests. | 3544 // The request my be empty during tests. |
| 3545 if (request.url().isEmpty()) | 3545 if (request.url().isEmpty()) |
| 3546 return; | 3546 return; |
| 3547 | 3547 |
| 3548 // Set the first party for cookies url if it has not been set yet (new | 3548 // Set the first party for cookies url if it has not been set yet (new |
| 3549 // requests). For redirects, it is updated by WebURLLoaderImpl. | 3549 // requests). This value will be updated during redirects, consistent with |
| 3550 // https://tools.ietf.org/html/draft-west-first-party-cookies-04#section-2.1.1 |
| 3550 if (request.firstPartyForCookies().isEmpty()) { | 3551 if (request.firstPartyForCookies().isEmpty()) { |
| 3551 if (request.frameType() == blink::WebURLRequest::FrameTypeTopLevel) { | 3552 if (request.frameType() == blink::WebURLRequest::FrameTypeTopLevel) { |
| 3552 request.setFirstPartyForCookies(request.url()); | 3553 request.setFirstPartyForCookies(request.url()); |
| 3553 } else { | 3554 } else { |
| 3554 // TODO(nasko): When the top-level frame is remote, there is no document. | 3555 // TODO(nasko): When the top-level frame is remote, there is no document. |
| 3555 // This is broken and should be fixed to propagate the first party. | 3556 // This is broken and should be fixed to propagate the first party. |
| 3556 WebFrame* top = frame->top(); | 3557 WebFrame* top = frame->top(); |
| 3557 if (top->isWebLocalFrame()) { | 3558 if (top->isWebLocalFrame()) { |
| 3558 request.setFirstPartyForCookies( | 3559 request.setFirstPartyForCookies( |
| 3559 frame->top()->document().firstPartyForCookies()); | 3560 frame->top()->document().firstPartyForCookies()); |
| 3560 } | 3561 } |
| 3561 } | 3562 } |
| 3563 |
| 3564 // If we need to set the first party, then we need to set the request's |
| 3565 // initiator as well; it will not be updated during redirects. |
| 3566 request.setRequestorOrigin(frame->document().securityOrigin()); |
| 3562 } | 3567 } |
| 3563 | 3568 |
| 3564 WebDataSource* provisional_data_source = frame->provisionalDataSource(); | 3569 WebDataSource* provisional_data_source = frame->provisionalDataSource(); |
| 3565 WebDataSource* data_source = | 3570 WebDataSource* data_source = |
| 3566 provisional_data_source ? provisional_data_source : frame->dataSource(); | 3571 provisional_data_source ? provisional_data_source : frame->dataSource(); |
| 3567 | 3572 |
| 3568 DocumentState* document_state = DocumentState::FromDataSource(data_source); | 3573 DocumentState* document_state = DocumentState::FromDataSource(data_source); |
| 3569 DCHECK(document_state); | 3574 DCHECK(document_state); |
| 3570 InternalDocumentStateData* internal_data = | 3575 InternalDocumentStateData* internal_data = |
| 3571 InternalDocumentStateData::FromDocumentState(document_state); | 3576 InternalDocumentStateData::FromDocumentState(document_state); |
| (...skipping 2117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5689 media::ConvertToSwitchOutputDeviceCB(web_callbacks); | 5694 media::ConvertToSwitchOutputDeviceCB(web_callbacks); |
| 5690 scoped_refptr<media::AudioOutputDevice> device = | 5695 scoped_refptr<media::AudioOutputDevice> device = |
| 5691 AudioDeviceFactory::NewOutputDevice(routing_id_, 0, sink_id.utf8(), | 5696 AudioDeviceFactory::NewOutputDevice(routing_id_, 0, sink_id.utf8(), |
| 5692 security_origin); | 5697 security_origin); |
| 5693 media::OutputDeviceStatus status = device->GetDeviceStatus(); | 5698 media::OutputDeviceStatus status = device->GetDeviceStatus(); |
| 5694 device->Stop(); | 5699 device->Stop(); |
| 5695 callback.Run(status); | 5700 callback.Run(status); |
| 5696 } | 5701 } |
| 5697 | 5702 |
| 5698 } // namespace content | 5703 } // namespace content |
| OLD | NEW |