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

Issue 7388: Remove throttling code from the Browser process and... (Closed)

Created:
12 years, 2 months ago by Elliot Glaysher
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

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 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=3568

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Patch Set 6 : '' #

Patch Set 7 : '' #

Patch Set 8 : '' #

Patch Set 9 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+199 lines, -27 lines) Patch
M base/ref_counted.h View 2 chunks +13 lines, -1 line 0 comments Download
M chrome/browser/render_view_host.h View 6 7 2 chunks +4 lines, -1 line 0 comments Download
M chrome/browser/render_view_host.cc View 6 7 2 chunks +4 lines, -1 line 0 comments Download
M chrome/browser/tab_contents.h View 6 7 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/tab_contents.cc View 1 2 3 4 5 6 7 4 chunks +3 lines, -7 lines 0 comments Download
M chrome/browser/views/constrained_window_impl_interactive_uitest.cc View 4 5 6 7 1 chunk +55 lines, -0 lines 0 comments Download
M chrome/browser/web_contents.h View 6 7 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/web_contents.cc View 6 7 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/common/render_messages_internal.h View 6 7 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/renderer/render_thread.cc View 1 2 3 4 2 chunks +2 lines, -3 lines 0 comments Download
M chrome/renderer/render_view.h View 1 2 3 4 5 6 7 8 5 chunks +38 lines, -6 lines 0 comments Download
M chrome/renderer/render_view.cc View 1 2 3 4 5 6 7 8 10 chunks +41 lines, -8 lines 0 comments Download
A chrome/test/data/constrained_files/infinite_popups.html View 1 chunk +12 lines, -0 lines 0 comments Download
A chrome/test/data/constrained_files/infinite_popups_impl.html View 1 chunk +13 lines, -0 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
Elliot Glaysher
Darin: I'm looking more for a high level design review from you. Do you believe ...
12 years, 2 months ago (2008-10-16 17:28:26 UTC) #1
brettw
I don't know of a better way to implement this, assuming this is the best ...
12 years, 2 months ago (2008-10-16 18:33:49 UTC) #2
Elliot Glaysher
Brett, I've updated the patch set.
12 years, 2 months ago (2008-10-16 19:53:51 UTC) #3
brettw
Implementation LGTM
12 years, 2 months ago (2008-10-16 19:57:25 UTC) #4
Elliot Glaysher
A unit test has been added so hopefully this doesn't regress.
12 years, 2 months ago (2008-10-16 20:29:28 UTC) #5
darin (slow to review)
http://codereview.chromium.org/7388/diff/1/5 File chrome/renderer/render_view.h (right): http://codereview.chromium.org/7388/diff/1/5#newcode54 Line 54: // Shared instnace to count the total number ...
12 years, 2 months ago (2008-10-16 20:38:13 UTC) #6
Elliot Glaysher
http://codereview.chromium.org/7388/diff/1/5 File chrome/renderer/render_view.h (right): http://codereview.chromium.org/7388/diff/1/5#newcode54 Line 54: // Shared instnace to count the total number ...
12 years, 2 months ago (2008-10-16 20:51:57 UTC) #7
Elliot Glaysher
Please take another look; I've implemented the plan in that email response I sent you.
12 years, 2 months ago (2008-10-16 23:39:05 UTC) #8
Elliot Glaysher
Updated to only use one message.
12 years, 2 months ago (2008-10-17 18:45:47 UTC) #9
darin (slow to review)
12 years, 2 months ago (2008-10-17 19:20:27 UTC) #10
LGTM modulo items below

http://codereview.chromium.org/7388/diff/260/263
File chrome/renderer/render_view.cc (right):

http://codereview.chromium.org/7388/diff/260/263#newcode97
Line 97: static const int kMaximumNumberOfPopups = 25;
nit: might want to revise the wording here to be specific about the fact that we
are only limiting unwanted or suppressed popups.

http://codereview.chromium.org/7388/diff/260/263#newcode2587
Line 2587: if (decrement_shared_popup_at_destruction_)
elliot tells me that this line should be deleted ;)

Powered by Google App Engine
This is Rietveld 408576698