Bug 25121 - Upstream changes to handle error messages from V8 when running worker script.
Summary: Upstream changes to handle error messages from V8 when running worker script.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Jian Li
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-09 14:11 PDT by Jian Li
Modified: 2009-04-13 13:23 PDT (History)
3 users (show)

See Also:


Attachments
Proposed Patch (2.92 KB, patch)
2009-04-09 17:32 PDT, Jian Li
fishd: review+
Details | Formatted Diff | Diff
Proposed Patch (6.39 KB, patch)
2009-04-10 15:46 PDT, Jian Li
fishd: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jian Li 2009-04-09 14:11:29 PDT
Upstream changes to handle error messages from V8 when running worker script.
Comment 1 Jian Li 2009-04-09 17:32:11 PDT
Created attachment 29384 [details]
Proposed Patch
Comment 2 Darin Fisher (:fishd, Google) 2009-04-09 22:54:44 PDT
Comment on attachment 29384 [details]
Proposed Patch

LGTM

> +    // Do the one-time initialization.
> +    static bool v8Initialized = false;
> +    if (!v8Initialized) {
> +        // Tells V8 not to call the default OOM handler, binding code will handle it.
> +        v8::V8::IgnoreOutOfMemoryException();
> +        v8::V8::SetFatalErrorHandler(reportFatalErrorInV8);
> +        
> +        v8::V8::AddMessageListener(handleConsoleMessage);
> +        
> +        v8Initialized = true;
> +    }

Is there really no worry about multiple threads running this code at the same time?
Comment 3 Jian Li 2009-04-10 13:03:58 PDT
It is now possible since we turn on v8 preemption although the chance is extremely small. I am working on a fix for this one. Thanks.

(In reply to comment #2)
> (From update of attachment 29384 [details] [review])
> LGTM
> 
> > +    // Do the one-time initialization.
> > +    static bool v8Initialized = false;
> > +    if (!v8Initialized) {
> > +        // Tells V8 not to call the default OOM handler, binding code will handle it.
> > +        v8::V8::IgnoreOutOfMemoryException();
> > +        v8::V8::SetFatalErrorHandler(reportFatalErrorInV8);
> > +        
> > +        v8::V8::AddMessageListener(handleConsoleMessage);
> > +        
> > +        v8Initialized = true;
> > +    }
> 
> Is there really no worry about multiple threads running this code at the same
> time?
> 

Comment 4 Jian Li 2009-04-10 15:46:37 PDT
Created attachment 29404 [details]
Proposed Patch

I fixed the threading problem. Please take a look again. Thanks.
Comment 5 Dmitry Titov 2009-04-13 13:23:18 PDT
Landed: http://trac.webkit.org/changeset/42452