OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 1388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1399 // static | 1399 // static |
1400 RenderProcessHost* RenderProcessHostImpl::GetProcessHostForSite( | 1400 RenderProcessHost* RenderProcessHostImpl::GetProcessHostForSite( |
1401 BrowserContext* browser_context, | 1401 BrowserContext* browser_context, |
1402 const GURL& url) { | 1402 const GURL& url) { |
1403 // Look up the map of site to process for the given browser_context. | 1403 // Look up the map of site to process for the given browser_context. |
1404 SiteProcessMap* map = | 1404 SiteProcessMap* map = |
1405 GetSiteProcessMapForBrowserContext(browser_context); | 1405 GetSiteProcessMapForBrowserContext(browser_context); |
1406 | 1406 |
1407 // See if we have an existing process for this site. If not, the caller | 1407 // See if we have an existing process for this site. If not, the caller |
1408 // should create a new process and register it. | 1408 // should create a new process and register it. |
1409 std::string site = SiteInstanceImpl::GetSiteForURL(browser_context, url) | 1409 std::string site = SiteInstance::GetSiteForURL(browser_context, url) |
1410 .possibly_invalid_spec(); | 1410 .possibly_invalid_spec(); |
1411 return map->FindProcess(site); | 1411 return map->FindProcess(site); |
1412 } | 1412 } |
1413 | 1413 |
1414 void RenderProcessHostImpl::RegisterProcessHostForSite( | 1414 void RenderProcessHostImpl::RegisterProcessHostForSite( |
1415 BrowserContext* browser_context, | 1415 BrowserContext* browser_context, |
1416 RenderProcessHost* process, | 1416 RenderProcessHost* process, |
1417 const GURL& url) { | 1417 const GURL& url) { |
1418 // Look up the map of site to process for the given browser_context. | 1418 // Look up the map of site to process for the given browser_context. |
1419 SiteProcessMap* map = | 1419 SiteProcessMap* map = |
1420 GetSiteProcessMapForBrowserContext(browser_context); | 1420 GetSiteProcessMapForBrowserContext(browser_context); |
1421 | 1421 |
1422 // TODO(creis): Determine if it's better to allow registration of | 1422 // TODO(creis): Determine if it's better to allow registration of |
1423 // empty sites or not. For now, group anything from which we can't parse | 1423 // empty sites or not. For now, group anything from which we can't parse |
1424 // a site into the same process, when using --process-per-site. | 1424 // a site into the same process, when using --process-per-site. |
1425 std::string site = SiteInstanceImpl::GetSiteForURL(browser_context, url) | 1425 std::string site = SiteInstance::GetSiteForURL(browser_context, url) |
1426 .possibly_invalid_spec(); | 1426 .possibly_invalid_spec(); |
1427 map->RegisterProcess(site, process); | 1427 map->RegisterProcess(site, process); |
1428 } | 1428 } |
1429 | 1429 |
1430 void RenderProcessHostImpl::ProcessDied(bool already_dead) { | 1430 void RenderProcessHostImpl::ProcessDied(bool already_dead) { |
1431 // Our child process has died. If we didn't expect it, it's a crash. | 1431 // Our child process has died. If we didn't expect it, it's a crash. |
1432 // In any case, we need to let everyone know it's gone. | 1432 // In any case, we need to let everyone know it's gone. |
1433 // The OnChannelError notification can fire multiple times due to nested sync | 1433 // The OnChannelError notification can fire multiple times due to nested sync |
1434 // calls to a renderer. If we don't have a valid channel here it means we | 1434 // calls to a renderer. If we don't have a valid channel here it means we |
1435 // already handled the error. | 1435 // already handled the error. |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1593 int32 gpu_process_host_id) { | 1593 int32 gpu_process_host_id) { |
1594 TRACE_EVENT0("renderer_host", | 1594 TRACE_EVENT0("renderer_host", |
1595 "RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwappedNoHost"); | 1595 "RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwappedNoHost"); |
1596 RenderWidgetHostImpl::AcknowledgeBufferPresent(route_id, | 1596 RenderWidgetHostImpl::AcknowledgeBufferPresent(route_id, |
1597 gpu_process_host_id, | 1597 gpu_process_host_id, |
1598 false, | 1598 false, |
1599 0); | 1599 0); |
1600 } | 1600 } |
1601 | 1601 |
1602 } // namespace content | 1602 } // namespace content |
OLD | NEW |