Changeset 90764 in webkit


Ignore:
Timestamp:
Jul 11, 2011 11:14:01 AM (13 years ago)
Author:
andersca@apple.com
Message:

Implement getFormValue for WebKit2
https://bugs.webkit.org/show_bug.cgi?id=64294
<rdar://problem/3964087>

Source/WebKit2:

Reviewed by Kevin Decker.

  • PluginProcess/PluginControllerProxy.cpp:

(WebKit::PluginControllerProxy::getFormValue):
Call Plugin::getFormValue.

  • PluginProcess/PluginControllerProxy.messages.in:

Add new GetFormValue message.

  • WebProcess/Plugins/Netscape/NetscapePlugin.cpp:

(WebKit::NetscapePlugin::getFormValue):
Get the form value and convert it to a String.

  • WebProcess/Plugins/Plugin.h:

Add getFormValue pure virtual member function.

  • WebProcess/Plugins/PluginProxy.cpp:

(WebKit::PluginProxy::getFormValue):
Send a GetFormValue message to the plug-in process.

  • WebProcess/Plugins/PluginView.cpp:

(WebKit::PluginView::getFormValue):
Call Plugin::getFormValue.

LayoutTests:

Remove now passing test.

  • platform/wk2/Skipped:
Location:
trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r90761 r90764  
     12011-07-11  Anders Carlsson  <andersca@apple.com>
     2
     3        Implement getFormValue for WebKit2
     4        https://bugs.webkit.org/show_bug.cgi?id=64294
     5        <rdar://problem/3964087>
     6
     7        Remove now passing test.
     8
     9        * platform/wk2/Skipped:
     10
    1112011-07-11  Ojan Vafai  <ojan@chromium.org>
    212
  • trunk/LayoutTests/platform/wk2/Skipped

    r90759 r90764  
    18531853fast/dom/shadow/create-content-element.html
    18541854
    1855 # Need to implement getFormValue().
    1856 plugins/form-value.html
    1857 
    18581855### END OF (2) Classified failures without bug reports (yet)
    18591856########################################
  • trunk/Source/WebKit2/ChangeLog

    r90760 r90764  
     12011-07-11  Anders Carlsson  <andersca@apple.com>
     2
     3        Implement getFormValue for WebKit2
     4        https://bugs.webkit.org/show_bug.cgi?id=64294
     5        <rdar://problem/3964087>
     6
     7        Reviewed by Kevin Decker.
     8
     9        * PluginProcess/PluginControllerProxy.cpp:
     10        (WebKit::PluginControllerProxy::getFormValue):
     11        Call Plugin::getFormValue.
     12
     13        * PluginProcess/PluginControllerProxy.messages.in:
     14        Add new GetFormValue message.
     15
     16        * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
     17        (WebKit::NetscapePlugin::getFormValue):
     18        Get the form value and convert it to a String.
     19
     20        * WebProcess/Plugins/Plugin.h:
     21        Add getFormValue pure virtual member function.
     22
     23        * WebProcess/Plugins/PluginProxy.cpp:
     24        (WebKit::PluginProxy::getFormValue):
     25        Send a GetFormValue message to the plug-in process.
     26
     27        * WebProcess/Plugins/PluginView.cpp:
     28        (WebKit::PluginView::getFormValue):
     29        Call Plugin::getFormValue.
     30
    1312011-07-11  Ada Chan  <adachan@apple.com>
    232
  • trunk/Source/WebKit2/PluginProcess/PluginControllerProxy.cpp

    r90331 r90764  
    594594}
    595595
     596void PluginControllerProxy::getFormValue(bool& returnValue, String& formValue)
     597{
     598    returnValue = m_plugin->getFormValue(formValue);
     599}
     600
    596601bool PluginControllerProxy::tryToShortCircuitEvaluate(NPObject* npObject, const String& scriptString, NPVariant* result)
    597602{
  • trunk/Source/WebKit2/PluginProcess/PluginControllerProxy.h

    r86812 r90764  
    141141
    142142    void privateBrowsingStateChanged(bool);
     143    void getFormValue(bool& returnValue, String& formValue);
    143144
    144145    bool tryToShortCircuitEvaluate(NPObject*, const String& scriptString, NPVariant* result);
  • trunk/Source/WebKit2/PluginProcess/PluginControllerProxy.messages.in

    r86467 r90764  
    106106    # Sent when private browsing is enabled or disabled
    107107    PrivateBrowsingStateChanged(bool isPrivateBrowsingEnabled)
     108
     109    # Gets the string representating the form value of the plug-in
     110    GetFormValue() -> (bool returnValue, WTF::String formValue)
    108111}
    109112
  • trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp

    r90328 r90764  
    768768}
    769769
     770bool NetscapePlugin::getFormValue(String& formValue)
     771{
     772    ASSERT(m_isStarted);
     773
     774    char* formValueString = 0;
     775    if (NPP_GetValue(NPPVformValue, &formValueString) != NPERR_NO_ERROR)
     776        return false;
     777
     778    formValue = String::fromUTF8(formValueString);
     779
     780    // The plug-in allocates the form value string with NPN_MemAlloc so it needs to be freed with NPN_MemFree.
     781    npnMemFree(formValueString);
     782    return true;
     783}
     784
    770785bool NetscapePlugin::supportsSnapshotting() const
    771786{
  • trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h

    r90332 r90764  
    194194
    195195    virtual void privateBrowsingStateChanged(bool);
     196    virtual bool getFormValue(String& formValue);
    196197
    197198    bool supportsSnapshotting() const;
  • trunk/Source/WebKit2/WebProcess/Plugins/Plugin.h

    r90331 r90764  
    193193    virtual void privateBrowsingStateChanged(bool) = 0;
    194194
     195    // Gets the form value representation for the plug-in, letting plug-ins participate in form submission.
     196    virtual bool getFormValue(String& formValue) = 0;
     197
    195198protected:
    196199    Plugin();
  • trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp

    r90326 r90764  
    374374}
    375375
     376bool PluginProxy::getFormValue(String& formValue)
     377{
     378    bool returnValue;
     379    if (!m_connection->connection()->sendSync(Messages::PluginControllerProxy::GetFormValue(), Messages::PluginControllerProxy::GetFormValue::Reply(returnValue, formValue), m_pluginInstanceID))
     380        return false;
     381
     382    return returnValue;
     383}
     384
    376385void PluginProxy::loadURL(uint64_t requestID, const String& method, const String& urlString, const String& target, const HTTPHeaderMap& headerFields, const Vector<uint8_t>& httpBody, bool allowPopups)
    377386{
  • trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.h

    r90326 r90764  
    102102
    103103    virtual void privateBrowsingStateChanged(bool);
     104    virtual bool getFormValue(String& formValue);
    104105
    105106    bool needsBackingStore() const;
  • trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp

    r90338 r90764  
    508508}
    509509
     510bool PluginView::getFormValue(String& formValue)
     511{
     512    // The plug-in can be null here if it failed to initialize.
     513    if (!m_isInitialized || !m_plugin)
     514        return false;
     515
     516    return m_plugin->getFormValue(formValue);
     517}
     518
    510519void PluginView::setFrameRect(const WebCore::IntRect& rect)
    511520{
  • trunk/Source/WebKit2/WebProcess/Plugins/PluginView.h

    r86851 r90764  
    103103    virtual JSC::JSObject* scriptObject(JSC::JSGlobalObject*);
    104104    virtual void privateBrowsingStateChanged(bool);
    105    
     105    virtual bool getFormValue(String&);
     106
    106107    // WebCore::Widget
    107108    virtual void setFrameRect(const WebCore::IntRect&);
Note: See TracChangeset for help on using the changeset viewer.