Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/presentation/presentation_service_impl.h" | 5 #include "content/browser/presentation/presentation_service_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 570 Reset(); | 570 Reset(); |
| 571 delete this; | 571 delete this; |
| 572 } | 572 } |
| 573 | 573 |
| 574 void PresentationServiceImpl::Reset() { | 574 void PresentationServiceImpl::Reset() { |
| 575 DVLOG(2) << "PresentationServiceImpl::Reset"; | 575 DVLOG(2) << "PresentationServiceImpl::Reset"; |
| 576 | 576 |
| 577 if (auto delegate = GetPresentationServiceDelegate()) | 577 if (auto delegate = GetPresentationServiceDelegate()) |
| 578 delegate->Reset(render_process_id_, render_frame_id_); | 578 delegate->Reset(render_process_id_, render_frame_id_); |
| 579 | 579 |
| 580 if (receiver_delegate_) { | |
|
imcheng
2016/11/28 22:12:00
If the receiver frame is already being destroyed t
zhaobin
2017/02/16 00:42:30
This function is called before destroying Presenta
imcheng
2017/02/24 19:20:33
I see. Note that Reset() also gets called on navig
imcheng
2017/02/24 19:20:33
It feels like we should be able to observe for thi
zhaobin
2017/02/25 01:31:03
Move state change to PresentationDispatcher.
Cont
mark a. foltz
2017/02/25 01:43:12
The offscreen tab should be closed if it attempts
| |
| 581 PresentationSessionInfo dummy_session(GURL("fake_url"), "fake_id", true); | |
| 582 OnConnectionStateChanged(dummy_session, | |
| 583 PresentationConnectionStateChangeInfo( | |
| 584 PRESENTATION_CONNECTION_STATE_TERMINATED)); | |
| 585 } | |
| 586 | |
| 580 default_presentation_urls_.clear(); | 587 default_presentation_urls_.clear(); |
| 581 | 588 |
| 582 screen_availability_listeners_.clear(); | 589 screen_availability_listeners_.clear(); |
| 583 | 590 |
| 584 start_session_request_id_ = kInvalidRequestSessionId; | 591 start_session_request_id_ = kInvalidRequestSessionId; |
| 585 pending_start_session_cb_.reset(); | 592 pending_start_session_cb_.reset(); |
| 586 | 593 |
| 587 pending_join_session_cbs_.clear(); | 594 pending_join_session_cbs_.clear(); |
| 588 | 595 |
| 589 if (on_session_messages_callback_.get()) { | 596 if (on_session_messages_callback_.get()) { |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 657 | 664 |
| 658 void PresentationServiceImpl::NewSessionCallbackWrapper::Run( | 665 void PresentationServiceImpl::NewSessionCallbackWrapper::Run( |
| 659 blink::mojom::PresentationSessionInfoPtr session, | 666 blink::mojom::PresentationSessionInfoPtr session, |
| 660 blink::mojom::PresentationErrorPtr error) { | 667 blink::mojom::PresentationErrorPtr error) { |
| 661 DCHECK(!callback_.is_null()); | 668 DCHECK(!callback_.is_null()); |
| 662 callback_.Run(std::move(session), std::move(error)); | 669 callback_.Run(std::move(session), std::move(error)); |
| 663 callback_.Reset(); | 670 callback_.Reset(); |
| 664 } | 671 } |
| 665 | 672 |
| 666 } // namespace content | 673 } // namespace content |
| OLD | NEW |