Chromium Code Reviews

Issue 6319001: Support window.opener after a process swap. (Closed)

Created:
9 years, 11 months ago by Charlie Reis
Modified:
9 years, 7 months ago
Reviewers:
jam, Matt Perry
CC:
chromium-reviews, darin (slow to review), brettw-cc_chromium.org
Visibility:
Public.

Description

Support window.opener after a process swap. Changes: 1. Swap out RVHs instead of closing them, so we can return to the same Frame object if we later come back. 2. Filter out messages from swapped out RVHs, in case any are in-flight. 3. Remove the workaround for navigating away from an app. 4. Update tests to reflect the new sequence of events. BUG=65953 TEST=AppApiTest.AppProcess TEST=ResourceDispatcherTest.CrossSiteImmediateLoadOnunloadCookie Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=85134

Patch Set 1 #

Patch Set 2 : Switch to SwapOut message. #

Patch Set 3 : Update comments. #

Total comments: 1

Patch Set 4 : Remove extension workaround, fix test. #

Patch Set 5 : Block non-ack IPC messages if swapped out. #

Patch Set 6 : Resolve merge conflicts, etc. #

Patch Set 7 : Filter messages in RVH instead. #

Patch Set 8 : Filter additional messages to TabContents. #

Patch Set 9 : Fix failing tests. #

Patch Set 10 : Add WasSwappedOut message for clean exit. #

Total comments: 3

Patch Set 11 : Better message filtering approach. #

Total comments: 6

Patch Set 12 : Fix fast back/forward issue. #

Patch Set 13 : Use ShutdownRequest instead. #

Patch Set 14 : Fix unload; chrome dependency in RenderWidget. #

Total comments: 5

Patch Set 15 : Abstract out message filtering code. #

Total comments: 9

Patch Set 16 : Fix Skia compile on Windows. #

Patch Set 17 : Rename to SwappedOutMessages. #

Patch Set 18 : Merge with trunk. #

Unified diffs Side-by-side diffs Stats (+751 lines, -211 lines)
M chrome/browser/extensions/app_process_apitest.cc View 2 chunks +3 lines, -9 lines 0 comments
M chrome/browser/extensions/extension_host.h View 1 chunk +2 lines, -1 line 0 comments
M chrome/browser/extensions/extension_host.cc View 1 chunk +2 lines, -1 line 0 comments
M chrome/browser/tab_contents/background_contents.h View 1 chunk +2 lines, -1 line 0 comments
M chrome/browser/tab_contents/background_contents.cc View 1 chunk +1 line, -0 lines 0 comments
M chrome/browser/tab_contents/web_contents_unittest.cc View 7 chunks +34 lines, -3 lines 0 comments
M chrome/browser/ui/browser.cc View 1 chunk +1 line, -1 line 0 comments
M chrome/browser/ui/webui/web_ui_unittest.cc View 1 chunk +9 lines, -0 lines 0 comments
M chrome/browser/visitedlink/visitedlink_unittest.cc View 1 chunk +1 line, -1 line 0 comments
M chrome/common/chrome_content_client.h View 1 chunk +2 lines, -0 lines 0 comments
M chrome/common/chrome_content_client.cc View 2 chunks +27 lines, -0 lines 0 comments
M chrome/common/render_messages.h View 1 chunk +2 lines, -1 line 0 comments
M chrome/renderer/chrome_content_renderer_client.h View 1 chunk +0 lines, -5 lines 0 comments
M chrome/renderer/chrome_content_renderer_client.cc View 2 chunks +1 line, -7 lines 0 comments
M content/browser/renderer_host/browser_render_process_host.h View 1 chunk +1 line, -1 line 0 comments
M content/browser/renderer_host/browser_render_process_host.cc View 1 chunk +3 lines, -3 lines 0 comments
M content/browser/renderer_host/mock_render_process_host.h View 1 chunk +1 line, -1 line 0 comments
M content/browser/renderer_host/mock_render_process_host.cc View 1 chunk +2 lines, -2 lines 0 comments
M content/browser/renderer_host/render_process_host.h View 2 chunks +5 lines, -5 lines 0 comments
M content/browser/renderer_host/render_view_host.h View 3 chunks +37 lines, -11 lines 0 comments
M content/browser/renderer_host/render_view_host.cc View 17 chunks +83 lines, -35 lines 0 comments
M content/browser/renderer_host/render_view_host_delegate.h View 1 chunk +4 lines, -2 lines 0 comments
M content/browser/renderer_host/render_view_host_unittest.cc View 2 chunks +4 lines, -5 lines 0 comments
M content/browser/renderer_host/render_widget_helper.h View 3 chunks +3 lines, -3 lines 0 comments
M content/browser/renderer_host/render_widget_helper.cc View 3 chunks +7 lines, -7 lines 0 comments
M content/browser/renderer_host/resource_dispatcher_host.h View 2 chunks +3 lines, -3 lines 0 comments
M content/browser/renderer_host/resource_dispatcher_host.cc View 2 chunks +14 lines, -21 lines 0 comments
M content/browser/renderer_host/resource_dispatcher_host_uitest.cc View 1 chunk +32 lines, -0 lines 0 comments
M content/browser/renderer_host/test_render_view_host.h View 1 chunk +3 lines, -0 lines 0 comments
M content/browser/renderer_host/test_render_view_host.cc View 1 chunk +4 lines, -0 lines 0 comments
M content/browser/site_instance.h View 2 chunks +9 lines, -0 lines 0 comments
M content/browser/site_instance.cc View 1 chunk +4 lines, -1 line 0 comments
M content/browser/tab_contents/render_view_host_manager.h View 4 chunks +9 lines, -1 line 0 comments
M content/browser/tab_contents/render_view_host_manager.cc View 14 chunks +138 lines, -32 lines 0 comments
M content/browser/tab_contents/render_view_host_manager_unittest.cc View 2 chunks +25 lines, -8 lines 0 comments
M content/browser/tab_contents/tab_contents.h View 1 chunk +4 lines, -2 lines 0 comments
M content/browser/tab_contents/tab_contents.cc View 7 chunks +20 lines, -6 lines 0 comments
M content/browser/tab_contents/test_tab_contents.cc View 2 chunks +7 lines, -1 line 0 comments
M content/common/content_client.h View 2 chunks +14 lines, -0 lines 0 comments
A content/common/swapped_out_messages.h View 1 chunk +23 lines, -0 lines 0 comments
A content/common/swapped_out_messages.cc View 1 chunk +79 lines, -0 lines 0 comments
M content/common/view_messages.h View 4 chunks +26 lines, -23 lines 0 comments
M content/content_common.gypi View 1 chunk +2 lines, -0 lines 0 comments
M content/renderer/render_view.h View 3 chunks +3 lines, -2 lines 0 comments
M content/renderer/render_view.cc View 6 chunks +50 lines, -3 lines 0 comments
M content/renderer/render_widget.h View 3 chunks +12 lines, -0 lines 0 comments
M content/renderer/render_widget.cc View 7 chunks +33 lines, -3 lines 0 comments

