• Trent Apted's avatar
    Cocoa: Mark the bookmark draggable button action as fired _before_ performing the action. · b2f5b3a6
    Trent Apted authored
    Opening an entire bookmark folder with more than 20 bookmarks in it
    from the bookmarks bar using Cmd+Click on a Cocoa browser is currently
    broken. This happens in the bookmark draggable button's action.
    
    The action may run a nested loop, which may see the mouse "up" event and
    cause the action to be performed again, inside the nested loop. We also
    need to ensure the bookmark button doesn't enter its _own_ nested run
    loop, since the mouse up has already been eaten by the nested run loop
    inside the action.
    
    Failure to do so causes the action to happen twice, which results in the
    nested run loop of the action spawning another, nested, run loop within
    itself, which never exits. This puts the browser into a very weird state.
    
    TEST=On Mac (chrome://flags/#views-browser-windows DISABLED), have a folder
         on the bookmarks bar with >20 items and Cmd+Click it. Accept the dialog.
         Bookmarks should open.
    
    Bug: 849135, 840387
    Change-Id: I7e1eaf57dff956647cbdcf2cb449bb971cada074
    Reviewed-on: https://chromium-review.googlesource.com/1090513
    Commit-Queue: Trent Apted <tapted@chromium.org>
    Reviewed-by: default avatarElly Fong-Jones <ellyjones@chromium.org>
    Reviewed-by: default avatarRobert Sesek <rsesek@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#565463}
    b2f5b3a6
bookmark_button.mm 17.1 KB