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

Side by Side Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 2133813002: Check that all RenderProcessHost(s) are terminated. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added more specific checks Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 // Represents the browser side of the browser <--> renderer communication 5 // Represents the browser side of the browser <--> renderer communication
6 // channel. There will be one RenderProcessHost per renderer process. 6 // channel. There will be one RenderProcessHost per renderer process.
7 7
8 #include "content/browser/renderer_host/render_process_host_impl.h" 8 #include "content/browser/renderer_host/render_process_host_impl.h"
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 2090 matching lines...) Expand 10 before | Expand all | Expand 10 after
2101 2101
2102 // Look up the map of site to process for the given browser_context, 2102 // Look up the map of site to process for the given browser_context,
2103 // in case we need to remove this process from it. It will be registered 2103 // in case we need to remove this process from it. It will be registered
2104 // under any sites it rendered that use process-per-site mode. 2104 // under any sites it rendered that use process-per-site mode.
2105 SiteProcessMap* map = 2105 SiteProcessMap* map =
2106 GetSiteProcessMapForBrowserContext(host->GetBrowserContext()); 2106 GetSiteProcessMapForBrowserContext(host->GetBrowserContext());
2107 map->RemoveProcess(host); 2107 map->RemoveProcess(host);
2108 } 2108 }
2109 2109
2110 // static 2110 // static
2111 void RenderProcessHostImpl::CheckAllTerminated() {
2112 iterator iter(AllHostsIterator());
2113 while (!iter.IsAtEnd()) {
2114 // The leftover hosts must have reset IPC channel and getting deleted soon.
2115 RenderProcessHostImpl* host =
2116 static_cast<RenderProcessHostImpl*>(iter.GetCurrentValue());
2117 CHECK(host->listeners_.IsEmpty());
2118 CHECK_EQ(0, host->worker_ref_count_);
2119 CHECK(!host->channel_);
2120 CHECK(host->deleting_soon_);
2121 }
2122 }
2123
2124 // static
2111 void RenderProcessHostImpl::FilterURL(RenderProcessHost* rph, 2125 void RenderProcessHostImpl::FilterURL(RenderProcessHost* rph,
2112 bool empty_allowed, 2126 bool empty_allowed,
2113 GURL* url) { 2127 GURL* url) {
2114 ChildProcessSecurityPolicyImpl* policy = 2128 ChildProcessSecurityPolicyImpl* policy =
2115 ChildProcessSecurityPolicyImpl::GetInstance(); 2129 ChildProcessSecurityPolicyImpl::GetInstance();
2116 2130
2117 if (empty_allowed && url->is_empty()) 2131 if (empty_allowed && url->is_empty())
2118 return; 2132 return;
2119 2133
2120 if (!url->is_valid()) { 2134 if (!url->is_valid()) {
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after
2764 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; 2778 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error;
2765 2779
2766 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias 2780 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias
2767 // enough information here so that we can determine what the bad message was. 2781 // enough information here so that we can determine what the bad message was.
2768 base::debug::Alias(&error); 2782 base::debug::Alias(&error);
2769 bad_message::ReceivedBadMessage(process.get(), 2783 bad_message::ReceivedBadMessage(process.get(),
2770 bad_message::RPH_MOJO_PROCESS_ERROR); 2784 bad_message::RPH_MOJO_PROCESS_ERROR);
2771 } 2785 }
2772 2786
2773 } // namespace content 2787 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698