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

Unified Diff: content/browser/web_contents/render_view_host_manager.cc

Issue 14267002: Change IsSwappedOut to const and do a more restrictive check. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/web_contents/render_view_host_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/render_view_host_manager.cc
diff --git a/content/browser/web_contents/render_view_host_manager.cc b/content/browser/web_contents/render_view_host_manager.cc
index 3f14460dfde1edcf93baaf9be8ed98558ae8f65a..f551fc612239b1ae76ccd00e33f519c2e0750fb6 100644
--- a/content/browser/web_contents/render_view_host_manager.cc
+++ b/content/browser/web_contents/render_view_host_manager.cc
@@ -975,12 +975,16 @@ void RenderViewHostManager::RenderViewDeleted(RenderViewHost* rvh) {
}
}
-bool RenderViewHostManager::IsSwappedOut(RenderViewHost* rvh) {
+bool RenderViewHostManager::IsSwappedOut(RenderViewHost* rvh) const {
if (!rvh->GetSiteInstance())
return false;
- return swapped_out_hosts_.find(rvh->GetSiteInstance()->GetId()) !=
- swapped_out_hosts_.end();
+ RenderViewHostMap::const_iterator iter = swapped_out_hosts_.find(
Charlie Reis 2013/04/15 21:14:02 Good catch. Can you add a comment here? Somethin
nasko 2013/04/15 21:52:46 Rename sounds like the better option. I like your
+ rvh->GetSiteInstance()->GetId());
+ if (iter == swapped_out_hosts_.end())
+ return false;
+
+ return iter->second == rvh;
}
RenderViewHostImpl* RenderViewHostManager::GetSwappedOutRenderViewHost(
« no previous file with comments | « content/browser/web_contents/render_view_host_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698