| 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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 blink::WebFrame* frame = render_frame()->GetWebFrame(); | 301 blink::WebFrame* frame = render_frame()->GetWebFrame(); |
| 302 // If not top-level navigation. | 302 // If not top-level navigation. |
| 303 if (frame->parent() || is_same_page_navigation) | 303 if (frame->parent() || is_same_page_navigation) |
| 304 return; | 304 return; |
| 305 | 305 |
| 306 // Remove all pending send message requests. | 306 // Remove all pending send message requests. |
| 307 MessageRequestQueue empty; | 307 MessageRequestQueue empty; |
| 308 std::swap(message_request_queue_, empty); | 308 std::swap(message_request_queue_, empty); |
| 309 } | 309 } |
| 310 | 310 |
| 311 void PresentationDispatcher::OnDestruct() { |
| 312 delete this; |
| 313 } |
| 314 |
| 311 void PresentationDispatcher::OnScreenAvailabilityUpdated( | 315 void PresentationDispatcher::OnScreenAvailabilityUpdated( |
| 312 const mojo::String& url, bool available) { | 316 const mojo::String& url, bool available) { |
| 313 const std::string& availability_url = url.get(); | 317 const std::string& availability_url = url.get(); |
| 314 auto status_it = availability_status_.find(availability_url); | 318 auto status_it = availability_status_.find(availability_url); |
| 315 if (status_it == availability_status_.end()) | 319 if (status_it == availability_status_.end()) |
| 316 return; | 320 return; |
| 317 AvailabilityStatus* status = status_it->second.get(); | 321 AvailabilityStatus* status = status_it->second.get(); |
| 318 DCHECK(status); | 322 DCHECK(status); |
| 319 | 323 |
| 320 if (status->listening_state == ListeningState::WAITING) | 324 if (status->listening_state == ListeningState::WAITING) |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 PresentationDispatcher::AvailabilityStatus::AvailabilityStatus( | 528 PresentationDispatcher::AvailabilityStatus::AvailabilityStatus( |
| 525 const std::string& availability_url) | 529 const std::string& availability_url) |
| 526 : url(availability_url), | 530 : url(availability_url), |
| 527 last_known_availability(false), | 531 last_known_availability(false), |
| 528 listening_state(ListeningState::INACTIVE) {} | 532 listening_state(ListeningState::INACTIVE) {} |
| 529 | 533 |
| 530 PresentationDispatcher::AvailabilityStatus::~AvailabilityStatus() { | 534 PresentationDispatcher::AvailabilityStatus::~AvailabilityStatus() { |
| 531 } | 535 } |
| 532 | 536 |
| 533 } // namespace content | 537 } // namespace content |
| OLD | NEW |