| 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 3194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3205 | 3205 |
| 3206 // See if we have an existing process with appropriate bindings for this site. | 3206 // See if we have an existing process with appropriate bindings for this site. |
| 3207 // If not, the caller should create a new process and register it. Note that | 3207 // If not, the caller should create a new process and register it. Note that |
| 3208 // IsSuitableHost expects a site URL rather than the full |url|. | 3208 // IsSuitableHost expects a site URL rather than the full |url|. |
| 3209 GURL site_url = SiteInstance::GetSiteForURL(browser_context, url); | 3209 GURL site_url = SiteInstance::GetSiteForURL(browser_context, url); |
| 3210 RenderProcessHost* host = map->FindProcess(site_url.possibly_invalid_spec()); | 3210 RenderProcessHost* host = map->FindProcess(site_url.possibly_invalid_spec()); |
| 3211 if (host && (!host->MayReuseHost() || | 3211 if (host && (!host->MayReuseHost() || |
| 3212 !IsSuitableHost(host, browser_context, site_url))) { | 3212 !IsSuitableHost(host, browser_context, site_url))) { |
| 3213 // The registered process does not have an appropriate set of bindings for | 3213 // The registered process does not have an appropriate set of bindings for |
| 3214 // the url. Remove it from the map so we can register a better one. | 3214 // the url. Remove it from the map so we can register a better one. |
| 3215 RecordAction( | 3215 base::RecordAction( |
| 3216 base::UserMetricsAction("BindingsMismatch_GetProcessHostPerSite")); | 3216 base::UserMetricsAction("BindingsMismatch_GetProcessHostPerSite")); |
| 3217 map->RemoveProcess(host); | 3217 map->RemoveProcess(host); |
| 3218 host = NULL; | 3218 host = NULL; |
| 3219 } | 3219 } |
| 3220 | 3220 |
| 3221 return host; | 3221 return host; |
| 3222 } | 3222 } |
| 3223 | 3223 |
| 3224 void RenderProcessHostImpl::RegisterProcessHostForSite( | 3224 void RenderProcessHostImpl::RegisterProcessHostForSite( |
| 3225 BrowserContext* browser_context, | 3225 BrowserContext* browser_context, |
| (...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3827 bad_message::ReceivedBadMessage(render_process_id, | 3827 bad_message::ReceivedBadMessage(render_process_id, |
| 3828 bad_message::RPH_MOJO_PROCESS_ERROR); | 3828 bad_message::RPH_MOJO_PROCESS_ERROR); |
| 3829 } | 3829 } |
| 3830 | 3830 |
| 3831 viz::SharedBitmapAllocationNotifierImpl* | 3831 viz::SharedBitmapAllocationNotifierImpl* |
| 3832 RenderProcessHostImpl::GetSharedBitmapAllocationNotifier() { | 3832 RenderProcessHostImpl::GetSharedBitmapAllocationNotifier() { |
| 3833 return &shared_bitmap_allocation_notifier_impl_; | 3833 return &shared_bitmap_allocation_notifier_impl_; |
| 3834 } | 3834 } |
| 3835 | 3835 |
| 3836 } // namespace content | 3836 } // namespace content |
| OLD | NEW |