Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(461)

Side by Side Diff: content/browser/presentation/presentation_service_impl.cc

Issue 2484273003: [Presentation API] (1-UA) fire PresentationConnection onterminate event if receiver page gets destr… (Closed)
Patch Set: merge with master Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 539 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 Reset(); 550 Reset();
551 delete this; 551 delete this;
552 } 552 }
553 553
554 void PresentationServiceImpl::Reset() { 554 void PresentationServiceImpl::Reset() {
555 DVLOG(2) << "PresentationServiceImpl::Reset"; 555 DVLOG(2) << "PresentationServiceImpl::Reset";
556 556
557 if (auto* delegate = GetPresentationServiceDelegate()) 557 if (auto* delegate = GetPresentationServiceDelegate())
558 delegate->Reset(render_process_id_, render_frame_id_); 558 delegate->Reset(render_process_id_, render_frame_id_);
559 559
560 if (receiver_delegate_) {
561 PresentationSessionInfo dummy_session(GURL("fake_url"), "fake_id");
mark a. foltz 2017/02/25 01:43:12 This is another case where having separate mojoms
zhaobin 2017/02/28 04:25:19 Removed :)
562 OnConnectionStateChanged(dummy_session,
563 PresentationConnectionStateChangeInfo(
564 PRESENTATION_CONNECTION_STATE_TERMINATED));
565 }
566
560 default_presentation_urls_.clear(); 567 default_presentation_urls_.clear();
561 568
562 screen_availability_listeners_.clear(); 569 screen_availability_listeners_.clear();
563 570
564 start_session_request_id_ = kInvalidRequestSessionId; 571 start_session_request_id_ = kInvalidRequestSessionId;
565 pending_start_session_cb_.reset(); 572 pending_start_session_cb_.reset();
566 573
567 pending_join_session_cbs_.clear(); 574 pending_join_session_cbs_.clear();
568 575
569 if (on_connection_messages_callback_.get()) { 576 if (on_connection_messages_callback_.get()) {
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
634 641
635 void PresentationServiceImpl::NewSessionCallbackWrapper::Run( 642 void PresentationServiceImpl::NewSessionCallbackWrapper::Run(
636 const base::Optional<PresentationSessionInfo>& session_info, 643 const base::Optional<PresentationSessionInfo>& session_info,
637 const base::Optional<PresentationError>& error) { 644 const base::Optional<PresentationError>& error) {
638 DCHECK(!callback_.is_null()); 645 DCHECK(!callback_.is_null());
639 callback_.Run(session_info, error); 646 callback_.Run(session_info, error);
640 callback_.Reset(); 647 callback_.Reset();
641 } 648 }
642 649
643 } // namespace content 650 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698