[Webkit-unassigned] [Bug 44444] Set the ResourceResponse HTTP headers in RessourceHandleWin

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Aug 23 11:54:18 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=44444


Adam Roben (aroben) <aroben at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #65144|review?, commit-queue?      |review-
               Flag|                            |




--- Comment #2 from Adam Roben (aroben) <aroben at apple.com>  2010-08-23 11:54:18 PST ---
(From update of attachment 65144)
> -        client()->didReceiveData(this, buffer, buffers.dwBufferLength, 0);
> +
> +        if (ResourceHandleClient* resourceHandleClient = client())
> +            resourceHandleClient->didReceiveData(this, buffer, buffers.dwBufferLength, 0);
>          buffers.dwBufferLength = bufferSize;
>      }
>  
> @@ -272,8 +293,24 @@ void ResourceHandle::onRequestComplete(L
>          InternetCloseHandle(d->m_secondaryHandle);
>      InternetCloseHandle(d->m_resourceHandle);
>  
> -    client()->didFinishLoading(this);
> -    delete this;
> +    if (ResourceHandleClient* resourceHandleClient = client())
> +        resourceHandleClient->didFinishLoading(this);
> +
> +    deref(); // balances ref in start
> +}

These changes seem completely separate from what the bug claims to be fixing. I think you should split them into a separate bug/patch.

> +String ResourceHandle::queryHTTPHeader(DWORD infoLevel)
> +{
> +    DWORD bufferSize = 0;
> +    HttpQueryInfoW(d->m_requestHandle, infoLevel, 0, &bufferSize, 0);
> +
> +    UChar* characters;
> +    String result = String::createUninitialized(bufferSize / sizeof(UChar), characters);
> +
> +    if (HttpQueryInfoW(d->m_requestHandle, infoLevel, characters, &bufferSize, 0))
> +        return result.left(result.length() - 1); // Remove NullTermination.

I think using a Vector<UChar> and String::adopt would be more efficient, since you won't have to copy the whole string at the end.

It would be clearer to have an early return if the second call to HttpQueryInfoW fails.

It might be nicer for this function to be a non-member function with internal linkage.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list