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

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

Issue 1507743005: [MediaRouter] Renames CloseRoute() to Terminate() and creates DetachRoute() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Forgot a call to DetachRoute! Created 5 years 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 <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 406
407 void PresentationServiceImpl::OnSendMessageCallback(bool sent) { 407 void PresentationServiceImpl::OnSendMessageCallback(bool sent) {
408 // It is possible that Reset() is invoked before receiving this callback. 408 // It is possible that Reset() is invoked before receiving this callback.
409 // So, always check send_message_callback_ for non-null. 409 // So, always check send_message_callback_ for non-null.
410 if (send_message_callback_) { 410 if (send_message_callback_) {
411 send_message_callback_->Run(sent); 411 send_message_callback_->Run(sent);
412 send_message_callback_.reset(); 412 send_message_callback_.reset();
413 } 413 }
414 } 414 }
415 415
416 void PresentationServiceImpl::CloseSession( 416 void PresentationServiceImpl::CloseConnection(
417 const mojo::String& presentation_url, 417 const mojo::String& presentation_url,
418 const mojo::String& presentation_id) { 418 const mojo::String& presentation_id) {
419 DVLOG(2) << "CloseSession " << presentation_id; 419 DVLOG(2) << "CloseConnection " << presentation_id;
420 if (delegate_) 420 if (delegate_)
421 delegate_->CloseSession(render_process_id_, render_frame_id_, 421 delegate_->CloseConnection(render_process_id_, render_frame_id_,
422 presentation_id); 422 presentation_id);
423 } 423 }
424 424
425 void PresentationServiceImpl::TerminateSession( 425 void PresentationServiceImpl::Terminate(const mojo::String& presentation_url,
426 const mojo::String& presentation_url, 426 const mojo::String& presentation_id) {
427 const mojo::String& presentation_id) { 427 DVLOG(2) << "Terminate " << presentation_id;
428 DVLOG(2) << "TerminateSession " << presentation_id;
429 if (delegate_) 428 if (delegate_)
430 delegate_->TerminateSession(render_process_id_, render_frame_id_, 429 delegate_->Terminate(render_process_id_, render_frame_id_, presentation_id);
431 presentation_id);
432 } 430 }
433 431
434 void PresentationServiceImpl::OnConnectionStateChanged( 432 void PresentationServiceImpl::OnConnectionStateChanged(
435 const PresentationSessionInfo& connection, 433 const PresentationSessionInfo& connection,
436 PresentationConnectionState state) { 434 PresentationConnectionState state) {
437 DCHECK(client_.get()); 435 DCHECK(client_.get());
438 client_->OnConnectionStateChanged( 436 client_->OnConnectionStateChanged(
439 presentation::PresentationSessionInfo::From(connection), 437 presentation::PresentationSessionInfo::From(connection),
440 PresentationConnectionStateToMojo(state)); 438 PresentationConnectionStateToMojo(state));
441 } 439 }
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 595
598 void PresentationServiceImpl::NewSessionMojoCallbackWrapper::Run( 596 void PresentationServiceImpl::NewSessionMojoCallbackWrapper::Run(
599 presentation::PresentationSessionInfoPtr session, 597 presentation::PresentationSessionInfoPtr session,
600 presentation::PresentationErrorPtr error) { 598 presentation::PresentationErrorPtr error) {
601 DCHECK(!callback_.is_null()); 599 DCHECK(!callback_.is_null());
602 callback_.Run(session.Pass(), error.Pass()); 600 callback_.Run(session.Pass(), error.Pass());
603 callback_.reset(); 601 callback_.reset();
604 } 602 }
605 603
606 } // namespace content 604 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698