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

Issue 1136953017: Add fallback mechanism to release Extension ports if the JS context has been destroyed. (Closed)

Created:
5 years, 7 months ago by not at google - send to devlin
Modified:
5 years, 7 months ago
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add fallback mechanism to release Extension ports if the JS context has been destroyed. The bug is that chrome.runtime.sendMessage looks for when its callback is garbage collected, and when it is, close the associated port. It's important to close the port to notify the other end of the closure, cleanup renderer state both locally and on that other end, and potentially browser state. Unfortunately the port management is implemented in JS itself, and port releasing needs to go through JS. The problem is that it's not possible to call into JS while in the process of garbage collection, so we delay it, by which point the JS context may have been destroyed and again it's not possible to call into JS. We fixed the former case a while ago, and this patch fixes the latter. BUG=471599 R=rockot@chromium.org Committed: https://crrev.com/70c00e241c68895fb245f53a6404866883ea0631 Cr-Commit-Position: refs/heads/master@{#330234}

Patch Set 1 #

Patch Set 2 : tweak #

Total comments: 7

Patch Set 3 : comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+114 lines, -69 lines) Patch
M extensions/renderer/messaging_bindings.cc View 1 2 5 chunks +96 lines, -65 lines 0 comments Download
M extensions/renderer/resources/guest_view/web_view/web_view_action_requests.js View 1 1 chunk +2 lines, -1 line 0 comments Download
M extensions/renderer/resources/messaging.js View 1 1 chunk +7 lines, -1 line 0 comments Download
M extensions/renderer/script_context.h View 1 chunk +3 lines, -1 line 0 comments Download
M extensions/renderer/script_context.cc View 2 chunks +6 lines, -1 line 0 comments Download

Messages

Total messages: 8 (2 generated)
not at google - send to devlin
LMK. I annotated the places where this differs. https://codereview.chromium.org/1136953017/diff/20001/extensions/renderer/messaging_bindings.cc File extensions/renderer/messaging_bindings.cc (right): https://codereview.chromium.org/1136953017/diff/20001/extensions/renderer/messaging_bindings.cc#newcode63 extensions/renderer/messaging_bindings.cc:63: class ...
5 years, 7 months ago (2015-05-15 18:14:24 UTC) #1
Ken Rockot(use gerrit already)
lgtm https://codereview.chromium.org/1136953017/diff/20001/extensions/renderer/messaging_bindings.cc File extensions/renderer/messaging_bindings.cc (right): https://codereview.chromium.org/1136953017/diff/20001/extensions/renderer/messaging_bindings.cc#newcode272 extensions/renderer/messaging_bindings.cc:272: new GCCallback(context(), args[0].As<v8::Object>(), nit: maybe document that this ...
5 years, 7 months ago (2015-05-15 21:47:54 UTC) #2
not at google - send to devlin
https://codereview.chromium.org/1136953017/diff/20001/extensions/renderer/messaging_bindings.cc File extensions/renderer/messaging_bindings.cc (right): https://codereview.chromium.org/1136953017/diff/20001/extensions/renderer/messaging_bindings.cc#newcode272 extensions/renderer/messaging_bindings.cc:272: new GCCallback(context(), args[0].As<v8::Object>(), On 2015/05/15 21:47:54, Ken Rockot wrote: ...
5 years, 7 months ago (2015-05-15 21:53:12 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1136953017/40001
5 years, 7 months ago (2015-05-15 21:55:24 UTC) #6
commit-bot: I haz the power
Committed patchset #3 (id:40001)
5 years, 7 months ago (2015-05-15 23:42:33 UTC) #7
commit-bot: I haz the power
5 years, 7 months ago (2015-05-18 11:29:14 UTC) #8
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/70c00e241c68895fb245f53a6404866883ea0631
Cr-Commit-Position: refs/heads/master@{#330234}

Powered by Google App Engine
This is Rietveld 408576698