OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/frame_host/render_frame_host_manager.h" | 5 #include "content/browser/frame_host/render_frame_host_manager.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 // in progress. Sanity check this for http://crbug.com/276333. | 265 // in progress. Sanity check this for http://crbug.com/276333. |
266 CHECK(pending_render_frame_host_); | 266 CHECK(pending_render_frame_host_); |
267 | 267 |
268 // Unload handlers run in the background, so we should never get an | 268 // Unload handlers run in the background, so we should never get an |
269 // unresponsiveness warning for them. | 269 // unresponsiveness warning for them. |
270 CHECK(!render_frame_host_->IsWaitingForUnloadACK()); | 270 CHECK(!render_frame_host_->IsWaitingForUnloadACK()); |
271 | 271 |
272 // If the tab becomes unresponsive during beforeunload while doing a | 272 // If the tab becomes unresponsive during beforeunload while doing a |
273 // cross-site navigation, proceed with the navigation. (This assumes that | 273 // cross-site navigation, proceed with the navigation. (This assumes that |
274 // the pending RenderFrameHost is still responsive.) | 274 // the pending RenderFrameHost is still responsive.) |
275 if (render_frame_host_->is_waiting_for_beforeunload_ack()) { | 275 if (render_frame_host_->IsWaitingForBeforeUnloadACK()) { |
276 // Haven't gotten around to starting the request, because we're still | 276 // Haven't gotten around to starting the request, because we're still |
277 // waiting for the beforeunload handler to finish. We'll pretend that it | 277 // waiting for the beforeunload handler to finish. We'll pretend that it |
278 // did finish, to let the navigation proceed. Note that there's a danger | 278 // did finish, to let the navigation proceed. Note that there's a danger |
279 // that the beforeunload handler will later finish and possibly return | 279 // that the beforeunload handler will later finish and possibly return |
280 // false (meaning the navigation should not proceed), but we'll ignore it | 280 // false (meaning the navigation should not proceed), but we'll ignore it |
281 // in this case because it took too long. | 281 // in this case because it took too long. |
282 if (pending_render_frame_host_->are_navigations_suspended()) { | 282 if (pending_render_frame_host_->are_navigations_suspended()) { |
283 pending_render_frame_host_->SetNavigationsSuspended( | 283 pending_render_frame_host_->SetNavigationsSuspended( |
284 false, base::TimeTicks::Now()); | 284 false, base::TimeTicks::Now()); |
285 } | 285 } |
(...skipping 1421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1707 void RenderFrameHostManager::DeleteRenderFrameProxyHost( | 1707 void RenderFrameHostManager::DeleteRenderFrameProxyHost( |
1708 SiteInstance* instance) { | 1708 SiteInstance* instance) { |
1709 RenderFrameProxyHostMap::iterator iter = proxy_hosts_.find(instance->GetId()); | 1709 RenderFrameProxyHostMap::iterator iter = proxy_hosts_.find(instance->GetId()); |
1710 if (iter != proxy_hosts_.end()) { | 1710 if (iter != proxy_hosts_.end()) { |
1711 delete iter->second; | 1711 delete iter->second; |
1712 proxy_hosts_.erase(iter); | 1712 proxy_hosts_.erase(iter); |
1713 } | 1713 } |
1714 } | 1714 } |
1715 | 1715 |
1716 } // namespace content | 1716 } // namespace content |
OLD | NEW |