[webkit-help] Formstate in Frameloader.cpp

Dinesh Garg gargdk at yahoo.com
Fri Jan 7 08:53:07 PST 2011


Hi All,
Is the following usage of formstate correct in following function in 
FrameLoader.cpp?

void FrameLoader::loadURL(const KURL& newURL, const String& referrer, const 
String& frameName, bool lockHistory, FrameLoadType newLoadType,
    PassRefPtr<Event>  event, PassRefPtr<FormState> prpFormState)
{
    RefPtr<FormState> formState = prpFormState;
    bool isFormSubmission = formState;
    ....
    targetFrame->loader()->loadURL(newURL, referrer, String(), lockHistory, 
newLoadType, event, formState);  <------wrong as per my understanding
     targetFrame->loader()->loadURL(newURL, referrer, String(), lockHistory, 
newLoadType, event, formState.release()); <----Should be like this
    ...
}

I checked the webkit trunk. There are several such instances of this in 
Frameloader.cpp. 

As per my understanding of RefPtr & PassRefPtr, we should 
call formState.release() to pass "PassRefPtr".

Thanks a lot,
Dinesh



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-help/attachments/20110107/03224dda/attachment.html>


More information about the webkit-help mailing list