summaryrefslogtreecommitdiffstats
path: root/chrome/browser/render_view_host.h
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-17 21:53:08 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-17 21:53:08 +0000
commit0aa5531f4cfa1a5e4fcb571201f6c39221b1260a (patch)
tree889fd0590f06fdc99d2bee143e060a2d26c8326e /chrome/browser/render_view_host.h
parent8ef59c3b8d485227dae56a1ce4edc784be329f59 (diff)
downloadchromium_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.h')
-rw-r--r--chrome/browser/render_view_host.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/chrome/browser/render_view_host.h b/chrome/browser/render_view_host.h
index 34616a3..8bf8e7f 100644
--- a/chrome/browser/render_view_host.h
+++ b/chrome/browser/render_view_host.h
@@ -382,6 +382,10 @@ class RenderViewHost : public RenderWidgetHost {
void ForwardMessageFromExternalHost(const std::string& target,
const std::string& message);
+ // Message the renderer that we should be counted as a new document and not
+ // as a popup.
+ void DisassociateFromPopupCount();
+
protected:
// Overridden from RenderWidgetHost:
virtual void UnhandledInputEvent(const WebInputEvent& event);
@@ -579,4 +583,3 @@ class RenderViewHostFactory {
};
#endif // CHROME_BROWSER_RENDER_VIEW_HOST_H__
-