diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-17 21:53:08 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-17 21:53:08 +0000 |
commit | 0aa5531f4cfa1a5e4fcb571201f6c39221b1260a (patch) | |
tree | 889fd0590f06fdc99d2bee143e060a2d26c8326e /chrome/browser/render_view_host.cc | |
parent | 8ef59c3b8d485227dae56a1ce4edc784be329f59 (diff) | |
download | chromium_src-0aa5531f4cfa1a5e4fcb571201f6c39221b1260a.zip chromium_src-0aa5531f4cfa1a5e4fcb571201f6c39221b1260a.tar.gz chromium_src-0aa5531f4cfa1a5e4fcb571201f6c39221b1260a.tar.bz2 |
Remove throttling code from the Browser process and implement throttling in the Renderer.
The previous way of doing throttling was just calling CloseContents() on a window to reject it. But since the Browser is notified about a window opening asynchronously, by the time the CloseContents() sends a message back to the Renderer, a bunch more windows have been opened, leading to memory exhaustion.
Instead, make all RenderViews created from a parent RenderView share a counter and start refusing to create RenderViews if too many RV have been created. Every RenderView (except for the first one) is assumed to be an unrequested popup, until notified by the Browser process by either a ViewMsg_DisassociateFromPopupCount message (this RenderView is a new top level page) or a ViewMsg_DisassociatePopup message (this RenderView is a requested popup and therefore shouldn't count against the count.)
BUG=3382, 2632
Review URL: http://codereview.chromium.org/7388
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3568 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/render_view_host.cc')
-rw-r--r-- | chrome/browser/render_view_host.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/chrome/browser/render_view_host.cc b/chrome/browser/render_view_host.cc index 03eec5a..0ac3e16 100644 --- a/chrome/browser/render_view_host.cc +++ b/chrome/browser/render_view_host.cc @@ -1005,6 +1005,10 @@ void RenderViewHost::OnPersonalizationEvent(const std::string& message, } #endif +void RenderViewHost::DisassociateFromPopupCount() { + Send(new ViewMsg_DisassociateFromPopupCount(routing_id_)); +} + void RenderViewHost::OnMsgGoToEntryAtOffset(int offset) { delegate_->GoToEntryAtOffset(offset); } @@ -1222,4 +1226,3 @@ void RenderViewHost::ForwardMessageFromExternalHost( const std::string& target, const std::string& message) { Send(new ViewMsg_HandleMessageFromExternalHost(routing_id_, target, message)); } - |