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

Issue 19670020: Run the Port cleanup code inside BindToGC in a setTimeout call to avoid (Closed)

Created:
7 years, 5 months ago by not at google - send to devlin
Modified:
7 years, 5 months ago
Reviewers:
Jeffrey Yasskin, adamk
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org
Visibility:
Public.

Description

Run the JS callbacks that execute on a v8 GC via MiscellaneousBindings::BoundToGC in the current MessageLoop rather than re-entrantly, to avoid executing any JS in an unexpected state. BUG=258526 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=213372

Patch Set 1 #

Patch Set 2 : comment tweak #

Total comments: 2

Patch Set 3 : . #

Patch Set 4 : use message loop #

Total comments: 11

Patch Set 5 : . #

Patch Set 6 : dont need trycatch anymore #

Patch Set 7 : more #

Total comments: 4

Patch Set 8 : more #

Total comments: 4

Patch Set 9 : creation empty #

Patch Set 10 : comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+45 lines, -27 lines) Patch
M chrome/renderer/extensions/miscellaneous_bindings.cc View 1 2 3 4 5 6 7 8 9 2 chunks +45 lines, -27 lines 0 comments Download

Messages

Total messages: 23 (0 generated)
not at google - send to devlin
I'll use setTimeout here after all. Despite it feeling slightly unrobost, there's no good way ...
7 years, 5 months ago (2013-07-23 20:22:11 UTC) #1
Jeffrey Yasskin
It looks like miscellaneous_bindings.cc:GCCallback could pretty easily yield to the RenderThread instead of calling args->callback ...
7 years, 5 months ago (2013-07-23 20:48:36 UTC) #2
not at google - send to devlin
My worry with deferring to C++ in any way is that we'd be entering back ...
7 years, 5 months ago (2013-07-23 21:03:40 UTC) #3
Jeffrey Yasskin
lgtm assuming Adam finds a reason we shouldn't do this in C++.
7 years, 5 months ago (2013-07-23 21:31:52 UTC) #4
Jeffrey Yasskin
Oh, could you comment this aspect of BindToGC's behavior in its header file?
7 years, 5 months ago (2013-07-23 21:32:27 UTC) #5
adamk
On 2013/07/23 21:03:40, kalman wrote: > My worry with deferring to C++ in any way ...
7 years, 5 months ago (2013-07-23 21:59:02 UTC) #6
Jeffrey Yasskin
On Tue, Jul 23, 2013 at 2:59 PM, <adamk@chromium.org> wrote: > On 2013/07/23 21:03:40, kalman ...
7 years, 5 months ago (2013-07-23 22:08:52 UTC) #7
not at google - send to devlin
Pretty sure this is sane. I rewrote it a bit to make sure that message ...
7 years, 5 months ago (2013-07-23 22:38:35 UTC) #8
not at google - send to devlin
(and comment added. ptal)
7 years, 5 months ago (2013-07-23 22:38:43 UTC) #9
adamk
https://codereview.chromium.org/19670020/diff/27001/chrome/renderer/extensions/miscellaneous_bindings.cc File chrome/renderer/extensions/miscellaneous_bindings.cc (right): https://codereview.chromium.org/19670020/diff/27001/chrome/renderer/extensions/miscellaneous_bindings.cc#newcode180 chrome/renderer/extensions/miscellaneous_bindings.cc:180: GCCallback* self) { I think you want to call ...
7 years, 5 months ago (2013-07-23 22:47:38 UTC) #10
not at google - send to devlin
https://codereview.chromium.org/19670020/diff/27001/chrome/renderer/extensions/miscellaneous_bindings.cc File chrome/renderer/extensions/miscellaneous_bindings.cc (right): https://codereview.chromium.org/19670020/diff/27001/chrome/renderer/extensions/miscellaneous_bindings.cc#newcode180 chrome/renderer/extensions/miscellaneous_bindings.cc:180: GCCallback* self) { On 2013/07/23 22:47:38, adamk wrote: > ...
7 years, 5 months ago (2013-07-23 22:55:03 UTC) #11
not at google - send to devlin
I don't think there's any point in the TryCatch anymore either.
7 years, 5 months ago (2013-07-23 22:57:28 UTC) #12
Jeffrey Yasskin
https://codereview.chromium.org/19670020/diff/27001/chrome/renderer/extensions/miscellaneous_bindings.cc File chrome/renderer/extensions/miscellaneous_bindings.cc (right): https://codereview.chromium.org/19670020/diff/27001/chrome/renderer/extensions/miscellaneous_bindings.cc#newcode180 chrome/renderer/extensions/miscellaneous_bindings.cc:180: GCCallback* self) { On 2013/07/23 22:47:38, adamk wrote: > ...
7 years, 5 months ago (2013-07-23 22:59:35 UTC) #13
not at google - send to devlin
done or something. not so happy about the public-ness of the destructor but what you ...
7 years, 5 months ago (2013-07-23 23:17:41 UTC) #14
adamk
https://codereview.chromium.org/19670020/diff/27001/chrome/renderer/extensions/miscellaneous_bindings.cc File chrome/renderer/extensions/miscellaneous_bindings.cc (right): https://codereview.chromium.org/19670020/diff/27001/chrome/renderer/extensions/miscellaneous_bindings.cc#newcode183 chrome/renderer/extensions/miscellaneous_bindings.cc:183: base::MessageLoop::current()->DeleteSoon(FROM_HERE, self); On 2013/07/23 23:17:41, kalman wrote: > On ...
7 years, 5 months ago (2013-07-23 23:43:20 UTC) #15
Jeffrey Yasskin
https://codereview.chromium.org/19670020/diff/46001/chrome/renderer/extensions/miscellaneous_bindings.cc File chrome/renderer/extensions/miscellaneous_bindings.cc (right): https://codereview.chromium.org/19670020/diff/46001/chrome/renderer/extensions/miscellaneous_bindings.cc#newcode171 chrome/renderer/extensions/miscellaneous_bindings.cc:171: new GCCallback(object, callback); Now this looks like an obvious ...
7 years, 5 months ago (2013-07-23 23:52:47 UTC) #16
not at google - send to devlin
https://codereview.chromium.org/19670020/diff/46001/chrome/renderer/extensions/miscellaneous_bindings.cc File chrome/renderer/extensions/miscellaneous_bindings.cc (right): https://codereview.chromium.org/19670020/diff/46001/chrome/renderer/extensions/miscellaneous_bindings.cc#newcode171 chrome/renderer/extensions/miscellaneous_bindings.cc:171: new GCCallback(object, callback); On 2013/07/23 23:52:47, Jeffrey Yasskin wrote: ...
7 years, 5 months ago (2013-07-24 00:09:28 UTC) #17
adamk
lgtm with one comment https://codereview.chromium.org/19670020/diff/51001/chrome/renderer/extensions/miscellaneous_bindings.cc File chrome/renderer/extensions/miscellaneous_bindings.cc (right): https://codereview.chromium.org/19670020/diff/51001/chrome/renderer/extensions/miscellaneous_bindings.cc#newcode194 chrome/renderer/extensions/miscellaneous_bindings.cc:194: v8::Handle<v8::Context> context = callback_->CreationContext(); I ...
7 years, 5 months ago (2013-07-24 00:18:05 UTC) #18
Jeffrey Yasskin
lgtm, thanks. https://codereview.chromium.org/19670020/diff/51001/chrome/renderer/extensions/miscellaneous_bindings.cc File chrome/renderer/extensions/miscellaneous_bindings.cc (right): https://codereview.chromium.org/19670020/diff/51001/chrome/renderer/extensions/miscellaneous_bindings.cc#newcode182 chrome/renderer/extensions/miscellaneous_bindings.cc:182: // Delete this to execute |callback| in ...
7 years, 5 months ago (2013-07-24 00:20:17 UTC) #19
not at google - send to devlin
done and done https://codereview.chromium.org/19670020/diff/51001/chrome/renderer/extensions/miscellaneous_bindings.cc File chrome/renderer/extensions/miscellaneous_bindings.cc (right): https://codereview.chromium.org/19670020/diff/51001/chrome/renderer/extensions/miscellaneous_bindings.cc#newcode194 chrome/renderer/extensions/miscellaneous_bindings.cc:194: v8::Handle<v8::Context> context = callback_->CreationContext(); On 2013/07/24 ...
7 years, 5 months ago (2013-07-24 00:21:09 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/kalman@chromium.org/19670020/54001
7 years, 5 months ago (2013-07-24 00:22:09 UTC) #21
adamk
https://codereview.chromium.org/19670020/diff/51001/chrome/renderer/extensions/miscellaneous_bindings.cc File chrome/renderer/extensions/miscellaneous_bindings.cc (right): https://codereview.chromium.org/19670020/diff/51001/chrome/renderer/extensions/miscellaneous_bindings.cc#newcode194 chrome/renderer/extensions/miscellaneous_bindings.cc:194: v8::Handle<v8::Context> context = callback_->CreationContext(); On 2013/07/24 00:21:09, kalman wrote: ...
7 years, 5 months ago (2013-07-24 00:24:47 UTC) #22
commit-bot: I haz the power
7 years, 5 months ago (2013-07-24 07:43:07 UTC) #23
Message was sent while issue was closed.
Change committed as 213372

Powered by Google App Engine
This is Rietveld 408576698