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

Issue 6155003: Changes instant so that the newly created tab has a new id. Doing (Closed)

Created:
9 years, 11 months ago by sky
Modified:
9 years, 7 months ago
Reviewers:
brettw, rafaelw1, rafaelw
CC:
chromium-reviews, Aaron Boodman, Erik does not do reviews, Paweł Hajdan Jr., pam+watch_chromium.org, brettw-cc_chromium.org
Visibility:
Public.

Description

Changes instant so that the newly created tab has a new id. Doing otherwise causes subtle problems with extensions and breaks the invariant that the tab id is unique. BUG=68508 TEST=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=71063

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+61 lines, -49 lines) Patch
M chrome/browser/extensions/extension_browser_event_router.h View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/extensions/extension_browser_event_router.cc View 1 chunk +4 lines, -2 lines 0 comments Download
M chrome/browser/gtk/tabs/tab_strip_gtk.h View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/gtk/tabs/tab_strip_gtk.cc View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/tab_contents/navigation_controller.h View 1 chunk +2 lines, -4 lines 0 comments Download
M chrome/browser/tab_contents/navigation_controller.cc View 1 chunk +0 lines, -8 lines 0 comments Download
M chrome/browser/tab_contents/navigation_controller_unittest.cc View 6 chunks +12 lines, -12 lines 0 comments Download
M chrome/browser/tabs/default_tab_handler.h View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/tabs/default_tab_handler.cc View 1 chunk +4 lines, -2 lines 0 comments Download
M chrome/browser/tabs/tab_strip_model.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/tabs/tab_strip_model_observer.h View 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/browser/tabs/tab_strip_model_observer.cc View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/tabs/tab_strip_model_unittest.cc View 1 chunk +4 lines, -2 lines 0 comments Download
M chrome/browser/ui/browser.h View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/ui/browser.cc View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/ui/cocoa/tab_strip_model_observer_bridge.h View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/ui/cocoa/tab_strip_model_observer_bridge.mm View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/toolbar/wrench_menu_model.h View 1 chunk +4 lines, -2 lines 0 comments Download
M chrome/browser/ui/toolbar/wrench_menu_model.cc View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/ui/views/frame/browser_view.h View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/ui/views/frame/browser_view.cc View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/ui/views/tabs/browser_tab_strip_controller.h View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc View 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 6 (0 generated)
sky
Brett, could you review the change to NavigationController, and Rafael the rest? The interesting bit ...
9 years, 11 months ago (2011-01-10 23:28:26 UTC) #1
rafaelw
lgtm. Aaron/Erik: I think this means that "committing" a instant search on top of an ...
9 years, 11 months ago (2011-01-11 01:24:59 UTC) #2
brettw
NavController LGTM
9 years, 11 months ago (2011-01-11 06:17:55 UTC) #3
Erik does not do reviews
On Mon, Jan 10, 2011 at 5:25 PM, <rafaelw@chromium.org> wrote: > lgtm. > > Aaron/Erik: ...
9 years, 11 months ago (2011-01-11 17:08:17 UTC) #4
rafaelw1
On Tue, Jan 11, 2011 at 9:08 AM, Erik Kay <erikkay@chromium.org> wrote: > On Mon, ...
9 years, 11 months ago (2011-01-11 18:55:04 UTC) #5
Erik does not do reviews
9 years, 11 months ago (2011-01-11 21:18:50 UTC) #6
+ben (FYI - this is the kind of thing I was talking about)

On Tue, Jan 11, 2011 at 10:54 AM, Rafael Weinstein <rafaelw@google.com>wrote:

>
>
> On Tue, Jan 11, 2011 at 9:08 AM, Erik Kay <erikkay@chromium.org> wrote:
>
>> On Mon, Jan 10, 2011 at 5:25 PM, <rafaelw@chromium.org> wrote:
>>
>>> lgtm.
>>>
>>> Aaron/Erik: I think this means that "committing" a instant search on top
>>> of an
>>> existing tab will look to the tabs api like a tab closed and a new one
>>> opened.
>>>
>>
>> Yes.  I think that's reasonable.
>>
>>
>>
>>> It also means that if there's a content script, it will have been hearing
>>> about
>>> a sequence of new tab ids (that the tabs api won't know anything else
>>> about
>>> because it's not a part of a tab strip), that never sent a tabCreated.
>>>
>>
>> Yes.  I chatted with Scott a bit about this yesterday.  This is my largest
>> area of concern.  However, given that the instant TabContents simply gets
>> swapped in, I think it's important that the content script actually run in
>> the page.  This means that we need to make sure that the tabs API (or
>> anything that uses tab ids) properly reacts to tabs without a window.  This
>> was already a potential problem in a number of scenarios (dragging tab, sync
>> login dialog, etc.).  Also, given that tab ids are guessable (monotonically
>> increasing integers), even if there aren't content scripts injected, we
>> still needed to protect against use of random tab ids.  This is especially
>> true as ChromeOS is using TabContents for more system things (screen saver,
>> html dialogs, etc.).
>>
>>
>>
>>> Finally, when the "commit" causes a tabCreated, it will occur after that
>>> script
>>> got injected into the tabs content (different order from the usual
>>> progression).
>>
>>
>> Would it be better if there was no tabCreated in this case and we just got
>> a tabUpdated?  Maybe the better thing is to do a tabCreated right away when
>> the instant tab is first created (but without a windowId or an index).
>>
>
> I can see both sides to this, but I think my vote is for waiting to send a
> tabCreated until the instant tab commits (status quo once this CL goes in).
> (a) It seems least likely to break existing extensions that may be assuming
> when they get a tabCreated, that it has a window, (b) I think it maps
> conceptually to what's actually going on and (c) my gut says that most users
> of the tabs API should ignore the instant tabs.
>

So in this world, "created" means "added to tab strip model"?  One thing
that this precludes is using executeScript to dynamically inject scripts
into these pages when they're first displayed.  I'm also worried that there
are going to be other cases where a tab is only ever created outside of this
context (and maybe never get put into a tabstrip), but will still need
content scripts injected.  For example, what about the "wicked fast" guys
that are preloading pages without displaying them?

Maybe for compatibility purposes, we need a new event?  onTabPreloaded?
 onTabInstantiated?  Maybe we should deprecate onTabCreated and rename it
onTabInserted?

Erik



>
>
>>
>> Unfortunately, in all of these scenarios, I can imagine poorly written
>> extensions being surprised by something, so breakage seems inevitable.
>>  Anybody have any other ideas?
>>
>> Erik
>>
>>
>

Powered by Google App Engine
This is Rietveld 408576698