Messages

Total messages: 28 (0 generated)
Charlie Reis
Here's the current draft, while I try to fix some of the other test failures ...
9 years, 8 months ago (2011-04-13 22:57:21 UTC) #1
jam
I don't quite understand how this is being done :) I read the motivation in ...
9 years, 8 months ago (2011-04-14 02:07:26 UTC) #2
Charlie Reis
On 2011/04/14 02:07:26, John Abd-El-Malek wrote: > I don't quite understand how this is being ...
9 years, 8 months ago (2011-04-14 03:02:14 UTC) #3
Charlie Reis
Just uploaded a new draft (patch set 4) that removes the temporary workaround logic introduced ...
9 years, 8 months ago (2011-04-14 17:55:48 UTC) #4
jam
Thanks for the doc, that explained it more. However I have to say that I ...
9 years, 8 months ago (2011-04-14 19:16:21 UTC) #5
Charlie Reis
Thanks for taking a look, John. Matt, would you be able to review this, or ...
9 years, 8 months ago (2011-04-14 19:38:48 UTC) #6
Matt Perry
Mostly LGTM. My one concern is whether a swapped-out RenderView can still send messages to ...
9 years, 8 months ago (2011-04-14 23:48:08 UTC) #7
Charlie Reis
On 2011/04/14 23:48:08, Matt Perry wrote: > Mostly LGTM. My one concern is whether a ...
9 years, 8 months ago (2011-04-18 18:01:02 UTC) #8
Matt Perry
On 2011/04/18 18:01:02, creis wrote: > On 2011/04/14 23:48:08, Matt Perry wrote: > > Mostly ...
9 years, 8 months ago (2011-04-18 18:06:47 UTC) #9
Charlie Reis
On 2011/04/18 18:06:47, Matt Perry wrote: > Interesting. 2 sounds like the ideal option, though ...
9 years, 8 months ago (2011-04-18 18:29:12 UTC) #10
Charlie Reis
After looking at the message filtering more, it became clear that we'd need to filter ...
9 years, 8 months ago (2011-04-28 01:49:50 UTC) #11
Matt Perry
http://codereview.chromium.org/6319001/diff/34002/content/browser/renderer_host/render_view_host.cc File content/browser/renderer_host/render_view_host.cc (right): http://codereview.chromium.org/6319001/diff/34002/content/browser/renderer_host/render_view_host.cc#newcode876 content/browser/renderer_host/render_view_host.cc:876: if (view && !is_swapped_out_) rather than adding these checks ...
9 years, 8 months ago (2011-04-28 22:48:20 UTC) #12
Charlie Reis
http://codereview.chromium.org/6319001/diff/34002/content/browser/renderer_host/render_view_host.cc File content/browser/renderer_host/render_view_host.cc (right): http://codereview.chromium.org/6319001/diff/34002/content/browser/renderer_host/render_view_host.cc#newcode876 content/browser/renderer_host/render_view_host.cc:876: if (view && !is_swapped_out_) On 2011/04/28 22:48:20, Matt Perry ...
9 years, 7 months ago (2011-04-29 17:53:53 UTC) #13
Matt Perry
LGTM http://codereview.chromium.org/6319001/diff/33046/content/browser/renderer_host/render_view_host.h File content/browser/renderer_host/render_view_host.h (right): http://codereview.chromium.org/6319001/diff/33046/content/browser/renderer_host/render_view_host.h#newcode192 content/browser/renderer_host/render_view_host.h:192: // Called to notify the RenderWidget that it ...
9 years, 7 months ago (2011-04-29 19:25:18 UTC) #14
Charlie Reis
Thanks Matt. Just trying to solve one last issue that's causing the test failure on ...
9 years, 7 months ago (2011-05-02 21:06:38 UTC) #15
Charlie Reis
Ok, we pass all the tests now! The main changes from patch set 11: 1. ...
9 years, 7 months ago (2011-05-05 15:17:58 UTC) #16
Matt Perry
http://codereview.chromium.org/6319001/diff/39023/content/renderer/render_widget.cc File content/renderer/render_widget.cc (right): http://codereview.chromium.org/6319001/diff/39023/content/renderer/render_widget.cc#newcode205 content/renderer/render_widget.cc:205: bool RenderWidget::CanSendWhileSwappedOut(IPC::Message* message) { It's a shame that these ...
9 years, 7 months ago (2011-05-05 17:06:50 UTC) #17
Charlie Reis
http://codereview.chromium.org/6319001/diff/39023/content/renderer/render_widget.cc File content/renderer/render_widget.cc (right): http://codereview.chromium.org/6319001/diff/39023/content/renderer/render_widget.cc#newcode205 content/renderer/render_widget.cc:205: bool RenderWidget::CanSendWhileSwappedOut(IPC::Message* message) { On 2011/05/05 17:06:50, Matt Perry ...
9 years, 7 months ago (2011-05-10 20:15:09 UTC) #18
Matt Perry
http://codereview.chromium.org/6319001/diff/39023/content/renderer/render_widget.cc File content/renderer/render_widget.cc (right): http://codereview.chromium.org/6319001/diff/39023/content/renderer/render_widget.cc#newcode205 content/renderer/render_widget.cc:205: bool RenderWidget::CanSendWhileSwappedOut(IPC::Message* message) { On 2011/05/10 20:15:09, creis wrote: ...
9 years, 7 months ago (2011-05-10 20:26:32 UTC) #19
Charlie Reis
http://codereview.chromium.org/6319001/diff/39023/content/renderer/render_widget.cc File content/renderer/render_widget.cc (right): http://codereview.chromium.org/6319001/diff/39023/content/renderer/render_widget.cc#newcode205 content/renderer/render_widget.cc:205: bool RenderWidget::CanSendWhileSwappedOut(IPC::Message* message) { On 2011/05/10 20:26:32, Matt Perry ...
9 years, 7 months ago (2011-05-10 20:35:23 UTC) #20
Charlie Reis
http://codereview.chromium.org/6319001/diff/39023/content/renderer/render_widget.cc File content/renderer/render_widget.cc (right): http://codereview.chromium.org/6319001/diff/39023/content/renderer/render_widget.cc#newcode205 content/renderer/render_widget.cc:205: bool RenderWidget::CanSendWhileSwappedOut(IPC::Message* message) { On 2011/05/10 20:35:23, creis wrote: ...
9 years, 7 months ago (2011-05-10 23:17:56 UTC) #21
Matt Perry
LGTM http://codereview.chromium.org/6319001/diff/49001/content/common/swapped_out_message_filter.cc File content/common/swapped_out_message_filter.cc (right): http://codereview.chromium.org/6319001/diff/49001/content/common/swapped_out_message_filter.cc#newcode40 content/common/swapped_out_message_filter.cc:40: if (CanSendWhileSwappedOut(&msg)) much clearer! thanks!
9 years, 7 months ago (2011-05-10 23:23:43 UTC) #22
Charlie Reis
Thanks Matt. John, can you take a look for sanity (now that Matt has approved), ...
9 years, 7 months ago (2011-05-11 01:03:54 UTC) #23
Charlie Reis
On 2011/05/11 01:03:54, creis wrote: > Thanks Matt. John, can you take a look for ...
9 years, 7 months ago (2011-05-11 20:13:29 UTC) #24
jam
sorry i forgot to hit publish on this earlier. i think the nacl build error ...
9 years, 7 months ago (2011-05-11 20:19:31 UTC) #25
jam
On 2011/05/11 20:19:31, John Abd-El-Malek wrote: > sorry i forgot to hit publish on this ...
9 years, 7 months ago (2011-05-11 20:20:32 UTC) #26
Charlie Reis
http://codereview.chromium.org/6319001/diff/49001/chrome/common/chrome_content_client.cc File chrome/common/chrome_content_client.cc (right): http://codereview.chromium.org/6319001/diff/49001/chrome/common/chrome_content_client.cc#newcode15 chrome/common/chrome_content_client.cc:15: #include "chrome/common/render_messages.h" On 2011/05/11 20:19:31, John Abd-El-Malek wrote: > ...
9 years, 7 months ago (2011-05-11 20:49:15 UTC) #27
jam
9 years, 7 months ago (2011-05-11 21:43:52 UTC) #28
rubber stamp lgtm (rubberstamp since I didn't review in detail)

On Wed, May 11, 2011 at 1:49 PM, <creis@chromium.org> wrote:

>
>
>
http://codereview.chromium.org/6319001/diff/49001/chrome/common/chrome_conten...
> File chrome/common/chrome_content_client.cc (right):
>
>
>
http://codereview.chromium.org/6319001/diff/49001/chrome/common/chrome_conten...
> chrome/common/chrome_content_client.cc:15: #include
> "chrome/common/render_messages.h"
> On 2011/05/11 20:19:31, John Abd-El-Malek wrote:
>
>> the reason you're getting the compile link failure is because on
>>
> windows, we
>
>> build a dll that has a little bit of chrome (see the
>>
> chrome_dll_nacl_win64
>
>> target) in 64 bits for the nacl sandbox to work.  it doesn't link in
>>
> with
>
>> webkit/skia etc, since those aren't built in 64 bit (and we wouldn't
>>
> want them
>
>> to, since it would bloat the binary unnecessarily).
>>
>
>  one (admittedly hacky) way to get around this would be to surround the
>>
> body of
>
>> these functions with "#if !defined(NACL_WIN64)", similar to other
>>
> places in this
>
>> file
>>
>
> Thanks.   (Fixed in render_messages.h, as you saw.)
>
>
>
>
http://codereview.chromium.org/6319001/diff/49001/content/browser/tab_content...
> File content/browser/tab_contents/render_view_host_manager.cc (right):
>
>
>
http://codereview.chromium.org/6319001/diff/49001/content/browser/tab_content...
> content/browser/tab_contents/render_view_host_manager.cc:196: if
> (pending_render_view_host_->GetPendingRequestId() == -1)
> On 2011/05/11 20:19:31, John Abd-El-Malek wrote:
>
>> nit: need brace brackets here
>>
>
> Done.
>
>
>
>
http://codereview.chromium.org/6319001/diff/49001/content/common/swapped_out_...
> File content/common/swapped_out_message_filter.h (right):
>
>
>
http://codereview.chromium.org/6319001/diff/49001/content/common/swapped_out_...
> content/common/swapped_out_message_filter.h:5: #ifndef
> CONTENT_COMMON_SWAPPED_OUT_MESSAGE_FILTER_H_
> On 2011/05/11 20:19:31, John Abd-El-Malek wrote:
>
>> why is this file called _message_filter?  we usually use that naming
>>
> for classes
>
>> that implement IPC::ChannelProxy::MessageFilter.  in this case,
>> swapped_out_messages.h (or something similar) seems more appropriate
>>
>
> Ah, wasn't aware of the convention.  Fixed.
>
>
>
>
http://codereview.chromium.org/6319001/diff/49001/content/renderer/render_vie...
> File content/renderer/render_view.cc (right):
>
>
>
http://codereview.chromium.org/6319001/diff/49001/content/renderer/render_vie...
> content/renderer/render_view.cc:690: if (is_swapped_out_) {
> On 2011/05/11 20:19:31, John Abd-El-Malek wrote:
>
>> nit: most of this file doesn't use brace brackets for one line
>>
> statements, so
>
>> should stick with that
>>
>
> Done.
>
>
> http://codereview.chromium.org/6319001/
>

Powered by Google App Engine