| 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 <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 if (!message_request_queue_.empty()) { | 203 if (!message_request_queue_.empty()) { |
| 204 DoSendMessage(message_request_queue_.front().get()); | 204 DoSendMessage(message_request_queue_.front().get()); |
| 205 } | 205 } |
| 206 } | 206 } |
| 207 | 207 |
| 208 void PresentationDispatcher::closeSession( | 208 void PresentationDispatcher::closeSession( |
| 209 const blink::WebString& presentationUrl, | 209 const blink::WebString& presentationUrl, |
| 210 const blink::WebString& presentationId) { | 210 const blink::WebString& presentationId) { |
| 211 ConnectToPresentationServiceIfNeeded(); | 211 ConnectToPresentationServiceIfNeeded(); |
| 212 | 212 |
| 213 presentation_service_->CloseSession( | 213 presentation_service_->CloseConnection(presentationUrl.utf8(), |
| 214 presentationUrl.utf8(), | 214 presentationId.utf8()); |
| 215 presentationId.utf8()); | |
| 216 } | 215 } |
| 217 | 216 |
| 218 void PresentationDispatcher::terminateSession( | 217 void PresentationDispatcher::terminateSession( |
| 219 const blink::WebString& presentationUrl, | 218 const blink::WebString& presentationUrl, |
| 220 const blink::WebString& presentationId) { | 219 const blink::WebString& presentationId) { |
| 221 ConnectToPresentationServiceIfNeeded(); | 220 ConnectToPresentationServiceIfNeeded(); |
| 222 | 221 |
| 223 presentation_service_->TerminateSession( | 222 presentation_service_->Terminate(presentationUrl.utf8(), |
| 224 presentationUrl.utf8(), | 223 presentationId.utf8()); |
| 225 presentationId.utf8()); | |
| 226 } | 224 } |
| 227 | 225 |
| 228 void PresentationDispatcher::getAvailability( | 226 void PresentationDispatcher::getAvailability( |
| 229 const blink::WebString& availabilityUrl, | 227 const blink::WebString& availabilityUrl, |
| 230 blink::WebPresentationAvailabilityCallbacks* callbacks) { | 228 blink::WebPresentationAvailabilityCallbacks* callbacks) { |
| 231 const std::string& availability_url = availabilityUrl.utf8(); | 229 const std::string& availability_url = availabilityUrl.utf8(); |
| 232 AvailabilityStatus* status = nullptr; | 230 AvailabilityStatus* status = nullptr; |
| 233 auto status_it = availability_status_.find(availability_url); | 231 auto status_it = availability_status_.find(availability_url); |
| 234 if (status_it == availability_status_.end()) { | 232 if (status_it == availability_status_.end()) { |
| 235 status = new AvailabilityStatus(availability_url); | 233 status = new AvailabilityStatus(availability_url); |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 PresentationDispatcher::AvailabilityStatus::AvailabilityStatus( | 498 PresentationDispatcher::AvailabilityStatus::AvailabilityStatus( |
| 501 const std::string& availability_url) | 499 const std::string& availability_url) |
| 502 : url(availability_url), | 500 : url(availability_url), |
| 503 last_known_availability(false), | 501 last_known_availability(false), |
| 504 listening_state(ListeningState::INACTIVE) {} | 502 listening_state(ListeningState::INACTIVE) {} |
| 505 | 503 |
| 506 PresentationDispatcher::AvailabilityStatus::~AvailabilityStatus() { | 504 PresentationDispatcher::AvailabilityStatus::~AvailabilityStatus() { |
| 507 } | 505 } |
| 508 | 506 |
| 509 } // namespace content | 507 } // namespace content |
| OLD | NEW |