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

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

Issue 18167004: Iterate over listeners when sending process died notification. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
OLDNEW
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 1586 matching lines...) Expand 10 before | Expand all | Expand 10 after
1597 RendererClosedDetails details(GetHandle(), status, exit_code); 1597 RendererClosedDetails details(GetHandle(), status, exit_code);
1598 NotificationService::current()->Notify( 1598 NotificationService::current()->Notify(
1599 NOTIFICATION_RENDERER_PROCESS_CLOSED, 1599 NOTIFICATION_RENDERER_PROCESS_CLOSED,
1600 Source<RenderProcessHost>(this), 1600 Source<RenderProcessHost>(this),
1601 Details<RendererClosedDetails>(&details)); 1601 Details<RendererClosedDetails>(&details));
1602 1602
1603 child_process_launcher_.reset(); 1603 child_process_launcher_.reset();
1604 channel_.reset(); 1604 channel_.reset();
1605 gpu_message_filter_ = NULL; 1605 gpu_message_filter_ = NULL;
1606 1606
1607 RenderWidgetHost::List widgets = RenderWidgetHost::GetRenderWidgetHosts(); 1607 IDMap<IPC::Listener>::iterator iter(&listeners_);
1608 for (size_t i = 0; i < widgets.size(); ++i) { 1608 while (!iter.IsAtEnd()) {
1609 if (widgets[i]->GetProcess()->GetID() != GetID()) 1609 iter.GetCurrentValue()->OnMessageReceived(
1610 continue; 1610 ViewHostMsg_RenderViewGone(iter.GetCurrentKey(),
1611 RenderWidgetHostImpl::From(widgets[i])->OnMessageReceived(
1612 ViewHostMsg_RenderViewGone(widgets[i]->GetRoutingID(),
1613 static_cast<int>(status), 1611 static_cast<int>(status),
1614 exit_code)); 1612 exit_code));
1613 iter.Advance();
1615 } 1614 }
1616 1615
1617 ClearTransportDIBCache(); 1616 ClearTransportDIBCache();
1618 1617
1619 // this object is not deleted at this point and may be reused later. 1618 // this object is not deleted at this point and may be reused later.
1620 // TODO(darin): clean this up 1619 // TODO(darin): clean this up
1621 } 1620 }
1622 1621
1623 int RenderProcessHostImpl::GetActiveViewCount() { 1622 int RenderProcessHostImpl::GetActiveViewCount() {
1624 int num_active_views = 0; 1623 int num_active_views = 0;
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
1776 // Skip widgets in other processes. 1775 // Skip widgets in other processes.
1777 if (widgets[i]->GetProcess()->GetID() != GetID()) 1776 if (widgets[i]->GetProcess()->GetID() != GetID())
1778 continue; 1777 continue;
1779 1778
1780 RenderViewHost* rvh = RenderViewHost::From(widgets[i]); 1779 RenderViewHost* rvh = RenderViewHost::From(widgets[i]);
1781 rvh->UpdateWebkitPreferences(rvh->GetWebkitPreferences()); 1780 rvh->UpdateWebkitPreferences(rvh->GetWebkitPreferences());
1782 } 1781 }
1783 } 1782 }
1784 1783
1785 } // namespace content 1784 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698