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

Issue 558813002: <webview>: Fix an issue with destroying an opener that has unattached guests. (Closed)

Created:
6 years, 3 months ago by lazyboy
Modified:
6 years, 3 months ago
Reviewers:
Fady Samuel
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

<webview>: Fix an issue with destroying an opener that has unattached guests. This CL also adds a test that exercises the code path and makes sure destroying an opener that has unattached window doesn't cause any undesired side effects. If we destroy an opener that had a pending newwindow, the newwindow's GC would try to setPermission to deny the newwindow later. But the opener is gone and its guestInstanceId isn't valid anymore, this would throw a JavaScript exception b/c we call webViewInternal.setPermission with undefined instance id: "Uncaught Error: Invocation of form ..." The fix is to ignore calling webViewInternal.setPermission in this case. Note that the added test doesn't necessarily check for the above exception because GC can be delayed arbitrarily. The test checks the regular code path. BUG=406616 Test=See the test added in newwindow/embedder.js for details. Open a chrome app window that has a <webview>. Add a newwindow event listener to the <webview>. Now trigger a new window from the <webview> so the listener fires. In the listener, destroy the <webview>. Every thing should work fine and should not exhibit any bad behavior. Without this change it would throw a JavaScript exception. Committed: https://crrev.com/40341e4ab145e7e4daa57de8ea1152f6018233b6 Cr-Commit-Position: refs/heads/master@{#294053}

Patch Set 1 #

Total comments: 2

Patch Set 2 : add tests for attach/discard call after opener destruction #

Total comments: 7

Patch Set 3 : address nits #

Patch Set 4 : fix setTimeout call #

Unified diffs Side-by-side diffs Delta from patch set Stats (+193 lines, -31 lines) Patch
M chrome/browser/apps/web_view_interactive_browsertest.cc View 1 6 chunks +65 lines, -12 lines 0 comments Download
M chrome/renderer/resources/extensions/web_view_events.js View 1 2 chunks +30 lines, -8 lines 0 comments Download
M chrome/test/data/extensions/platform_apps/web_view/newwindow/embedder.js View 1 2 3 5 chunks +98 lines, -11 lines 0 comments Download

Messages

Total messages: 10 (2 generated)
lazyboy
6 years, 3 months ago (2014-09-09 21:37:47 UTC) #2
Fady Samuel
https://chromiumcodereview.appspot.com/558813002/diff/1/chrome/test/data/extensions/platform_apps/web_view/newwindow/embedder.js File chrome/test/data/extensions/platform_apps/web_view/newwindow/embedder.js (right): https://chromiumcodereview.appspot.com/558813002/diff/1/chrome/test/data/extensions/platform_apps/web_view/newwindow/embedder.js#newcode347 chrome/test/data/extensions/platform_apps/web_view/newwindow/embedder.js:347: window.setTimeout(function() { embedder.test.succeed(); }, 0); What happens if we ...
6 years, 3 months ago (2014-09-09 21:55:35 UTC) #3
lazyboy
Comment addressed in patchset #2 https://chromiumcodereview.appspot.com/558813002/diff/1/chrome/test/data/extensions/platform_apps/web_view/newwindow/embedder.js File chrome/test/data/extensions/platform_apps/web_view/newwindow/embedder.js (right): https://chromiumcodereview.appspot.com/558813002/diff/1/chrome/test/data/extensions/platform_apps/web_view/newwindow/embedder.js#newcode347 chrome/test/data/extensions/platform_apps/web_view/newwindow/embedder.js:347: window.setTimeout(function() { embedder.test.succeed(); }, ...
6 years, 3 months ago (2014-09-09 22:52:22 UTC) #4
Fady Samuel
lgtm with nits https://chromiumcodereview.appspot.com/558813002/diff/20001/chrome/test/data/extensions/platform_apps/web_view/newwindow/embedder.js File chrome/test/data/extensions/platform_apps/web_view/newwindow/embedder.js (right): https://chromiumcodereview.appspot.com/558813002/diff/20001/chrome/test/data/extensions/platform_apps/web_view/newwindow/embedder.js#newcode251 chrome/test/data/extensions/platform_apps/web_view/newwindow/embedder.js:251: //window.setTimeout(function() { embedder.test.succeed(); }, 0); Delete ...
6 years, 3 months ago (2014-09-09 23:01:34 UTC) #5
lazyboy
Comments address in patchset #3, #4. https://chromiumcodereview.appspot.com/558813002/diff/20001/chrome/test/data/extensions/platform_apps/web_view/newwindow/embedder.js File chrome/test/data/extensions/platform_apps/web_view/newwindow/embedder.js (right): https://chromiumcodereview.appspot.com/558813002/diff/20001/chrome/test/data/extensions/platform_apps/web_view/newwindow/embedder.js#newcode251 chrome/test/data/extensions/platform_apps/web_view/newwindow/embedder.js:251: //window.setTimeout(function() { embedder.test.succeed(); ...
6 years, 3 months ago (2014-09-09 23:18:36 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/lazyboy@chromium.org/558813002/60001
6 years, 3 months ago (2014-09-09 23:51:59 UTC) #8
commit-bot: I haz the power
Committed patchset #4 (id:60001) as 68fc36cb07eaf5ff4536b8ce3040f1c2ba951ebf
6 years, 3 months ago (2014-09-10 00:38:06 UTC) #9
commit-bot: I haz the power
6 years, 3 months ago (2014-09-10 03:57:02 UTC) #10
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/40341e4ab145e7e4daa57de8ea1152f6018233b6
Cr-Commit-Position: refs/heads/master@{#294053}

Powered by Google App Engine
This is Rietveld 408576698