Bug 24727

Summary: Need to upstream V8XMLHttpRequest*
Product: WebKit Reporter: David Levin <levin>
Component: PlatformAssignee: David Levin <levin>
Status: RESOLVED FIXED    
Severity: Normal CC: dglazkov
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Proposed fix. dglazkov: review+

Description David Levin 2009-03-20 14:38:25 PDT
See summary.
Comment 1 David Levin 2009-03-20 14:40:16 PDT
Created attachment 28801 [details]
Proposed fix.
Comment 2 Dimitri Glazkov (Google) 2009-03-21 20:34:41 PDT
Comment on attachment 28801 [details]
Proposed fix.

Proper design for all these hidden dependency helpers is out of scope for this scrubbing, so LGTM, good to land after these changes:

> +    if (ec) {
> +        V8Proxy::SetDOMException(ec);
> +        return v8::Handle<v8::Value>();
> +    }

I have a helper in V8Proxy.h that might be useful here, throwError

> +    if (ec) {
> +        V8Proxy::SetDOMException(ec);
> +        return v8::Handle<v8::Value>();
> +    }

... and here.

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

... and here.

> +    if (ec) {
> +        V8Proxy::SetDOMException(ec);
> +        return v8::Handle<v8::Value>();
> +    }

... and here.

> +    INC_STATS("DOM.XMLHttpRequest.getResponseHeader()");
> +    if (args.Length() < 1) {
> +        V8Proxy::ThrowError(V8Proxy::SYNTAX_ERROR, "Not enough arguments");
> +        return v8::Undefined();
> +    }

Ditto.

> +    if (ec) {
> +        V8Proxy::SetDOMException(ec);
> +        return v8::Handle<v8::Value>();
> +    }
> +    return v8StringOrNull(result);
> +}

Same thing.

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

Analogously.
Comment 3 David Levin 2009-03-22 00:36:31 PDT
Committed as r41898.