| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/renderer_host/render_view_host_impl.h" | 5 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 Navigate(params); | 354 Navigate(params); |
| 355 } | 355 } |
| 356 | 356 |
| 357 void RenderViewHostImpl::SetNavigationsSuspended( | 357 void RenderViewHostImpl::SetNavigationsSuspended( |
| 358 bool suspend, | 358 bool suspend, |
| 359 const base::TimeTicks& proceed_time) { | 359 const base::TimeTicks& proceed_time) { |
| 360 // This should only be called to toggle the state. | 360 // This should only be called to toggle the state. |
| 361 DCHECK(navigations_suspended_ != suspend); | 361 DCHECK(navigations_suspended_ != suspend); |
| 362 | 362 |
| 363 navigations_suspended_ = suspend; | 363 navigations_suspended_ = suspend; |
| 364 if (!suspend && suspended_nav_params_.get()) { | 364 if (!suspend && suspended_nav_params_) { |
| 365 // There's navigation message params waiting to be sent. Now that we're not | 365 // There's navigation message params waiting to be sent. Now that we're not |
| 366 // suspended anymore, resume navigation by sending them. If we were swapped | 366 // suspended anymore, resume navigation by sending them. If we were swapped |
| 367 // out, we should also stop filtering out the IPC messages now. | 367 // out, we should also stop filtering out the IPC messages now. |
| 368 SetSwappedOut(false); | 368 SetSwappedOut(false); |
| 369 | 369 |
| 370 DCHECK(!proceed_time.is_null()); | 370 DCHECK(!proceed_time.is_null()); |
| 371 suspended_nav_params_->browser_navigation_start = proceed_time; | 371 suspended_nav_params_->browser_navigation_start = proceed_time; |
| 372 Send(new ViewMsg_Navigate(GetRoutingID(), *suspended_nav_params_.get())); | 372 Send(new ViewMsg_Navigate(GetRoutingID(), *suspended_nav_params_.get())); |
| 373 suspended_nav_params_.reset(); | 373 suspended_nav_params_.reset(); |
| 374 } | 374 } |
| 375 } | 375 } |
| 376 | 376 |
| 377 void RenderViewHostImpl::CancelSuspendedNavigations() { | 377 void RenderViewHostImpl::CancelSuspendedNavigations() { |
| 378 // Clear any state if a pending navigation is canceled or pre-empted. | 378 // Clear any state if a pending navigation is canceled or pre-empted. |
| 379 if (suspended_nav_params_.get()) | 379 if (suspended_nav_params_) |
| 380 suspended_nav_params_.reset(); | 380 suspended_nav_params_.reset(); |
| 381 navigations_suspended_ = false; | 381 navigations_suspended_ = false; |
| 382 } | 382 } |
| 383 | 383 |
| 384 void RenderViewHostImpl::FirePageBeforeUnload(bool for_cross_site_transition) { | 384 void RenderViewHostImpl::FirePageBeforeUnload(bool for_cross_site_transition) { |
| 385 if (!IsRenderViewLive()) { | 385 if (!IsRenderViewLive()) { |
| 386 // This RenderViewHostImpl doesn't have a live renderer, so just | 386 // This RenderViewHostImpl doesn't have a live renderer, so just |
| 387 // skip running the onbeforeunload handler. | 387 // skip running the onbeforeunload handler. |
| 388 is_waiting_for_beforeunload_ack_ = true; // Checked by OnShouldCloseACK. | 388 is_waiting_for_beforeunload_ack_ = true; // Checked by OnShouldCloseACK. |
| 389 unload_ack_is_for_cross_site_transition_ = for_cross_site_transition; | 389 unload_ack_is_for_cross_site_transition_ = for_cross_site_transition; |
| (...skipping 1672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2062 is_waiting_for_beforeunload_ack_ = false; | 2062 is_waiting_for_beforeunload_ack_ = false; |
| 2063 is_waiting_for_unload_ack_ = false; | 2063 is_waiting_for_unload_ack_ = false; |
| 2064 has_timed_out_on_unload_ = false; | 2064 has_timed_out_on_unload_ = false; |
| 2065 } | 2065 } |
| 2066 | 2066 |
| 2067 void RenderViewHostImpl::ClearPowerSaveBlockers() { | 2067 void RenderViewHostImpl::ClearPowerSaveBlockers() { |
| 2068 STLDeleteValues(&power_save_blockers_); | 2068 STLDeleteValues(&power_save_blockers_); |
| 2069 } | 2069 } |
| 2070 | 2070 |
| 2071 } // namespace content | 2071 } // namespace content |
| OLD | NEW |