2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Collabora Ltd. All rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
14 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
18 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
21 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 #include "PluginView.h"
31 #include "DocumentLoader.h"
33 #include "EventNames.h"
34 #include "FrameLoader.h"
35 #include "FrameTree.h"
37 #include "FrameView.h"
38 #include "GraphicsContext.h"
40 #include "HTMLNames.h"
41 #include "HTMLPlugInElement.h"
42 #include "JSDOMWindow.h"
43 #include "KeyboardEvent.h"
44 #include "MIMETypeRegistry.h"
45 #include "MouseEvent.h"
46 #include "NotImplemented.h"
48 #include "FocusController.h"
49 #include "PlatformMouseEvent.h"
51 #include "PluginMessageThrottlerWin.h"
53 #include "PluginPackage.h"
54 #include "kjs_binding.h"
55 #include "kjs_proxy.h"
56 #include "PluginDatabase.h"
57 #include "PluginDebug.h"
58 #include "PluginPackage.h"
59 #include "c_instance.h"
60 #include "npruntime_impl.h"
61 #include "runtime_root.h"
64 #include <kjs/JSLock.h>
65 #include <kjs/value.h>
66 #include <wtf/ASCIICType.h>
80 using namespace EventNames;
81 using namespace HTMLNames;
83 static int s_callingPlugin;
85 static String scriptStringIfJavaScriptURL(const KURL& url)
87 if (!url.protocolIs("javascript"))
90 // This returns an unescaped string
91 return decodeURLEscapeSequences(url.string().substring(11));
94 PluginView* PluginView::s_currentPluginView = 0;
96 void PluginView::popPopupsStateTimerFired(Timer<PluginView>*)
98 popPopupsEnabledState();
101 IntRect PluginView::windowClipRect() const
103 // Start by clipping to our bounds.
104 IntRect clipRect(m_windowRect);
106 // Take our element and get the clip rect from the enclosing layer and frame view.
107 RenderLayer* layer = m_element->renderer()->enclosingLayer();
108 FrameView* parentView = m_element->document()->view();
109 clipRect.intersect(parentView->windowClipRectForLayer(layer, true));
114 void PluginView::setFrameGeometry(const IntRect& rect)
116 if (m_element->document()->printing())
119 if (rect != frameGeometry())
120 Widget::setFrameGeometry(rect);
125 setNPWindowRect(rect);
129 void PluginView::geometryChanged() const
134 void PluginView::handleEvent(Event* event)
136 if (!m_plugin || m_isWindowed)
139 if (event->isMouseEvent())
140 handleMouseEvent(static_cast<MouseEvent*>(event));
141 else if (event->isKeyboardEvent())
142 handleKeyboardEvent(static_cast<KeyboardEvent*>(event));
145 bool PluginView::start()
151 ASSERT(m_plugin->pluginFuncs()->newp);
154 PluginView::setCurrentPluginView(this);
156 KJS::JSLock::DropAllLocks dropAllLocks;
157 setCallingPlugin(true);
158 npErr = m_plugin->pluginFuncs()->newp((NPMIMEType)m_mimeType.data(), m_instance, m_mode, m_paramCount, m_paramNames, m_paramValues, NULL);
159 setCallingPlugin(false);
162 PluginView::setCurrentPluginView(0);
164 if (npErr != NPERR_NO_ERROR)
169 if (!m_url.isEmpty() && !m_loadManually) {
170 FrameLoadRequest frameLoadRequest;
171 frameLoadRequest.resourceRequest().setHTTPMethod("GET");
172 frameLoadRequest.resourceRequest().setURL(m_url);
173 load(frameLoadRequest, false, 0);
179 void PluginView::setCurrentPluginView(PluginView* pluginView)
181 s_currentPluginView = pluginView;
184 PluginView* PluginView::currentPluginView()
186 return s_currentPluginView;
189 static char* createUTF8String(const String& str)
191 CString cstr = str.utf8();
192 char* result = reinterpret_cast<char*>(fastMalloc(cstr.length() + 1));
194 strncpy(result, cstr.data(), cstr.length() + 1);
199 static bool getString(KJSProxy* proxy, JSValue* result, String& string)
201 if (!proxy || !result || result->isUndefined())
205 ExecState* exec = proxy->globalObject()->globalExec();
206 UString ustring = result->toString(exec);
207 exec->clearException();
213 void PluginView::performRequest(PluginRequest* request)
215 // don't let a plugin start any loads if it is no longer part of a document that is being
216 // displayed unless the loads are in the same frame as the plugin.
217 const String& targetFrameName = request->frameLoadRequest().frameName();
218 if (m_parentFrame->loader()->documentLoader() != m_parentFrame->loader()->activeDocumentLoader() &&
219 (targetFrameName.isNull() || m_parentFrame->tree()->find(targetFrameName) != m_parentFrame))
222 KURL requestURL = request->frameLoadRequest().resourceRequest().url();
223 String jsString = scriptStringIfJavaScriptURL(requestURL);
225 if (jsString.isNull()) {
226 // if this is not a targeted request, create a stream for it. otherwise,
227 // just pass it off to the loader
228 if (targetFrameName.isEmpty()) {
229 PluginStream* stream = new PluginStream(this, m_parentFrame, request->frameLoadRequest().resourceRequest(), request->sendNotification(), request->notifyData(), plugin()->pluginFuncs(), instance(), m_plugin->quirks());
230 m_streams.add(stream);
233 m_parentFrame->loader()->load(request->frameLoadRequest().resourceRequest(), targetFrameName);
235 // FIXME: <rdar://problem/4807469> This should be sent when the document has finished loading
236 if (request->sendNotification()) {
237 KJS::JSLock::DropAllLocks dropAllLocks;
238 setCallingPlugin(true);
239 m_plugin->pluginFuncs()->urlnotify(m_instance, requestURL.string().utf8().data(), NPRES_DONE, request->notifyData());
240 setCallingPlugin(false);
246 // Targeted JavaScript requests are only allowed on the frame that contains the JavaScript plugin
247 // and this has been made sure in ::load.
248 ASSERT(targetFrameName.isEmpty() || m_parentFrame->tree()->find(targetFrameName) == m_parentFrame);
250 // Executing a script can cause the plugin view to be destroyed, so we keep a reference to the parent frame.
251 RefPtr<Frame> parentFrame = m_parentFrame;
252 JSValue* result = m_parentFrame->loader()->executeScript(jsString, request->shouldAllowPopups());
254 if (targetFrameName.isNull()) {
258 if (getString(parentFrame->scriptProxy(), result, resultString))
259 cstr = resultString.utf8();
261 RefPtr<PluginStream> stream = new PluginStream(this, m_parentFrame, request->frameLoadRequest().resourceRequest(), request->sendNotification(), request->notifyData(), plugin()->pluginFuncs(), instance(), m_plugin->quirks());
262 m_streams.add(stream);
263 stream->sendJavaScriptStream(requestURL, cstr);
267 void PluginView::requestTimerFired(Timer<PluginView>* timer)
269 ASSERT(timer == &m_requestTimer);
270 ASSERT(m_requests.size() > 0);
271 ASSERT(!m_isJavaScriptPaused);
273 PluginRequest* request = m_requests[0];
274 m_requests.remove(0);
276 // Schedule a new request before calling performRequest since the call to
277 // performRequest can cause the plugin view to be deleted.
278 if (m_requests.size() > 0)
279 m_requestTimer.startOneShot(0);
281 performRequest(request);
285 void PluginView::scheduleRequest(PluginRequest* request)
287 m_requests.append(request);
289 if (!m_isJavaScriptPaused)
290 m_requestTimer.startOneShot(0);
293 NPError PluginView::load(const FrameLoadRequest& frameLoadRequest, bool sendNotification, void* notifyData)
295 ASSERT(frameLoadRequest.resourceRequest().httpMethod() == "GET" || frameLoadRequest.resourceRequest().httpMethod() == "POST");
297 KURL url = frameLoadRequest.resourceRequest().url();
300 return NPERR_INVALID_URL;
302 const String& targetFrameName = frameLoadRequest.frameName();
303 String jsString = scriptStringIfJavaScriptURL(url);
305 if (!jsString.isNull()) {
306 Settings* settings = m_parentFrame->settings();
307 if (!settings || !settings->isJavaScriptEnabled()) {
308 // Return NPERR_GENERIC_ERROR if JS is disabled. This is what Mozilla does.
309 return NPERR_GENERIC_ERROR;
312 if (!targetFrameName.isNull() && m_parentFrame->tree()->find(targetFrameName) != m_parentFrame) {
313 // For security reasons, only allow JS requests to be made on the frame that contains the plug-in.
314 return NPERR_INVALID_PARAM;
318 PluginRequest* request = new PluginRequest(frameLoadRequest, sendNotification, notifyData, arePopupsAllowed());
319 scheduleRequest(request);
321 return NPERR_NO_ERROR;
324 static KURL makeURL(const KURL& baseURL, const char* relativeURLString)
326 String urlString = relativeURLString;
328 // Strip return characters.
329 urlString.replace('\n', "");
330 urlString.replace('\r', "");
332 return KURL(baseURL, urlString);
335 NPError PluginView::getURLNotify(const char* url, const char* target, void* notifyData)
337 FrameLoadRequest frameLoadRequest;
339 frameLoadRequest.setFrameName(target);
340 frameLoadRequest.resourceRequest().setHTTPMethod("GET");
341 frameLoadRequest.resourceRequest().setURL(makeURL(m_baseURL, url));
343 return load(frameLoadRequest, true, notifyData);
346 NPError PluginView::getURL(const char* url, const char* target)
348 FrameLoadRequest frameLoadRequest;
350 frameLoadRequest.setFrameName(target);
351 frameLoadRequest.resourceRequest().setHTTPMethod("GET");
352 frameLoadRequest.resourceRequest().setURL(makeURL(m_baseURL, url));
354 return load(frameLoadRequest, false, 0);
357 NPError PluginView::postURLNotify(const char* url, const char* target, uint32 len, const char* buf, NPBool file, void* notifyData)
359 return handlePost(url, target, len, buf, file, notifyData, true, true);
362 NPError PluginView::postURL(const char* url, const char* target, uint32 len, const char* buf, NPBool file)
364 // As documented, only allow headers to be specified via NPP_PostURL when using a file.
365 return handlePost(url, target, len, buf, file, 0, false, file);
368 NPError PluginView::newStream(NPMIMEType type, const char* target, NPStream** stream)
372 return NPERR_GENERIC_ERROR;
375 int32 PluginView::write(NPStream* stream, int32 len, void* buffer)
382 NPError PluginView::destroyStream(NPStream* stream, NPReason reason)
384 PluginStream* browserStream = static_cast<PluginStream*>(stream->ndata);
386 if (!stream || PluginStream::ownerForStream(stream) != m_instance)
387 return NPERR_INVALID_INSTANCE_ERROR;
389 browserStream->cancelAndDestroyStream(reason);
390 return NPERR_NO_ERROR;
393 void PluginView::status(const char* message)
395 if (Page* page = m_parentFrame->page())
396 page->chrome()->setStatusbarText(m_parentFrame, String(message));
399 NPError PluginView::setValue(NPPVariable variable, void* value)
402 case NPPVpluginWindowBool:
403 m_isWindowed = value;
404 return NPERR_NO_ERROR;
405 case NPPVpluginTransparentBool:
406 m_isTransparent = value;
407 return NPERR_NO_ERROR;
410 return NPERR_GENERIC_ERROR;
414 void PluginView::invalidateTimerFired(Timer<PluginView>* timer)
416 ASSERT(timer == &m_invalidateTimer);
418 for (unsigned i = 0; i < m_invalidRects.size(); i++)
419 Widget::invalidateRect(m_invalidRects[i]);
420 m_invalidRects.clear();
424 void PluginView::pushPopupsEnabledState(bool state)
426 m_popupStateStack.append(state);
429 void PluginView::popPopupsEnabledState()
431 m_popupStateStack.removeLast();
434 bool PluginView::arePopupsAllowed() const
436 if (!m_popupStateStack.isEmpty())
437 return m_popupStateStack.last();
442 void PluginView::setJavaScriptPaused(bool paused)
444 if (m_isJavaScriptPaused == paused)
446 m_isJavaScriptPaused = paused;
448 if (m_isJavaScriptPaused)
449 m_requestTimer.stop();
450 else if (!m_requests.isEmpty())
451 m_requestTimer.startOneShot(0);
454 PassRefPtr<KJS::Bindings::Instance> PluginView::bindingInstance()
456 #if ENABLE(NETSCAPE_PLUGIN_API)
457 NPObject* object = 0;
459 if (!m_plugin || !m_plugin->pluginFuncs()->getvalue)
464 KJS::JSLock::DropAllLocks dropAllLocks;
465 setCallingPlugin(true);
466 npErr = m_plugin->pluginFuncs()->getvalue(m_instance, NPPVpluginScriptableNPObject, &object);
467 setCallingPlugin(false);
470 if (npErr != NPERR_NO_ERROR || !object)
473 RefPtr<KJS::Bindings::RootObject> root = m_parentFrame->createRootObject(this, m_parentFrame->scriptProxy()->globalObject());
474 RefPtr<KJS::Bindings::Instance> instance = KJS::Bindings::CInstance::create(object, root.release());
476 _NPN_ReleaseObject(object);
478 return instance.release();
484 void PluginView::disconnectStream(PluginStream* stream)
486 ASSERT(m_streams.contains(stream));
488 m_streams.remove(stream);
491 void PluginView::setParameters(const Vector<String>& paramNames, const Vector<String>& paramValues)
493 ASSERT(paramNames.size() == paramValues.size());
495 unsigned size = paramNames.size();
496 unsigned paramCount = 0;
498 m_paramNames = reinterpret_cast<char**>(fastMalloc(sizeof(char*) * size));
499 m_paramValues = reinterpret_cast<char**>(fastMalloc(sizeof(char*) * size));
501 for (unsigned i = 0; i < size; i++) {
502 if (m_plugin->quirks().contains(PluginQuirkRemoveWindowlessVideoParam) && equalIgnoringCase(paramNames[i], "windowlessvideo"))
505 m_paramNames[paramCount] = createUTF8String(paramNames[i]);
506 m_paramValues[paramCount] = createUTF8String(paramValues[i]);
511 m_paramCount = paramCount;
514 PluginView::PluginView(Frame* parentFrame, const IntSize& size, PluginPackage* plugin, Element* element, const KURL& url, const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType, bool loadManually)
515 : m_parentFrame(parentFrame)
520 , m_baseURL(m_parentFrame->loader()->completeURL(m_parentFrame->document()->baseURL().string()))
521 , m_status(PluginStatusLoadedSuccessfully)
522 , m_requestTimer(this, &PluginView::requestTimerFired)
523 , m_invalidateTimer(this, &PluginView::invalidateTimerFired)
524 , m_popPopupsStateTimer(this, &PluginView::popPopupsStateTimerFired)
528 , m_isTransparent(false)
530 , m_attachedToWindow(false)
531 , m_haveInitialized(false)
532 #if PLATFORM(GTK) || defined(Q_WS_X11)
533 , m_needsXEmbed(false)
538 , m_isCallingPluginWndProc(false)
541 , m_loadManually(loadManually)
543 , m_isJavaScriptPaused(false)
546 m_status = PluginStatusCanNotFindPlugin;
550 m_instance = &m_instanceStruct;
551 m_instance->ndata = this;
553 m_mimeType = mimeType.utf8();
555 setParameters(paramNames, paramValues);
558 m_npWindow.ws_info = 0;
561 m_mode = m_loadManually ? NP_FULL : NP_EMBED;
566 void PluginView::didReceiveResponse(const ResourceResponse& response)
568 ASSERT(m_loadManually);
569 ASSERT(!m_manualStream);
571 m_manualStream = new PluginStream(this, m_parentFrame, m_parentFrame->loader()->activeDocumentLoader()->request(), false, 0, plugin()->pluginFuncs(), instance(), m_plugin->quirks());
572 m_manualStream->setLoadManually(true);
574 m_manualStream->didReceiveResponse(0, response);
577 void PluginView::didReceiveData(const char* data, int length)
579 ASSERT(m_loadManually);
580 ASSERT(m_manualStream);
582 m_manualStream->didReceiveData(0, data, length);
585 void PluginView::didFinishLoading()
587 ASSERT(m_loadManually);
588 ASSERT(m_manualStream);
590 m_manualStream->didFinishLoading(0);
593 void PluginView::didFail(const ResourceError& error)
595 ASSERT(m_loadManually);
596 ASSERT(m_manualStream);
598 m_manualStream->didFail(0, error);
601 void PluginView::setCallingPlugin(bool b) const
603 if (!m_plugin->quirks().contains(PluginQuirkHasModalMessageLoop))
611 ASSERT(s_callingPlugin >= 0);
614 bool PluginView::isCallingPlugin()
616 return s_callingPlugin > 0;
619 PluginView* PluginView::create(Frame* parentFrame, const IntSize& size, Element* element, const KURL& url, const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType, bool loadManually)
621 // if we fail to find a plugin for this MIME type, findPlugin will search for
622 // a plugin by the file extension and update the MIME type, so pass a mutable String
623 String mimeTypeCopy = mimeType;
624 PluginPackage* plugin = PluginDatabase::installedPlugins()->findPlugin(url, mimeTypeCopy);
626 // No plugin was found, try refreshing the database and searching again
627 if (!plugin && PluginDatabase::installedPlugins()->refresh()) {
628 mimeTypeCopy = mimeType;
629 plugin = PluginDatabase::installedPlugins()->findPlugin(url, mimeTypeCopy);
632 return new PluginView(parentFrame, size, plugin, element, url, paramNames, paramValues, mimeTypeCopy, loadManually);
635 void PluginView::freeStringArray(char** stringArray, int length)
640 for (int i = 0; i < length; i++)
641 fastFree(stringArray[i]);
643 fastFree(stringArray);
646 static inline bool startsWithBlankLine(const Vector<char>& buffer)
648 return buffer.size() > 0 && buffer[0] == '\n';
651 static inline int locationAfterFirstBlankLine(const Vector<char>& buffer)
653 const char* bytes = buffer.data();
654 unsigned length = buffer.size();
656 for (unsigned i = 0; i < length - 4; i++) {
657 // Support for Acrobat. It sends "\n\n".
658 if (bytes[i] == '\n' && bytes[i + 1] == '\n')
661 // Returns the position after 2 CRLF's or 1 CRLF if it is the first line.
662 if (bytes[i] == '\r' && bytes[i + 1] == '\n') {
666 else if (bytes[i] == '\n')
667 // Support for Director. It sends "\r\n\n" (3880387).
669 else if (bytes[i] == '\r' && bytes[i + 1] == '\n')
670 // Support for Flash. It sends "\r\n\r\n" (3758113).
678 static inline const char* findEOL(const char* bytes, unsigned length)
680 // According to the HTTP specification EOL is defined as
681 // a CRLF pair. Unfortunately, some servers will use LF
682 // instead. Worse yet, some servers will use a combination
683 // of both (e.g. <header>CRLFLF<body>), so findEOL needs
684 // to be more forgiving. It will now accept CRLF, LF or
687 // It returns NULL if EOLF is not found or it will return
688 // a pointer to the first terminating character.
689 for (unsigned i = 0; i < length; i++) {
690 if (bytes[i] == '\n')
692 if (bytes[i] == '\r') {
693 // Check to see if spanning buffer bounds
694 // (CRLF is across reads). If so, wait for
706 static inline String capitalizeRFC822HeaderFieldName(const String& name)
708 bool capitalizeCharacter = true;
711 for (unsigned i = 0; i < name.length(); i++) {
714 if (capitalizeCharacter && name[i] >= 'a' && name[i] <= 'z')
715 c = toASCIIUpper(name[i]);
716 else if (!capitalizeCharacter && name[i] >= 'A' && name[i] <= 'Z')
717 c = toASCIILower(name[i]);
722 capitalizeCharacter = true;
724 capitalizeCharacter = false;
732 static inline HTTPHeaderMap parseRFC822HeaderFields(const Vector<char>& buffer, unsigned length)
734 const char* bytes = buffer.data();
737 HTTPHeaderMap headerFields;
739 // Loop ove rlines until we're past the header, or we can't find any more end-of-lines
740 while ((eol = findEOL(bytes, length))) {
741 const char* line = bytes;
742 int lineLength = eol - bytes;
744 // Move bytes to the character after the terminator as returned by findEOL.
746 if ((*eol == '\r') && (*bytes == '\n'))
747 bytes++; // Safe since findEOL won't return a spanning CRLF.
749 length -= (bytes - line);
751 // Blank line; we're at the end of the header
753 else if (*line == ' ' || *line == '\t') {
754 // Continuation of the previous header
755 if (lastKey.isNull()) {
756 // malformed header; ignore it and continue
759 // Merge the continuation of the previous header
760 String currentValue = headerFields.get(lastKey);
761 String newValue(line, lineLength);
763 headerFields.set(lastKey, currentValue + newValue);
768 for (colon = line; *colon != ':' && colon != eol; colon++) {
772 // malformed header; ignore it and continue
775 lastKey = capitalizeRFC822HeaderFieldName(String(line, colon - line));
778 for (colon++; colon != eol; colon++) {
779 if (*colon != ' ' && *colon != '\t')
785 value = String(colon, eol - colon);
787 String oldValue = headerFields.get(lastKey);
788 if (!oldValue.isNull()) {
789 String tmp = oldValue;
795 headerFields.set(lastKey, value);
803 NPError PluginView::handlePost(const char* url, const char* target, uint32 len, const char* buf, bool file, void* notifyData, bool sendNotification, bool allowHeaders)
805 if (!url || !len || !buf)
806 return NPERR_INVALID_PARAM;
808 FrameLoadRequest frameLoadRequest;
810 HTTPHeaderMap headerFields;
814 NPError readResult = handlePostReadFile(buffer, len, buf);
815 if(readResult != NPERR_NO_ERROR)
819 memcpy(buffer.data(), buf, len);
822 const char* postData = buffer.data();
823 int postDataLength = buffer.size();
826 if (startsWithBlankLine(buffer)) {
830 int location = locationAfterFirstBlankLine(buffer);
831 if (location != -1) {
832 // If the blank line is somewhere in the middle of the buffer, everything before is the header
833 headerFields = parseRFC822HeaderFields(buffer, location);
834 unsigned dataLength = buffer.size() - location;
836 // Sometimes plugins like to set Content-Length themselves when they post,
837 // but WebFoundation does not like that. So we will remove the header
838 // and instead truncate the data to the requested length.
839 String contentLength = headerFields.get("Content-Length");
841 if (!contentLength.isNull())
842 dataLength = min(contentLength.toInt(), (int)dataLength);
843 headerFields.remove("Content-Length");
845 postData += location;
846 postDataLength = dataLength;
851 frameLoadRequest.resourceRequest().setHTTPMethod("POST");
852 frameLoadRequest.resourceRequest().setURL(makeURL(m_baseURL, url));
853 frameLoadRequest.resourceRequest().addHTTPHeaderFields(headerFields);
854 frameLoadRequest.resourceRequest().setHTTPBody(FormData::create(postData, postDataLength));
855 frameLoadRequest.setFrameName(target);
857 return load(frameLoadRequest, sendNotification, notifyData);
860 } // namespace WebCore