Bug 25170 - Upstream V8WorkerCustom.cpp and V8WorkerContextCustom.cpp for V8 bindings.
Summary: Upstream V8WorkerCustom.cpp and V8WorkerContextCustom.cpp for V8 bindings.
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: 25167
Blocks:
  Show dependency treegraph
 
Reported: 2009-04-13 17:32 PDT by Jian Li
Modified: 2009-04-18 18:42 PDT (History)
1 user (show)

See Also:


Attachments
Proposed Patch (18.80 KB, patch)
2009-04-13 17:45 PDT, Jian Li
dglazkov: review+
Details | Formatted Diff | Diff
Proposed Patch (18.64 KB, patch)
2009-04-17 11:04 PDT, Jian Li
dglazkov: 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-13 17:32:58 PDT
Upstream V8WorkerCustom.cpp and V8WorkerContextCustom.cpp for V8 bindings.
Comment 1 Jian Li 2009-04-13 17:45:07 PDT
Created attachment 29449 [details]
Proposed Patch
Comment 2 Dimitri Glazkov (Google) 2009-04-16 20:40:53 PDT
Comment on attachment 29449 [details]
Proposed Patch

Apologies for the delay. Good scrubbing! Needs just a few more changes.

> +ACCESSOR_GETTER(WorkerContextSelf) {

Brace on new line.

> +ACCESSOR_GETTER(WorkerContextOnmessage) {

Ditto.

> +ACCESSOR_SETTER(WorkerContextOnmessage) {

Ditto.

> +v8::Handle<v8::Value> SetTimeoutOrInterval(const v8::Arguments& args, bool singleShot) {

Ditto.

> +v8::Handle<v8::Value> ClearTimeoutOrInterval(const v8::Arguments& args) {

Ditto.

> +    int tid = ToInt32(args[0], ok);

toInt32, and let's expand tid to timerId.

> +CALLBACK_FUNC_DECL(WorkerContextImportScripts) {

Brace on new line.

> +CALLBACK_FUNC_DECL(WorkerContextSetTimeout) {

Ditto.

> +CALLBACK_FUNC_DECL(WorkerContextClearTimeout) {

Ditto.

> +CALLBACK_FUNC_DECL(WorkerContextSetInterval) {

Ditto.

> +CALLBACK_FUNC_DECL(WorkerContextClearInterval) {

Ditto.

> +CALLBACK_FUNC_DECL(WorkerContextAddEventListener) {

Ditto.

> +CALLBACK_FUNC_DECL(WorkerContextRemoveEventListener) {

Ditto.

> +CALLBACK_FUNC_DECL(WorkerConstructor) {

Ditto.

> +    if (!WorkerContextExecutionProxy::isWebWorkersEnabled()) {
> +        V8Proxy::ThrowError(V8Proxy::SYNTAX_ERROR, "Worker is not enabled.");
> +        return v8::Undefined();

Use throwError helper from V8Proxy.

> +        V8Proxy::ThrowError(V8Proxy::TYPE_ERROR, "DOM object constructor cannot be called as a function.");
> +        return v8::Undefined();

Ditto.

> +    if (args.Length() == 0) {
> +        V8Proxy::ThrowError(V8Proxy::SYNTAX_ERROR, "Not enough arguments");
> +        return v8::Undefined();

Ditto.

> +    if (tryCatch.HasCaught()) {
> +        v8::ThrowException(tryCatch.Exception());
> +        return v8::Undefined();

Ditto.

> +ACCESSOR_GETTER(WorkerOnmessage) {

Brace on new line.

> +ACCESSOR_SETTER(WorkerOnmessage) {

Ditto.

> +ACCESSOR_GETTER(WorkerOnerror) {

Ditto.

> +ACCESSOR_SETTER(WorkerOnerror) {

Ditto.

> +CALLBACK_FUNC_DECL(WorkerAddEventListener) {

Ditto.

> +CALLBACK_FUNC_DECL(WorkerRemoveEventListener) {

Ditto.
Comment 3 Jian Li 2009-04-17 11:04:32 PDT
Created attachment 29583 [details]
Proposed Patch

All issues fixed.
Comment 4 Dimitri Glazkov (Google) 2009-04-17 14:34:58 PDT
Comment on attachment 29583 [details]
Proposed Patch

Even better.
Comment 5 Dmitry Titov 2009-04-18 18:42:19 PDT
landed: http://trac.webkit.org/changeset/42648