Summary: | Upstream changes to handle error messages from V8 when running worker script. | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Jian Li <jianli> | ||||||
Component: | WebCore Misc. | Assignee: | Jian Li <jianli> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | dglazkov, fishd, jianli | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | All | ||||||||
OS: | All | ||||||||
Attachments: |
|
Description
Jian Li
2009-04-09 14:11:29 PDT
Created attachment 29384 [details]
Proposed Patch
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? 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? > Created attachment 29404 [details]
Proposed Patch
I fixed the threading problem. Please take a look again. Thanks.
|