OLD | NEW |
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 2085 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2096 | 2096 |
2097 // Look up the map of site to process for the given browser_context, | 2097 // Look up the map of site to process for the given browser_context, |
2098 // in case we need to remove this process from it. It will be registered | 2098 // in case we need to remove this process from it. It will be registered |
2099 // under any sites it rendered that use process-per-site mode. | 2099 // under any sites it rendered that use process-per-site mode. |
2100 SiteProcessMap* map = | 2100 SiteProcessMap* map = |
2101 GetSiteProcessMapForBrowserContext(host->GetBrowserContext()); | 2101 GetSiteProcessMapForBrowserContext(host->GetBrowserContext()); |
2102 map->RemoveProcess(host); | 2102 map->RemoveProcess(host); |
2103 } | 2103 } |
2104 | 2104 |
2105 // static | 2105 // static |
| 2106 bool RenderProcessHostImpl::HasAnyConnection() { |
| 2107 iterator iter(AllHostsIterator()); |
| 2108 while (!iter.IsAtEnd()) { |
| 2109 if (iter.GetCurrentValue()->HasConnection()) |
| 2110 return true; |
| 2111 } |
| 2112 return false; |
| 2113 } |
| 2114 |
| 2115 // static |
2106 void RenderProcessHostImpl::FilterURL(RenderProcessHost* rph, | 2116 void RenderProcessHostImpl::FilterURL(RenderProcessHost* rph, |
2107 bool empty_allowed, | 2117 bool empty_allowed, |
2108 GURL* url) { | 2118 GURL* url) { |
2109 ChildProcessSecurityPolicyImpl* policy = | 2119 ChildProcessSecurityPolicyImpl* policy = |
2110 ChildProcessSecurityPolicyImpl::GetInstance(); | 2120 ChildProcessSecurityPolicyImpl::GetInstance(); |
2111 | 2121 |
2112 if (empty_allowed && url->is_empty()) | 2122 if (empty_allowed && url->is_empty()) |
2113 return; | 2123 return; |
2114 | 2124 |
2115 if (!url->is_valid()) { | 2125 if (!url->is_valid()) { |
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2763 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; | 2773 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; |
2764 | 2774 |
2765 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias | 2775 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias |
2766 // enough information here so that we can determine what the bad message was. | 2776 // enough information here so that we can determine what the bad message was. |
2767 base::debug::Alias(&error); | 2777 base::debug::Alias(&error); |
2768 bad_message::ReceivedBadMessage(process.get(), | 2778 bad_message::ReceivedBadMessage(process.get(), |
2769 bad_message::RPH_MOJO_PROCESS_ERROR); | 2779 bad_message::RPH_MOJO_PROCESS_ERROR); |
2770 } | 2780 } |
2771 | 2781 |
2772 } // namespace content | 2782 } // namespace content |
OLD | NEW |