OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/tab_contents/render_view_host_manager.h" | 5 #include "content/browser/tab_contents/render_view_host_manager.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "content/browser/debugger/devtools_manager.h" | 9 #include "content/browser/debugger/devtools_manager.h" |
10 #include "content/browser/renderer_host/render_view_host.h" | 10 #include "content/browser/renderer_host/render_view_host.h" |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 render_view_host_->SwapOut(new_render_process_host_id, new_request_id); | 300 render_view_host_->SwapOut(new_render_process_host_id, new_request_id); |
301 | 301 |
302 // ResourceDispatcherHost has told us to run the onunload handler, which | 302 // ResourceDispatcherHost has told us to run the onunload handler, which |
303 // means it is not a download or unsafe page, and we are going to perform the | 303 // means it is not a download or unsafe page, and we are going to perform the |
304 // navigation. Thus, we no longer need to remember that the RenderViewHost | 304 // navigation. Thus, we no longer need to remember that the RenderViewHost |
305 // is part of a pending cross-site request. | 305 // is part of a pending cross-site request. |
306 pending_render_view_host_->SetHasPendingCrossSiteRequest(false, | 306 pending_render_view_host_->SetHasPendingCrossSiteRequest(false, |
307 new_request_id); | 307 new_request_id); |
308 } | 308 } |
309 | 309 |
310 void RenderViewHostManager::OnCrossSiteNavigationCanceled() { | |
311 DCHECK(cross_navigation_pending_); | |
312 cross_navigation_pending_ = false; | |
313 if (pending_render_view_host_) | |
314 CancelPending(); | |
315 } | |
316 | |
317 void RenderViewHostManager::Observe( | 310 void RenderViewHostManager::Observe( |
318 int type, | 311 int type, |
319 const content::NotificationSource& source, | 312 const content::NotificationSource& source, |
320 const content::NotificationDetails& details) { | 313 const content::NotificationDetails& details) { |
321 switch (type) { | 314 switch (type) { |
322 case content::NOTIFICATION_RENDERER_PROCESS_CLOSING: | 315 case content::NOTIFICATION_RENDERER_PROCESS_CLOSING: |
323 RendererProcessClosing( | 316 RendererProcessClosing( |
324 content::Source<content::RenderProcessHost>(source).ptr()); | 317 content::Source<content::RenderProcessHost>(source).ptr()); |
325 break; | 318 break; |
326 | 319 |
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
816 } | 809 } |
817 } | 810 } |
818 | 811 |
819 bool RenderViewHostManager::IsSwappedOut(RenderViewHost* rvh) { | 812 bool RenderViewHostManager::IsSwappedOut(RenderViewHost* rvh) { |
820 if (!rvh->site_instance()) | 813 if (!rvh->site_instance()) |
821 return false; | 814 return false; |
822 | 815 |
823 return swapped_out_hosts_.find(rvh->site_instance()->id()) != | 816 return swapped_out_hosts_.find(rvh->site_instance()->id()) != |
824 swapped_out_hosts_.end(); | 817 swapped_out_hosts_.end(); |
825 } | 818 } |
OLD | NEW |