RESOLVED FIXED 27906
[chromium] MessagePort construction fails in worker process
https://bugs.webkit.org/show_bug.cgi?id=27906
Summary [chromium] MessagePort construction fails in worker process
John Abd-El-Malek
Reported 2009-07-31 18:10:12 PDT
Need a fix in bindings. Per discussion with Dimitri, here's the fix and cleanup of the other place.
Attachments
Proposed patch (5.68 KB, patch)
2009-07-31 18:13 PDT, John Abd-El-Malek
no flags
fix style problems (5.67 KB, patch)
2009-07-31 18:52 PDT, John Abd-El-Malek
dglazkov: review+
Fixed a few problems with WorkerContextExecutionProxy, good to go (6.90 KB, patch)
2009-08-03 09:44 PDT, John Abd-El-Malek
dglazkov: review+
fixed David's comments (6.90 KB, patch)
2009-08-03 10:17 PDT, John Abd-El-Malek
no flags
Really update the patch (6.97 KB, patch)
2009-08-03 10:33 PDT, John Abd-El-Malek
abarth: commit-queue+
John Abd-El-Malek
Comment 1 2009-07-31 18:13:36 PDT
Created attachment 33915 [details] Proposed patch
John Abd-El-Malek
Comment 2 2009-07-31 18:40:20 PDT
note, for the MessagePort case, I hit this assert in debug mode and I'm not sure what the right fix is (i.e. this isn't ready to commit until it's fixed) WorkerContextExecutionProxy::ToV8Object calls V8DOMWrapper::setJSWrapperForDOMObject which has this code: #ifndef NDEBUG V8ClassIndex::V8WrapperType type = V8DOMWrapper::domWrapperType(wrapper); switch (type) { #define MAKE_CASE(TYPE, NAME) case V8ClassIndex::TYPE: ACTIVE_DOM_OBJECT_TYPES(MAKE_CASE) ASSERT_NOT_REACHED(); #undef MAKE_CASE default: break; } #endif Note sure why the check was added. Should WOrkerContextExecutionProxy not call V8DOMWrapper::setJSWrapperForDOMObject(impl, result); for MessagePort?
John Abd-El-Malek
Comment 3 2009-07-31 18:52:04 PDT
Created attachment 33918 [details] fix style problems
Dimitri Glazkov (Google)
Comment 4 2009-08-03 08:35:01 PDT
Comment on attachment 33918 [details] fix style problems r=me. I feel a bit queasy looking WorkerContextExecutionProxy and all its parallel methods. It also needs to be style-cleaned. I'll aks jianli or dimich to look into this.
John Abd-El-Malek
Comment 5 2009-08-03 08:46:02 PDT
Thanks, I agree it'd be good to try and share more code there. per comment 2, this is NOT ready to commit. There's still an assert that gets hit, I was wondering if you know the best way to avoid it (not sure exactly what it's testing against). I'll ping you on irc in a little bit, gotta take care of some other stuff first.
John Abd-El-Malek
Comment 6 2009-08-03 09:44:10 PDT
Created attachment 33983 [details] Fixed a few problems with WorkerContextExecutionProxy, good to go
Dimitri Glazkov (Google)
Comment 7 2009-08-03 10:01:09 PDT
Comment on attachment 33983 [details] Fixed a few problems with WorkerContextExecutionProxy, good to go Ugh. r=me.
David Levin
Comment 8 2009-08-03 10:09:26 PDT
Drive by comments, In WebCore/bindings/v8/V8DOMWrapper.cpp 520 // These objects can be constructed under WorkerContextExecutionProxy, need special handling 521 // as V8Proxy::retrieve() will crash then. I can't parse this (maybe there is a typo). Line 523-526 seems like it should be indented by one more space. In WebCore/bindings/v8/WorkerContextExecutionProxy.cpp, 219 #define MAKE_CASE(TYPE, NAME) case V8ClassIndex::TYPE: 220 ACTIVE_DOM_OBJECT_TYPES(MAKE_CASE) 221 isActiveDomObject = true; 222 #undef MAKE_CASE Shouldn't there be a break right after line 221 (or else something that says fall through)?
John Abd-El-Malek
Comment 9 2009-08-03 10:17:12 PDT
Created attachment 33985 [details] fixed David's comments
John Abd-El-Malek
Comment 10 2009-08-03 10:18:38 PDT
(In reply to comment #8) > Drive by comments, Thanks, replies below. > > In WebCore/bindings/v8/V8DOMWrapper.cpp > > 520 // These objects can be constructed under WorkerContextExecutionProxy, > need special handling > 521 // as V8Proxy::retrieve() will crash then. > > I can't parse this (maybe there is a typo). you're right, it wasn't that clear. updated. > > Line 523-526 seems like it should be indented by one more space. > done > > > In WebCore/bindings/v8/WorkerContextExecutionProxy.cpp, > > 219 #define MAKE_CASE(TYPE, NAME) case V8ClassIndex::TYPE: > 220 ACTIVE_DOM_OBJECT_TYPES(MAKE_CASE) > 221 isActiveDomObject = true; > 222 #undef MAKE_CASE > > > Shouldn't there be a break right after line 221 (or else something that says > fall through)? The code I copied this from (V8DOMWrapper::setJSWrapperForActiveDOMObject) didn't have it. It doesn't make a difference either way, since it'll fall through to the default case which breaks, but I added it anyways.
Dimitri Glazkov (Google)
Comment 11 2009-08-03 10:33:03 PDT
> > Shouldn't there be a break right after line 221 (or else something that says > > fall through)? > > The code I copied this from (V8DOMWrapper::setJSWrapperForActiveDOMObject) > didn't have it. It doesn't make a difference either way, since it'll fall > through to the default case which breaks, but I added it anyways. You did? :)
John Abd-El-Malek
Comment 12 2009-08-03 10:33:33 PDT
Created attachment 33990 [details] Really update the patch
David Levin
Comment 13 2009-08-03 10:36:39 PDT
Comment on attachment 33990 [details] Really update the patch Thanks John.
Adam Barth
Comment 14 2009-08-03 23:20:11 PDT
John, do you mean to have this bug assigned to you? In this state, it won't be committed out of the commit queue. If you'd like me to commit it for you, you can reset the assignee to the default and nominate it landing by setting the commit-queue flag to "?"
John Abd-El-Malek
Comment 15 2009-08-03 23:38:03 PDT
(In reply to comment #14) > John, do you mean to have this bug assigned to you? In this state, it won't be > committed out of the commit queue. If you'd like me to commit it for you, you > can reset the assignee to the default and nominate it landing by setting the > commit-queue flag to "?" oops, thanks for alerting me, it doesn't have to be assigned to me anymore. Don't see the commit-queue flag though.
Adam Barth
Comment 16 2009-08-04 00:06:11 PDT
Comment on attachment 33990 [details] Really update the patch Clearing review flag on attachment: 33990 Sending WebCore/ChangeLog Sending WebCore/bindings/v8/V8DOMWrapper.cpp Sending WebCore/bindings/v8/V8Proxy.cpp Sending WebCore/bindings/v8/WorkerContextExecutionProxy.cpp Transmitting file data .... Committed revision 46748. http://trac.webkit.org/changeset/46748
Adam Barth
Comment 17 2009-08-04 00:06:16 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.