| 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/renderer/presentation/presentation_dispatcher.h" | 5 #include "content/renderer/presentation/presentation_dispatcher.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 if (!error.is_null()) { | 379 if (!error.is_null()) { |
| 380 DCHECK(session_info.is_null()); | 380 DCHECK(session_info.is_null()); |
| 381 callback->onError(blink::WebPresentationError( | 381 callback->onError(blink::WebPresentationError( |
| 382 GetWebPresentationErrorTypeFromMojo(error->error_type), | 382 GetWebPresentationErrorTypeFromMojo(error->error_type), |
| 383 blink::WebString::fromUTF8(error->message))); | 383 blink::WebString::fromUTF8(error->message))); |
| 384 return; | 384 return; |
| 385 } | 385 } |
| 386 | 386 |
| 387 DCHECK(!session_info.is_null()); | 387 DCHECK(!session_info.is_null()); |
| 388 presentation_service_->ListenForSessionMessages(session_info.Clone()); | 388 presentation_service_->ListenForSessionMessages(session_info.Clone()); |
| 389 callback->onSuccess(base::WrapUnique( | 389 callback->onSuccess( |
| 390 new PresentationConnectionClient(std::move(session_info)))); | 390 base::MakeUnique<PresentationConnectionClient>(std::move(session_info))); |
| 391 } | 391 } |
| 392 | 392 |
| 393 void PresentationDispatcher::OnConnectionStateChanged( | 393 void PresentationDispatcher::OnConnectionStateChanged( |
| 394 blink::mojom::PresentationSessionInfoPtr connection, | 394 blink::mojom::PresentationSessionInfoPtr connection, |
| 395 blink::mojom::PresentationConnectionState state) { | 395 blink::mojom::PresentationConnectionState state) { |
| 396 if (!controller_) | 396 if (!controller_) |
| 397 return; | 397 return; |
| 398 | 398 |
| 399 DCHECK(!connection.is_null()); | 399 DCHECK(!connection.is_null()); |
| 400 controller_->didChangeSessionState( | 400 controller_->didChangeSessionState( |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 PresentationDispatcher::AvailabilityStatus::AvailabilityStatus( | 527 PresentationDispatcher::AvailabilityStatus::AvailabilityStatus( |
| 528 const std::string& availability_url) | 528 const std::string& availability_url) |
| 529 : url(availability_url), | 529 : url(availability_url), |
| 530 last_known_availability(false), | 530 last_known_availability(false), |
| 531 listening_state(ListeningState::INACTIVE) {} | 531 listening_state(ListeningState::INACTIVE) {} |
| 532 | 532 |
| 533 PresentationDispatcher::AvailabilityStatus::~AvailabilityStatus() { | 533 PresentationDispatcher::AvailabilityStatus::~AvailabilityStatus() { |
| 534 } | 534 } |
| 535 | 535 |
| 536 } // namespace content | 536 } // namespace content |
| OLD | NEW |