Bug 65778 - [WebWorkers][chromium] Make statics thread-safe and make sure V8 API accesses correct isolates
Summary: [WebWorkers][chromium] Make statics thread-safe and make sure V8 API accesses...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Dmitry Lomov
URL:
Keywords:
Depends on: 65881
Blocks: 61016
  Show dependency treegraph
 
Reported: 2011-08-05 10:52 PDT by Dmitry Lomov
Modified: 2011-08-09 12:01 PDT (History)
6 users (show)

See Also:


Attachments
Fixes. (18.15 KB, patch)
2011-08-05 10:57 PDT, Dmitry Lomov
webkit.review.bot: commit-queue-
Details | Formatted Diff | Diff
Release compilation fixed (18.21 KB, patch)
2011-08-05 13:53 PDT, Dmitry Lomov
levin: review-
Details | Formatted Diff | Diff
CR feedback (18.33 KB, patch)
2011-08-08 10:39 PDT, Dmitry Lomov
no flags Details | Formatted Diff | Diff
Fixed field initialization to unbreak chromium canary. (19.12 KB, patch)
2011-08-09 10:37 PDT, Dmitry Lomov
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Lomov 2011-08-05 10:52:53 PDT
After attempting to switch WebWorkers in-process and run tests I discovered a bunch of statics that should be made per-isolate and several cases of V8 API accessing the wrong isolate.
Comment 1 Dmitry Lomov 2011-08-05 10:57:25 PDT
Created attachment 103086 [details]
Fixes.
Comment 2 WebKit Review Bot 2011-08-05 11:15:17 PDT
Comment on attachment 103086 [details]
Fixes.

Attachment 103086 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/9310020
Comment 3 WebKit Review Bot 2011-08-05 12:18:04 PDT
Comment on attachment 103086 [details]
Fixes.

Attachment 103086 [details] did not pass cr-mac-ews (chromium):
Output: http://queues.webkit.org/results/9323039
Comment 4 Dmitry Lomov 2011-08-05 13:53:38 PDT
Created attachment 103102 [details]
Release compilation fixed
Comment 5 David Levin 2011-08-07 20:59:07 PDT
Comment on attachment 103102 [details]
Release compilation fixed

View in context: https://bugs.webkit.org/attachment.cgi?id=103102&action=review

Just a few things to clear/clean up.

> Source/WebCore/ChangeLog:11
> +        (WebCore::V8BindingPerIsolateData::lazyEventListenerToStringTemplate):

Why are all of these items being moved?

Ideally they would be moved in one change and if any changes were needed, then that would happen in another change.

> Source/WebCore/bindings/v8/V8Binding.h:176
> +        inline AllowAllocation()

Isn't inline redundant here (since you put the function body in the class definition)?

> Source/WebCore/bindings/v8/V8Binding.h:183
> +        inline ~AllowAllocation()

Ditto.

> Source/WebCore/bindings/v8/V8Binding.h:199
> +      static inline v8::Local<v8::Object> newInstance(v8::Handle<v8::Function>, int argc, v8::Handle<v8::Value> argv[]);

The indentation is following Chromium style as opposed to WebKit style.

> Source/WebCore/bindings/v8/V8LazyEventListener.cpp:143
>                  toStringTemplate = v8::Persistent<v8::FunctionTemplate>::New(v8::FunctionTemplate::New(V8LazyEventListenerToString));

I wonder why this isn't part of the method lazyEventListenerToStringTemplate.

> Source/WebKit/chromium/ChangeLog:8
> +        * src/BoundObject.cpp:Headers

Would be nice to explain why this change was needed. (Now I see why bur it is still nice to add the info here to make it quicker for people to understand.)
Comment 6 Dmitry Lomov 2011-08-08 10:20:15 PDT
Comment on attachment 103102 [details]
Release compilation fixed

View in context: https://bugs.webkit.org/attachment.cgi?id=103102&action=review

>> Source/WebCore/ChangeLog:11

> 
> Why are all of these items being moved?
> 
> Ideally they would be moved in one change and if any changes were needed, then that would happen in another change.

You mean why AllowAllocation is moved between headers? This is because of the header dependencies (V8Proxy include V8Utilities include V8Bindings include V8Proxy).

