mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Update to Chromium revision 208345.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1313 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@@ -424,25 +424,12 @@ CefRefPtr<CefBrowserHostImpl> CefBrowserHostImpl::GetBrowserByChildID(
|
||||
int render_process_id) {
|
||||
if (CEF_CURRENTLY_ON_UIT()) {
|
||||
// Use the non-thread-safe but potentially faster approach.
|
||||
content::RenderProcessHost* render_process_host =
|
||||
content::RenderProcessHost::FromID(render_process_id);
|
||||
if (!render_process_host)
|
||||
return NULL;
|
||||
|
||||
content::RenderProcessHost::RenderWidgetHostsIterator iter(
|
||||
render_process_host->GetRenderWidgetHostsIterator());
|
||||
if (!iter.IsAtEnd()) {
|
||||
const content::RenderWidgetHost* widget = iter.GetCurrentValue();
|
||||
|
||||
// This implementation is based on an assumption that each process hosts a
|
||||
// single renderer. Revisit this implementation if the assumption proves
|
||||
// false.
|
||||
iter.Advance();
|
||||
DCHECK(iter.IsAtEnd());
|
||||
|
||||
if (widget && widget->IsRenderView()) {
|
||||
return GetBrowserForHost(content::RenderViewHost::From(
|
||||
const_cast<content::RenderWidgetHost*>(widget)));
|
||||
content::RenderWidgetHost::List widgets =
|
||||
content::RenderWidgetHost::GetRenderWidgetHosts();
|
||||
for (size_t i = 0; i < widgets.size(); ++i) {
|
||||
if (widgets[i]->GetProcess()->GetID() == render_process_id &&
|
||||
widgets[i]->IsRenderView()) {
|
||||
return GetBrowserForHost(content::RenderViewHost::From(widgets[i]));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user