Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(121)

Side by Side Diff: content/browser/tab_contents/render_view_host_manager.cc

Issue 8549022: Define DevTools content API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments addressed Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_impl.h"
10 #include "content/browser/renderer_host/render_view_host.h" 10 #include "content/browser/renderer_host/render_view_host.h"
11 #include "content/browser/renderer_host/render_view_host_delegate.h" 11 #include "content/browser/renderer_host/render_view_host_delegate.h"
12 #include "content/browser/renderer_host/render_view_host_factory.h" 12 #include "content/browser/renderer_host/render_view_host_factory.h"
13 #include "content/browser/renderer_host/render_widget_host_view.h" 13 #include "content/browser/renderer_host/render_widget_host_view.h"
14 #include "content/browser/site_instance.h" 14 #include "content/browser/site_instance.h"
15 #include "content/browser/tab_contents/navigation_controller.h" 15 #include "content/browser/tab_contents/navigation_controller.h"
16 #include "content/browser/tab_contents/navigation_entry.h" 16 #include "content/browser/tab_contents/navigation_entry.h"
17 #include "content/browser/tab_contents/tab_contents_view.h" 17 #include "content/browser/tab_contents/tab_contents_view.h"
18 #include "content/browser/webui/web_ui.h" 18 #include "content/browser/webui/web_ui.h"
19 #include "content/browser/webui/web_ui_factory.h" 19 #include "content/browser/webui/web_ui_factory.h"
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after
741 // Same SiteInstance can be used. Navigate render_view_host_ if we are not 741 // Same SiteInstance can be used. Navigate render_view_host_ if we are not
742 // cross navigating. 742 // cross navigating.
743 DCHECK(!cross_navigation_pending_); 743 DCHECK(!cross_navigation_pending_);
744 return render_view_host_; 744 return render_view_host_;
745 } 745 }
746 746
747 void RenderViewHostManager::CancelPending() { 747 void RenderViewHostManager::CancelPending() {
748 RenderViewHost* pending_render_view_host = pending_render_view_host_; 748 RenderViewHost* pending_render_view_host = pending_render_view_host_;
749 pending_render_view_host_ = NULL; 749 pending_render_view_host_ = NULL;
750 750
751 DevToolsManager* devtools_manager = DevToolsManager::GetInstance(); 751 content::DevToolsManagerImpl::GetInstance()->OnCancelPendingNavigation(
752 if (devtools_manager) { // NULL in unit tests. 752 pending_render_view_host,
753 devtools_manager->OnCancelPendingNavigation(pending_render_view_host, 753 render_view_host_);
754 render_view_host_);
755 }
756 754
757 // We no longer need to prevent the process from exiting. 755 // We no longer need to prevent the process from exiting.
758 pending_render_view_host->process()->RemovePendingView(); 756 pending_render_view_host->process()->RemovePendingView();
759 757
760 // The pending RVH may already be on the swapped out list if we started to 758 // The pending RVH may already be on the swapped out list if we started to
761 // swap it back in and then canceled. If so, make sure it gets swapped out 759 // swap it back in and then canceled. If so, make sure it gets swapped out
762 // again. If it's not on the swapped out list (e.g., aborting a pending 760 // again. If it's not on the swapped out list (e.g., aborting a pending
763 // load), then it's safe to shut down. 761 // load), then it's safe to shut down.
764 if (IsSwappedOut(pending_render_view_host)) { 762 if (IsSwappedOut(pending_render_view_host)) {
765 // Any currently suspended navigations are no longer needed. 763 // Any currently suspended navigations are no longer needed.
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
804 } 802 }
805 } 803 }
806 804
807 bool RenderViewHostManager::IsSwappedOut(RenderViewHost* rvh) { 805 bool RenderViewHostManager::IsSwappedOut(RenderViewHost* rvh) {
808 if (!rvh->site_instance()) 806 if (!rvh->site_instance())
809 return false; 807 return false;
810 808
811 return swapped_out_hosts_.find(rvh->site_instance()->id()) != 809 return swapped_out_hosts_.find(rvh->site_instance()->id()) !=
812 swapped_out_hosts_.end(); 810 swapped_out_hosts_.end();
813 } 811 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698