Do you insist on splitting class move between headers and change in class into two different patches? I see little reason for that.

>> Source/WebCore/bindings/v8/V8Binding.h:176
>> +        inline AllowAllocation()
> 
> Isn't inline redundant here (since you put the function body in the class definition)?

You are right - I'll remove this.

>> Source/WebCore/bindings/v8/V8Binding.h:199
>> +      static inline v8::Local<v8::Object> newInstance(v8::Handle<v8::Function>, int argc, v8::Handle<v8::Value> argv[]);
> 
> The indentation is following Chromium style as opposed to WebKit style.

Will fix

>> Source/WebCore/bindings/v8/V8LazyEventListener.cpp:143
>>                  toStringTemplate = v8::Persistent<v8::FunctionTemplate>::New(v8::FunctionTemplate::New(V8LazyEventListenerToString));
> 
> I wonder why this isn't part of the method lazyEventListenerToStringTemplate.

V8BindingPerIsolateData does not need to know anything about V8LazyEventListener, other than provide a container for its data. This logic really belongs here.

>> Source/WebKit/chromium/ChangeLog:8
>> +        * src/BoundObject.cpp:Headers
> 
> Would be nice to explain why this change was needed. (Now I see why bur it is still nice to add the info here to make it quicker for people to understand.)

True that) Will add comments.
Comment 7 Dmitry Lomov 2011-08-08 10:39:19 PDT
Created attachment 103263 [details]
CR feedback
Comment 8 David Levin 2011-08-08 11:17:58 PDT
(In reply to comment #6)
> (From update of attachment 103102 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=103102&action=review
> 
> >> Source/WebCore/ChangeLog:11
> 
> > 
> > Why are all of these items being moved?
> > 
> > Ideally they would be moved in one change and if any changes were needed, then that would happen in another change.
> 
> You mean why AllowAllocation is moved between headers? This is because of the header dependencies (V8Proxy include V8Utilities include V8Bindings include V8Proxy).
> 
> Do you insist on splitting class move between headers and change in class into two different patches? I see little reason for that.

I won't insist. However, doing this all at once makes it much harder to determine what is being moved vs what is being changed but at the moment and later when someone goes thru diffs to understand what was done.
Comment 9 WebKit Review Bot 2011-08-08 12:11:48 PDT
Comment on attachment 103263 [details]
CR feedback

Clearing flags on attachment: 103263

Committed r92619: <http://trac.webkit.org/changeset/92619>
Comment 10 WebKit Review Bot 2011-08-08 12:11:53 PDT
All reviewed patches have been landed.  Closing bug.
Comment 11 Dmitry Lomov 2011-08-08 12:39:33 PDT
(In reply to comment #8)
> (In reply to comment #6)
> > (From update of attachment 103102 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=103102&action=review
> > 
> > >> Source/WebCore/ChangeLog:11
> > 
> > > 
> > > Why are all of these items being moved?
> > > 
> > > Ideally they would be moved in one change and if any changes were needed, then that would happen in another change.
> > 
> > You mean why AllowAllocation is moved between headers? This is because of the header dependencies (V8Proxy include V8Utilities include V8Bindings include V8Proxy).
> > 
> > Do you insist on splitting class move between headers and change in class into two different patches? I see little reason for that.
> 
> I won't insist. However, doing this all at once makes it much harder to determine what is being moved vs what is being changed but at the moment and later when someone goes thru diffs to understand what was done.

Point taken.
Comment 12 Dmitry Lomov 2011-08-08 15:16:51 PDT
Patch rolled out due to breaking chromium canary
Comment 13 Dmitry Lomov 2011-08-09 10:37:23 PDT
Created attachment 103370 [details]
Fixed field initialization to unbreak chromium canary.
Comment 14 WebKit Review Bot 2011-08-09 12:01:20 PDT
Comment on attachment 103370 [details]
Fixed field initialization to unbreak chromium canary.

Clearing flags on attachment: 103370

Committed r92694: <http://trac.webkit.org/changeset/92694>
Comment 15 WebKit Review Bot 2011-08-09 12:01:25 PDT
All reviewed patches have been landed.  Closing bug.