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

Issue 200003: Chrome side of the fix for http://b/issue?id=1694574, which is a bug caused w... (Closed)

Created:
11 years, 3 months ago by ananta
Modified:
9 years, 6 months ago
Reviewers:
amit
CC:
chromium-reviews_googlegroups.com, brettw, Ben Goodger (Google), Paweł Hajdan Jr.
Visibility:
Public.

Description

Chrome side of the fix for http://b/issue?id=1694574, which is a bug caused when a new automation client instance is launched and attempts to attach to an existing external tab. An example of where this could happen is javascript on a page attempting a window.open with target _blank. In this case the Chrome browser creates a TabContents instance which is attached to an ExternalTabContainer instance. The automation client then attaches to this ExternalTabContainer. This all works if the automation client is in the same client process. If a new process is launched a separate automation channel is created between the client and the chrome browser which causes this to not work as expected. Fix is have a floating ExternalTabContainer instance which is eventually connected to by the client. When we receive a notification from the client that it is about to connect to the ExternalTabContainer instance we setup the automation channel and other info in the underlying automation profile. The new TabContents is created with the same profile instance as the current TabContents. This does not work correctly if the underlying profile is an automation profile as its lifetime is tied to the ExternalTabContainer. To fix this I added a setter for the new policy to the NavigationController. Not doing this causes the browser to crash if the original ExternalTabContainer instance dies. There is a bigger issue here which is that all this profile sharing would cause session cookies to not work correctly if multiple automation clients are connected to the same Chrome browser instance over the same profile. I will file a separate bug to track this issue. Bug=1694574 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=25594

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Total comments: 3

Patch Set 5 : '' #

Patch Set 6 : '' #

Patch Set 7 : '' #

Total comments: 12

Patch Set 8 : '' #

Total comments: 6

Patch Set 9 : '' #

Patch Set 10 : '' #

Patch Set 11 : '' #

Patch Set 12 : '' #

Patch Set 13 : '' #

Patch Set 14 : '' #

Total comments: 10

Patch Set 15 : '' #

Patch Set 16 : '' #

Patch Set 17 : '' #

Patch Set 18 : '' #

Patch Set 19 : '' #

Patch Set 20 : '' #

Patch Set 21 : '' #

Patch Set 22 : '' #

Patch Set 23 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+203 lines, -52 lines) Patch
M chrome/browser/automation/automation_provider.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/browser/automation/automation_provider.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/automation/automation_provider_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 3 chunks +36 lines, -2 lines 0 comments Download
M chrome/browser/automation/automation_resource_message_filter.cc View 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +12 lines, -1 line 0 comments Download
M chrome/browser/external_tab_container.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 5 chunks +28 lines, -7 lines 0 comments Download
M chrome/browser/external_tab_container.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 7 chunks +102 lines, -35 lines 0 comments Download
M chrome/browser/tab_contents/navigation_controller.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/test/automation/automation_messages_internal.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 2 chunks +12 lines, -7 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
ananta
11 years, 3 months ago (2009-09-03 05:19:58 UTC) #1
amit
The changes overall look pretty good, a few suggestions below http://codereview.chromium.org/200003/diff/8001/8003 File chrome/browser/external_tab_container.cc (right): http://codereview.chromium.org/200003/diff/8001/8003#newcode258 ...
11 years, 3 months ago (2009-09-03 17:34:28 UTC) #2
ananta
I made a change to call RegisterRenderView when the floating ExternalTabContainer is Reinitialized. This ensures ...
11 years, 3 months ago (2009-09-04 05:49:09 UTC) #3
amit
lgtm with a following nits. http://codereview.chromium.org/200003/diff/2003/2009 File chrome/browser/automation/automation_profile_impl.h (right): http://codereview.chromium.org/200003/diff/2003/2009#newcode203 Line 203: Profile* original_profile() const ...
11 years, 3 months ago (2009-09-04 13:59:29 UTC) #4
ananta
http://codereview.chromium.org/200003/diff/2003/2009 File chrome/browser/automation/automation_profile_impl.h (right): http://codereview.chromium.org/200003/diff/2003/2009#newcode203 Line 203: Profile* original_profile() const { On 2009/09/04 13:59:30, amit ...
11 years, 3 months ago (2009-09-04 16:27:04 UTC) #5
amit
lgtm++ http://codereview.chromium.org/200003/diff/8015/9009 File chrome/browser/automation/automation_provider_win.cc (right): http://codereview.chromium.org/200003/diff/8015/9009#newcode472 Line 472: if (AddExternalTab(external_tab_container)) { feels like AddExternalTab should ...
11 years, 3 months ago (2009-09-04 16:48:28 UTC) #6
ananta
http://codereview.chromium.org/200003/diff/8015/9006 File chrome/browser/external_tab_container.cc (right): http://codereview.chromium.org/200003/diff/8015/9006#newcode167 Line 167: tab_contents_->profile()->GetOriginalProfile(); On 2009/09/04 16:48:28, amit wrote: > can ...
11 years, 3 months ago (2009-09-04 17:31:42 UTC) #7
amit
lgtm++ looks much better, thanks for patiently slogging through all the iterations. http://codereview.chromium.org/200003/diff/7047/6040 File chrome/browser/automation/automation_provider_win.cc ...
11 years, 3 months ago (2009-09-04 17:40:43 UTC) #8
amit
lgtm and a few more nits http://codereview.chromium.org/200003/diff/7047/6040 File chrome/browser/automation/automation_provider_win.cc (right): http://codereview.chromium.org/200003/diff/7047/6040#newcode344 Line 344: external_tab_container->Init(profile, settings.parent, ...
11 years, 3 months ago (2009-09-04 17:49:14 UTC) #9
ananta
11 years, 3 months ago (2009-09-04 17:54:47 UTC) #10
http://codereview.chromium.org/200003/diff/7047/6040
File chrome/browser/automation/automation_provider_win.cc (right):

http://codereview.chromium.org/200003/diff/7047/6040#newcode344
Line 344: external_tab_container->Init(profile, settings.parent,
settings.dimensions,
On 2009/09/04 17:49:14, amit wrote:
> A comment explaining that init will grab a self ref.

Done.

http://codereview.chromium.org/200003/diff/7047/6040#newcode481
Line 481: external_tab_container.release();
On 2009/09/04 17:40:43, amit wrote:
> Call Uninitialize instead?

Done.

http://codereview.chromium.org/200003/diff/7047/6037
File chrome/browser/external_tab_container.cc (right):

http://codereview.chromium.org/200003/diff/7047/6037#newcode509
Line 509: return views::WidgetWin::OnCreate(create_struct);
On 2009/09/04 17:40:43, amit wrote:
> we should grab a ref only if the base OnCreate is successful

Done.

http://codereview.chromium.org/200003/diff/7047/6037#newcode585
Line 585: int cookie) {
On 2009/09/04 17:40:43, amit wrote:
> fits above?

Done.

Powered by Google App Engine
This is Rietveld 408576698