<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[178219] trunk/Source</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/178219">178219</a></dd>
<dt>Author</dt> <dd>andersca@apple.com</dd>
<dt>Date</dt> <dd>2015-01-09 16:16:52 -0800 (Fri, 09 Jan 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Move the Windows only plug-in code to WebKit/win
https://bugs.webkit.org/show_bug.cgi?id=140133

Reviewed by Darin Adler.

Source/WebCore:

* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:

Source/WebKit:

* WebKit.vcxproj/WebKit/WebKit.vcxproj:
* WebKit.vcxproj/WebKit/WebKit.vcxproj.filters:

Source/WebKit/win:

* Plugins/PaintHooks.asm: Renamed from Source/WebCore/plugins/win/PaintHooks.asm.
* Plugins/PluginDatabase.cpp: Renamed from Source/WebCore/plugins/PluginDatabase.cpp.
(WebCore::persistentPluginMetadataCachePath):
(WebCore::PluginDatabase::PluginDatabase):
(WebCore::PluginDatabase::installedPlugins):
(WebCore::PluginDatabase::isMIMETypeRegistered):
(WebCore::PluginDatabase::addExtraPluginDirectory):
(WebCore::PluginDatabase::refresh):
(WebCore::PluginDatabase::plugins):
(WebCore::PluginDatabase::preferredPluginCompare):
(WebCore::PluginDatabase::pluginForMIMEType):
(WebCore::PluginDatabase::MIMETypeForExtension):
(WebCore::PluginDatabase::findPlugin):
(WebCore::PluginDatabase::setPreferredPluginForMIMEType):
(WebCore::PluginDatabase::fileExistsAndIsNotDisabled):
(WebCore::PluginDatabase::getDeletedPlugins):
(WebCore::PluginDatabase::add):
(WebCore::PluginDatabase::remove):
(WebCore::PluginDatabase::clear):
(WebCore::PluginDatabase::removeDisabledPluginFile):
(WebCore::PluginDatabase::addDisabledPluginFile):
(WebCore::PluginDatabase::defaultPluginDirectories):
(WebCore::PluginDatabase::isPreferredPluginDirectory):
(WebCore::PluginDatabase::getPluginPathsInDirectories):
(WebCore::fillBufferWithContentsOfFile):
(WebCore::readUTF8String):
(WebCore::readTime):
(WebCore::PluginDatabase::loadPersistentMetadataCache):
(WebCore::writeUTF8String):
(WebCore::writeTime):
(WebCore::PluginDatabase::updatePersistentMetadataCache):
(WebCore::PluginDatabase::isPersistentMetadataCacheEnabled):
(WebCore::PluginDatabase::setPersistentMetadataCacheEnabled):
(WebCore::PluginDatabase::persistentMetadataCachePath):
(WebCore::PluginDatabase::setPersistentMetadataCachePath):
* Plugins/PluginDatabase.h: Renamed from Source/WebCore/plugins/PluginDatabase.h.
(WebCore::PluginDatabase::setPluginDirectories):
(WebCore::PluginDatabase::pluginDirectories):
* Plugins/PluginDatabaseWin.cpp: Renamed from Source/WebCore/plugins/win/PluginDatabaseWin.cpp.
(WebCore::addPluginPathsFromRegistry):
(WebCore::PluginDatabase::getPluginPathsInDirectories):
(WebCore::parseVersionString):
(WebCore::compareVersions):
(WebCore::addMozillaPluginDirectories):
(WebCore::addWindowsMediaPlayerPluginDirectory):
(WebCore::addAdobeAcrobatPluginDirectory):
(WebCore::addJavaPluginDirectory):
(WebCore::safariPluginsDirectory):
(WebCore::addMacromediaPluginDirectories):
(WebCore::PluginDatabase::defaultPluginDirectories):
(WebCore::PluginDatabase::isPreferredPluginDirectory):
* Plugins/PluginDebug.cpp: Renamed from Source/WebCore/plugins/PluginDebug.cpp.
(WebCore::prettyNameForNPError):
(WebCore::prettyNameForDrawingModel):
(WebCore::prettyNameForEventModel):
(WebCore::prettyNameForNPNVariable):
(WebCore::prettyNameForNPPVariable):
(WebCore::prettyNameForNPNURLVariable):
* Plugins/PluginDebug.h: Renamed from Source/WebCore/plugins/PluginDebug.h.
* Plugins/PluginMessageThrottlerWin.cpp: Renamed from Source/WebCore/plugins/win/PluginMessageThrottlerWin.cpp.
(WebCore::PluginMessageThrottlerWin::PluginMessageThrottlerWin):
(WebCore::PluginMessageThrottlerWin::~PluginMessageThrottlerWin):
(WebCore::PluginMessageThrottlerWin::appendMessage):
(WebCore::PluginMessageThrottlerWin::processQueuedMessage):
(WebCore::PluginMessageThrottlerWin::messageThrottleTimerFired):
(WebCore::PluginMessageThrottlerWin::allocateMessage):
(WebCore::PluginMessageThrottlerWin::isInlineMessage):
(WebCore::PluginMessageThrottlerWin::freeMessage):
* Plugins/PluginMessageThrottlerWin.h: Renamed from Source/WebCore/plugins/win/PluginMessageThrottlerWin.h.
* Plugins/PluginPackage.cpp: Renamed from Source/WebCore/plugins/PluginPackage.cpp.
(WebCore::PluginPackage::~PluginPackage):
(WebCore::PluginPackage::freeLibrarySoon):
(WebCore::PluginPackage::freeLibraryTimerFired):
(WebCore::PluginPackage::compare):
(WebCore::PluginPackage::PluginPackage):
(WebCore::PluginPackage::unload):
(WebCore::PluginPackage::unloadWithoutShutdown):
(WebCore::PluginPackage::setEnabled):
(WebCore::PluginPackage::createPackage):
(WebCore::PluginPackage::createPackageFromCache):
(WebCore::PluginPackage::determineQuirks):
(WebCore::PluginPackage::determineModuleVersionFromDescription):
(WebCore::getListFromVariantArgs):
(WebCore::makeSource):
(WebCore::NPN_Evaluate):
(WebCore::NPN_Invoke):
(WebCore::PluginPackage::initializeBrowserFuncs):
(WebCore::PluginPackage::hash):
(WebCore::PluginPackage::equal):
(WebCore::PluginPackage::compareFileVersion):
(WebCore::PluginPackage::ensurePluginLoaded):
* Plugins/PluginPackage.h: Renamed from Source/WebCore/plugins/PluginPackage.h.
(WebCore::PluginPackage::name):
(WebCore::PluginPackage::description):
(WebCore::PluginPackage::path):
(WebCore::PluginPackage::fileName):
(WebCore::PluginPackage::parentDirectory):
(WebCore::PluginPackage::module):
(WebCore::PluginPackage::lastModified):
(WebCore::PluginPackage::mimeToDescriptions):
(WebCore::PluginPackage::mimeToExtensions):
(WebCore::PluginPackage::isEnabled):
(WebCore::PluginPackage::pluginFuncs):
(WebCore::PluginPackage::quirks):
(WebCore::PluginPackage::version):
(WebCore::PluginPackage::fullMIMEDescription):
(WebCore::PluginPackageHash::hash):
(WebCore::PluginPackageHash::equal):
* Plugins/PluginPackageWin.cpp: Renamed from Source/WebCore/plugins/win/PluginPackageWin.cpp.
(WebCore::getVersionInfo):
(WebCore::PluginPackage::isPluginBlacklisted):
(WebCore::PluginPackage::determineQuirks):
(WebCore::PluginPackage::fetchInfo):
(WebCore::PluginPackage::load):
(WebCore::PluginPackage::hash):
(WebCore::PluginPackage::equal):
(WebCore::PluginPackage::NPVersion):
* Plugins/PluginQuirkSet.h: Renamed from Source/WebCore/plugins/PluginQuirkSet.h.
(WebCore::PluginQuirkSet::PluginQuirkSet):
(WebCore::PluginQuirkSet::add):
(WebCore::PluginQuirkSet::contains):
* Plugins/PluginStream.cpp: Renamed from Source/WebCore/plugins/PluginStream.cpp.
(WebCore::streams):
(WebCore::PluginStream::PluginStream):
(WebCore::PluginStream::~PluginStream):
(WebCore::PluginStream::start):
(WebCore::PluginStream::stop):
(WebCore::lastModifiedDate):
(WebCore::PluginStream::startStream):
(WebCore::PluginStream::ownerForStream):
(WebCore::PluginStream::cancelAndDestroyStream):
(WebCore::PluginStream::destroyStream):
(WebCore::PluginStream::delayDeliveryTimerFired):
(WebCore::PluginStream::deliverData):
(WebCore::PluginStream::sendJavaScriptStream):
(WebCore::PluginStream::didReceiveResponse):
(WebCore::PluginStream::didReceiveData):
(WebCore::PluginStream::didFail):
(WebCore::PluginStream::didFinishLoading):
(WebCore::PluginStream::wantsAllStreams):
* Plugins/PluginStream.h: Renamed from Source/WebCore/plugins/PluginStream.h.
(WebCore::PluginStreamClient::~PluginStreamClient):
(WebCore::PluginStreamClient::streamDidFinishLoading):
(WebCore::PluginStream::create):
(WebCore::PluginStream::setLoadManually):
* Plugins/PluginView.cpp: Renamed from Source/WebCore/plugins/PluginView.cpp.
(WebCore::instanceMap):
(WebCore::scriptStringIfJavaScriptURL):
(WebCore::PluginView::popPopupsStateTimerFired):
(WebCore::PluginView::windowClipRect):
(WebCore::PluginView::setFrameRect):
(WebCore::PluginView::frameRectsChanged):
(WebCore::PluginView::clipRectChanged):
(WebCore::PluginView::handleEvent):
(WebCore::PluginView::init):
(WebCore::PluginView::startOrAddToUnstartedList):
(WebCore::PluginView::start):
(WebCore::PluginView::mediaCanStart):
(WebCore::PluginView::~PluginView):
(WebCore::PluginView::stop):
(WebCore::PluginView::setCurrentPluginView):
(WebCore::PluginView::currentPluginView):
(WebCore::createUTF8String):
(WebCore::PluginView::performRequest):
(WebCore::PluginView::requestTimerFired):
(WebCore::PluginView::scheduleRequest):
(WebCore::PluginView::load):
(WebCore::makeURL):
(WebCore::PluginView::getURLNotify):
(WebCore::PluginView::getURL):
(WebCore::PluginView::postURLNotify):
(WebCore::PluginView::postURL):
(WebCore::PluginView::newStream):
(WebCore::PluginView::write):
(WebCore::PluginView::destroyStream):
(WebCore::PluginView::status):
(WebCore::PluginView::setValue):
(WebCore::PluginView::invalidateTimerFired):
(WebCore::PluginView::pushPopupsEnabledState):
(WebCore::PluginView::popPopupsEnabledState):
(WebCore::PluginView::arePopupsAllowed):
(WebCore::PluginView::setJavaScriptPaused):
(WebCore::PluginView::npObject):
(WebCore::PluginView::bindingInstance):
(WebCore::PluginView::disconnectStream):
(WebCore::PluginView::setParameters):
(WebCore::PluginView::PluginView):
(WebCore::PluginView::focusPluginElement):
(WebCore::PluginView::didReceiveResponse):
(WebCore::PluginView::didReceiveData):
(WebCore::PluginView::didFinishLoading):
(WebCore::PluginView::didFail):
(WebCore::PluginView::setCallingPlugin):
(WebCore::PluginView::isCallingPlugin):
(WebCore::PluginView::create):
(WebCore::PluginView::freeStringArray):
(WebCore::startsWithBlankLine):
(WebCore::locationAfterFirstBlankLine):
(WebCore::findEOL):
(WebCore::capitalizeRFC822HeaderFieldName):
(WebCore::parseRFC822HeaderFields):
(WebCore::PluginView::handlePost):
(WebCore::PluginView::invalidateWindowlessPluginRect):
(WebCore::PluginView::paintMissingPluginIcon):
(WebCore::PluginView::userAgent):
(WebCore::PluginView::userAgentStatic):
(WebCore::PluginView::lifeSupportTimerFired):
(WebCore::PluginView::keepAlive):
(WebCore::PluginView::getValueStatic):
(WebCore::PluginView::getValue):
(WebCore::getFrame):
(WebCore::PluginView::getValueForURL):
(WebCore::PluginView::setValueForURL):
(WebCore::PluginView::getAuthenticationInfo):
(WebCore::PluginView::privateBrowsingStateChanged):
* Plugins/PluginView.h: Renamed from Source/WebCore/plugins/PluginView.h.
(WebCore::PluginRequest::PluginRequest):
(WebCore::PluginRequest::frameLoadRequest):
(WebCore::PluginRequest::notifyData):
(WebCore::PluginRequest::sendNotification):
(WebCore::PluginRequest::shouldAllowPopups):
(WebCore::PluginManualLoader::~PluginManualLoader):
(WebCore::PluginView::plugin):
(WebCore::PluginView::instance):
(WebCore::PluginView::status):
(WebCore::PluginView::streamDidFinishLoading):
(WebCore::PluginView::parentFrame):
(WebCore::PluginView::pluginsPage):
(WebCore::PluginView::mimeType):
(WebCore::PluginView::url):
(WebCore::PluginView::pluginWndProc):
(WebCore::PluginView::platformPluginWidget):
(WebCore::PluginView::setPlatformPluginWidget):
(WebCore::toPluginView):
* Plugins/PluginViewWin.cpp: Renamed from Source/WebCore/plugins/win/PluginViewWin.cpp.
(windowHandleForPageClient):
(WebCore::PluginView::hookedBeginPaint):
(WebCore::PluginView::hookedEndPaint):
(WebCore::hook):
(WebCore::setUpOffscreenPaintingHooks):
(WebCore::registerPluginView):
(WebCore::PluginView::PluginViewWndProc):
(WebCore::isWindowsMessageUserGesture):
(WebCore::contentsToNativeWindow):
(WebCore::PluginView::wndProc):
(WebCore::PluginView::updatePluginWidget):
(WebCore::PluginView::setFocus):
(WebCore::PluginView::show):
(WebCore::PluginView::hide):
(WebCore::PluginView::dispatchNPEvent):
(WebCore::PluginView::paintIntoTransformedContext):
(WebCore::PluginView::paintWindowedPluginIntoContext):
(WebCore::PluginView::paint):
(WebCore::PluginView::handleKeyboardEvent):
(WebCore::PluginView::handleMouseEvent):
(WebCore::PluginView::setParent):
(WebCore::PluginView::setParentVisible):
(WebCore::PluginView::setNPWindowRect):
(WebCore::PluginView::handlePostReadFile):
(WebCore::PluginView::platformGetValueStatic):
(WebCore::PluginView::platformGetValue):
(WebCore::PluginView::invalidateRect):
(WebCore::PluginView::invalidateRegion):
(WebCore::PluginView::forceRedraw):
(WebCore::PluginView::platformStart):
(WebCore::PluginView::platformDestroy):
(WebCore::PluginView::snapshot):
* Plugins/npapi.cpp: Renamed from Source/WebCore/plugins/npapi.cpp.
(pluginViewForInstance):
(NPN_MemAlloc):
(NPN_MemFree):
(NPN_MemFlush):
(NPN_ReloadPlugins):
(NPN_RequestRead):
(NPN_GetURLNotify):
(NPN_GetURL):
(NPN_PostURLNotify):
(NPN_PostURL):
(NPN_NewStream):
(NPN_Write):
(NPN_DestroyStream):
(NPN_UserAgent):
(NPN_Status):
(NPN_InvalidateRect):
(NPN_InvalidateRegion):
(NPN_ForceRedraw):
(NPN_GetValue):
(NPN_SetValue):
(NPN_GetJavaEnv):
(NPN_GetJavaPeer):
(NPN_PushPopupsEnabledState):
(NPN_PopPopupsEnabledState):
(NPN_PluginThreadAsyncCall):
(NPN_GetValueForURL):
(NPN_SetValueForURL):
(NPN_GetAuthenticationInfo):
(NPN_PopUpContextMenu):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxproj">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojcopyForwardingHeaderscmd">trunk/Source/WebCore/WebCore.vcxproj/copyForwardingHeaders.cmd</a></li>
<li><a href="#trunkSourceWebCoreloaderFrameLoadercpp">trunk/Source/WebCore/loader/FrameLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformeflTemporaryLinkStubscpp">trunk/Source/WebCore/platform/efl/TemporaryLinkStubs.cpp</a></li>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitWebKitvcxprojWebKitWebKitvcxproj">trunk/Source/WebKit/WebKit.vcxproj/WebKit/WebKit.vcxproj</a></li>
<li><a href="#trunkSourceWebKitWebKitvcxprojWebKitWebKitvcxprojfilters">trunk/Source/WebKit/WebKit.vcxproj/WebKit/WebKit.vcxproj.filters</a></li>
<li><a href="#trunkSourceWebKitWebKitvcxprojWebKitWebKitCommonprops">trunk/Source/WebKit/WebKit.vcxproj/WebKit/WebKitCommon.props</a></li>
<li><a href="#trunkSourceWebKitwinChangeLog">trunk/Source/WebKit/win/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitwinWebCoreSupportEmbeddedWidgeth">trunk/Source/WebKit/win/WebCoreSupport/EmbeddedWidget.h</a></li>
<li><a href="#trunkSourceWebKitwinWebCoreSupportWebFrameLoaderClientcpp">trunk/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp</a></li>
<li><a href="#trunkSourceWebKitwinWebCoreSupportWebPlatformStrategiescpp">trunk/Source/WebKit/win/WebCoreSupport/WebPlatformStrategies.cpp</a></li>
<li><a href="#trunkSourceWebKitwinWebFramecpp">trunk/Source/WebKit/win/WebFrame.cpp</a></li>
<li><a href="#trunkSourceWebKitwinWebViewcpp">trunk/Source/WebKit/win/WebView.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessPluginsunixPluginInfoStoreUnixcpp">trunk/Source/WebKit2/UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>trunk/Source/WebKit/win/Plugins/</li>
<li><a href="#trunkSourceWebKitwinPluginsPaintHooksasm">trunk/Source/WebKit/win/Plugins/PaintHooks.asm</a></li>
<li><a href="#trunkSourceWebKitwinPluginsPluginDatabasecpp">trunk/Source/WebKit/win/Plugins/PluginDatabase.cpp</a></li>
<li><a href="#trunkSourceWebKitwinPluginsPluginDatabaseh">trunk/Source/WebKit/win/Plugins/PluginDatabase.h</a></li>
<li><a href="#trunkSourceWebKitwinPluginsPluginDatabaseWincpp">trunk/Source/WebKit/win/Plugins/PluginDatabaseWin.cpp</a></li>
<li><a href="#trunkSourceWebKitwinPluginsPluginDebugcpp">trunk/Source/WebKit/win/Plugins/PluginDebug.cpp</a></li>
<li><a href="#trunkSourceWebKitwinPluginsPluginDebugh">trunk/Source/WebKit/win/Plugins/PluginDebug.h</a></li>
<li><a href="#trunkSourceWebKitwinPluginsPluginMessageThrottlerWincpp">trunk/Source/WebKit/win/Plugins/PluginMessageThrottlerWin.cpp</a></li>
<li><a href="#trunkSourceWebKitwinPluginsPluginMessageThrottlerWinh">trunk/Source/WebKit/win/Plugins/PluginMessageThrottlerWin.h</a></li>
<li><a href="#trunkSourceWebKitwinPluginsPluginPackagecpp">trunk/Source/WebKit/win/Plugins/PluginPackage.cpp</a></li>
<li><a href="#trunkSourceWebKitwinPluginsPluginPackageh">trunk/Source/WebKit/win/Plugins/PluginPackage.h</a></li>
<li><a href="#trunkSourceWebKitwinPluginsPluginPackageWincpp">trunk/Source/WebKit/win/Plugins/PluginPackageWin.cpp</a></li>
<li><a href="#trunkSourceWebKitwinPluginsPluginQuirkSeth">trunk/Source/WebKit/win/Plugins/PluginQuirkSet.h</a></li>
<li><a href="#trunkSourceWebKitwinPluginsPluginStreamcpp">trunk/Source/WebKit/win/Plugins/PluginStream.cpp</a></li>
<li><a href="#trunkSourceWebKitwinPluginsPluginStreamh">trunk/Source/WebKit/win/Plugins/PluginStream.h</a></li>
<li><a href="#trunkSourceWebKitwinPluginsPluginViewcpp">trunk/Source/WebKit/win/Plugins/PluginView.cpp</a></li>
<li><a href="#trunkSourceWebKitwinPluginsPluginViewh">trunk/Source/WebKit/win/Plugins/PluginView.h</a></li>
<li><a href="#trunkSourceWebKitwinPluginsPluginViewWincpp">trunk/Source/WebKit/win/Plugins/PluginViewWin.cpp</a></li>
<li><a href="#trunkSourceWebKitwinPluginsnpapicpp">trunk/Source/WebKit/win/Plugins/npapi.cpp</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorepluginsPluginDatabasecpp">trunk/Source/WebCore/plugins/PluginDatabase.cpp</a></li>
<li><a href="#trunkSourceWebCorepluginsPluginDatabaseh">trunk/Source/WebCore/plugins/PluginDatabase.h</a></li>
<li><a href="#trunkSourceWebCorepluginsPluginDebugcpp">trunk/Source/WebCore/plugins/PluginDebug.cpp</a></li>
<li><a href="#trunkSourceWebCorepluginsPluginDebugh">trunk/Source/WebCore/plugins/PluginDebug.h</a></li>
<li><a href="#trunkSourceWebCorepluginsPluginPackagecpp">trunk/Source/WebCore/plugins/PluginPackage.cpp</a></li>
<li><a href="#trunkSourceWebCorepluginsPluginPackageh">trunk/Source/WebCore/plugins/PluginPackage.h</a></li>
<li><a href="#trunkSourceWebCorepluginsPluginQuirkSeth">trunk/Source/WebCore/plugins/PluginQuirkSet.h</a></li>
<li><a href="#trunkSourceWebCorepluginsPluginStreamcpp">trunk/Source/WebCore/plugins/PluginStream.cpp</a></li>
<li><a href="#trunkSourceWebCorepluginsPluginStreamh">trunk/Source/WebCore/plugins/PluginStream.h</a></li>
<li><a href="#trunkSourceWebCorepluginsPluginViewcpp">trunk/Source/WebCore/plugins/PluginView.cpp</a></li>
<li><a href="#trunkSourceWebCorepluginsPluginViewh">trunk/Source/WebCore/plugins/PluginView.h</a></li>
<li><a href="#trunkSourceWebCorepluginsnpapicpp">trunk/Source/WebCore/plugins/npapi.cpp</a></li>
<li>trunk/Source/WebCore/plugins/win/</li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (178218 => 178219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2015-01-10 00:09:59 UTC (rev 178218)
+++ trunk/Source/WebCore/CMakeLists.txt        2015-01-10 00:16:52 UTC (rev 178219)
</span><span class="lines">@@ -2231,9 +2231,7 @@
</span><span class="cx">     plugins/DOMPlugin.cpp
</span><span class="cx">     plugins/DOMPluginArray.cpp
</span><span class="cx">     plugins/PluginData.cpp
</span><del>-    plugins/PluginDebug.cpp
</del><span class="cx">     plugins/PluginMainThreadScheduler.cpp
</span><del>-    plugins/PluginStream.cpp
</del><span class="cx"> 
</span><span class="cx">     rendering/AutoTableLayout.cpp
</span><span class="cx">     rendering/BidiRun.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (178218 => 178219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-01-10 00:09:59 UTC (rev 178218)
+++ trunk/Source/WebCore/ChangeLog        2015-01-10 00:16:52 UTC (rev 178219)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2015-01-06  Anders Carlsson  &lt;andersca@apple.com&gt;
+
+        Move the Windows only plug-in code to WebKit/win
+        https://bugs.webkit.org/show_bug.cgi?id=140133
+
+        Reviewed by Darin Adler.
+
+        * WebCore.vcxproj/WebCore.vcxproj:
+        * WebCore.vcxproj/WebCore.vcxproj.filters:
+
</ins><span class="cx"> 2015-01-09  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Another Windows build fix.
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (178218 => 178219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2015-01-10 00:09:59 UTC (rev 178218)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2015-01-10 00:16:52 UTC (rev 178219)
</span><span class="lines">@@ -17704,18 +17704,8 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\plugins\DOMMimeTypeArray.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\plugins\DOMPlugin.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\plugins\DOMPluginArray.cpp&quot; /&gt;
</span><del>-    &lt;ClCompile Include=&quot;..\plugins\npapi.cpp&quot; /&gt;
</del><span class="cx">     &lt;ClCompile Include=&quot;..\plugins\PluginData.cpp&quot; /&gt;
</span><del>-    &lt;ClCompile Include=&quot;..\plugins\PluginDatabase.cpp&quot; /&gt;
-    &lt;ClCompile Include=&quot;..\plugins\PluginDebug.cpp&quot; /&gt;
</del><span class="cx">     &lt;ClCompile Include=&quot;..\plugins\PluginMainThreadScheduler.cpp&quot; /&gt;
</span><del>-    &lt;ClCompile Include=&quot;..\plugins\PluginPackage.cpp&quot; /&gt;
-    &lt;ClCompile Include=&quot;..\plugins\PluginStream.cpp&quot; /&gt;
-    &lt;ClCompile Include=&quot;..\plugins\PluginView.cpp&quot; /&gt;
-    &lt;ClCompile Include=&quot;..\plugins\win\PluginDatabaseWin.cpp&quot; /&gt;
-    &lt;ClCompile Include=&quot;..\plugins\win\PluginMessageThrottlerWin.cpp&quot; /&gt;
-    &lt;ClCompile Include=&quot;..\plugins\win\PluginPackageWin.cpp&quot; /&gt;
-    &lt;ClCompile Include=&quot;..\plugins\win\PluginViewWin.cpp&quot; /&gt;
</del><span class="cx">     &lt;ClCompile Include=&quot;..\svg\SVGAllInOne.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\svg\SVGFontFaceElement.cpp&quot;&gt;
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="lines">@@ -20972,15 +20962,7 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\plugins\npfunctions.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\plugins\npruntime.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\plugins\PluginData.h&quot; /&gt;
</span><del>-    &lt;ClInclude Include=&quot;..\plugins\PluginDatabase.h&quot; /&gt;
-    &lt;ClInclude Include=&quot;..\plugins\PluginDebug.h&quot; /&gt;
</del><span class="cx">     &lt;ClInclude Include=&quot;..\plugins\PluginMainThreadScheduler.h&quot; /&gt;
</span><del>-    &lt;ClInclude Include=&quot;..\plugins\PluginPackage.h&quot; /&gt;
-    &lt;ClInclude Include=&quot;..\plugins\PluginQuirkSet.h&quot; /&gt;
-    &lt;ClInclude Include=&quot;..\plugins\PluginStrategy.h&quot; /&gt;
-    &lt;ClInclude Include=&quot;..\plugins\PluginStream.h&quot; /&gt;
-    &lt;ClInclude Include=&quot;..\plugins\PluginView.h&quot; /&gt;
-    &lt;ClInclude Include=&quot;..\plugins\win\PluginMessageThrottlerWin.h&quot; /&gt;
</del><span class="cx">     &lt;ClInclude Include=&quot;..\svg\ColorDistance.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\svg\SVGAElement.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\svg\SVGAltGlyphDefElement.h&quot; /&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters (178218 => 178219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2015-01-10 00:09:59 UTC (rev 178218)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2015-01-10 00:16:52 UTC (rev 178219)
</span><span class="lines">@@ -4542,42 +4542,12 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\plugins\DOMPluginArray.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;plugins&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><del>-    &lt;ClCompile Include=&quot;..\plugins\npapi.cpp&quot;&gt;
-      &lt;Filter&gt;plugins&lt;/Filter&gt;
-    &lt;/ClCompile&gt;
</del><span class="cx">     &lt;ClCompile Include=&quot;..\plugins\PluginData.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;plugins&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><del>-    &lt;ClCompile Include=&quot;..\plugins\PluginDatabase.cpp&quot;&gt;
-      &lt;Filter&gt;plugins&lt;/Filter&gt;
-    &lt;/ClCompile&gt;
-    &lt;ClCompile Include=&quot;..\plugins\PluginDebug.cpp&quot;&gt;
-      &lt;Filter&gt;plugins&lt;/Filter&gt;
-    &lt;/ClCompile&gt;
</del><span class="cx">     &lt;ClCompile Include=&quot;..\plugins\PluginMainThreadScheduler.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;plugins&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><del>-    &lt;ClCompile Include=&quot;..\plugins\PluginPackage.cpp&quot;&gt;
-      &lt;Filter&gt;plugins&lt;/Filter&gt;
-    &lt;/ClCompile&gt;
-    &lt;ClCompile Include=&quot;..\plugins\PluginStream.cpp&quot;&gt;
-      &lt;Filter&gt;plugins&lt;/Filter&gt;
-    &lt;/ClCompile&gt;
-    &lt;ClCompile Include=&quot;..\plugins\PluginView.cpp&quot;&gt;
-      &lt;Filter&gt;plugins&lt;/Filter&gt;
-    &lt;/ClCompile&gt;
-    &lt;ClCompile Include=&quot;..\plugins\win\PluginDatabaseWin.cpp&quot;&gt;
-      &lt;Filter&gt;plugins\win&lt;/Filter&gt;
-    &lt;/ClCompile&gt;
-    &lt;ClCompile Include=&quot;..\plugins\win\PluginMessageThrottlerWin.cpp&quot;&gt;
-      &lt;Filter&gt;plugins\win&lt;/Filter&gt;
-    &lt;/ClCompile&gt;
-    &lt;ClCompile Include=&quot;..\plugins\win\PluginPackageWin.cpp&quot;&gt;
-      &lt;Filter&gt;plugins\win&lt;/Filter&gt;
-    &lt;/ClCompile&gt;
-    &lt;ClCompile Include=&quot;..\plugins\win\PluginViewWin.cpp&quot;&gt;
-      &lt;Filter&gt;plugins\win&lt;/Filter&gt;
-    &lt;/ClCompile&gt;
</del><span class="cx">     &lt;ClCompile Include=&quot;..\svg\SVGAllInOne.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;rendering\svg&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><span class="lines">@@ -11550,33 +11520,12 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\plugins\PluginData.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;plugins&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span><del>-    &lt;ClInclude Include=&quot;..\plugins\PluginDatabase.h&quot;&gt;
-      &lt;Filter&gt;plugins&lt;/Filter&gt;
-    &lt;/ClInclude&gt;
-    &lt;ClInclude Include=&quot;..\plugins\PluginDebug.h&quot;&gt;
-      &lt;Filter&gt;plugins&lt;/Filter&gt;
-    &lt;/ClInclude&gt;
</del><span class="cx">     &lt;ClInclude Include=&quot;..\plugins\PluginMainThreadScheduler.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;plugins&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span><del>-    &lt;ClInclude Include=&quot;..\plugins\PluginPackage.h&quot;&gt;
-      &lt;Filter&gt;plugins&lt;/Filter&gt;
-    &lt;/ClInclude&gt;
-    &lt;ClInclude Include=&quot;..\plugins\PluginQuirkSet.h&quot;&gt;
-      &lt;Filter&gt;plugins&lt;/Filter&gt;
-    &lt;/ClInclude&gt;
</del><span class="cx">     &lt;ClInclude Include=&quot;..\plugins\PluginStrategy.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;plugins&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span><del>-    &lt;ClInclude Include=&quot;..\plugins\PluginStream.h&quot;&gt;
-      &lt;Filter&gt;plugins&lt;/Filter&gt;
-    &lt;/ClInclude&gt;
-    &lt;ClInclude Include=&quot;..\plugins\PluginView.h&quot;&gt;
-      &lt;Filter&gt;plugins&lt;/Filter&gt;
-    &lt;/ClInclude&gt;
-    &lt;ClInclude Include=&quot;..\plugins\win\PluginMessageThrottlerWin.h&quot;&gt;
-      &lt;Filter&gt;plugins\win&lt;/Filter&gt;
-    &lt;/ClInclude&gt;
</del><span class="cx">     &lt;ClInclude Include=&quot;..\svg\ColorDistance.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;rendering\svg&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojcopyForwardingHeaderscmd"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/copyForwardingHeaders.cmd (178218 => 178219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/copyForwardingHeaders.cmd        2015-01-10 00:09:59 UTC (rev 178218)
+++ trunk/Source/WebCore/WebCore.vcxproj/copyForwardingHeaders.cmd        2015-01-10 00:16:52 UTC (rev 178219)
</span><span class="lines">@@ -79,6 +79,7 @@
</span><span class="cx"> xcopy /y /d &quot;%ProjectDir%..\page\animation\*.h&quot; &quot;%CONFIGURATIONBUILDDIR%\include\WebCore&quot;
</span><span class="cx"> xcopy /y /d &quot;%ProjectDir%..\page\win\*.h&quot; &quot;%CONFIGURATIONBUILDDIR%\include\WebCore&quot;
</span><span class="cx"> xcopy /y /d &quot;%ProjectDir%..\bridge\*.h&quot; &quot;%CONFIGURATIONBUILDDIR%\include\WebCore&quot;
</span><ins>+xcopy /y /d &quot;%ProjectDir%..\bridge\c\*.h&quot; &quot;%CONFIGURATIONBUILDDIR%\include\WebCore&quot;
</ins><span class="cx"> xcopy /y /d &quot;%ProjectDir%..\bridge\jsc\*.h&quot; &quot;%CONFIGURATIONBUILDDIR%\include\WebCore&quot;
</span><span class="cx"> xcopy /y /d &quot;%ProjectDir%..\plugins\*.h&quot; &quot;%CONFIGURATIONBUILDDIR%\include\WebCore&quot;
</span><span class="cx"> xcopy /y /d &quot;%ProjectDir%..\plugins\win\*.h&quot; &quot;%CONFIGURATIONBUILDDIR%\include\WebCore&quot;
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderFrameLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/FrameLoader.cpp (178218 => 178219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/FrameLoader.cpp        2015-01-10 00:09:59 UTC (rev 178218)
+++ trunk/Source/WebCore/loader/FrameLoader.cpp        2015-01-10 00:16:52 UTC (rev 178219)
</span><span class="lines">@@ -91,7 +91,6 @@
</span><span class="cx"> #include &quot;PageTransitionEvent.h&quot;
</span><span class="cx"> #include &quot;PlatformStrategies.h&quot;
</span><span class="cx"> #include &quot;PluginData.h&quot;
</span><del>-#include &quot;PluginDatabase.h&quot;
</del><span class="cx"> #include &quot;PluginDocument.h&quot;
</span><span class="cx"> #include &quot;PolicyChecker.h&quot;
</span><span class="cx"> #include &quot;ProgressTracker.h&quot;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformeflTemporaryLinkStubscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/efl/TemporaryLinkStubs.cpp (178218 => 178219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/efl/TemporaryLinkStubs.cpp        2015-01-10 00:09:59 UTC (rev 178218)
+++ trunk/Source/WebCore/platform/efl/TemporaryLinkStubs.cpp        2015-01-10 00:16:52 UTC (rev 178219)
</span><span class="lines">@@ -36,7 +36,6 @@
</span><span class="cx"> #include &quot;FrameView.h&quot;
</span><span class="cx"> #include &quot;URL.h&quot;
</span><span class="cx"> #include &quot;NotImplemented.h&quot;
</span><del>-#include &quot;PluginView.h&quot;
</del><span class="cx"> #include &quot;ScrollbarTheme.h&quot;
</span><span class="cx"> #include &quot;SharedBuffer.h&quot;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepluginsPluginDatabasecpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/plugins/PluginDatabase.cpp (178218 => 178219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/plugins/PluginDatabase.cpp        2015-01-10 00:09:59 UTC (rev 178218)
+++ trunk/Source/WebCore/plugins/PluginDatabase.cpp        2015-01-10 00:16:52 UTC (rev 178219)
</span><span class="lines">@@ -1,677 +0,0 @@
</span><del>-/*
- * Copyright (C) 2006, 2007 Apple Inc.  All rights reserved.
- * Copyright (C) 2008 Collabora, Ltd.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include &quot;config.h&quot;
-#include &quot;PluginDatabase.h&quot;
-
-#include &quot;Frame.h&quot;
-#include &quot;URL.h&quot;
-#include &quot;PluginPackage.h&quot;
-#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE)
-#include &quot;FileSystem.h&quot;
-#endif
-#include &lt;stdlib.h&gt;
-#include &lt;wtf/text/CString.h&gt;
-
-namespace WebCore {
-
-typedef HashMap&lt;String, RefPtr&lt;PluginPackage&gt; &gt; PluginPackageByNameMap;
-
-#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE)
-static const size_t maximumPersistentPluginMetadataCacheSize = 32768;
-
-static bool gPersistentPluginMetadataCacheIsEnabled;
-
-String&amp; persistentPluginMetadataCachePath()
-{
-    DEPRECATED_DEFINE_STATIC_LOCAL(String, cachePath, ());
-    return cachePath;
-}
-#endif
-
-PluginDatabase::PluginDatabase()
-#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE)
-    : m_persistentMetadataCacheIsLoaded(false)
-#endif
-{
-}
-
-PluginDatabase* PluginDatabase::installedPlugins(bool populate)
-{
-    static PluginDatabase* plugins = 0;
-
-    if (!plugins) {
-        plugins = new PluginDatabase;
-
-        if (populate) {
-            plugins-&gt;setPluginDirectories(PluginDatabase::defaultPluginDirectories());
-            plugins-&gt;refresh();
-        }
-    }
-
-    return plugins;
-}
-
-bool PluginDatabase::isMIMETypeRegistered(const String&amp; mimeType)
-{
-    if (mimeType.isNull())
-        return false;
-    if (m_registeredMIMETypes.contains(mimeType))
-        return true;
-    // No plugin was found, try refreshing the database and searching again
-    return (refresh() &amp;&amp; m_registeredMIMETypes.contains(mimeType));
-}
-
-void PluginDatabase::addExtraPluginDirectory(const String&amp; directory)
-{
-    m_pluginDirectories.append(directory);
-    refresh();
-}
-
-bool PluginDatabase::refresh()
-{
-#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE)
-    if (!m_persistentMetadataCacheIsLoaded)
-        loadPersistentMetadataCache();
-#endif
-    bool pluginSetChanged = false;
-
-    if (!m_plugins.isEmpty()) {
-        PluginSet pluginsToUnload;
-        getDeletedPlugins(pluginsToUnload);
-
-        // Unload plugins
-        PluginSet::const_iterator end = pluginsToUnload.end();
-        for (PluginSet::const_iterator it = pluginsToUnload.begin(); it != end; ++it)
-            remove(it-&gt;get());
-
-        pluginSetChanged = !pluginsToUnload.isEmpty();
-    }
-
-    HashSet&lt;String&gt; paths;
-    getPluginPathsInDirectories(paths);
-
-    HashMap&lt;String, time_t&gt; pathsWithTimes;
-
-    // We should only skip unchanged files if we didn't remove any plugins above. If we did remove
-    // any plugins, we need to look at every plugin file so that, e.g., if the user has two versions
-    // of RealPlayer installed and just removed the newer one, we'll pick up the older one.
-    bool shouldSkipUnchangedFiles = !pluginSetChanged;
-
-    HashSet&lt;String&gt;::const_iterator pathsEnd = paths.end();
-    for (HashSet&lt;String&gt;::const_iterator it = paths.begin(); it != pathsEnd; ++it) {
-        time_t lastModified;
-        if (!getFileModificationTime(*it, lastModified))
-            continue;
-
-        pathsWithTimes.add(*it, lastModified);
-
-        // If the path's timestamp hasn't changed since the last time we ran refresh(), we don't have to do anything.
-        if (shouldSkipUnchangedFiles &amp;&amp; m_pluginPathsWithTimes.get(*it) == lastModified)
-            continue;
-
-        if (RefPtr&lt;PluginPackage&gt; oldPackage = m_pluginsByPath.get(*it)) {
-            ASSERT(!shouldSkipUnchangedFiles || oldPackage-&gt;lastModified() != lastModified);
-            remove(oldPackage.get());
-        }
-
-        RefPtr&lt;PluginPackage&gt; package = PluginPackage::createPackage(*it, lastModified);
-        if (package &amp;&amp; add(package.release()))
-            pluginSetChanged = true;
-    }
-
-    // Cache all the paths we found with their timestamps for next time.
-    pathsWithTimes.swap(m_pluginPathsWithTimes);
-
-    if (!pluginSetChanged)
-        return false;
-
-#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE)
-    updatePersistentMetadataCache();
-#endif
-
-    m_registeredMIMETypes.clear();
-
-    // Register plug-in MIME types
-    PluginSet::const_iterator end = m_plugins.end();
-    for (PluginSet::const_iterator it = m_plugins.begin(); it != end; ++it) {
-        // Get MIME types
-        MIMEToDescriptionsMap::const_iterator map_it = (*it)-&gt;mimeToDescriptions().begin();
-        MIMEToDescriptionsMap::const_iterator map_end = (*it)-&gt;mimeToDescriptions().end();
-        for (; map_it != map_end; ++map_it)
-            m_registeredMIMETypes.add(map_it-&gt;key);
-    }
-
-    return true;
-}
-
-Vector&lt;PluginPackage*&gt; PluginDatabase::plugins() const
-{
-    Vector&lt;PluginPackage*&gt; result;
-
-    PluginSet::const_iterator end = m_plugins.end();
-    for (PluginSet::const_iterator it = m_plugins.begin(); it != end; ++it)
-        result.append((*it).get());
-
-    return result;
-}
-
-int PluginDatabase::preferredPluginCompare(const void* a, const void* b)
-{
-    PluginPackage* pluginA = *static_cast&lt;PluginPackage* const*&gt;(a);
-    PluginPackage* pluginB = *static_cast&lt;PluginPackage* const*&gt;(b);
-
-    return pluginA-&gt;compare(*pluginB);
-}
-
-PluginPackage* PluginDatabase::pluginForMIMEType(const String&amp; mimeType)
-{
-    if (mimeType.isEmpty())
-        return 0;
-
-    String key = mimeType.lower();
-    PluginSet::const_iterator end = m_plugins.end();
-    PluginPackage* preferredPlugin = m_preferredPlugins.get(key);
-    if (preferredPlugin
-        &amp;&amp; preferredPlugin-&gt;isEnabled()
-        &amp;&amp; preferredPlugin-&gt;mimeToDescriptions().contains(key)) {
-        return preferredPlugin;
-    }
-
-    Vector&lt;PluginPackage*, 2&gt; pluginChoices;
-
-    for (PluginSet::const_iterator it = m_plugins.begin(); it != end; ++it) {
-        PluginPackage* plugin = (*it).get();
-
-        if (!plugin-&gt;isEnabled())
-            continue;
-
-        if (plugin-&gt;mimeToDescriptions().contains(key)) {
-#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE)
-            if (!plugin-&gt;ensurePluginLoaded())
-                continue;
-#endif
-            pluginChoices.append(plugin);
-        }
-    }
-
-    if (pluginChoices.isEmpty())
-        return 0;
-
-    qsort(pluginChoices.data(), pluginChoices.size(), sizeof(PluginPackage*), PluginDatabase::preferredPluginCompare);
-
-    return pluginChoices[0];
-}
-
-String PluginDatabase::MIMETypeForExtension(const String&amp; extension) const
-{
-    if (extension.isEmpty())
-        return String();
-
-    PluginSet::const_iterator end = m_plugins.end();
-    String mimeType;
-    Vector&lt;PluginPackage*, 2&gt; pluginChoices;
-    HashMap&lt;PluginPackage*, String&gt; mimeTypeForPlugin;
-
-    for (PluginSet::const_iterator it = m_plugins.begin(); it != end; ++it) {
-        if (!(*it)-&gt;isEnabled())
-            continue;
-
-        MIMEToExtensionsMap::const_iterator mime_end = (*it)-&gt;mimeToExtensions().end();
-
-        for (MIMEToExtensionsMap::const_iterator mime_it = (*it)-&gt;mimeToExtensions().begin(); mime_it != mime_end; ++mime_it) {
-            mimeType = mime_it-&gt;key;
-            PluginPackage* preferredPlugin = m_preferredPlugins.get(mimeType);
-            const Vector&lt;String&gt;&amp; extensions = mime_it-&gt;value;
-            bool foundMapping = false;
-            for (unsigned i = 0; i &lt; extensions.size(); i++) {
-                if (equalIgnoringCase(extensions[i], extension)) {
-                    PluginPackage* plugin = (*it).get();
-
-                    if (preferredPlugin &amp;&amp; PluginPackage::equal(*plugin, *preferredPlugin))
-                        return mimeType;
-
-#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE)
-                    if (!plugin-&gt;ensurePluginLoaded())
-                        continue;
-#endif
-                    pluginChoices.append(plugin);
-                    mimeTypeForPlugin.add(plugin, mimeType);
-                    foundMapping = true;
-                    break;
-                }
-            }
-            if (foundMapping)
-                break;
-        }
-    }
-
-    if (pluginChoices.isEmpty())
-        return String();
-
-    qsort(pluginChoices.data(), pluginChoices.size(), sizeof(PluginPackage*), PluginDatabase::preferredPluginCompare);
-
-    return mimeTypeForPlugin.get(pluginChoices[0]);
-}
-
-PluginPackage* PluginDatabase::findPlugin(const URL&amp; url, String&amp; mimeType)
-{
-    if (!mimeType.isEmpty())
-        return pluginForMIMEType(mimeType);
-    
-    String filename = url.lastPathComponent();
-    if (filename.endsWith('/'))
-        return 0;
-    
-    int extensionPos = filename.reverseFind('.');
-    if (extensionPos == -1)
-        return 0;
-    
-    String mimeTypeForExtension = MIMETypeForExtension(filename.substring(extensionPos + 1));
-    PluginPackage* plugin = pluginForMIMEType(mimeTypeForExtension);
-    if (!plugin) {
-        // FIXME: if no plugin could be found, query Windows for the mime type
-        // corresponding to the extension.
-        return 0;
-    }
-    
-    mimeType = mimeTypeForExtension;
-    return plugin;
-}
-
-void PluginDatabase::setPreferredPluginForMIMEType(const String&amp; mimeType, PluginPackage* plugin)
-{
-    if (!plugin || plugin-&gt;mimeToExtensions().contains(mimeType))
-        m_preferredPlugins.set(mimeType.lower(), plugin);
-}
-
-bool PluginDatabase::fileExistsAndIsNotDisabled(const String&amp; filePath) const
-{
-    // Skip plugin files that are disabled by filename.
-    if (m_disabledPluginFiles.contains(pathGetFileName(filePath)))
-        return false;
-
-    return fileExists(filePath);
-}
-
-void PluginDatabase::getDeletedPlugins(PluginSet&amp; plugins) const
-{
-    PluginSet::const_iterator end = m_plugins.end();
-    for (PluginSet::const_iterator it = m_plugins.begin(); it != end; ++it) {
-        if (!fileExistsAndIsNotDisabled((*it)-&gt;path()))
-            plugins.add(*it);
-    }
-}
-
-bool PluginDatabase::add(PassRefPtr&lt;PluginPackage&gt; prpPackage)
-{
-    ASSERT_ARG(prpPackage, prpPackage);
-
-    RefPtr&lt;PluginPackage&gt; package = prpPackage;
-
-    if (!m_plugins.add(package).isNewEntry)
-        return false;
-
-    m_pluginsByPath.add(package-&gt;path(), package);
-    return true;
-}
-
-void PluginDatabase::remove(PluginPackage* package)
-{
-    MIMEToExtensionsMap::const_iterator it = package-&gt;mimeToExtensions().begin();
-    MIMEToExtensionsMap::const_iterator end = package-&gt;mimeToExtensions().end();
-    for ( ; it != end; ++it) {
-        PluginPackageByNameMap::iterator packageInMap = m_preferredPlugins.find(it-&gt;key);
-        if (packageInMap != m_preferredPlugins.end() &amp;&amp; packageInMap-&gt;value == package)
-            m_preferredPlugins.remove(packageInMap);
-    }
-
-    m_plugins.remove(package);
-    m_pluginsByPath.remove(package-&gt;path());
-}
-
-void PluginDatabase::clear()
-{
-    m_plugins.clear();
-    m_pluginsByPath.clear();
-    m_pluginPathsWithTimes.clear();
-    m_registeredMIMETypes.clear();
-    m_preferredPlugins.clear();
-#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE)
-    m_persistentMetadataCacheIsLoaded = false;
-#endif
-}
-
-bool PluginDatabase::removeDisabledPluginFile(const String&amp; fileName)
-{
-    return m_disabledPluginFiles.remove(fileName);
-}
-
-bool PluginDatabase::addDisabledPluginFile(const String&amp; fileName)
-{
-    return m_disabledPluginFiles.add(fileName).isNewEntry;
-}
-
-#if (!OS(WINDOWS) || !ENABLE(NETSCAPE_PLUGIN_API))
-// For Safari/Win the following three methods are implemented
-// in PluginDatabaseWin.cpp, but if we can use WebCore constructs
-// for the logic we should perhaps move it here under XP_WIN?
-
-Vector&lt;String&gt; PluginDatabase::defaultPluginDirectories()
-{
-    Vector&lt;String&gt; paths;
-
-    // Add paths specific to each platform
-#if defined(XP_UNIX)
-    String userPluginPath = homeDirectoryPath();
-    userPluginPath.append(String(&quot;/.mozilla/plugins&quot;));
-    paths.append(userPluginPath);
-
-    userPluginPath = homeDirectoryPath();
-    userPluginPath.append(String(&quot;/.netscape/plugins&quot;));
-    paths.append(userPluginPath);
-
-    paths.append(&quot;/usr/lib/browser/plugins&quot;);
-    paths.append(&quot;/usr/local/lib/mozilla/plugins&quot;);
-    paths.append(&quot;/usr/lib/firefox/plugins&quot;);
-    paths.append(&quot;/usr/lib64/browser-plugins&quot;);
-    paths.append(&quot;/usr/lib/browser-plugins&quot;);
-    paths.append(&quot;/usr/lib/mozilla/plugins&quot;);
-    paths.append(&quot;/usr/local/netscape/plugins&quot;);
-    paths.append(&quot;/opt/mozilla/plugins&quot;);
-    paths.append(&quot;/opt/mozilla/lib/plugins&quot;);
-    paths.append(&quot;/opt/netscape/plugins&quot;);
-    paths.append(&quot;/opt/netscape/communicator/plugins&quot;);
-    paths.append(&quot;/usr/lib/netscape/plugins&quot;);
-    paths.append(&quot;/usr/lib/netscape/plugins-libc5&quot;);
-    paths.append(&quot;/usr/lib/netscape/plugins-libc6&quot;);
-    paths.append(&quot;/usr/lib64/netscape/plugins&quot;);
-    paths.append(&quot;/usr/lib64/mozilla/plugins&quot;);
-    paths.append(&quot;/usr/lib/nsbrowser/plugins&quot;);
-    paths.append(&quot;/usr/lib64/nsbrowser/plugins&quot;);
-
-    String mozHome(getenv(&quot;MOZILLA_HOME&quot;));
-    mozHome.append(&quot;/plugins&quot;);
-    paths.append(mozHome);
-
-    Vector&lt;String&gt; mozPaths;
-    String mozPath(getenv(&quot;MOZ_PLUGIN_PATH&quot;));
-    mozPath.split(UChar(':'), /* allowEmptyEntries */ false, mozPaths);
-    paths.appendVector(mozPaths);
-#elif defined(XP_MACOSX)
-    String userPluginPath = homeDirectoryPath();
-    userPluginPath.append(String(&quot;/Library/Internet Plug-Ins&quot;));
-    paths.append(userPluginPath);
-    paths.append(&quot;/Library/Internet Plug-Ins&quot;);
-#elif defined(XP_WIN)
-    String userPluginPath = homeDirectoryPath();
-    userPluginPath.append(String(&quot;\\Application Data\\Mozilla\\plugins&quot;));
-    paths.append(userPluginPath);
-#endif
-
-    return paths;
-}
-
-bool PluginDatabase::isPreferredPluginDirectory(const String&amp; path)
-{
-    String preferredPath = homeDirectoryPath();
-
-#if defined(XP_UNIX)
-    preferredPath.append(String(&quot;/.mozilla/plugins&quot;));
-#elif defined(XP_MACOSX)
-    preferredPath.append(String(&quot;/Library/Internet Plug-Ins&quot;));
-#elif defined(XP_WIN)
-    preferredPath.append(String(&quot;\\Application Data\\Mozilla\\plugins&quot;));
-#endif
-
-    // TODO: We should normalize the path before doing a comparison.
-    return path == preferredPath;
-}
-
-void PluginDatabase::getPluginPathsInDirectories(HashSet&lt;String&gt;&amp; paths) const
-{
-    // FIXME: This should be a case insensitive set.
-    HashSet&lt;String&gt; uniqueFilenames;
-
-#if defined(XP_UNIX)
-    String fileNameFilter(&quot;*.so&quot;);
-#else
-    String fileNameFilter(&quot;&quot;);
-#endif
-
-    Vector&lt;String&gt;::const_iterator dirsEnd = m_pluginDirectories.end();
-    for (Vector&lt;String&gt;::const_iterator dIt = m_pluginDirectories.begin(); dIt != dirsEnd; ++dIt) {
-        Vector&lt;String&gt; pluginPaths = listDirectory(*dIt, fileNameFilter);
-        Vector&lt;String&gt;::const_iterator pluginsEnd = pluginPaths.end();
-        for (Vector&lt;String&gt;::const_iterator pIt = pluginPaths.begin(); pIt != pluginsEnd; ++pIt) {
-            if (!fileExistsAndIsNotDisabled(*pIt))
-                continue;
-
-            paths.add(*pIt);
-        }
-    }
-}
-
-#endif // !OS(WINDOWS)
-
-#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE)
-
-static void fillBufferWithContentsOfFile(PlatformFileHandle file, Vector&lt;char&gt;&amp; buffer)
-{
-    size_t bufferSize = 0;
-    size_t bufferCapacity = 1024;
-    buffer.resize(bufferCapacity);
-
-    do {
-        bufferSize += readFromFile(file, buffer.data() + bufferSize, bufferCapacity - bufferSize);
-        if (bufferSize == bufferCapacity) {
-            if (bufferCapacity &lt; maximumPersistentPluginMetadataCacheSize) {
-                bufferCapacity *= 2;
-                buffer.resize(bufferCapacity);
-            } else {
-                buffer.clear();
-                return;
-            }
-        } else
-            break;
-    } while (true);
-
-    buffer.shrink(bufferSize);
-}
-
-static bool readUTF8String(String&amp; resultString, char*&amp; start, const char* end)
-{
-    if (start &gt;= end)
-        return false;
-
-    int len = strlen(start);
-    resultString = String::fromUTF8(start, len);
-    start += len + 1;
-
-    return true;
-}
-
-static bool readTime(time_t&amp; resultTime, char*&amp; start, const char* end)
-{
-    if (start + sizeof(time_t) &gt;= end)
-        return false;
-
-    // The stream is not necessary aligned.
-    memcpy(&amp;resultTime, start, sizeof(time_t));
-    start += sizeof(time_t);
-
-    return true;
-}
-
-static const char schemaVersion = '1';
-static const char persistentPluginMetadataCacheFilename[] = &quot;PluginMetadataCache.bin&quot;;
-
-void PluginDatabase::loadPersistentMetadataCache()
-{
-    if (!isPersistentMetadataCacheEnabled() || persistentMetadataCachePath().isEmpty())
-        return;
-
-    PlatformFileHandle file;
-    String absoluteCachePath = pathByAppendingComponent(persistentMetadataCachePath(), persistentPluginMetadataCacheFilename);
-    file = openFile(absoluteCachePath, OpenForRead);
-
-    if (!isHandleValid(file))
-        return;
-
-    // Mark cache as loaded regardless of success or failure. If
-    // there's error in the cache, we won't try to load it anymore.
-    m_persistentMetadataCacheIsLoaded = true;
-
-    Vector&lt;char&gt; fileContents;
-    fillBufferWithContentsOfFile(file, fileContents);
-    closeFile(file);
-
-    if (fileContents.size() &lt; 2 || fileContents.first() != schemaVersion || fileContents.last() != '\0') {
-        LOG_ERROR(&quot;Unable to read plugin metadata cache: corrupt schema&quot;);
-        deleteFile(absoluteCachePath);
-        return;
-    }
-
-    char* bufferPos = fileContents.data() + 1;
-    char* end = fileContents.data() + fileContents.size();
-
-    PluginSet cachedPlugins;
-    HashMap&lt;String, time_t&gt; cachedPluginPathsWithTimes;
-    HashMap&lt;String, RefPtr&lt;PluginPackage&gt; &gt; cachedPluginsByPath;
-
-    while (bufferPos &lt; end) {
-        String path;
-        time_t lastModified;
-        String name;
-        String desc;
-        String mimeDesc;
-        if (!(readUTF8String(path, bufferPos, end)
-              &amp;&amp; readTime(lastModified, bufferPos, end)
-              &amp;&amp; readUTF8String(name, bufferPos, end)
-              &amp;&amp; readUTF8String(desc, bufferPos, end)
-              &amp;&amp; readUTF8String(mimeDesc, bufferPos, end))) {
-            LOG_ERROR(&quot;Unable to read plugin metadata cache: corrupt data&quot;);
-            deleteFile(absoluteCachePath);
-            return;
-        }
-
-        // Skip metadata that points to plugins from directories that
-        // are not part of plugin directory list anymore.
-        String pluginDirectoryName = directoryName(path);
-        if (m_pluginDirectories.find(pluginDirectoryName) == WTF::notFound)
-            continue;
-
-        RefPtr&lt;PluginPackage&gt; package = PluginPackage::createPackageFromCache(path, lastModified, name, desc, mimeDesc);
-
-        if (package &amp;&amp; cachedPlugins.add(package).isNewEntry) {
-            cachedPluginPathsWithTimes.add(package-&gt;path(), package-&gt;lastModified());
-            cachedPluginsByPath.add(package-&gt;path(), package);
-        }
-    }
-
-    m_plugins.swap(cachedPlugins);
-    m_pluginsByPath.swap(cachedPluginsByPath);
-    m_pluginPathsWithTimes.swap(cachedPluginPathsWithTimes);
-}
-
-static bool writeUTF8String(PlatformFileHandle file, const String&amp; string)
-{
-    CString utf8String = string.utf8();
-    int length = utf8String.length() + 1;
-    return writeToFile(file, utf8String.data(), length) == length;
-}
-
-static bool writeTime(PlatformFileHandle file, const time_t&amp; time)
-{
-    return writeToFile(file, reinterpret_cast&lt;const char*&gt;(&amp;time), sizeof(time_t)) == sizeof(time_t);
-}
-
-void PluginDatabase::updatePersistentMetadataCache()
-{
-    if (!isPersistentMetadataCacheEnabled() || persistentMetadataCachePath().isEmpty())
-        return;
-
-    makeAllDirectories(persistentMetadataCachePath());
-    String absoluteCachePath = pathByAppendingComponent(persistentMetadataCachePath(), persistentPluginMetadataCacheFilename);
-    deleteFile(absoluteCachePath);
-
-    if (m_plugins.isEmpty())
-        return;
-
-    PlatformFileHandle file;
-    file = openFile(absoluteCachePath, OpenForWrite);
-
-    if (!isHandleValid(file)) {
-        LOG_ERROR(&quot;Unable to open plugin metadata cache for saving&quot;);
-        return;
-    }
-
-    char localSchemaVersion = schemaVersion;
-    if (writeToFile(file, &amp;localSchemaVersion, 1) != 1) {
-        LOG_ERROR(&quot;Unable to write plugin metadata cache schema&quot;);
-        closeFile(file);
-        deleteFile(absoluteCachePath);
-        return;
-    }
-
-    PluginSet::const_iterator end = m_plugins.end();
-    for (PluginSet::const_iterator it = m_plugins.begin(); it != end; ++it) {
-        if (!(writeUTF8String(file, (*it)-&gt;path())
-              &amp;&amp; writeTime(file, (*it)-&gt;lastModified())
-              &amp;&amp; writeUTF8String(file, (*it)-&gt;name())
-              &amp;&amp; writeUTF8String(file, (*it)-&gt;description())
-              &amp;&amp; writeUTF8String(file, (*it)-&gt;fullMIMEDescription()))) {
-            LOG_ERROR(&quot;Unable to write plugin metadata to cache&quot;);
-            closeFile(file);
-            deleteFile(absoluteCachePath);
-            return;
-        }
-    }
-
-    closeFile(file);
-}
-
-bool PluginDatabase::isPersistentMetadataCacheEnabled()
-{
-    return gPersistentPluginMetadataCacheIsEnabled;
-}
-
-void PluginDatabase::setPersistentMetadataCacheEnabled(bool isEnabled)
-{
-    gPersistentPluginMetadataCacheIsEnabled = isEnabled;
-}
-
-String PluginDatabase::persistentMetadataCachePath()
-{
-    return WebCore::persistentPluginMetadataCachePath();
-}
-
-void PluginDatabase::setPersistentMetadataCachePath(const String&amp; persistentMetadataCachePath)
-{
-    WebCore::persistentPluginMetadataCachePath() = persistentMetadataCachePath;
-}
-#endif
-}
</del></span></pre></div>
<a id="trunkSourceWebCorepluginsPluginDatabaseh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/plugins/PluginDatabase.h (178218 => 178219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/plugins/PluginDatabase.h        2015-01-10 00:09:59 UTC (rev 178218)
+++ trunk/Source/WebCore/plugins/PluginDatabase.h        2015-01-10 00:16:52 UTC (rev 178219)
</span><span class="lines">@@ -1,118 +0,0 @@
</span><del>-/*
- * Copyright (C) 2006, 2007 Apple Inc.  All rights reserved.
- * Copyright (C) 2008 Collabora, Ltd.  All rights reserved.
- * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef PluginDatabase_h
-#define PluginDatabase_h
-
-#include &quot;PluginPackage.h&quot;
-#include &lt;wtf/HashSet.h&gt;
-#include &lt;wtf/Vector.h&gt;
-#include &lt;wtf/text/StringHash.h&gt;
-#include &lt;wtf/text/WTFString.h&gt;
-
-namespace WebCore {
-    class Element;
-    class Frame;
-    class IntSize;
-    class URL;
-    class PluginDatabaseClient;
-    class PluginPackage;
-
-    typedef HashSet&lt;RefPtr&lt;PluginPackage&gt;, PluginPackageHash, PluginPackageHashTraits&gt; PluginSet;
-
-    class PluginDatabase {
-        WTF_MAKE_NONCOPYABLE(PluginDatabase); WTF_MAKE_FAST_ALLOCATED;
-    public:
-        PluginDatabase();
-
-        // The first call to installedPlugins creates the plugin database
-        // and by default populates it with the plugins installed on the system.
-        // For testing purposes, it is possible to not populate the database
-        // automatically, as the plugins might affect the DRT results by
-        // writing to a.o. stderr.
-        static PluginDatabase* installedPlugins(bool populate = true);
-
-        bool refresh();
-        void clear();
-        Vector&lt;PluginPackage*&gt; plugins() const;
-        bool isMIMETypeRegistered(const String&amp; mimeType);
-        void addExtraPluginDirectory(const String&amp;);
-
-        static bool isPreferredPluginDirectory(const String&amp; directory);
-        static int preferredPluginCompare(const void*, const void*);
-
-        PluginPackage* findPlugin(const URL&amp;, String&amp; mimeType);
-        PluginPackage* pluginForMIMEType(const String&amp; mimeType);
-        void setPreferredPluginForMIMEType(const String&amp; mimeType, PluginPackage* plugin);
-
-        void setPluginDirectories(const Vector&lt;String&gt;&amp; directories)
-        {
-            clear();
-            m_pluginDirectories = directories;
-        }
-
-        bool removeDisabledPluginFile(const String&amp; fileName);
-        bool addDisabledPluginFile(const String&amp; fileName);
-        static Vector&lt;String&gt; defaultPluginDirectories();
-        Vector&lt;String&gt; pluginDirectories() const { return m_pluginDirectories; }
-
-        String MIMETypeForExtension(const String&amp; extension) const;
-#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE)
-        static bool isPersistentMetadataCacheEnabled();
-        static void setPersistentMetadataCacheEnabled(bool isEnabled);
-        static String persistentMetadataCachePath();
-        static void setPersistentMetadataCachePath(const String&amp; persistentMetadataCachePath);
-#endif
-
-    private:
-        void getPluginPathsInDirectories(HashSet&lt;String&gt;&amp;) const;
-        void getDeletedPlugins(PluginSet&amp;) const;
-        bool fileExistsAndIsNotDisabled(const String&amp;) const;
-
-        // Returns whether the plugin was actually added or not (it won't be added if it's a duplicate of an existing plugin).
-        bool add(PassRefPtr&lt;PluginPackage&gt;);
-        void remove(PluginPackage*);
-#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE)
-        void loadPersistentMetadataCache();
-        void updatePersistentMetadataCache();
-#endif
-
-        HashSet&lt;String&gt; m_disabledPluginFiles;
-        Vector&lt;String&gt; m_pluginDirectories;
-        HashSet&lt;String&gt; m_registeredMIMETypes;
-        PluginSet m_plugins;
-        HashMap&lt;String, RefPtr&lt;PluginPackage&gt; &gt; m_pluginsByPath;
-        HashMap&lt;String, time_t&gt; m_pluginPathsWithTimes;
-        HashMap&lt;String, RefPtr&lt;PluginPackage&gt; &gt; m_preferredPlugins;
-#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE)
-        bool m_persistentMetadataCacheIsLoaded;
-#endif
-    };
-
-} // namespace WebCore
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorepluginsPluginDebugcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/plugins/PluginDebug.cpp (178218 => 178219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/plugins/PluginDebug.cpp        2015-01-10 00:09:59 UTC (rev 178218)
+++ trunk/Source/WebCore/plugins/PluginDebug.cpp        2015-01-10 00:16:52 UTC (rev 178219)
</span><span class="lines">@@ -1,179 +0,0 @@
</span><del>-/*
- * Copyright (C) 2006, 2007 Apple Inc.  All rights reserved.
- * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include &quot;config.h&quot;
-#include &quot;PluginDebug.h&quot;
-
-#include &lt;wtf/text/WTFString.h&gt;
-
-#if !LOG_DISABLED
-
-namespace WebCore {
-
-static const char* const errorStrings[] = {
-    &quot;No errors occurred.&quot;, /* NPERR_NO_ERROR */
-    &quot;Error with no specific error code occurred.&quot;, /* NPERR_GENERIC_ERROR */
-    &quot;Invalid instance passed to the plug-in.&quot;, /* NPERR_INVALID_INSTANCE_ERROR */
-    &quot;Function table invalid.&quot;, /* NPERR_INVALID_FUNCTABLE_ERROR */
-    &quot;Loading of plug-in failed.&quot;, /* NPERR_MODULE_LOAD_FAILED_ERROR */
-    &quot;Memory allocation failed.&quot;, /* NPERR_OUT_OF_MEMORY_ERROR */
-    &quot;Plug-in missing or invalid.&quot;, /* NPERR_INVALID_PLUGIN_ERROR */
-    &quot;Plug-in directory missing or invalid.&quot;, /* NPERR_INVALID_PLUGIN_DIR_ERROR */
-    &quot;Versions of plug-in and Communicator do not match.&quot;, /* NPERR_INCOMPATIBLE_VERSION_ERROR */
-    &quot;Parameter missing or invalid.&quot;, /* NPERR_INVALID_PARAM */
-    &quot;URL missing or invalid.&quot;, /* NPERR_INVALID_URL */
-    &quot;File missing or invalid.&quot;, /* NPERR_FILE_NOT_FOUND */
-    &quot;Stream contains no data.&quot;, /* NPERR_NO_DATA */
-    &quot;Seekable stream expected.&quot;, /* NPERR_STREAM_NOT_SEEKABLE */
-    &quot;Unknown error code&quot;
-};
-
-#ifdef XP_MACOSX
-static const char* const drawingModels[] = {
-    &quot;NPDrawingModelQuickDraw&quot;,
-    &quot;NPDrawingModelCoreGraphics&quot;,
-    &quot;NPDrawingModelOpenGL&quot;,
-    &quot;NPDrawingModelCoreAnimation&quot;
-};
-
-static const char* const eventModels[] = {
-    &quot;NPEventModelCarbon&quot;,
-    &quot;NPEventModelCocoa&quot;
-};
-#endif //XP_MACOSX
-
-const char* prettyNameForNPError(NPError error)
-{
-    return errorStrings[error];
-}
-
-#ifdef XP_MACOSX
-const char* prettyNameForDrawingModel(NPDrawingModel drawingModel)
-{
-    return drawingModels[drawingModel];
-}
-
-const char* prettyNameForEventModel(NPEventModel eventModel)
-{
-    return eventModels[eventModel];
-}
-#endif //XP_MACOSX
-
-CString prettyNameForNPNVariable(NPNVariable variable)
-{
-    switch (variable) {
-    case NPNVxDisplay: return &quot;NPNVxDisplay&quot;;
-    case NPNVxtAppContext: return &quot;NPNVxtAppContext&quot;;
-    case NPNVnetscapeWindow: return &quot;NPNVnetscapeWindow&quot;;
-    case NPNVjavascriptEnabledBool: return &quot;NPNVjavascriptEnabledBool&quot;;
-    case NPNVasdEnabledBool: return &quot;NPNVasdEnabledBool&quot;;
-    case NPNVisOfflineBool: return &quot;NPNVisOfflineBool&quot;;
-
-    case NPNVserviceManager: return &quot;NPNVserviceManager (not supported)&quot;;
-    case NPNVDOMElement: return &quot;NPNVDOMElement (not supported)&quot;;
-    case NPNVDOMWindow: return &quot;NPNVDOMWindow (not supported)&quot;;
-    case NPNVToolkit: return &quot;NPNVToolkit (not supported)&quot;;
-    case NPNVSupportsXEmbedBool: return &quot;NPNVSupportsXEmbedBool (not supported)&quot;;
-
-    case NPNVWindowNPObject: return &quot;NPNVWindowNPObject&quot;;
-    case NPNVPluginElementNPObject: return &quot;NPNVPluginElementNPObject&quot;;
-    case NPNVSupportsWindowless: return &quot;NPNVSupportsWindowless&quot;;
-    case NPNVprivateModeBool: return &quot;NPNVprivateModeBool&quot;;
-
-#ifdef XP_MACOSX
-    case NPNVpluginDrawingModel: return &quot;NPNVpluginDrawingModel&quot;;
-#ifndef NP_NO_QUICKDRAW
-    case NPNVsupportsQuickDrawBool: return &quot;NPNVsupportsQuickDrawBool&quot;;
-#endif
-    case NPNVsupportsCoreGraphicsBool: return &quot;NPNVsupportsCoreGraphicsBool&quot;;
-    case NPNVsupportsOpenGLBool: return &quot;NPNVsupportsOpenGLBool&quot;;
-    case NPNVsupportsCoreAnimationBool: return &quot;NPNVsupportsCoreAnimationBool&quot;;
-#ifndef NP_NO_CARBON
-    case NPNVsupportsCarbonBool: return &quot;NPNVsupportsCarbonBool&quot;;
-#endif
-    case NPNVsupportsCocoaBool: return &quot;NPNVsupportsCocoaBool&quot;;
-#endif
-
-    default: return &quot;Unknown variable&quot;;
-    }
-}
-
-CString prettyNameForNPPVariable(NPPVariable variable, void* value)
-{
-    switch (variable) {
-    case NPPVpluginNameString: return &quot;NPPVpluginNameString&quot;;
-    case NPPVpluginDescriptionString: return &quot;NPPVpluginDescriptionString&quot;;
-    case NPPVpluginWindowBool: return &quot;NPPVpluginWindowBool&quot;;
-    case NPPVpluginTransparentBool: return &quot;NPPVpluginTransparentBool&quot;;
-
-    case NPPVjavaClass: return &quot;NPPVjavaClass (not supported)&quot;;
-    case NPPVpluginWindowSize: return &quot;NPPVpluginWindowSize (not supported)&quot;;
-    case NPPVpluginTimerInterval: return &quot;NPPVpluginTimerInterval (not supported)&quot;;
-    case NPPVpluginScriptableInstance: return &quot;NPPVpluginScriptableInstance (not supported)&quot;;
-    case NPPVpluginScriptableIID: return &quot;NPPVpluginScriptableIID (not supported)&quot;;
-    case NPPVjavascriptPushCallerBool: return &quot;NPPVjavascriptPushCallerBool (not supported)&quot;;
-    case NPPVpluginKeepLibraryInMemory: return &quot;NPPVpluginKeepLibraryInMemory (not supported)&quot;;
-    case NPPVpluginNeedsXEmbed: return &quot;NPPVpluginNeedsXEmbed (not supported)&quot;;
-
-    case NPPVpluginScriptableNPObject: return &quot;NPPVpluginScriptableNPObject&quot;;
-
-    case NPPVformValue: return &quot;NPPVformValue (not supported)&quot;;
-    case NPPVpluginUrlRequestsDisplayedBool: return &quot;NPPVpluginUrlRequestsDisplayedBool (not supported)&quot;;
-
-    case NPPVpluginWantsAllNetworkStreams: return &quot;NPPVpluginWantsAllNetworkStreams&quot;;
-    case NPPVpluginCancelSrcStream: return &quot;NPPVpluginCancelSrcStream&quot;;
-
-#ifdef XP_MACOSX
-    case NPPVpluginDrawingModel: {
-        String result(&quot;NPPVpluginDrawingModel, &quot;);
-        result.append(prettyNameForDrawingModel(NPDrawingModel(uintptr_t(value))));
-        return result.latin1();
-    }
-    case NPPVpluginEventModel: {
-        String result(&quot;NPPVpluginEventModel, &quot;);
-        result.append(prettyNameForEventModel(NPEventModel(uintptr_t(value))));
-        return result.latin1();
-    }
-    case NPPVpluginCoreAnimationLayer: return &quot;NPPVpluginCoreAnimationLayer&quot;;
-#else
-    UNUSED_PARAM(value);
-#endif
-
-    default: return &quot;Unknown variable&quot;;
-    }
-}
-
-CString prettyNameForNPNURLVariable(NPNURLVariable variable)
-{
-    switch (variable) {
-    case NPNURLVCookie: return &quot;NPNURLVCookie&quot;;
-    case NPNURLVProxy: return &quot;NPNURLVProxy&quot;;
-    default: return &quot;Unknown variable&quot;;
-    }
-}
-} // namespace WebCore
-
-#endif // !LOG_DISABLED
</del></span></pre></div>
<a id="trunkSourceWebCorepluginsPluginDebugh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/plugins/PluginDebug.h (178218 => 178219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/plugins/PluginDebug.h        2015-01-10 00:09:59 UTC (rev 178218)
+++ trunk/Source/WebCore/plugins/PluginDebug.h        2015-01-10 00:16:52 UTC (rev 178219)
</span><span class="lines">@@ -1,55 +0,0 @@
</span><del>-/*
- * Copyright (C) 2006, 2007 Apple Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#ifndef PluginDebug_h
-#define PluginDebug_h
-
-#include &quot;Logging.h&quot;
-#include &quot;npruntime_internal.h&quot;
-#include &lt;wtf/text/CString.h&gt;
-
-#define LOG_NPERROR(err) if (err != NPERR_NO_ERROR) LOG_VERBOSE(Plugins, &quot;%s\n&quot;, prettyNameForNPError(err))
-#define LOG_PLUGIN_NET_ERROR() LOG_VERBOSE(Plugins, &quot;Stream failed due to problems with network, disk I/O, lack of memory, or other problems.\n&quot;)
-
-#if !LOG_DISABLED
-
-namespace WebCore {
-
-const char* prettyNameForNPError(NPError error);
-
-CString prettyNameForNPNVariable(NPNVariable variable);
-CString prettyNameForNPPVariable(NPPVariable variable, void* value);
-CString prettyNameForNPNURLVariable(NPNURLVariable variable);
-
-#ifdef XP_MACOSX
-const char* prettyNameForDrawingModel(NPDrawingModel drawingModel);
-const char* prettyNameForEventModel(NPEventModel eventModel);
-#endif
-
-} // namespace WebCore
-
-#endif // !LOG_DISABLED
-
-#endif // PluginDebug_h
</del></span></pre></div>
<a id="trunkSourceWebCorepluginsPluginPackagecpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/plugins/PluginPackage.cpp (178218 => 178219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/plugins/PluginPackage.cpp        2015-01-10 00:09:59 UTC (rev 178218)
+++ trunk/Source/WebCore/plugins/PluginPackage.cpp        2015-01-10 00:16:52 UTC (rev 178219)
</span><span class="lines">@@ -1,478 +0,0 @@
</span><del>-/*
- * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
- * Copyright (C) 2008 Collabora Ltd.  All rights reserved.
- * Copyright (C) 2009 Holger Hans Peter Freyther
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include &quot;config.h&quot;
-#include &quot;PluginPackage.h&quot;
-
-#include &quot;c_utility.h&quot;
-#include &quot;IdentifierRep.h&quot;
-#include &quot;MIMETypeRegistry.h&quot;
-#include &quot;NP_jsobject.h&quot;
-#include &quot;PluginDatabase.h&quot;
-#include &quot;PluginDebug.h&quot;
-#include &quot;PluginView.h&quot;
-#include &quot;runtime_root.h&quot;
-#include &quot;Timer.h&quot;
-#include &quot;npruntime_impl.h&quot;
-#include &lt;string.h&gt;
-#include &lt;JavaScriptCore/Completion.h&gt;
-#include &lt;JavaScriptCore/JSGlobalObject.h&gt;
-#include &lt;wtf/text/CString.h&gt;
-
-namespace WebCore {
-
-PluginPackage::~PluginPackage()
-{
-    // This destructor gets called during refresh() if PluginDatabase's
-    // PluginSet hash is already populated, as it removes items from
-    // the hash table. Calling the destructor on a loaded plug-in of
-    // course would cause a crash, so we check to call unload before we
-    // ASSERT.
-    // FIXME: There is probably a better way to fix this.
-    if (!m_loadCount)
-        unloadWithoutShutdown();
-    else
-        unload();
-
-    ASSERT(!m_isLoaded);
-}
-
-void PluginPackage::freeLibrarySoon()
-{
-    ASSERT(!m_freeLibraryTimer.isActive());
-    ASSERT(m_module);
-    ASSERT(!m_loadCount);
-
-    m_freeLibraryTimer.startOneShot(0);
-}
-
-void PluginPackage::freeLibraryTimerFired()
-{
-    ASSERT(m_module);
-    // Do nothing if the module got loaded again meanwhile
-    if (!m_loadCount) {
-        unloadModule(m_module);
-        m_module = 0;
-    }
-}
-
-
-int PluginPackage::compare(const PluginPackage&amp; compareTo) const
-{
-    // Sort plug-ins that allow multiple instances first.
-    bool AallowsMultipleInstances = !quirks().contains(PluginQuirkDontAllowMultipleInstances);
-    bool BallowsMultipleInstances = !compareTo.quirks().contains(PluginQuirkDontAllowMultipleInstances);
-    if (AallowsMultipleInstances != BallowsMultipleInstances)
-        return AallowsMultipleInstances ? -1 : 1;
-
-    // Sort plug-ins in a preferred path first.
-    bool AisInPreferredDirectory = PluginDatabase::isPreferredPluginDirectory(parentDirectory());
-    bool BisInPreferredDirectory = PluginDatabase::isPreferredPluginDirectory(compareTo.parentDirectory());
-    if (AisInPreferredDirectory != BisInPreferredDirectory)
-        return AisInPreferredDirectory ? -1 : 1;
-
-    int diff = strcmp(name().utf8().data(), compareTo.name().utf8().data());
-    if (diff)
-        return diff;
-
-    diff = compareFileVersion(compareTo.version());
-    if (diff)
-        return diff;
-
-    return strcmp(parentDirectory().utf8().data(), compareTo.parentDirectory().utf8().data());
-}
-
-PluginPackage::PluginPackage(const String&amp; path, const time_t&amp; lastModified)
-    : m_isEnabled(true)
-    , m_isLoaded(false)
-    , m_loadCount(0)
-    , m_path(path)
-    , m_moduleVersion(0)
-    , m_module(0)
-    , m_lastModified(lastModified)
-    , m_freeLibraryTimer(*this, &amp;PluginPackage::freeLibraryTimerFired)
-#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE)
-    , m_infoIsFromCache(true)
-#endif
-{
-    m_fileName = pathGetFileName(m_path);
-    m_parentDirectory = m_path.left(m_path.length() - m_fileName.length() - 1);
-}
-
-void PluginPackage::unload()
-{
-    if (!m_isLoaded)
-        return;
-
-    if (--m_loadCount &gt; 0)
-        return;
-
-#if ENABLE(NETSCAPE_PLUGIN_API)
-    m_NPP_Shutdown();
-#endif
-
-    unloadWithoutShutdown();
-}
-
-void PluginPackage::unloadWithoutShutdown()
-{
-    if (!m_isLoaded)
-        return;
-
-    ASSERT(!m_loadCount);
-    ASSERT(m_module);
-
-    // &lt;rdar://5530519&gt;: Crash when closing tab with pdf file (Reader 7 only)
-    // If the plugin has subclassed its parent window, as with Reader 7, we may have
-    // gotten here by way of the plugin's internal window proc forwarding a message to our
-    // original window proc. If we free the plugin library from here, we will jump back
-    // to code we just freed when we return, so delay calling FreeLibrary at least until
-    // the next message loop
-    freeLibrarySoon();
-
-    m_isLoaded = false;
-}
-
-void PluginPackage::setEnabled(bool enabled)
-{
-    m_isEnabled = enabled;
-}
-
-PassRefPtr&lt;PluginPackage&gt; PluginPackage::createPackage(const String&amp; path, const time_t&amp; lastModified)
-{
-    RefPtr&lt;PluginPackage&gt; package = adoptRef(new PluginPackage(path, lastModified));
-
-    if (!package-&gt;fetchInfo())
-        return 0;
-
-    return package.release();
-}
-
-#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE)
-PassRefPtr&lt;PluginPackage&gt; PluginPackage::createPackageFromCache(const String&amp; path, const time_t&amp; lastModified, const String&amp; name, const String&amp; description, const String&amp; mimeDescription)
-{
-    RefPtr&lt;PluginPackage&gt; package = adoptRef(new PluginPackage(path, lastModified));
-    package-&gt;m_name = name;
-    package-&gt;m_description = description;
-    package-&gt;determineModuleVersionFromDescription();
-    package-&gt;setMIMEDescription(mimeDescription);
-    package-&gt;m_infoIsFromCache = true;
-    return package.release();
-}
-#endif
-
-#if defined(XP_UNIX)
-void PluginPackage::determineQuirks(const String&amp; mimeType)
-{
-    if (MIMETypeRegistry::isJavaAppletMIMEType(mimeType)) {
-        // Because a single process cannot create multiple VMs, and we cannot reliably unload a
-        // Java VM, we cannot unload the Java plugin, or we'll lose reference to our only VM
-        m_quirks.add(PluginQuirkDontUnloadPlugin);
-
-        // Setting the window region to an empty region causes bad scrolling repaint problems
-        // with the Java plug-in.
-        m_quirks.add(PluginQuirkDontClipToZeroRectWhenScrolling);
-        return;
-    }
-
-    if (mimeType == &quot;application/x-shockwave-flash&quot;) {
-        static const PlatformModuleVersion flashTenVersion(0x0a000000);
-
-        if (compareFileVersion(flashTenVersion) &gt;= 0) {
-            // Flash 10.0 b218 doesn't like having a NULL window handle
-            m_quirks.add(PluginQuirkDontSetNullWindowHandleOnDestroy);
-        } else {
-            // Flash 9 and older requests windowless plugins if we return a mozilla user agent
-            m_quirks.add(PluginQuirkWantsMozillaUserAgent);
-        }
-
-#if CPU(X86_64)
-        // 64-bit Flash freezes if right-click is sent in windowless mode
-        m_quirks.add(PluginQuirkIgnoreRightClickInWindowlessMode);
-#endif
-
-        m_quirks.add(PluginQuirkRequiresDefaultScreenDepth);
-        m_quirks.add(PluginQuirkThrottleInvalidate);
-        m_quirks.add(PluginQuirkThrottleWMUserPlusOneMessages);
-        m_quirks.add(PluginQuirkFlashURLNotifyBug);
-    }
-}
-#endif
-
-#if !OS(WINDOWS)
-void PluginPackage::determineModuleVersionFromDescription()
-{
-    // It's a bit lame to detect the plugin version by parsing it
-    // from the plugin description string, but it doesn't seem that
-    // version information is available in any standardized way at
-    // the module level, like in Windows
-
-    if (m_description.isEmpty())
-        return;
-
-    if (m_description.startsWith(&quot;Shockwave Flash&quot;) &amp;&amp; m_description.length() &gt;= 19) {
-        // The flash version as a PlatformModuleVersion differs on Unix from Windows
-        // since the revision can be larger than a 8 bits, so we allow it 16 here and
-        // push the major/minor up 8 bits. Thus on Unix, Flash's version may be
-        // 0x0a000000 instead of 0x000a0000.
-
-        Vector&lt;String&gt; versionParts;
-        m_description.substring(16).split(' ', /*allowEmptyEntries =*/ false, versionParts);
-        if (versionParts.isEmpty())
-            return;
-
-        if (versionParts.size() &gt;= 1) {
-            Vector&lt;String&gt; majorMinorParts;
-            versionParts[0].split('.', majorMinorParts);
-            if (majorMinorParts.size() &gt;= 1) {
-                bool converted = false;
-                unsigned major = majorMinorParts[0].toUInt(&amp;converted);
-                if (converted)
-                    m_moduleVersion = (major &amp; 0xff) &lt;&lt; 24;
-            }
-            if (majorMinorParts.size() == 2) {
-                bool converted = false;
-                unsigned minor = majorMinorParts[1].toUInt(&amp;converted);
-                if (converted)
-                    m_moduleVersion |= (minor &amp; 0xff) &lt;&lt; 16;
-            }
-        }
-
-        if (versionParts.size() &gt;= 2) {
-            String revision = versionParts[1];
-            if (revision.length() &gt; 1 &amp;&amp; (revision[0] == 'r' || revision[0] == 'b')) {
-                revision.remove(0, 1);
-                m_moduleVersion |= revision.toInt() &amp; 0xffff;
-            }
-        }
-    }
-}
-#endif
-
-#if ENABLE(NETSCAPE_PLUGIN_API)
-static void getListFromVariantArgs(JSC::ExecState* exec, const NPVariant* args, unsigned argCount, JSC::Bindings::RootObject* rootObject, JSC::MarkedArgumentBuffer&amp; aList)
-{
-    for (unsigned i = 0; i &lt; argCount; ++i)
-        aList.append(JSC::Bindings::convertNPVariantToValue(exec, &amp;args[i], rootObject));
-}
-
-static inline JSC::SourceCode makeSource(const String&amp; source, const String&amp; url = String(), const TextPosition&amp; startPosition = TextPosition::minimumPosition())
-{
-    return JSC::SourceCode(JSC::StringSourceProvider::create(source, url, startPosition), startPosition.m_line.oneBasedInt(), startPosition.m_column.oneBasedInt());
-}
-
-static bool NPN_Evaluate(NPP instance, NPObject* o, NPString* s, NPVariant* variant)
-{
-    if (o-&gt;_class == NPScriptObjectClass) {
-        JavaScriptObject* obj = reinterpret_cast&lt;JavaScriptObject*&gt;(o);
-
-        JSC::Bindings::RootObject* rootObject = obj-&gt;rootObject;
-        if (!rootObject || !rootObject-&gt;isValid())
-            return false;
-
-        // There is a crash in Flash when evaluating a script that destroys the
-        // PluginView, so we destroy it asynchronously.
-        PluginView::keepAlive(instance);
-
-        JSC::ExecState* exec = rootObject-&gt;globalObject()-&gt;globalExec();
-        JSC::JSLockHolder lock(exec);
-        String scriptString = JSC::Bindings::convertNPStringToUTF16(s);
-
-        JSC::JSValue returnValue = JSC::evaluate(rootObject-&gt;globalObject()-&gt;globalExec(), makeSource(scriptString), JSC::JSValue());
-
-        JSC::Bindings::convertValueToNPVariant(exec, returnValue, variant);
-        exec-&gt;clearException();
-        return true;
-    }
-
-    VOID_TO_NPVARIANT(*variant);
-    return false;
-}
-
-static bool NPN_Invoke(NPP npp, NPObject* o, NPIdentifier methodName, const NPVariant* args, uint32_t argCount, NPVariant* result)
-{
-    if (o-&gt;_class == NPScriptObjectClass) {
-        JavaScriptObject* obj = reinterpret_cast&lt;JavaScriptObject*&gt;(o);
-
-        IdentifierRep* i = static_cast&lt;IdentifierRep*&gt;(methodName);
-        if (!i-&gt;isString())
-            return false;
-
-        // Special case the &quot;eval&quot; method.
-        if (methodName == _NPN_GetStringIdentifier(&quot;eval&quot;)) {
-            if (argCount != 1)
-                return false;
-            if (args[0].type != NPVariantType_String)
-                return false;
-            return WebCore::NPN_Evaluate(npp, o, const_cast&lt;NPString*&gt;(&amp;args[0].value.stringValue), result);
-        }
-
-        // Look up the function object.
-        JSC::Bindings::RootObject* rootObject = obj-&gt;rootObject;
-        if (!rootObject || !rootObject-&gt;isValid())
-            return false;
-        JSC::ExecState* exec = rootObject-&gt;globalObject()-&gt;globalExec();
-        JSC::JSLockHolder lock(exec);
-        JSC::JSValue function = obj-&gt;imp-&gt;get(exec, JSC::Bindings::identifierFromNPIdentifier(exec, i-&gt;string()));
-        JSC::CallData callData;
-        JSC::CallType callType = getCallData(function, callData);
-        if (callType == JSC::CallTypeNone)
-            return false;
-
-        // Call the function object.
-        JSC::MarkedArgumentBuffer argList;
-        getListFromVariantArgs(exec, args, argCount, rootObject, argList);
-        JSC::JSValue resultV = JSC::call(exec, function, callType, callData, obj-&gt;imp, argList);
-
-        // Convert and return the result of the function call.
-        JSC::Bindings::convertValueToNPVariant(exec, resultV, result);
-        exec-&gt;clearException();
-        return true;
-    }
-
-    if (o-&gt;_class-&gt;invoke)
-        return o-&gt;_class-&gt;invoke(o, methodName, args, argCount, result);
-
-    VOID_TO_NPVARIANT(*result);
-    return true;
-}
-
-void PluginPackage::initializeBrowserFuncs()
-{
-    memset(&amp;m_browserFuncs, 0, sizeof(m_browserFuncs));
-    m_browserFuncs.size = sizeof(m_browserFuncs);
-    m_browserFuncs.version = NPVersion();
-
-    m_browserFuncs.geturl = NPN_GetURL;
-    m_browserFuncs.posturl = NPN_PostURL;
-    m_browserFuncs.requestread = NPN_RequestRead;
-    m_browserFuncs.newstream = NPN_NewStream;
-    m_browserFuncs.write = NPN_Write;
-    m_browserFuncs.destroystream = NPN_DestroyStream;
-    m_browserFuncs.status = NPN_Status;
-    m_browserFuncs.uagent = NPN_UserAgent;
-    m_browserFuncs.memalloc = NPN_MemAlloc;
-    m_browserFuncs.memfree = NPN_MemFree;
-    m_browserFuncs.memflush = NPN_MemFlush;
-    m_browserFuncs.reloadplugins = NPN_ReloadPlugins;
-    m_browserFuncs.geturlnotify = NPN_GetURLNotify;
-    m_browserFuncs.posturlnotify = NPN_PostURLNotify;
-    m_browserFuncs.getvalue = NPN_GetValue;
-    m_browserFuncs.setvalue = NPN_SetValue;
-    m_browserFuncs.invalidaterect = NPN_InvalidateRect;
-    m_browserFuncs.invalidateregion = NPN_InvalidateRegion;
-    m_browserFuncs.forceredraw = NPN_ForceRedraw;
-    m_browserFuncs.getJavaEnv = NPN_GetJavaEnv;
-    m_browserFuncs.getJavaPeer = NPN_GetJavaPeer;
-    m_browserFuncs.pushpopupsenabledstate = NPN_PushPopupsEnabledState;
-    m_browserFuncs.poppopupsenabledstate = NPN_PopPopupsEnabledState;
-    m_browserFuncs.pluginthreadasynccall = NPN_PluginThreadAsyncCall;
-
-    m_browserFuncs.releasevariantvalue = _NPN_ReleaseVariantValue;
-    m_browserFuncs.getstringidentifier = _NPN_GetStringIdentifier;
-    m_browserFuncs.getstringidentifiers = _NPN_GetStringIdentifiers;
-    m_browserFuncs.getintidentifier = _NPN_GetIntIdentifier;
-    m_browserFuncs.identifierisstring = _NPN_IdentifierIsString;
-    m_browserFuncs.utf8fromidentifier = _NPN_UTF8FromIdentifier;
-    m_browserFuncs.intfromidentifier = _NPN_IntFromIdentifier;
-    m_browserFuncs.createobject = _NPN_CreateObject;
-    m_browserFuncs.retainobject = _NPN_RetainObject;
-    m_browserFuncs.releaseobject = _NPN_ReleaseObject;
-    m_browserFuncs.invoke = WebCore::NPN_Invoke;
-    m_browserFuncs.invokeDefault = _NPN_InvokeDefault;
-    m_browserFuncs.evaluate = WebCore::NPN_Evaluate;
-    m_browserFuncs.getproperty = _NPN_GetProperty;
-    m_browserFuncs.setproperty = _NPN_SetProperty;
-    m_browserFuncs.removeproperty = _NPN_RemoveProperty;
-    m_browserFuncs.hasproperty = _NPN_HasProperty;
-    m_browserFuncs.hasmethod = _NPN_HasMethod;
-    m_browserFuncs.setexception = _NPN_SetException;
-    m_browserFuncs.enumerate = _NPN_Enumerate;
-    m_browserFuncs.construct = _NPN_Construct;
-    m_browserFuncs.getvalueforurl = NPN_GetValueForURL;
-    m_browserFuncs.setvalueforurl = NPN_SetValueForURL;
-    m_browserFuncs.getauthenticationinfo = NPN_GetAuthenticationInfo;
-
-    m_browserFuncs.popupcontextmenu = NPN_PopUpContextMenu;
-}
-#endif // ENABLE(NETSCAPE_PLUGIN_API)
-
-#if ENABLE(PLUGIN_PACKAGE_SIMPLE_HASH)
-unsigned PluginPackage::hash() const
-{
-    struct HashCodes {
-        unsigned hash;
-        time_t modifiedDate;
-    } hashCodes;
-
-    hashCodes.hash = m_path.impl()-&gt;hash();
-    hashCodes.modifiedDate = m_lastModified;
-
-    return StringHasher::hashMemory&lt;sizeof(hashCodes)&gt;(&amp;hashCodes);
-}
-
-bool PluginPackage::equal(const PluginPackage&amp; a, const PluginPackage&amp; b)
-{
-    return a.m_description == b.m_description;
-}
-#endif
-
-int PluginPackage::compareFileVersion(const PlatformModuleVersion&amp; compareVersion) const
-{
-    // return -1, 0, or 1 if plug-in version is less than, equal to, or greater than
-    // the passed version
-
-#if OS(WINDOWS)
-    if (m_moduleVersion.mostSig != compareVersion.mostSig)
-        return m_moduleVersion.mostSig &gt; compareVersion.mostSig ? 1 : -1;
-    if (m_moduleVersion.leastSig != compareVersion.leastSig)
-        return m_moduleVersion.leastSig &gt; compareVersion.leastSig ? 1 : -1;
-#else    
-    if (m_moduleVersion != compareVersion)
-        return m_moduleVersion &gt; compareVersion ? 1 : -1;
-#endif
-
-    return 0;
-}
-
-#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE)
-bool PluginPackage::ensurePluginLoaded()
-{
-    if (!m_infoIsFromCache)
-        return m_isLoaded;
-
-    m_quirks = PluginQuirkSet();
-    m_name = String();
-    m_description = String();
-    m_fullMIMEDescription = String();
-    m_moduleVersion = 0;
-
-    return fetchInfo();
-}
-#endif
-
-}
</del></span></pre></div>
<a id="trunkSourceWebCorepluginsPluginPackageh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/plugins/PluginPackage.h (178218 => 178219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/plugins/PluginPackage.h        2015-01-10 00:09:59 UTC (rev 178218)
+++ trunk/Source/WebCore/plugins/PluginPackage.h        2015-01-10 00:16:52 UTC (rev 178219)
</span><span class="lines">@@ -1,149 +0,0 @@
</span><del>-/*
- * Copyright (C) 2006, 2007 Apple Inc.  All rights reserved.
- * Copyright (C) 2008 Collabora, Ltd.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef PluginPackage_h
-#define PluginPackage_h
-
-#include &quot;FileSystem.h&quot;
-#include &quot;PluginQuirkSet.h&quot;
-#include &quot;Timer.h&quot;
-#if ENABLE(NETSCAPE_PLUGIN_API)
-#include &quot;npruntime_internal.h&quot;
-#endif
-#include &lt;wtf/HashMap.h&gt;
-#include &lt;wtf/RefCounted.h&gt;
-#include &lt;wtf/text/StringHash.h&gt;
-#include &lt;wtf/text/WTFString.h&gt;
-
-namespace WebCore {
-    typedef HashMap&lt;String, String&gt; MIMEToDescriptionsMap;
-    typedef HashMap&lt;String, Vector&lt;String&gt; &gt; MIMEToExtensionsMap;
-
-    class PluginPackage : public RefCounted&lt;PluginPackage&gt; {
-    public:
-        ~PluginPackage();
-        static PassRefPtr&lt;PluginPackage&gt; createPackage(const String&amp; path, const time_t&amp; lastModified);
-#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE)
-        static PassRefPtr&lt;PluginPackage&gt; createPackageFromCache(const String&amp; path, const time_t&amp; lastModified, const String&amp; name, const String&amp; description, const String&amp; mimeDescription);
-#endif
-
-        const String&amp; name() const { return m_name; }
-        const String&amp; description() const { return m_description; }
-        const String&amp; path() const { return m_path; }
-        const String&amp; fileName() const { return m_fileName; }
-        const String&amp; parentDirectory() const { return m_parentDirectory; }
-        PlatformModule module() const { return m_module; }
-        uint16_t NPVersion() const;
-        time_t lastModified() const { return m_lastModified; }
-
-        const MIMEToDescriptionsMap&amp; mimeToDescriptions() const { return m_mimeToDescriptions; }
-        const MIMEToExtensionsMap&amp; mimeToExtensions() const { return m_mimeToExtensions; }
-
-        unsigned hash() const;
-        static bool equal(const PluginPackage&amp; a, const PluginPackage&amp; b);
-
-        bool load();
-        void unload();
-        void unloadWithoutShutdown();
-
-        bool isEnabled() const { return m_isEnabled; }
-        void setEnabled(bool);
-
-#if ENABLE(NETSCAPE_PLUGIN_API)
-        const NPPluginFuncs* pluginFuncs() const { return &amp;m_pluginFuncs; }
-#endif
-        int compareFileVersion(const PlatformModuleVersion&amp;) const;
-        int compare(const PluginPackage&amp;) const;
-        PluginQuirkSet quirks() const { return m_quirks; }
-        const PlatformModuleVersion&amp; version() const { return m_moduleVersion; }
-
-#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE)
-        bool ensurePluginLoaded();
-        void setMIMEDescription(const String&amp; mimeDescription);
-        String fullMIMEDescription() const { return m_fullMIMEDescription;}
-#endif
-    private:
-        PluginPackage(const String&amp; path, const time_t&amp; lastModified);
-
-        bool fetchInfo();
-        bool isPluginBlacklisted();
-        void determineQuirks(const String&amp; mimeType);
-
-        void determineModuleVersionFromDescription();
-        void initializeBrowserFuncs();
-
-        bool m_isEnabled;
-        bool m_isLoaded;
-        int m_loadCount;
-
-        String m_description;
-        String m_path;
-        String m_fileName;
-        String m_name;
-        String m_parentDirectory;
-
-        PlatformModuleVersion m_moduleVersion;
-
-        MIMEToDescriptionsMap m_mimeToDescriptions;
-        MIMEToExtensionsMap m_mimeToExtensions;
-
-        PlatformModule m_module;
-        time_t m_lastModified;
-
-#if ENABLE(NETSCAPE_PLUGIN_API)
-        NPP_ShutdownProcPtr m_NPP_Shutdown;
-        NPPluginFuncs m_pluginFuncs;
-        NPNetscapeFuncs m_browserFuncs;
-#endif
-
-        void freeLibrarySoon();
-        void freeLibraryTimerFired();
-        Timer m_freeLibraryTimer;
-
-        PluginQuirkSet m_quirks;
-#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE)
-        String m_fullMIMEDescription;
-        bool m_infoIsFromCache;
-#endif
-    };
-
-    // FIXME: This is a workaround because PluginPackageHash is broken and may consider keys with different hashes as equal.
-    struct PluginPackageHashTraits : HashTraits&lt;RefPtr&lt;PluginPackage&gt; &gt; {
-        static const int minimumTableSize = 64;
-    };
-
-    struct PluginPackageHash {
-        static unsigned hash(const uintptr_t key) { return reinterpret_cast&lt;PluginPackage*&gt;(key)-&gt;hash(); }
-        static unsigned hash(const RefPtr&lt;PluginPackage&gt;&amp; key) { return key-&gt;hash(); }
-
-        static bool equal(const uintptr_t a, const uintptr_t b) { return equal(reinterpret_cast&lt;PluginPackage*&gt;(a), reinterpret_cast&lt;PluginPackage*&gt;(b)); }
-        static bool equal(const RefPtr&lt;PluginPackage&gt;&amp; a, const RefPtr&lt;PluginPackage&gt;&amp; b) { return PluginPackage::equal(*a.get(), *b.get()); }
-        static const bool safeToCompareToEmptyOrDeleted = false;
-    };
-
-} // namespace WebCore
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorepluginsPluginQuirkSeth"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/plugins/PluginQuirkSet.h (178218 => 178219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/plugins/PluginQuirkSet.h        2015-01-10 00:09:59 UTC (rev 178218)
+++ trunk/Source/WebCore/plugins/PluginQuirkSet.h        2015-01-10 00:16:52 UTC (rev 178219)
</span><span class="lines">@@ -1,66 +0,0 @@
</span><del>-/*
- * Copyright (C) 2008 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer. 
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution. 
- * 3.  Neither the name of Apple Inc. (&quot;Apple&quot;) nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission. 
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS &quot;AS IS&quot; AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef PluginQuirkSet_h
-#define PluginQuirkSet_h
-
-
-namespace WebCore {
-
-    enum PluginQuirk {
-        PluginQuirkWantsMozillaUserAgent = 1 &lt;&lt; 0,
-        PluginQuirkDeferFirstSetWindowCall = 1 &lt;&lt; 1,
-        PluginQuirkThrottleInvalidate = 1 &lt;&lt; 2, 
-        PluginQuirkRemoveWindowlessVideoParam = 1 &lt;&lt; 3,
-        PluginQuirkThrottleWMUserPlusOneMessages = 1 &lt;&lt; 4,
-        PluginQuirkDontUnloadPlugin = 1 &lt;&lt; 5,
-        PluginQuirkDontCallWndProcForSameMessageRecursively = 1 &lt;&lt; 6,
-        PluginQuirkHasModalMessageLoop = 1 &lt;&lt; 7,
-        PluginQuirkFlashURLNotifyBug = 1 &lt;&lt; 8,
-        PluginQuirkDontClipToZeroRectWhenScrolling = 1 &lt;&lt; 9,
-        PluginQuirkDontSetNullWindowHandleOnDestroy = 1 &lt;&lt; 10,
-        PluginQuirkDontAllowMultipleInstances = 1 &lt;&lt; 11,
-        PluginQuirkRequiresGtkToolKit = 1 &lt;&lt; 12,
-        PluginQuirkRequiresDefaultScreenDepth = 1 &lt;&lt; 13,
-        PluginQuirkDontCallSetWindowMoreThanOnce = 1 &lt;&lt; 14,
-        PluginQuirkIgnoreRightClickInWindowlessMode = 1 &lt;&lt; 15,
-        PluginQuirkWantsChromeUserAgent = 1 &lt;&lt; 16
-    };
-
-    class PluginQuirkSet {
-        public:
-            PluginQuirkSet() : m_quirks(0) { }
-            void add(PluginQuirk quirk) { m_quirks |= quirk; }
-            bool contains(PluginQuirk quirk) const { return m_quirks &amp; quirk; }
-        private:
-            unsigned m_quirks;
-    };
-
-} // namespace WebCore
-
-#endif // PluginQuirkSet_h
</del></span></pre></div>
<a id="trunkSourceWebCorepluginsPluginStreamcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/plugins/PluginStream.cpp (178218 => 178219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/plugins/PluginStream.cpp        2015-01-10 00:09:59 UTC (rev 178218)
+++ trunk/Source/WebCore/plugins/PluginStream.cpp        2015-01-10 00:16:52 UTC (rev 178219)
</span><span class="lines">@@ -1,482 +0,0 @@
</span><del>-/*
- * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
- * Copyright (C) 2008 Collabora, Ltd. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#include &quot;config.h&quot;
-#include &quot;PluginStream.h&quot;
-
-#include &quot;DocumentLoader.h&quot;
-#include &quot;Frame.h&quot;
-#include &quot;FrameLoader.h&quot;
-#include &quot;HTTPHeaderNames.h&quot;
-#include &quot;PluginDebug.h&quot;
-#include &quot;ResourceLoadScheduler.h&quot;
-#include &quot;SharedBuffer.h&quot;
-#include &quot;SubresourceLoader.h&quot;
-#include &lt;wtf/StringExtras.h&gt;
-#include &lt;wtf/text/CString.h&gt;
-#include &lt;wtf/text/StringBuilder.h&gt;
-#include &lt;wtf/text/WTFString.h&gt;
-
-// We use -2 here because some plugins like to return -1 to indicate error
-// and this way we won't clash with them.
-static const int WebReasonNone = -2;
-
-using std::max;
-using std::min;
-
-namespace WebCore {
-
-typedef HashMap&lt;NPStream*, NPP&gt; StreamMap;
-static StreamMap&amp; streams()
-{
-    static StreamMap staticStreams;
-    return staticStreams;
-}
-
-PluginStream::PluginStream(PluginStreamClient* client, Frame* frame, const ResourceRequest&amp; resourceRequest, bool sendNotification, void* notifyData, const NPPluginFuncs* pluginFuncs, NPP instance, const PluginQuirkSet&amp; quirks)
-    : m_resourceRequest(resourceRequest)
-    , m_client(client)
-    , m_frame(frame)
-    , m_notifyData(notifyData)
-    , m_sendNotification(sendNotification)
-    , m_streamState(StreamBeforeStarted)
-    , m_loadManually(false)
-    , m_delayDeliveryTimer(*this, &amp;PluginStream::delayDeliveryTimerFired)
-    , m_tempFileHandle(invalidPlatformFileHandle)
-    , m_pluginFuncs(pluginFuncs)
-    , m_instance(instance)
-    , m_quirks(quirks)
-{
-    ASSERT(m_instance);
-
-    m_stream.url = 0;
-    m_stream.ndata = 0;
-    m_stream.pdata = 0;
-    m_stream.end = 0;
-    m_stream.notifyData = 0;
-    m_stream.lastmodified = 0;
-    m_stream.headers = 0;
-
-    streams().add(&amp;m_stream, m_instance);
-}
-
-PluginStream::~PluginStream()
-{
-    ASSERT(m_streamState != StreamStarted);
-    ASSERT(!m_loader);
-
-    fastFree((char*)m_stream.url);
-
-    streams().remove(&amp;m_stream);
-}
-
-void PluginStream::start()
-{
-    ASSERT(!m_loadManually);
-    m_loader = resourceLoadScheduler()-&gt;schedulePluginStreamLoad(m_frame, this, m_resourceRequest);
-}
-
-void PluginStream::stop()
-{
-    m_streamState = StreamStopped;
-
-    if (m_loadManually) {
-        ASSERT(!m_loader);
-
-        DocumentLoader* documentLoader = m_frame-&gt;loader().activeDocumentLoader();
-        ASSERT(documentLoader);
-
-        if (documentLoader-&gt;isLoadingMainResource())
-            documentLoader-&gt;cancelMainResourceLoad(m_frame-&gt;loader().cancelledError(m_resourceRequest));
-
-        return;
-    }
-
-    if (m_loader) {
-        m_loader-&gt;cancel();
-        m_loader = 0;
-    }
-
-    m_client = 0;
-}
-
-static uint32_t lastModifiedDate(const ResourceResponse&amp; response)
-{
-    double lastModified = response.lastModified();
-    if (!std::isfinite(lastModified))
-        return 0;
-
-    return lastModified * 1000;
-}
-
-void PluginStream::startStream()
-{
-    ASSERT(m_streamState == StreamBeforeStarted);
-
-    const URL&amp; responseURL = m_resourceResponse.url();
-
-    // Some plugins (Flash) expect that javascript URLs are passed back decoded as this is the
-    // format used when requesting the URL.
-    if (protocolIsJavaScript(responseURL))
-        m_stream.url = fastStrDup(decodeURLEscapeSequences(responseURL.string()).utf8().data());
-    else
-        m_stream.url = fastStrDup(responseURL.string().utf8().data());
-
-    CString mimeTypeStr = m_resourceResponse.mimeType().utf8();
-
-    long long expectedContentLength = m_resourceResponse.expectedContentLength();
-
-    if (m_resourceResponse.isHTTP()) {
-        StringBuilder stringBuilder;
-        String separator = ASCIILiteral(&quot;: &quot;);
-
-        String statusLine = &quot;HTTP &quot; + String::number(m_resourceResponse.httpStatusCode()) + &quot; OK\n&quot;;
-        stringBuilder.append(statusLine);
-
-        HTTPHeaderMap::const_iterator end = m_resourceResponse.httpHeaderFields().end();
-        for (HTTPHeaderMap::const_iterator it = m_resourceResponse.httpHeaderFields().begin(); it != end; ++it) {
-            stringBuilder.append(it-&gt;key);
-            stringBuilder.append(separator);
-            stringBuilder.append(it-&gt;value);
-            stringBuilder.append('\n');
-        }
-
-        m_headers = stringBuilder.toString().utf8();
-
-        // If the content is encoded (most likely compressed), then don't send its length to the plugin,
-        // which is only interested in the decoded length, not yet known at the moment.
-        // &lt;rdar://problem/4470599&gt; tracks a request for -[NSURLResponse expectedContentLength] to incorporate this logic.
-        String contentEncoding = m_resourceResponse.httpHeaderField(HTTPHeaderName::ContentEncoding);
-        if (!contentEncoding.isNull() &amp;&amp; contentEncoding != &quot;identity&quot;)
-            expectedContentLength = -1;
-    }
-
-    m_stream.headers = m_headers.data();
-    m_stream.pdata = 0;
-    m_stream.ndata = this;
-    m_stream.end = max(expectedContentLength, 0LL);
-    m_stream.lastmodified = lastModifiedDate(m_resourceResponse);
-    m_stream.notifyData = m_notifyData;
-
-    m_transferMode = NP_NORMAL;
-    m_offset = 0;
-    m_reason = WebReasonNone;
-
-    // Protect the stream if destroystream is called from within the newstream handler
-    RefPtr&lt;PluginStream&gt; protect(this);
-
-    // calling into a plug-in could result in re-entrance if the plug-in yields
-    // control to the system (rdar://5744899). prevent this by deferring further
-    // loading while calling into the plug-in.
-    if (m_loader)
-        m_loader-&gt;setDefersLoading(true);
-    NPError npErr = m_pluginFuncs-&gt;newstream(m_instance, (NPMIMEType)mimeTypeStr.data(), &amp;m_stream, false, &amp;m_transferMode);
-    if (m_loader)
-        m_loader-&gt;setDefersLoading(false);
-    
-    // If the stream was destroyed in the call to newstream we return
-    if (m_reason != WebReasonNone)
-        return;
-        
-    if (npErr != NPERR_NO_ERROR) {
-        cancelAndDestroyStream(npErr);
-        return;
-    }
-
-    m_streamState = StreamStarted;
-
-    if (m_transferMode == NP_NORMAL)
-        return;
-
-    m_path = openTemporaryFile(&quot;WKP&quot;, m_tempFileHandle);
-
-    // Something went wrong, cancel loading the stream
-    if (!isHandleValid(m_tempFileHandle))
-        cancelAndDestroyStream(NPRES_NETWORK_ERR);
-}
-
-NPP PluginStream::ownerForStream(NPStream* stream)
-{
-    return streams().get(stream);
-}
-
-void PluginStream::cancelAndDestroyStream(NPReason reason)
-{
-    RefPtr&lt;PluginStream&gt; protect(this);
-
-    destroyStream(reason);
-    stop();
-}
-
-void PluginStream::destroyStream(NPReason reason)
-{
-    m_reason = reason;
-    if (m_reason != NPRES_DONE) {
-        // Stop any pending data from being streamed
-        if (m_deliveryData)
-            m_deliveryData-&gt;resize(0);
-    } else if (m_deliveryData &amp;&amp; m_deliveryData-&gt;size() &gt; 0) {
-        // There is more data to be streamed, don't destroy the stream now.
-        return;
-    }
-    destroyStream();
-}
-
-void PluginStream::destroyStream()
-{
-    if (m_streamState == StreamStopped)
-        return;
-
-    ASSERT(m_reason != WebReasonNone);
-    ASSERT(!m_deliveryData || m_deliveryData-&gt;size() == 0);
-
-    closeFile(m_tempFileHandle);
-
-    bool newStreamCalled = m_stream.ndata;
-
-    // Protect from destruction if:
-    //  NPN_DestroyStream is called from NPP_NewStream or
-    //  PluginStreamClient::streamDidFinishLoading() removes the last reference
-    RefPtr&lt;PluginStream&gt; protect(this);
-
-    if (newStreamCalled) {
-        if (m_reason == NPRES_DONE &amp;&amp; (m_transferMode == NP_ASFILE || m_transferMode == NP_ASFILEONLY)) {
-            ASSERT(!m_path.isNull());
-
-            if (m_loader)
-                m_loader-&gt;setDefersLoading(true);
-            m_pluginFuncs-&gt;asfile(m_instance, &amp;m_stream, m_path.utf8().data());
-            if (m_loader)
-                m_loader-&gt;setDefersLoading(false);
-        }
-
-        if (m_streamState != StreamBeforeStarted) {
-            if (m_loader)
-                m_loader-&gt;setDefersLoading(true);
-
-            NPError npErr = m_pluginFuncs-&gt;destroystream(m_instance, &amp;m_stream, m_reason);
-
-            if (m_loader)
-                m_loader-&gt;setDefersLoading(false);
-
-            LOG_NPERROR(npErr);
-        }
-
-        m_stream.ndata = 0;
-    }
-
-    if (m_sendNotification) {
-        // Flash 9 can dereference null if we call NPP_URLNotify without first calling NPP_NewStream
-        // for requests made with NPN_PostURLNotify; see &lt;rdar://5588807&gt;
-        if (m_loader)
-            m_loader-&gt;setDefersLoading(true);
-        if (!newStreamCalled &amp;&amp; m_quirks.contains(PluginQuirkFlashURLNotifyBug) &amp;&amp;
-            equalIgnoringCase(m_resourceRequest.httpMethod(), &quot;POST&quot;)) {
-            m_transferMode = NP_NORMAL;
-            m_stream.url = &quot;&quot;;
-            m_stream.notifyData = m_notifyData;
-
-            static char emptyMimeType[] = &quot;&quot;;
-            m_pluginFuncs-&gt;newstream(m_instance, emptyMimeType, &amp;m_stream, false, &amp;m_transferMode);
-            m_pluginFuncs-&gt;destroystream(m_instance, &amp;m_stream, m_reason);
-
-            // in successful requests, the URL is dynamically allocated and freed in our
-            // destructor, so reset it to 0
-            m_stream.url = 0;
-        }
-        m_pluginFuncs-&gt;urlnotify(m_instance, m_resourceRequest.url().string().utf8().data(), m_reason, m_notifyData);
-        if (m_loader)
-            m_loader-&gt;setDefersLoading(false);
-    }
-
-    m_streamState = StreamStopped;
-
-    if (!m_loadManually &amp;&amp; m_client)
-        m_client-&gt;streamDidFinishLoading(this);
-
-    if (!m_path.isNull())
-        deleteFile(m_path);
-}
-
-void PluginStream::delayDeliveryTimerFired()
-{
-    deliverData();
-}
-
-void PluginStream::deliverData()
-{
-    ASSERT(m_deliveryData);
-    
-    if (m_streamState == StreamStopped)
-        // FIXME: We should cancel our job in the SubresourceLoader on error so we don't reach this case
-        return;
-
-    ASSERT(m_streamState != StreamBeforeStarted);
-
-    if (!m_stream.ndata || m_deliveryData-&gt;size() == 0)
-        return;
-
-    int32_t totalBytes = m_deliveryData-&gt;size();
-    int32_t totalBytesDelivered = 0;
-
-    if (m_loader)
-        m_loader-&gt;setDefersLoading(true);
-    while (totalBytesDelivered &lt; totalBytes) {
-        int32_t deliveryBytes = m_pluginFuncs-&gt;writeready(m_instance, &amp;m_stream);
-
-        if (deliveryBytes &lt;= 0) {
-            m_delayDeliveryTimer.startOneShot(0);
-            break;
-        } else {
-            deliveryBytes = min(deliveryBytes, totalBytes - totalBytesDelivered);
-            int32_t dataLength = deliveryBytes;
-            char* data = m_deliveryData-&gt;data() + totalBytesDelivered;
-
-            // Write the data
-            deliveryBytes = m_pluginFuncs-&gt;write(m_instance, &amp;m_stream, m_offset, dataLength, (void*)data);
-            if (deliveryBytes &lt; 0) {
-                LOG_PLUGIN_NET_ERROR();
-                if (m_loader)
-                    m_loader-&gt;setDefersLoading(false);
-                cancelAndDestroyStream(NPRES_NETWORK_ERR);
-                return;
-            }
-            deliveryBytes = min(deliveryBytes, dataLength);
-            m_offset += deliveryBytes;
-            totalBytesDelivered += deliveryBytes;
-        }
-    }
-    if (m_loader)
-        m_loader-&gt;setDefersLoading(false);
-
-    if (totalBytesDelivered &gt; 0) {
-        if (totalBytesDelivered &lt; totalBytes) {
-            int remainingBytes = totalBytes - totalBytesDelivered;
-            memmove(m_deliveryData-&gt;data(), m_deliveryData-&gt;data() + totalBytesDelivered, remainingBytes);
-            m_deliveryData-&gt;resize(remainingBytes);
-        } else {
-            m_deliveryData-&gt;resize(0);
-            if (m_reason != WebReasonNone)
-                destroyStream();
-        }
-    } 
-}
-
-void PluginStream::sendJavaScriptStream(const URL&amp; requestURL, const CString&amp; resultString)
-{
-    didReceiveResponse(0, ResourceResponse(requestURL, &quot;text/plain&quot;, resultString.length(), &quot;&quot;));
-
-    if (m_streamState == StreamStopped)
-        return;
-
-    if (!resultString.isNull()) {
-        didReceiveData(0, resultString.data(), resultString.length());
-        if (m_streamState == StreamStopped)
-            return;
-    }
-
-    m_loader = 0;
-
-    destroyStream(resultString.isNull() ? NPRES_NETWORK_ERR : NPRES_DONE);
-}
-
-void PluginStream::didReceiveResponse(NetscapePlugInStreamLoader* loader, const ResourceResponse&amp; response)
-{
-    ASSERT_UNUSED(loader, loader == m_loader);
-    ASSERT(m_streamState == StreamBeforeStarted);
-
-    m_resourceResponse = response;
-
-    startStream();
-}
-
-void PluginStream::didReceiveData(NetscapePlugInStreamLoader* loader, const char* data, int length)
-{
-    ASSERT_UNUSED(loader, loader == m_loader);
-    ASSERT(m_streamState == StreamStarted);
-
-    // If the plug-in cancels the stream in deliverData it could be deleted, 
-    // so protect it here.
-    RefPtr&lt;PluginStream&gt; protect(this);
-
-    if (m_transferMode != NP_ASFILEONLY) {
-        if (!m_deliveryData)
-            m_deliveryData = std::make_unique&lt;Vector&lt;char&gt;&gt;();
-
-        int oldSize = m_deliveryData-&gt;size();
-        m_deliveryData-&gt;resize(oldSize + length);
-        memcpy(m_deliveryData-&gt;data() + oldSize, data, length);
-
-        deliverData();
-    }
-
-    if (m_streamState != StreamStopped &amp;&amp; isHandleValid(m_tempFileHandle)) {
-        int bytesWritten = writeToFile(m_tempFileHandle, data, length);
-        if (bytesWritten != length)
-            cancelAndDestroyStream(NPRES_NETWORK_ERR);
-    }
-}
-
-void PluginStream::didFail(NetscapePlugInStreamLoader* loader, const ResourceError&amp;)
-{
-    ASSERT_UNUSED(loader, loader == m_loader);
-
-    LOG_PLUGIN_NET_ERROR();
-
-    // destroyStream can result in our being deleted
-    RefPtr&lt;PluginStream&gt; protect(this);
-
-    destroyStream(NPRES_NETWORK_ERR);
-
-    m_loader = 0;
-}
-
-void PluginStream::didFinishLoading(NetscapePlugInStreamLoader* loader)
-{
-    ASSERT_UNUSED(loader, loader == m_loader);
-    ASSERT(m_streamState == StreamStarted);
-
-    // destroyStream can result in our being deleted
-    RefPtr&lt;PluginStream&gt; protect(this);
-
-    destroyStream(NPRES_DONE);
-
-    m_loader = 0;
-}
-
-bool PluginStream::wantsAllStreams() const
-{
-    if (!m_pluginFuncs-&gt;getvalue)
-        return false;
-
-    void* result = 0;
-    if (m_pluginFuncs-&gt;getvalue(m_instance, NPPVpluginWantsAllNetworkStreams, &amp;result) != NPERR_NO_ERROR)
-        return false;
-
-    return result != 0;
-}
-
-}
</del></span></pre></div>
<a id="trunkSourceWebCorepluginsPluginStreamh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/plugins/PluginStream.h (178218 => 178219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/plugins/PluginStream.h        2015-01-10 00:09:59 UTC (rev 178218)
+++ trunk/Source/WebCore/plugins/PluginStream.h        2015-01-10 00:16:52 UTC (rev 178219)
</span><span class="lines">@@ -1,122 +0,0 @@
</span><del>-/*
- * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
- * Copyright (C) 2008 Collabora, Ltd. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#ifndef PluginStream_h
-#define PluginStream_h
-
-#include &quot;FileSystem.h&quot;
-#include &quot;URL.h&quot;
-#include &quot;NetscapePlugInStreamLoader.h&quot;
-#include &quot;PluginQuirkSet.h&quot;
-#include &quot;ResourceRequest.h&quot;
-#include &quot;ResourceResponse.h&quot;
-#include &quot;Timer.h&quot;
-#include &quot;npruntime_internal.h&quot;
-#include &lt;wtf/HashMap.h&gt;
-#include &lt;wtf/RefCounted.h&gt;
-#include &lt;wtf/Vector.h&gt;
-#include &lt;wtf/text/CString.h&gt;
-#include &lt;wtf/text/StringHash.h&gt;
-#include &lt;wtf/text/WTFString.h&gt;
-
-namespace WebCore {
-    class Frame;
-    class PluginStream;
-
-    enum PluginStreamState { StreamBeforeStarted, StreamStarted, StreamStopped };
-
-    class PluginStreamClient {
-    public:
-        virtual ~PluginStreamClient() {}
-        virtual void streamDidFinishLoading(PluginStream*) {}
-    };
-
-    class PluginStream : public RefCounted&lt;PluginStream&gt;, private NetscapePlugInStreamLoaderClient {
-    public:
-        static PassRefPtr&lt;PluginStream&gt; create(PluginStreamClient* client, Frame* frame, const ResourceRequest&amp; request, bool sendNotification, void* notifyData, const NPPluginFuncs* functions, NPP instance, const PluginQuirkSet&amp; quirks)
-        {
-            return adoptRef(new PluginStream(client, frame, request, sendNotification, notifyData, functions, instance, quirks));
-        }
-        virtual ~PluginStream();
-        
-        void start();
-        void stop();
-
-        void startStream();
-
-        void setLoadManually(bool loadManually) { m_loadManually = loadManually; }
-
-        void sendJavaScriptStream(const URL&amp; requestURL, const WTF::CString&amp; resultString);
-        void cancelAndDestroyStream(NPReason);
-
-        static NPP ownerForStream(NPStream*);
-
-        // NetscapePlugInStreamLoaderClient
-        virtual void didReceiveResponse(NetscapePlugInStreamLoader*, const ResourceResponse&amp;);
-        virtual void didReceiveData(NetscapePlugInStreamLoader*, const char*, int);
-        virtual void didFail(NetscapePlugInStreamLoader*, const ResourceError&amp;);
-        virtual void didFinishLoading(NetscapePlugInStreamLoader*);
-        virtual bool wantsAllStreams() const;
-
-    private:
-        PluginStream(PluginStreamClient*, Frame*, const ResourceRequest&amp;, bool sendNotification, void* notifyData, const NPPluginFuncs*, NPP instance, const PluginQuirkSet&amp;);
-
-        void deliverData();
-        void destroyStream(NPReason);
-        void destroyStream();
-
-        ResourceRequest m_resourceRequest;
-        ResourceResponse m_resourceResponse;
-
-        PluginStreamClient* m_client;
-        Frame* m_frame;
-        RefPtr&lt;NetscapePlugInStreamLoader&gt; m_loader;
-        void* m_notifyData;
-        bool m_sendNotification;
-        PluginStreamState m_streamState;
-        bool m_loadManually;
-
-        Timer m_delayDeliveryTimer;
-        void delayDeliveryTimerFired();
-
-        std::unique_ptr&lt;Vector&lt;char&gt;&gt; m_deliveryData;
-
-        PlatformFileHandle m_tempFileHandle;
-
-        const NPPluginFuncs* m_pluginFuncs;
-        NPP m_instance;
-        uint16_t m_transferMode;
-        int32_t m_offset;
-        CString m_headers;
-        String m_path;
-        NPReason m_reason;
-        NPStream m_stream;
-        PluginQuirkSet m_quirks;
-    };
-
-} // namespace WebCore
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorepluginsPluginViewcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/plugins/PluginView.cpp (178218 => 178219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/plugins/PluginView.cpp        2015-01-10 00:09:59 UTC (rev 178218)
+++ trunk/Source/WebCore/plugins/PluginView.cpp        2015-01-10 00:16:52 UTC (rev 178219)
</span><span class="lines">@@ -1,1489 +0,0 @@
</span><del>-/*
- * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
- * Copyright (C) 2008 Collabora Ltd. All rights reserved.
- * Copyright (C) 2010 Girish Ramakrishnan &lt;girish@forwardbias.in&gt;
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#include &quot;config.h&quot;
-#include &quot;PluginView.h&quot;
-
-#include &quot;BridgeJSC.h&quot;
-#include &quot;Chrome.h&quot;
-#include &quot;CookieJar.h&quot;
-#include &quot;Document.h&quot;
-#include &quot;DocumentLoader.h&quot;
-#include &quot;Element.h&quot;
-#include &quot;FocusController.h&quot;
-#include &quot;Frame.h&quot;
-#include &quot;FrameLoadRequest.h&quot;
-#include &quot;FrameLoader.h&quot;
-#include &quot;FrameLoaderClient.h&quot;
-#include &quot;FrameTree.h&quot;
-#include &quot;FrameView.h&quot;
-#include &quot;GraphicsContext.h&quot;
-#include &quot;HTMLNames.h&quot;
-#include &quot;HTMLPlugInElement.h&quot;
-#include &quot;HTTPHeaderNames.h&quot;
-#include &quot;Image.h&quot;
-#include &quot;JSDOMBinding.h&quot;
-#include &quot;JSDOMWindow.h&quot;
-#include &quot;KeyboardEvent.h&quot;
-#include &quot;MIMETypeRegistry.h&quot;
-#include &quot;MouseEvent.h&quot;
-#include &quot;NotImplemented.h&quot;
-#include &quot;Page.h&quot;
-#include &quot;PlatformMouseEvent.h&quot;
-#include &quot;PluginDatabase.h&quot;
-#include &quot;PluginDebug.h&quot;
-#include &quot;PluginMainThreadScheduler.h&quot;
-#include &quot;PluginPackage.h&quot;
-#include &quot;ProxyServer.h&quot;
-#include &quot;RenderBox.h&quot;
-#include &quot;RenderObject.h&quot;
-#include &quot;ScriptController.h&quot;
-#include &quot;SecurityOrigin.h&quot;
-#include &quot;Settings.h&quot;
-#include &quot;UserGestureIndicator.h&quot;
-#include &quot;WheelEvent.h&quot;
-#include &quot;c_instance.h&quot;
-#include &quot;npruntime_impl.h&quot;
-#include &quot;runtime_root.h&quot;
-#include &lt;bindings/ScriptValue.h&gt;
-#include &lt;runtime/JSCJSValue.h&gt;
-#include &lt;runtime/JSLock.h&gt;
-#include &lt;wtf/ASCIICType.h&gt;
-#include &lt;wtf/text/WTFString.h&gt;
-
-#if OS(WINDOWS) &amp;&amp; ENABLE(NETSCAPE_PLUGIN_API)
-#include &quot;PluginMessageThrottlerWin.h&quot;
-#endif
-
-using JSC::ExecState;
-using JSC::JSLock;
-using JSC::JSObject;
-using JSC::JSValue;
-
-#if ENABLE(NETSCAPE_PLUGIN_API)
-
-using std::min;
-
-using namespace WTF;
-
-namespace WebCore {
-
-using namespace HTMLNames;
-
-static int s_callingPlugin;
-
-typedef HashMap&lt;NPP, PluginView*&gt; InstanceMap;
-
-static InstanceMap&amp; instanceMap()
-{
-    static InstanceMap&amp; map = *new InstanceMap;
-    return map;
-}
-
-static String scriptStringIfJavaScriptURL(const URL&amp; url)
-{
-    if (!protocolIsJavaScript(url))
-        return String();
-
-    // This returns an unescaped string
-    return decodeURLEscapeSequences(url.string().substring(11));
-}
-
-PluginView* PluginView::s_currentPluginView = 0;
-
-void PluginView::popPopupsStateTimerFired()
-{
-    popPopupsEnabledState();
-}
-
-IntRect PluginView::windowClipRect() const
-{
-    // Start by clipping to our bounds.
-    IntRect clipRect(m_windowRect);
-    
-    // Take our element and get the clip rect from the enclosing layer and frame view.
-    FrameView* parentView = m_element-&gt;document().view();
-    clipRect.intersect(parentView-&gt;windowClipRectForFrameOwner(m_element, true));
-
-    return clipRect;
-}
-
-void PluginView::setFrameRect(const IntRect&amp; rect)
-{
-    if (m_element-&gt;document().printing())
-        return;
-
-    if (rect != frameRect())
-        Widget::setFrameRect(rect);
-
-    updatePluginWidget();
-
-#if OS(WINDOWS)
-    // On Windows always call plugin to change geometry.
-    setNPWindowRect(rect);
-#elif defined(XP_UNIX)
-    // On Unix, multiple calls to setNPWindow() in windowed mode causes Flash to crash
-    if (m_mode == NP_FULL || !m_isWindowed)
-        setNPWindowRect(rect);
-#endif
-}
-
-void PluginView::frameRectsChanged()
-{
-    updatePluginWidget();
-}
-
-void PluginView::clipRectChanged()
-{
-    updatePluginWidget();
-}
-
-void PluginView::handleEvent(Event* event)
-{
-    if (!m_plugin || m_isWindowed)
-        return;
-
-    // Protect the plug-in from deletion while dispatching the event.
-    RefPtr&lt;PluginView&gt; protect(this);
-
-    if (event-&gt;isMouseEvent())
-        handleMouseEvent(static_cast&lt;MouseEvent*&gt;(event));
-    else if (event-&gt;isKeyboardEvent())
-        handleKeyboardEvent(static_cast&lt;KeyboardEvent*&gt;(event));
-#if defined(XP_MACOSX)
-    else if (event-&gt;type() == eventNames().wheelEvent || event-&gt;type() == eventNames().mousewheelEvent)
-        handleWheelEvent(static_cast&lt;WheelEvent*&gt;(event));
-#endif
-    else if (event-&gt;type() == eventNames().contextmenuEvent)
-        event-&gt;setDefaultHandled(); // We don't know if the plug-in has handled mousedown event by displaying a context menu, so we never want WebKit to show a default one.
-#if defined(XP_UNIX) &amp;&amp; ENABLE(NETSCAPE_PLUGIN_API)
-    else if (event-&gt;type() == eventNames().focusoutEvent)
-        handleFocusOutEvent();
-    else if (event-&gt;type() == eventNames().focusinEvent)
-        handleFocusInEvent();
-#endif
-}
-
-void PluginView::init()
-{
-    if (m_haveInitialized)
-        return;
-
-    m_haveInitialized = true;
-
-    if (!m_plugin) {
-        ASSERT(m_status == PluginStatusCanNotFindPlugin);
-        return;
-    }
-
-    LOG(Plugins, &quot;PluginView::init(): Initializing plug-in '%s'&quot;, m_plugin-&gt;name().utf8().data());
-
-    if (!m_plugin-&gt;load()) {
-        m_plugin = 0;
-        m_status = PluginStatusCanNotLoadPlugin;
-        return;
-    }
-
-    if (!startOrAddToUnstartedList()) {
-        m_status = PluginStatusCanNotLoadPlugin;
-        return;
-    }
-
-    m_status = PluginStatusLoadedSuccessfully;
-}
-
-bool PluginView::startOrAddToUnstartedList()
-{
-    if (!m_parentFrame-&gt;page())
-        return false;
-
-    // We only delay starting the plug-in if we're going to kick off the load
-    // ourselves. Otherwise, the loader will try to deliver data before we've
-    // started the plug-in.
-    if (!m_loadManually &amp;&amp; !m_parentFrame-&gt;page()-&gt;canStartMedia()) {
-        m_parentFrame-&gt;document()-&gt;addMediaCanStartListener(this);
-        m_isWaitingToStart = true;
-        return true;
-    }
-
-    return start();
-}
-
-bool PluginView::start()
-{
-    if (m_isStarted)
-        return false;
-
-    m_isWaitingToStart = false;
-
-    PluginMainThreadScheduler::scheduler().registerPlugin(m_instance);
-
-    ASSERT(m_plugin);
-    ASSERT(m_plugin-&gt;pluginFuncs()-&gt;newp);
-
-    NPError npErr;
-    {
-        PluginView::setCurrentPluginView(this);
-        JSC::JSLock::DropAllLocks dropAllLocks(JSDOMWindowBase::commonVM());
-        setCallingPlugin(true);
-        npErr = m_plugin-&gt;pluginFuncs()-&gt;newp((NPMIMEType)m_mimeType.utf8().data(), m_instance, m_mode, m_paramCount, m_paramNames, m_paramValues, NULL);
-        setCallingPlugin(false);
-        LOG_NPERROR(npErr);
-        PluginView::setCurrentPluginView(0);
-    }
-
-    if (npErr != NPERR_NO_ERROR) {
-        m_status = PluginStatusCanNotLoadPlugin;
-        PluginMainThreadScheduler::scheduler().unregisterPlugin(m_instance);
-        return false;
-    }
-
-    m_isStarted = true;
-
-    if (!m_url.isEmpty() &amp;&amp; !m_loadManually) {
-        FrameLoadRequest frameLoadRequest(m_parentFrame-&gt;document()-&gt;securityOrigin());
-        frameLoadRequest.resourceRequest().setHTTPMethod(&quot;GET&quot;);
-        frameLoadRequest.resourceRequest().setURL(m_url);
-        load(frameLoadRequest, false, 0);
-    }
-
-    m_status = PluginStatusLoadedSuccessfully;
-
-    if (!platformStart())
-        m_status = PluginStatusCanNotLoadPlugin;
-
-    if (m_status != PluginStatusLoadedSuccessfully)
-        return false;
-
-    return true;
-}
-
-void PluginView::mediaCanStart()
-{
-    ASSERT(!m_isStarted);
-    if (!start())
-        parentFrame()-&gt;loader().client().dispatchDidFailToStartPlugin(this);
-}
-
-PluginView::~PluginView()
-{
-    LOG(Plugins, &quot;PluginView::~PluginView()&quot;);
-
-    ASSERT(!m_lifeSupportTimer.isActive());
-
-    // If we failed to find the plug-in, we'll return early in our constructor, and
-    // m_instance will be 0.
-    if (m_instance)
-        instanceMap().remove(m_instance);
-
-    if (m_isWaitingToStart)
-        m_parentFrame-&gt;document()-&gt;removeMediaCanStartListener(this);
-
-    stop();
-
-    freeStringArray(m_paramNames, m_paramCount);
-    freeStringArray(m_paramValues, m_paramCount);
-
-    platformDestroy();
-
-    m_parentFrame-&gt;script().cleanupScriptObjectsForPlugin(this);
-
-    if (m_plugin &amp;&amp; !(m_plugin-&gt;quirks().contains(PluginQuirkDontUnloadPlugin)))
-        m_plugin-&gt;unload();
-}
-
-void PluginView::stop()
-{
-    if (!m_isStarted)
-        return;
-
-    LOG(Plugins, &quot;PluginView::stop(): Stopping plug-in '%s'&quot;, m_plugin-&gt;name().utf8().data());
-
-    HashSet&lt;RefPtr&lt;PluginStream&gt; &gt; streams = m_streams;
-    HashSet&lt;RefPtr&lt;PluginStream&gt; &gt;::iterator end = streams.end();
-    for (HashSet&lt;RefPtr&lt;PluginStream&gt; &gt;::iterator it = streams.begin(); it != end; ++it) {
-        (*it)-&gt;stop();
-        disconnectStream((*it).get());
-    }
-
-    ASSERT(m_streams.isEmpty());
-
-    m_isStarted = false;
-
-    JSC::JSLock::DropAllLocks dropAllLocks(JSDOMWindowBase::commonVM());
-
-#if ENABLE(NETSCAPE_PLUGIN_API)
-#if defined(XP_WIN) &amp;&amp; !PLATFORM(GTK)
-    // Unsubclass the window
-    if (m_isWindowed) {
-        WNDPROC currentWndProc = (WNDPROC)GetWindowLongPtr(platformPluginWidget(), GWLP_WNDPROC);
-
-        if (currentWndProc == PluginViewWndProc)
-            SetWindowLongPtr(platformPluginWidget(), GWLP_WNDPROC, (LONG_PTR)m_pluginWndProc);
-    }
-#endif // !defined(XP_WIN) || PLATFORM(GTK)
-#endif // ENABLE(NETSCAPE_PLUGIN_API)
-
-#if !defined(XP_MACOSX)
-    // Clear the window
-    m_npWindow.window = 0;
-
-    if (m_plugin-&gt;pluginFuncs()-&gt;setwindow &amp;&amp; !m_plugin-&gt;quirks().contains(PluginQuirkDontSetNullWindowHandleOnDestroy)) {
-        PluginView::setCurrentPluginView(this);
-        setCallingPlugin(true);
-        m_plugin-&gt;pluginFuncs()-&gt;setwindow(m_instance, &amp;m_npWindow);
-        setCallingPlugin(false);
-        PluginView::setCurrentPluginView(0);
-    }
-
-#ifdef XP_UNIX
-    delete static_cast&lt;NPSetWindowCallbackStruct*&gt;(m_npWindow.ws_info);
-    m_npWindow.ws_info = 0;
-#endif
-
-#endif // !defined(XP_MACOSX)
-
-    PluginMainThreadScheduler::scheduler().unregisterPlugin(m_instance);
-
-    NPSavedData* savedData = 0;
-    PluginView::setCurrentPluginView(this);
-    setCallingPlugin(true);
-    NPError npErr = m_plugin-&gt;pluginFuncs()-&gt;destroy(m_instance, &amp;savedData);
-    setCallingPlugin(false);
-    LOG_NPERROR(npErr);
-    PluginView::setCurrentPluginView(0);
-
-#if ENABLE(NETSCAPE_PLUGIN_API)
-    if (savedData) {
-        // TODO: Actually save this data instead of just discarding it
-        if (savedData-&gt;buf)
-            NPN_MemFree(savedData-&gt;buf);
-        NPN_MemFree(savedData);
-    }
-#endif
-
-    m_instance-&gt;pdata = 0;
-}
-
-void PluginView::setCurrentPluginView(PluginView* pluginView)
-{
-    s_currentPluginView = pluginView;
-}
-
-PluginView* PluginView::currentPluginView()
-{
-    return s_currentPluginView;
-}
-
-static char* createUTF8String(const String&amp; str)
-{
-    CString cstr = str.utf8();
-    const size_t cstrLength = cstr.length();
-    char* result = reinterpret_cast&lt;char*&gt;(fastMalloc(cstrLength + 1));
-
-    memcpy(result, cstr.data(), cstrLength);
-    result[cstrLength] = '\0';
-
-    return result;
-}
-
-void PluginView::performRequest(PluginRequest* request)
-{
-    if (!m_isStarted)
-        return;
-
-    // don't let a plugin start any loads if it is no longer part of a document that is being 
-    // displayed unless the loads are in the same frame as the plugin.
-    const String&amp; targetFrameName = request-&gt;frameLoadRequest().frameName();
-    if (m_parentFrame-&gt;loader().documentLoader() != m_parentFrame-&gt;loader().activeDocumentLoader() &amp;&amp; (targetFrameName.isNull() || m_parentFrame-&gt;tree().find(targetFrameName) != m_parentFrame))
-        return;
-
-    URL requestURL = request-&gt;frameLoadRequest().resourceRequest().url();
-    String jsString = scriptStringIfJavaScriptURL(requestURL);
-
-    UserGestureIndicator gestureIndicator(request-&gt;shouldAllowPopups() ? DefinitelyProcessingUserGesture : PossiblyProcessingUserGesture);
-
-    if (jsString.isNull()) {
-        // if this is not a targeted request, create a stream for it. otherwise,
-        // just pass it off to the loader
-        if (targetFrameName.isEmpty()) {
-            RefPtr&lt;PluginStream&gt; stream = PluginStream::create(this, m_parentFrame.get(), request-&gt;frameLoadRequest().resourceRequest(), request-&gt;sendNotification(), request-&gt;notifyData(), plugin()-&gt;pluginFuncs(), instance(), m_plugin-&gt;quirks());
-            m_streams.add(stream);
-            stream-&gt;start();
-        } else {
-            // If the target frame is our frame, we could destroy the
-            // PluginView, so we protect it. &lt;rdar://problem/6991251&gt;
-            RefPtr&lt;PluginView&gt; protect(this);
-
-            FrameLoadRequest frameRequest(m_parentFrame.get(), request-&gt;frameLoadRequest().resourceRequest());
-            frameRequest.setFrameName(targetFrameName);
-            frameRequest.setShouldCheckNewWindowPolicy(true);
-            m_parentFrame-&gt;loader().load(frameRequest);
-
-            // FIXME: &lt;rdar://problem/4807469&gt; This should be sent when the document has finished loading
-            if (request-&gt;sendNotification()) {
-                PluginView::setCurrentPluginView(this);
-                JSC::JSLock::DropAllLocks dropAllLocks(JSDOMWindowBase::commonVM());
-                setCallingPlugin(true);
-                m_plugin-&gt;pluginFuncs()-&gt;urlnotify(m_instance, requestURL.string().utf8().data(), NPRES_DONE, request-&gt;notifyData());
-                setCallingPlugin(false);
-                PluginView::setCurrentPluginView(0);
-            }
-        }
-        return;
-    }
-
-    // Targeted JavaScript requests are only allowed on the frame that contains the JavaScript plugin
-    // and this has been made sure in ::load.
-    ASSERT(targetFrameName.isEmpty() || m_parentFrame-&gt;tree().find(targetFrameName) == m_parentFrame);
-    
-    // Executing a script can cause the plugin view to be destroyed, so we keep a reference to it.
-    RefPtr&lt;PluginView&gt; protector(this);
-    Deprecated::ScriptValue result = m_parentFrame-&gt;script().executeScript(jsString, request-&gt;shouldAllowPopups());
-
-    if (targetFrameName.isNull()) {
-        String resultString;
-
-        JSC::ExecState* scriptState = m_parentFrame-&gt;script().globalObject(pluginWorld())-&gt;globalExec();
-        CString cstr;
-        if (result.getString(scriptState, resultString))
-            cstr = resultString.utf8();
-
-        RefPtr&lt;PluginStream&gt; stream = PluginStream::create(this, m_parentFrame.get(), request-&gt;frameLoadRequest().resourceRequest(), request-&gt;sendNotification(), request-&gt;notifyData(), plugin()-&gt;pluginFuncs(), instance(), m_plugin-&gt;quirks());
-        m_streams.add(stream);
-        stream-&gt;sendJavaScriptStream(requestURL, cstr);
-    }
-}
-
-void PluginView::requestTimerFired()
-{
-    ASSERT(!m_requests.isEmpty());
-    ASSERT(!m_isJavaScriptPaused);
-
-    std::unique_ptr&lt;PluginRequest&gt; request = WTF::move(m_requests[0]);
-    m_requests.remove(0);
-    
-    // Schedule a new request before calling performRequest since the call to
-    // performRequest can cause the plugin view to be deleted.
-    if (!m_requests.isEmpty())
-        m_requestTimer.startOneShot(0);
-
-    performRequest(request.get());
-}
-
-void PluginView::scheduleRequest(std::unique_ptr&lt;PluginRequest&gt; request)
-{
-    m_requests.append(WTF::move(request));
-
-    if (!m_isJavaScriptPaused)
-        m_requestTimer.startOneShot(0);
-}
-
-NPError PluginView::load(const FrameLoadRequest&amp; frameLoadRequest, bool sendNotification, void* notifyData)
-{
-    ASSERT(frameLoadRequest.resourceRequest().httpMethod() == &quot;GET&quot; || frameLoadRequest.resourceRequest().httpMethod() == &quot;POST&quot;);
-
-    URL url = frameLoadRequest.resourceRequest().url();
-    
-    if (url.isEmpty())
-        return NPERR_INVALID_URL;
-
-    // Don't allow requests to be made when the document loader is stopping all loaders.
-    DocumentLoader* loader = m_parentFrame-&gt;loader().documentLoader();
-    if (!loader || loader-&gt;isStopping())
-        return NPERR_GENERIC_ERROR;
-
-    const String&amp; targetFrameName = frameLoadRequest.frameName();
-    String jsString = scriptStringIfJavaScriptURL(url);
-
-    if (!jsString.isNull()) {
-        // Return NPERR_GENERIC_ERROR if JS is disabled. This is what Mozilla does.
-        if (!m_parentFrame-&gt;script().canExecuteScripts(NotAboutToExecuteScript))
-            return NPERR_GENERIC_ERROR;
-
-        // For security reasons, only allow JS requests to be made on the frame that contains the plug-in.
-        if (!targetFrameName.isNull() &amp;&amp; m_parentFrame-&gt;tree().find(targetFrameName) != m_parentFrame)
-            return NPERR_INVALID_PARAM;
-    } else if (!m_parentFrame-&gt;document()-&gt;securityOrigin()-&gt;canDisplay(url))
-        return NPERR_GENERIC_ERROR;
-
-    scheduleRequest(std::make_unique&lt;PluginRequest&gt;(frameLoadRequest, sendNotification, notifyData, arePopupsAllowed()));
-
-    return NPERR_NO_ERROR;
-}
-
-static URL makeURL(const URL&amp; baseURL, const char* relativeURLString)
-{
-    String urlString = relativeURLString;
-
-    // Strip return characters.
-    urlString.replaceWithLiteral('\n', &quot;&quot;);
-    urlString.replaceWithLiteral('\r', &quot;&quot;);
-
-    return URL(baseURL, urlString);
-}
-
-NPError PluginView::getURLNotify(const char* url, const char* target, void* notifyData)
-{
-    FrameLoadRequest frameLoadRequest(m_parentFrame-&gt;document()-&gt;securityOrigin());
-
-    frameLoadRequest.setFrameName(target);
-    frameLoadRequest.resourceRequest().setHTTPMethod(&quot;GET&quot;);
-    frameLoadRequest.resourceRequest().setURL(makeURL(m_parentFrame-&gt;document()-&gt;baseURL(), url));
-
-    return load(frameLoadRequest, true, notifyData);
-}
-
-NPError PluginView::getURL(const char* url, const char* target)
-{
-    FrameLoadRequest frameLoadRequest(m_parentFrame-&gt;document()-&gt;securityOrigin());
-
-    frameLoadRequest.setFrameName(target);
-    frameLoadRequest.resourceRequest().setHTTPMethod(&quot;GET&quot;);
-    frameLoadRequest.resourceRequest().setURL(makeURL(m_parentFrame-&gt;document()-&gt;baseURL(), url));
-
-    return load(frameLoadRequest, false, 0);
-}
-
-NPError PluginView::postURLNotify(const char* url, const char* target, uint32_t len, const char* buf, NPBool file, void* notifyData)
-{
-    return handlePost(url, target, len, buf, file, notifyData, true, true);
-}
-
-NPError PluginView::postURL(const char* url, const char* target, uint32_t len, const char* buf, NPBool file)
-{
-    // As documented, only allow headers to be specified via NPP_PostURL when using a file.
-    return handlePost(url, target, len, buf, file, 0, false, file);
-}
-
-NPError PluginView::newStream(NPMIMEType, const char* /* target */, NPStream**)
-{
-    notImplemented();
-    // Unsupported
-    return NPERR_GENERIC_ERROR;
-}
-
-int32_t PluginView::write(NPStream*, int32_t /* len */, void* /* buffer */)
-{
-    notImplemented();
-    // Unsupported
-    return -1;
-}
-
-NPError PluginView::destroyStream(NPStream* stream, NPReason reason)
-{
-    if (!stream || PluginStream::ownerForStream(stream) != m_instance)
-        return NPERR_INVALID_INSTANCE_ERROR;
-
-    PluginStream* browserStream = static_cast&lt;PluginStream*&gt;(stream-&gt;ndata);
-    browserStream-&gt;cancelAndDestroyStream(reason);
-
-    return NPERR_NO_ERROR;
-}
-
-void PluginView::status(const char* message)
-{
-    if (Page* page = m_parentFrame-&gt;page())
-        page-&gt;chrome().setStatusbarText(m_parentFrame.get(), String::fromUTF8(message));
-}
-
-NPError PluginView::setValue(NPPVariable variable, void* value)
-{
-    LOG(Plugins, &quot;PluginView::setValue(%s): &quot;, prettyNameForNPPVariable(variable, value).data());
-
-    switch (variable) {
-    case NPPVpluginWindowBool:
-        m_isWindowed = value;
-        return NPERR_NO_ERROR;
-    case NPPVpluginTransparentBool:
-        m_isTransparent = value;
-        return NPERR_NO_ERROR;
-#if defined(XP_MACOSX)
-    case NPPVpluginDrawingModel: {
-        // Can only set drawing model inside NPP_New()
-        if (this != currentPluginView())
-           return NPERR_GENERIC_ERROR;
-
-        NPDrawingModel newDrawingModel = NPDrawingModel(uintptr_t(value));
-        switch (newDrawingModel) {
-        case NPDrawingModelCoreGraphics:
-            return NPERR_NO_ERROR;
-        case NPDrawingModelCoreAnimation:
-        default:
-            LOG(Plugins, &quot;Plugin asked for unsupported drawing model: %s&quot;,
-                    prettyNameForDrawingModel(newDrawingModel));
-            return NPERR_GENERIC_ERROR;
-        }
-    }
-
-    case NPPVpluginEventModel: {
-        // Can only set event model inside NPP_New()
-        if (this != currentPluginView())
-           return NPERR_GENERIC_ERROR;
-
-        NPEventModel newEventModel = NPEventModel(uintptr_t(value));
-        switch (newEventModel) {
-        case NPEventModelCocoa:
-            return NPERR_NO_ERROR;
-        default:
-            LOG(Plugins, &quot;Plugin asked for unsupported event model: %s&quot;,
-                    prettyNameForEventModel(newEventModel));
-            return NPERR_GENERIC_ERROR;
-        }
-    }
-#endif // defined(XP_MACOSX)
-
-    default:
-        notImplemented();
-        return NPERR_GENERIC_ERROR;
-    }
-}
-
-void PluginView::invalidateTimerFired()
-{
-    for (unsigned i = 0; i &lt; m_invalidRects.size(); i++)
-        invalidateRect(m_invalidRects[i]);
-    m_invalidRects.clear();
-}
-
-
-void PluginView::pushPopupsEnabledState(bool state)
-{
-    m_popupStateStack.append(state);
-}

-void PluginView::popPopupsEnabledState()
-{
-    m_popupStateStack.removeLast();
-}
-
-bool PluginView::arePopupsAllowed() const
-{
-    if (!m_popupStateStack.isEmpty())
-        return m_popupStateStack.last();
-
-    return false;
-}
-
-void PluginView::setJavaScriptPaused(bool paused)
-{
-    if (m_isJavaScriptPaused == paused)
-        return;
-    m_isJavaScriptPaused = paused;
-
-    if (m_isJavaScriptPaused)
-        m_requestTimer.stop();
-    else if (!m_requests.isEmpty())
-        m_requestTimer.startOneShot(0);
-}
-
-#if ENABLE(NETSCAPE_PLUGIN_API)
-NPObject* PluginView::npObject()
-{
-    NPObject* object = 0;
-
-    if (!m_isStarted || !m_plugin || !m_plugin-&gt;pluginFuncs()-&gt;getvalue)
-        return 0;
-
-    // On Windows, calling Java's NPN_GetValue can allow the message loop to
-    // run, allowing loading to take place or JavaScript to run. Protect the
-    // PluginView from destruction. &lt;rdar://problem/6978804&gt;
-    RefPtr&lt;PluginView&gt; protect(this);
-
-    NPError npErr;
-    {
-        PluginView::setCurrentPluginView(this);
-        JSC::JSLock::DropAllLocks dropAllLocks(JSDOMWindowBase::commonVM());
-        setCallingPlugin(true);
-        npErr = m_plugin-&gt;pluginFuncs()-&gt;getvalue(m_instance, NPPVpluginScriptableNPObject, &amp;object);
-        setCallingPlugin(false);
-        PluginView::setCurrentPluginView(0);
-    }
-
-    if (npErr != NPERR_NO_ERROR)
-        return 0;
-
-    return object;
-}
-#endif
-
-PassRefPtr&lt;JSC::Bindings::Instance&gt; PluginView::bindingInstance()
-{
-#if ENABLE(NETSCAPE_PLUGIN_API)
-    NPObject* object = npObject();
-    if (!object)
-        return 0;
-
-    if (hasOneRef()) {
-        // The renderer for the PluginView was destroyed during the above call, and
-        // the PluginView will be destroyed when this function returns, so we
-        // return null.
-        return 0;
-    }
-
-    RefPtr&lt;JSC::Bindings::RootObject&gt; root = m_parentFrame-&gt;script().createRootObject(this);
-    RefPtr&lt;JSC::Bindings::Instance&gt; instance = JSC::Bindings::CInstance::create(object, root.release());
-
-    _NPN_ReleaseObject(object);
-
-    return instance.release();
-#else
-    return 0;
-#endif
-}
-
-void PluginView::disconnectStream(PluginStream* stream)
-{
-    ASSERT(m_streams.contains(stream));
-
-    m_streams.remove(stream);
-}
-
-void PluginView::setParameters(const Vector&lt;String&gt;&amp; paramNames, const Vector&lt;String&gt;&amp; paramValues)
-{
-    ASSERT(paramNames.size() == paramValues.size());
-
-    unsigned size = paramNames.size();
-    unsigned paramCount = 0;
-
-    m_paramNames = reinterpret_cast&lt;char**&gt;(fastMalloc(sizeof(char*) * size));
-    m_paramValues = reinterpret_cast&lt;char**&gt;(fastMalloc(sizeof(char*) * size));
-
-    for (unsigned i = 0; i &lt; size; i++) {
-        if (m_plugin-&gt;quirks().contains(PluginQuirkRemoveWindowlessVideoParam) &amp;&amp; equalIgnoringCase(paramNames[i], &quot;windowlessvideo&quot;))
-            continue;
-
-        if (paramNames[i] == &quot;pluginspage&quot;)
-            m_pluginsPage = paramValues[i];
-
-        m_paramNames[paramCount] = createUTF8String(paramNames[i]);
-        m_paramValues[paramCount] = createUTF8String(paramValues[i]);
-
-        paramCount++;
-    }
-
-    m_paramCount = paramCount;
-}
-
-PluginView::PluginView(Frame* parentFrame, const IntSize&amp; size, PluginPackage* plugin, HTMLPlugInElement* element, const URL&amp; url, const Vector&lt;String&gt;&amp; paramNames, const Vector&lt;String&gt;&amp; paramValues, const String&amp; mimeType, bool loadManually)
-    : m_parentFrame(parentFrame)
-    , m_plugin(plugin)
-    , m_element(element)
-    , m_isStarted(false)
-    , m_url(url)
-    , m_status(PluginStatusLoadedSuccessfully)
-    , m_requestTimer(*this, &amp;PluginView::requestTimerFired)
-    , m_invalidateTimer(*this, &amp;PluginView::invalidateTimerFired)
-    , m_popPopupsStateTimer(*this, &amp;PluginView::popPopupsStateTimerFired)
-    , m_lifeSupportTimer(*this, &amp;PluginView::lifeSupportTimerFired)
-    , m_mode(loadManually ? NP_FULL : NP_EMBED)
-    , m_paramNames(0)
-    , m_paramValues(0)
-    , m_mimeType(mimeType)
-    , m_instance(0)
-#if defined(XP_MACOSX)
-    , m_isWindowed(false)
-    , m_updatedCocoaTextInputRequested(false)
-    , m_keyDownSent(false)
-    , m_disregardKeyUpCounter(0)
-#else
-    , m_isWindowed(true)
-#endif
-    , m_isTransparent(false)
-    , m_haveInitialized(false)
-    , m_isWaitingToStart(false)
-#if defined(XP_UNIX)
-    , m_needsXEmbed(false)
-#endif
-#if OS(WINDOWS) &amp;&amp; ENABLE(NETSCAPE_PLUGIN_API)
-    , m_pluginWndProc(0)
-    , m_lastMessage(0)
-    , m_isCallingPluginWndProc(false)
-    , m_wmPrintHDC(0)
-    , m_haveUpdatedPluginWidget(false)
-#endif
-#if PLATFORM(EFL)
-    , m_window(0)
-#endif
-#if defined(XP_MACOSX)
-    , m_contextRef(0)
-#endif
-#if defined(XP_UNIX) &amp;&amp; ENABLE(NETSCAPE_PLUGIN_API)
-    , m_hasPendingGeometryChange(true)
-    , m_drawable(0)
-    , m_visual(0)
-    , m_colormap(0)
-    , m_pluginDisplay(0)
-#endif
-    , m_loadManually(loadManually)
-    , m_manualStream(0)
-    , m_isJavaScriptPaused(false)
-    , m_haveCalledSetWindow(false)
-{
-    if (!m_plugin) {
-        m_status = PluginStatusCanNotFindPlugin;
-        return;
-    }
-
-    m_instance = &amp;m_instanceStruct;
-    m_instance-&gt;ndata = this;
-    m_instance-&gt;pdata = 0;
-
-    instanceMap().add(m_instance, this);
-
-    setParameters(paramNames, paramValues);
-
-    memset(&amp;m_npWindow, 0, sizeof(m_npWindow));
-#if defined(XP_MACOSX)
-    memset(&amp;m_npCgContext, 0, sizeof(m_npCgContext));
-#endif
-
-    resize(size);
-}
-
-void PluginView::focusPluginElement()
-{
-    if (Page* page = m_parentFrame-&gt;page())
-        page-&gt;focusController().setFocusedElement(m_element, m_parentFrame);
-    else
-        m_parentFrame-&gt;document()-&gt;setFocusedElement(m_element);
-}
-
-void PluginView::didReceiveResponse(const ResourceResponse&amp; response)
-{
-    if (m_status != PluginStatusLoadedSuccessfully)
-        return;
-
-    ASSERT(m_loadManually);
-    ASSERT(!m_manualStream);
-
-    m_manualStream = PluginStream::create(this, m_parentFrame.get(), m_parentFrame-&gt;loader().activeDocumentLoader()-&gt;request(), false, 0, plugin()-&gt;pluginFuncs(), instance(), m_plugin-&gt;quirks());
-    m_manualStream-&gt;setLoadManually(true);
-
-    m_manualStream-&gt;didReceiveResponse(0, response);
-}
-
-void PluginView::didReceiveData(const char* data, int length)
-{
-    if (m_status != PluginStatusLoadedSuccessfully)
-        return;
-
-    ASSERT(m_loadManually);
-    ASSERT(m_manualStream);
-    
-    m_manualStream-&gt;didReceiveData(0, data, length);
-}
-
-void PluginView::didFinishLoading()
-{
-    if (m_status != PluginStatusLoadedSuccessfully)
-        return;
-
-    ASSERT(m_loadManually);
-    ASSERT(m_manualStream);
-
-    m_manualStream-&gt;didFinishLoading(0);
-}
-
-void PluginView::didFail(const ResourceError&amp; error)
-{
-    if (m_status != PluginStatusLoadedSuccessfully)
-        return;
-
-    ASSERT(m_loadManually);
-    
-    if (m_manualStream)
-        m_manualStream-&gt;didFail(0, error);
-}
-
-void PluginView::setCallingPlugin(bool b) const
-{
-    if (!m_plugin-&gt;quirks().contains(PluginQuirkHasModalMessageLoop))
-        return;
-
-    if (b)
-        ++s_callingPlugin;
-    else
-        --s_callingPlugin;
-
-    ASSERT(s_callingPlugin &gt;= 0);
-}
-
-bool PluginView::isCallingPlugin()
-{
-    return s_callingPlugin &gt; 0;
-}
-
-PassRefPtr&lt;PluginView&gt; PluginView::create(Frame* parentFrame, const IntSize&amp; size, HTMLPlugInElement* element, const URL&amp; url, const Vector&lt;String&gt;&amp; paramNames, const Vector&lt;String&gt;&amp; paramValues, const String&amp; mimeType, bool loadManually)
-{
-    // if we fail to find a plugin for this MIME type, findPlugin will search for
-    // a plugin by the file extension and update the MIME type, so pass a mutable String
-    String mimeTypeCopy = mimeType;
-    PluginPackage* plugin = PluginDatabase::installedPlugins()-&gt;findPlugin(url, mimeTypeCopy);
-
-    // No plugin was found, try refreshing the database and searching again
-    if (!plugin &amp;&amp; PluginDatabase::installedPlugins()-&gt;refresh()) {
-        mimeTypeCopy = mimeType;
-        plugin = PluginDatabase::installedPlugins()-&gt;findPlugin(url, mimeTypeCopy);
-    }
-
-    return adoptRef(new PluginView(parentFrame, size, plugin, element, url, paramNames, paramValues, mimeTypeCopy, loadManually));
-}
-
-void PluginView::freeStringArray(char** stringArray, int length)
-{
-    if (!stringArray)
-        return;
-
-    for (int i = 0; i &lt; length; i++)
-        fastFree(stringArray[i]);
-
-    fastFree(stringArray);
-}
-
-static inline bool startsWithBlankLine(const Vector&lt;char&gt;&amp; buffer)
-{
-    return buffer.size() &gt; 0 &amp;&amp; buffer[0] == '\n';
-}
-
-static inline int locationAfterFirstBlankLine(const Vector&lt;char&gt;&amp; buffer)
-{
-    const char* bytes = buffer.data();
-    unsigned length = buffer.size();
-
-    for (unsigned i = 0; i &lt; length - 4; i++) {
-        // Support for Acrobat. It sends &quot;\n\n&quot;.
-        if (bytes[i] == '\n' &amp;&amp; bytes[i + 1] == '\n')
-            return i + 2;
-        
-        // Returns the position after 2 CRLF's or 1 CRLF if it is the first line.
-        if (bytes[i] == '\r' &amp;&amp; bytes[i + 1] == '\n') {
-            i += 2;
-            if (i == 2)
-                return i;
-            else if (bytes[i] == '\n')
-                // Support for Director. It sends &quot;\r\n\n&quot; (3880387).
-                return i + 1;
-            else if (bytes[i] == '\r' &amp;&amp; bytes[i + 1] == '\n')
-                // Support for Flash. It sends &quot;\r\n\r\n&quot; (3758113).
-                return i + 2;
-        }
-    }
-
-    return -1;
-}
-
-static inline const char* findEOL(const char* bytes, unsigned length)
-{
-    // According to the HTTP specification EOL is defined as
-    // a CRLF pair. Unfortunately, some servers will use LF
-    // instead. Worse yet, some servers will use a combination
-    // of both (e.g. &lt;header&gt;CRLFLF&lt;body&gt;), so findEOL needs
-    // to be more forgiving. It will now accept CRLF, LF or
-    // CR.
-    //
-    // It returns NULL if EOLF is not found or it will return
-    // a pointer to the first terminating character.
-    for (unsigned i = 0; i &lt; length; i++) {
-        if (bytes[i] == '\n')
-            return bytes + i;
-        if (bytes[i] == '\r') {
-            // Check to see if spanning buffer bounds
-            // (CRLF is across reads). If so, wait for
-            // next read.
-            if (i + 1 == length)
-                break;
-
-            return bytes + i;
-        }
-    }
-
-    return 0;
-}
-
-static inline String capitalizeRFC822HeaderFieldName(const String&amp; name)
-{
-    bool capitalizeCharacter = true;
-    String result;
-
-    for (unsigned i = 0; i &lt; name.length(); i++) {
-        UChar c;
-
-        if (capitalizeCharacter &amp;&amp; name[i] &gt;= 'a' &amp;&amp; name[i] &lt;= 'z')
-            c = toASCIIUpper(name[i]);
-        else if (!capitalizeCharacter &amp;&amp; name[i] &gt;= 'A' &amp;&amp; name[i] &lt;= 'Z')
-            c = toASCIILower(name[i]);
-        else
-            c = name[i];
-
-        if (name[i] == '-')
-            capitalizeCharacter = true;
-        else
-            capitalizeCharacter = false;
-
-        result.append(c);
-    }
-
-    return result;
-}
-
-static inline HTTPHeaderMap parseRFC822HeaderFields(const Vector&lt;char&gt;&amp; buffer, unsigned length)
-{
-    const char* bytes = buffer.data();
-    const char* eol;
-    String lastKey;
-    HTTPHeaderMap headerFields;
-
-    // Loop ove rlines until we're past the header, or we can't find any more end-of-lines
-    while ((eol = findEOL(bytes, length))) {
-        const char* line = bytes;
-        int lineLength = eol - bytes;
-        
-        // Move bytes to the character after the terminator as returned by findEOL.
-        bytes = eol + 1;
-        if ((*eol == '\r') &amp;&amp; (*bytes == '\n'))
-            bytes++; // Safe since findEOL won't return a spanning CRLF.
-
-        length -= (bytes - line);
-        if (lineLength == 0)
-            // Blank line; we're at the end of the header
-            break;
-        else if (*line == ' ' || *line == '\t') {
-            // Continuation of the previous header
-            if (lastKey.isNull()) {
-                // malformed header; ignore it and continue
-                continue;
-            } else {
-                // Merge the continuation of the previous header
-                String currentValue = headerFields.get(lastKey);
-                String newValue(line, lineLength);
-
-                headerFields.set(lastKey, currentValue + newValue);
-            }
-        } else {
-            // Brand new header
-            const char* colon;
-            for (colon = line; *colon != ':' &amp;&amp; colon != eol; colon++) {
-                // empty loop
-            }
-            if (colon == eol) 
-                // malformed header; ignore it and continue
-                continue;
-            else {
-                lastKey = capitalizeRFC822HeaderFieldName(String(line, colon - line));
-                String value;
-
-                for (colon++; colon != eol; colon++) {
-                    if (*colon != ' ' &amp;&amp; *colon != '\t')
-                        break;
-                }
-                if (colon == eol)
-                    value = &quot;&quot;;
-                else
-                    value = String(colon, eol - colon);
-
-                String oldValue = headerFields.get(lastKey);
-                if (!oldValue.isNull())
-                    value = oldValue + &quot;, &quot; + value;
-
-                headerFields.set(lastKey, value);
-            }
-        }
-    }
-
-    return headerFields;
-}
-
-NPError PluginView::handlePost(const char* url, const char* target, uint32_t len, const char* buf, bool file, void* notifyData, bool sendNotification, bool allowHeaders)
-{
-    if (!url || !len || !buf)
-        return NPERR_INVALID_PARAM;
-
-    FrameLoadRequest frameLoadRequest(m_parentFrame-&gt;document()-&gt;securityOrigin());
-
-    HTTPHeaderMap headerFields;
-    Vector&lt;char&gt; buffer;
-    
-    if (file) {
-        NPError readResult = handlePostReadFile(buffer, len, buf);
-        if(readResult != NPERR_NO_ERROR)
-            return readResult;
-    } else {
-        buffer.resize(len);
-        memcpy(buffer.data(), buf, len);
-    }
-
-    const char* postData = buffer.data();
-    int postDataLength = buffer.size();
-
-    if (allowHeaders) {
-        if (startsWithBlankLine(buffer)) {
-            postData++;
-            postDataLength--;
-        } else {
-            int location = locationAfterFirstBlankLine(buffer);
-            if (location != -1) {
-                // If the blank line is somewhere in the middle of the buffer, everything before is the header
-                headerFields = parseRFC822HeaderFields(buffer, location);
-                unsigned dataLength = buffer.size() - location;
-
-                // Sometimes plugins like to set Content-Length themselves when they post,
-                // but WebFoundation does not like that. So we will remove the header
-                // and instead truncate the data to the requested length.
-                String contentLength = headerFields.get(HTTPHeaderName::ContentLength);
-
-                if (!contentLength.isNull())
-                    dataLength = min(contentLength.toInt(), (int)dataLength);
-                headerFields.remove(HTTPHeaderName::ContentLength);
-
-                postData += location;
-                postDataLength = dataLength;
-            }
-        }
-    }
-
-    frameLoadRequest.resourceRequest().setHTTPMethod(&quot;POST&quot;);
-    frameLoadRequest.resourceRequest().setURL(makeURL(m_parentFrame-&gt;document()-&gt;baseURL(), url));
-    frameLoadRequest.resourceRequest().setHTTPHeaderFields(WTF::move(headerFields));
-    frameLoadRequest.resourceRequest().setHTTPBody(FormData::create(postData, postDataLength));
-    frameLoadRequest.setFrameName(target);
-
-    return load(frameLoadRequest, sendNotification, notifyData);
-}
-
-void PluginView::invalidateWindowlessPluginRect(const IntRect&amp; rect)
-{
-    if (!isVisible())
-        return;
-    
-    if (!m_element-&gt;renderer())
-        return;
-    auto&amp; renderer = downcast&lt;RenderBox&gt;(*m_element-&gt;renderer());
-    
-    IntRect dirtyRect = rect;
-    dirtyRect.move(renderer.borderLeft() + renderer.paddingLeft(), renderer.borderTop() + renderer.paddingTop());
-    renderer.repaintRectangle(dirtyRect);
-}
-
-void PluginView::paintMissingPluginIcon(GraphicsContext* context, const IntRect&amp; rect)
-{
-    static RefPtr&lt;Image&gt; nullPluginImage;
-    if (!nullPluginImage)
-        nullPluginImage = Image::loadPlatformResource(&quot;nullPlugin&quot;);
-
-    IntRect imageRect(frameRect().x(), frameRect().y(), nullPluginImage-&gt;width(), nullPluginImage-&gt;height());
-
-    int xOffset = (frameRect().width() - imageRect.width()) / 2;
-    int yOffset = (frameRect().height() - imageRect.height()) / 2;
-
-    imageRect.move(xOffset, yOffset);
-
-    if (!rect.intersects(imageRect))
-        return;
-
-    context-&gt;save();
-    context-&gt;clip(windowClipRect());
-    context-&gt;drawImage(nullPluginImage.get(), ColorSpaceDeviceRGB, imageRect.location());
-    context-&gt;restore();
-}
-
-static const char* MozillaUserAgent = &quot;Mozilla/5.0 (&quot;
-#if defined(XP_MACOSX)
-        &quot;Macintosh; U; Intel Mac OS X;&quot;
-#elif defined(XP_WIN)
-        &quot;Windows; U; Windows NT 5.1;&quot;
-#elif defined(XP_UNIX)
-// The Gtk port uses X11 plugins in Mac.
-#if OS(DARWIN) &amp;&amp; PLATFORM(GTK)
-    &quot;X11; U; Intel Mac OS X;&quot;
-#else
-    &quot;X11; U; Linux i686;&quot;
-#endif
-#endif
-        &quot; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0&quot;;
-
-static const char* const ChromeUserAgent = &quot;Mozilla/5.0 (&quot;
-#if defined(XP_MACOSX)
-    &quot;Macintosh; U; Intel Mac OS X;&quot;
-#elif defined(XP_WIN)
-    &quot;Windows; U; Windows NT 5.1;&quot;
-#elif defined(XP_UNIX)
-    // The Gtk port uses X11 plugins in Mac.
-#if OS(DARWIN) &amp;&amp; PLATFORM(GTK)
-    &quot;X11; U; Intel Mac OS X;&quot;
-#else
-    &quot;X11; U; Linux i686;&quot;
-#endif
-#endif
-    &quot; AppleWebKit/534.34 (KHTML, like Gecko) Chrome/19.0.1055.1 Safari/534.34&quot;;
-
-const char* PluginView::userAgent()
-{
-    if (m_plugin-&gt;quirks().contains(PluginQuirkWantsMozillaUserAgent))
-        return MozillaUserAgent;
-    else if (m_plugin-&gt;quirks().contains(PluginQuirkWantsChromeUserAgent))
-        return ChromeUserAgent;
-    if (m_userAgent.isNull())
-        m_userAgent = m_parentFrame-&gt;loader().userAgent(m_url).utf8();
-
-    return m_userAgent.data();
-}
-
-#if ENABLE(NETSCAPE_PLUGIN_API)
-const char* PluginView::userAgentStatic()
-{
-    return MozillaUserAgent;
-}
-#endif
-
-
-void PluginView::lifeSupportTimerFired()
-{
-    deref();
-}
-
-void PluginView::keepAlive()
-{
-    if (m_lifeSupportTimer.isActive())
-        return;
-
-    ref();
-    m_lifeSupportTimer.startOneShot(0);
-}
-
-#if ENABLE(NETSCAPE_PLUGIN_API)
-void PluginView::keepAlive(NPP instance)
-{
-    PluginView* view = instanceMap().get(instance);
-    if (!view)
-        return;
-
-    view-&gt;keepAlive();
-}
-
-NPError PluginView::getValueStatic(NPNVariable variable, void* value)
-{
-    LOG(Plugins, &quot;PluginView::getValueStatic(%s)&quot;, prettyNameForNPNVariable(variable).data());
-
-    NPError result;
-    if (platformGetValueStatic(variable, value, &amp;result))
-        return result;
-
-    return NPERR_GENERIC_ERROR;
-}
-
-NPError PluginView::getValue(NPNVariable variable, void* value)
-{
-    LOG(Plugins, &quot;PluginView::getValue(%s)&quot;, prettyNameForNPNVariable(variable).data());
-
-    NPError result;
-    if (platformGetValue(variable, value, &amp;result))
-        return result;
-
-    if (platformGetValueStatic(variable, value, &amp;result))
-        return result;
-
-    switch (variable) {
-    case NPNVWindowNPObject: {
-        if (m_isJavaScriptPaused)
-            return NPERR_GENERIC_ERROR;
-
-        NPObject* windowScriptObject = m_parentFrame-&gt;script().windowScriptNPObject();
-
-        // Return value is expected to be retained, as described here: &lt;http://www.mozilla.org/projects/plugin/npruntime.html&gt;
-        if (windowScriptObject)
-            _NPN_RetainObject(windowScriptObject);
-
-        void** v = (void**)value;
-        *v = windowScriptObject;
-
-        return NPERR_NO_ERROR;
-    }
-
-    case NPNVPluginElementNPObject: {
-        if (m_isJavaScriptPaused)
-            return NPERR_GENERIC_ERROR;
-
-        NPObject* pluginScriptObject = 0;
-
-        if (m_element-&gt;hasTagName(appletTag) || m_element-&gt;hasTagName(embedTag) || m_element-&gt;hasTagName(objectTag))
-            pluginScriptObject = m_element-&gt;getNPObject();
-
-        // Return value is expected to be retained, as described here: &lt;http://www.mozilla.org/projects/plugin/npruntime.html&gt;
-        if (pluginScriptObject)
-            _NPN_RetainObject(pluginScriptObject);
-
-        void** v = (void**)value;
-        *v = pluginScriptObject;
-
-        return NPERR_NO_ERROR;
-    }
-
-    case NPNVprivateModeBool: {
-        Page* page = m_parentFrame-&gt;page();
-        if (!page)
-            return NPERR_GENERIC_ERROR;
-        *((NPBool*)value) = page-&gt;usesEphemeralSession();
-        return NPERR_NO_ERROR;
-    }
-
-    default:
-        return NPERR_GENERIC_ERROR;
-    }
-}
-
-static Frame* getFrame(Frame* parentFrame, Element* element)
-{
-    if (parentFrame)
-        return parentFrame;
-    
-    return element-&gt;document().frame();
-}
-
-NPError PluginView::getValueForURL(NPNURLVariable variable, const char* url, char** value, uint32_t* len)
-{
-    LOG(Plugins, &quot;PluginView::getValueForURL(%s)&quot;, prettyNameForNPNURLVariable(variable).data());
-
-    NPError result = NPERR_NO_ERROR;
-
-    switch (variable) {
-    case NPNURLVCookie: {
-        URL u(m_parentFrame-&gt;document()-&gt;baseURL(), url);
-        if (u.isValid()) {
-            Frame* frame = getFrame(parentFrame(), m_element);
-            if (frame) {
-                const CString cookieStr = cookies(frame-&gt;document(), u).utf8();
-                if (!cookieStr.isNull()) {
-                    const int size = cookieStr.length();
-                    *value = static_cast&lt;char*&gt;(NPN_MemAlloc(size+1));
-                    if (*value) {
-                        memset(*value, 0, size+1);
-                        memcpy(*value, cookieStr.data(), size+1);
-                        if (len)
-                            *len = size;
-                    } else
-                        result = NPERR_OUT_OF_MEMORY_ERROR;
-                }
-            }
-        } else
-            result = NPERR_INVALID_URL;
-        break;
-    }
-    case NPNURLVProxy: {
-        URL u(m_parentFrame-&gt;document()-&gt;baseURL(), url);
-        if (u.isValid()) {
-            Frame* frame = getFrame(parentFrame(), m_element);
-            const FrameLoader* frameLoader = frame ? &amp;frame-&gt;loader() : 0;
-            const NetworkingContext* context = frameLoader ? frameLoader-&gt;networkingContext() : 0;
-            const CString proxyStr = toString(proxyServersForURL(u, context)).utf8();
-            if (!proxyStr.isNull()) {
-                const int size = proxyStr.length();
-                *value = static_cast&lt;char*&gt;(NPN_MemAlloc(size+1));
-                if (*value) {
-                    memset(*value, 0, size+1);
-                    memcpy(*value, proxyStr.data(), size+1);
-                    if (len)
-                        *len = size;
-                } else
-                    result = NPERR_OUT_OF_MEMORY_ERROR;
-            }
-        } else
-            result = NPERR_INVALID_URL;
-        break;
-    }
-    default:
-        result = NPERR_GENERIC_ERROR;
-        LOG(Plugins, &quot;PluginView::getValueForURL: %s&quot;, prettyNameForNPNURLVariable(variable).data());
-        break;
-    }
-
-    return result;
-}
-
-
-NPError PluginView::setValueForURL(NPNURLVariable variable, const char* url, const char* value, uint32_t len)
-{
-    LOG(Plugins, &quot;PluginView::setValueForURL(%s)&quot;, prettyNameForNPNURLVariable(variable).data());
-
-    NPError result = NPERR_NO_ERROR;
-
-    switch (variable) {
-    case NPNURLVCookie: {
-        URL u(m_parentFrame-&gt;document()-&gt;baseURL(), url);
-        if (u.isValid()) {
-            const String cookieStr = String::fromUTF8(value, len);
-            Frame* frame = getFrame(parentFrame(), m_element);
-            if (frame &amp;&amp; !cookieStr.isEmpty())
-                setCookies(frame-&gt;document(), u, cookieStr);
-        } else
-            result = NPERR_INVALID_URL;
-        break;
-    }
-    case NPNURLVProxy:
-        LOG(Plugins, &quot;PluginView::setValueForURL(%s): Plugins are NOT allowed to set proxy information.&quot;, prettyNameForNPNURLVariable(variable).data());
-        result = NPERR_GENERIC_ERROR;
-        break;
-    default:
-        LOG(Plugins, &quot;PluginView::setValueForURL: %s&quot;, prettyNameForNPNURLVariable(variable).data());
-        result = NPERR_GENERIC_ERROR;
-        break;
-    }
-
-    return result;
-}
-
-NPError PluginView::getAuthenticationInfo(const char* protocol, const char* host, int32_t port, const char* /* scheme */, const char* /* realm */, char**  /* username */, uint32_t* /* ulen */, char** /* password */, uint32_t* /* plen */)
-{
-#if LOG_DISABLED
-    UNUSED_PARAM(protocol);
-    UNUSED_PARAM(host);
-    UNUSED_PARAM(port);
-#endif
-    LOG(Plugins, &quot;PluginView::getAuthenticationInfo: protocol=%s, host=%s, port=%d&quot;, protocol, host, port);
-    notImplemented();
-    return NPERR_GENERIC_ERROR;
-}
-#endif
-
-void PluginView::privateBrowsingStateChanged(bool privateBrowsingEnabled)
-{
-    NPP_SetValueProcPtr setValue = m_plugin-&gt;pluginFuncs()-&gt;setvalue;
-    if (!setValue)
-        return;
-
-    PluginView::setCurrentPluginView(this);
-    JSC::JSLock::DropAllLocks dropAllLocks(JSDOMWindowBase::commonVM());
-    setCallingPlugin(true);
-    NPBool value = privateBrowsingEnabled;
-    setValue(m_instance, NPNVprivateModeBool, &amp;value);
-    setCallingPlugin(false);
-    PluginView::setCurrentPluginView(0);
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(NETSCAPE_PLUGIN_API)
</del></span></pre></div>
<a id="trunkSourceWebCorepluginsPluginViewh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/plugins/PluginView.h (178218 => 178219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/plugins/PluginView.h        2015-01-10 00:09:59 UTC (rev 178218)
+++ trunk/Source/WebCore/plugins/PluginView.h        2015-01-10 00:16:52 UTC (rev 178219)
</span><span class="lines">@@ -1,440 +0,0 @@
</span><del>-/*
- * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
- * Copyright (C) 2008 Collabora Ltd. All rights reserved.
- * Copyright (C) 2009 Girish Ramakrishnan &lt;girish@forwardbias.in&gt;
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#ifndef PluginView_h
-#define PluginView_h
-
-#include &quot;FrameLoadRequest.h&quot;
-#include &quot;IntRect.h&quot;
-#include &quot;MediaCanStartListener.h&quot;
-#include &quot;PluginViewBase.h&quot;
-#include &quot;ResourceRequest.h&quot;
-#include &quot;Timer.h&quot;
-#include &lt;wtf/HashMap.h&gt;
-#include &lt;wtf/HashSet.h&gt;
-#include &lt;wtf/OwnPtr.h&gt;
-#include &lt;wtf/PassRefPtr.h&gt;
-#include &lt;wtf/RefPtr.h&gt;
-#include &lt;wtf/Vector.h&gt;
-#include &lt;wtf/text/CString.h&gt;
-
-#if ENABLE(NETSCAPE_PLUGIN_API)
-#include &quot;PluginStream.h&quot;
-#include &quot;npruntime_internal.h&quot;
-#endif
-
-#if OS(WINDOWS) &amp;&amp; PLATFORM(GTK)
-typedef struct HWND__* HWND;
-typedef HWND PlatformPluginWidget;
-#else
-typedef PlatformWidget PlatformPluginWidget;
-#endif
-#if PLATFORM(GTK)
-typedef struct _GtkSocket GtkSocket;
-#endif
-
-#if PLATFORM(X11)
-typedef unsigned long Window;
-typedef struct _XDisplay Display;
-#endif
-
-namespace JSC {
-    namespace Bindings {
-        class Instance;
-    }
-}
-
-namespace WebCore {
-    class Frame;
-    class FrameView;
-    class Image;
-    class HTMLPlugInElement;
-    class KeyboardEvent;
-    class MouseEvent;
-    class URL;
-#if OS(WINDOWS) &amp;&amp; ENABLE(NETSCAPE_PLUGIN_API)
-    class PluginMessageThrottlerWin;
-#endif
-    class PluginPackage;
-    class PluginRequest;
-    class PluginStream;
-    class ResourceError;
-    class ResourceResponse;
-    class WheelEvent;
-
-    enum PluginStatus {
-        PluginStatusCanNotFindPlugin,
-        PluginStatusCanNotLoadPlugin,
-        PluginStatusLoadedSuccessfully
-    };
-
-    class PluginRequest {
-        WTF_MAKE_NONCOPYABLE(PluginRequest); WTF_MAKE_FAST_ALLOCATED;
-    public:
-        PluginRequest(const FrameLoadRequest&amp; frameLoadRequest, bool sendNotification, void* notifyData, bool shouldAllowPopups)
-            : m_frameLoadRequest(frameLoadRequest)
-            , m_notifyData(notifyData)
-            , m_sendNotification(sendNotification)
-            , m_shouldAllowPopups(shouldAllowPopups) { }
-    public:
-        const FrameLoadRequest&amp; frameLoadRequest() const { return m_frameLoadRequest; }
-        void* notifyData() const { return m_notifyData; }
-        bool sendNotification() const { return m_sendNotification; }
-        bool shouldAllowPopups() const { return m_shouldAllowPopups; }
-    private:
-        FrameLoadRequest m_frameLoadRequest;
-        void* m_notifyData;
-        bool m_sendNotification;
-        bool m_shouldAllowPopups;
-    };
-
-    class PluginManualLoader {
-    public:
-        virtual ~PluginManualLoader() {}
-        virtual void didReceiveResponse(const ResourceResponse&amp;) = 0;
-        virtual void didReceiveData(const char*, int) = 0;
-        virtual void didFinishLoading() = 0;
-        virtual void didFail(const ResourceError&amp;) = 0;
-    };
-
-    class PluginView : public PluginViewBase
-#if ENABLE(NETSCAPE_PLUGIN_API)
-                     , private PluginStreamClient
-#endif
-                     , public PluginManualLoader
-                     , private MediaCanStartListener {
-    public:
-        static PassRefPtr&lt;PluginView&gt; create(Frame* parentFrame, const IntSize&amp;, HTMLPlugInElement*, const URL&amp;, const Vector&lt;String&gt;&amp; paramNames, const Vector&lt;String&gt;&amp; paramValues, const String&amp; mimeType, bool loadManually);
-        virtual ~PluginView();
-
-        PluginPackage* plugin() const { return m_plugin.get(); }
-#if ENABLE(NETSCAPE_PLUGIN_API)
-        NPP instance() const { return m_instance; }
-#endif
-
-        void setNPWindowRect(const IntRect&amp;);
-        static PluginView* currentPluginView();
-
-#if ENABLE(NETSCAPE_PLUGIN_API)
-        NPObject* npObject();
-#endif
-        PassRefPtr&lt;JSC::Bindings::Instance&gt; bindingInstance();
-
-        PluginStatus status() const { return m_status; }
-
-#if ENABLE(NETSCAPE_PLUGIN_API)
-        // NPN functions
-        NPError getURLNotify(const char* url, const char* target, void* notifyData);
-        NPError getURL(const char* url, const char* target);
-        NPError postURLNotify(const char* url, const char* target, uint32_t len, const char* but, NPBool file, void* notifyData);
-        NPError postURL(const char* url, const char* target, uint32_t len, const char* but, NPBool file);
-        NPError newStream(NPMIMEType type, const char* target, NPStream** stream);
-        int32_t write(NPStream* stream, int32_t len, void* buffer);
-        NPError destroyStream(NPStream* stream, NPReason reason);
-#endif
-        const char* userAgent();
-#if ENABLE(NETSCAPE_PLUGIN_API)
-        static const char* userAgentStatic();
-#endif
-        void status(const char* message);
-        
-#if ENABLE(NETSCAPE_PLUGIN_API)
-        NPError getValue(NPNVariable variable, void* value);
-        static NPError getValueStatic(NPNVariable variable, void* value);
-        NPError setValue(NPPVariable variable, void* value);
-        NPError getValueForURL(NPNURLVariable variable, const char* url, char** value, uint32_t* len);
-        NPError setValueForURL(NPNURLVariable variable, const char* url, const char* value, uint32_t len);
-        NPError getAuthenticationInfo(const char* protocol, const char* host, int32_t port, const char* scheme, const char* realm, char** username, uint32_t* ulen, char** password, uint32_t* plen);
-        void invalidateRect(NPRect*);
-        void invalidateRegion(NPRegion);
-#endif
-        void forceRedraw();
-        void pushPopupsEnabledState(bool state);
-        void popPopupsEnabledState();
-
-        virtual void invalidateRect(const IntRect&amp;);
-
-        bool arePopupsAllowed() const;
-
-        void setJavaScriptPaused(bool);
-
-        void privateBrowsingStateChanged(bool);
-
-        void disconnectStream(PluginStream*);
-        void streamDidFinishLoading(PluginStream* stream) { disconnectStream(stream); }
-
-        // Widget functions
-        virtual void setFrameRect(const IntRect&amp;);
-        virtual void frameRectsChanged();
-        virtual void setFocus(bool);
-        virtual void show();
-        virtual void hide();
-        virtual void paint(GraphicsContext*, const IntRect&amp;);
-        virtual void clipRectChanged() override;
-
-        // This method is used by plugins on all platforms to obtain a clip rect that includes clips set by WebCore,
-        // e.g., in overflow:auto sections.  The clip rects coordinates are in the containing window's coordinate space.
-        // This clip includes any clips that the widget itself sets up for its children.
-        IntRect windowClipRect() const;
-
-        virtual void handleEvent(Event*);
-        virtual void setParent(ScrollView*);
-        virtual void setParentVisible(bool);
-
-        virtual bool isPluginView() const override { return true; }
-
-        Frame* parentFrame() const { return m_parentFrame.get(); }
-
-        void focusPluginElement();
-
-        const String&amp; pluginsPage() const { return m_pluginsPage; }
-        const String&amp; mimeType() const { return m_mimeType; }
-        const URL&amp; url() const { return m_url; }
-
-#if defined(XP_MACOSX) &amp;&amp; ENABLE(NETSCAPE_PLUGIN_API)
-        bool popUpContextMenu(NPMenu*);
-#endif
-
-#if OS(WINDOWS) &amp;&amp; ENABLE(NETSCAPE_PLUGIN_API)
-        static LRESULT CALLBACK PluginViewWndProc(HWND, UINT, WPARAM, LPARAM);
-        LRESULT wndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
-        WNDPROC pluginWndProc() const { return m_pluginWndProc; }
-#endif
-
-        // Used for manual loading
-        void didReceiveResponse(const ResourceResponse&amp;);
-        void didReceiveData(const char*, int);
-        void didFinishLoading();
-        void didFail(const ResourceError&amp;);
-
-        static bool isCallingPlugin();
-
-        bool start();
-
-#if ENABLE(NETSCAPE_PLUGIN_API)
-        static void keepAlive(NPP);
-#endif
-        void keepAlive();
-
-#if PLATFORM(X11)
-        static Display* getPluginDisplay(Frame*);
-        static Window getRootWindow(Frame* parentFrame);
-#endif
-
-    private:
-        PluginView(Frame* parentFrame, const IntSize&amp;, PluginPackage*, HTMLPlugInElement*, const URL&amp;, const Vector&lt;String&gt;&amp; paramNames, const Vector&lt;String&gt;&amp; paramValues, const String&amp; mimeType, bool loadManually);
-
-        void setParameters(const Vector&lt;String&gt;&amp; paramNames, const Vector&lt;String&gt;&amp; paramValues);
-        bool startOrAddToUnstartedList();
-        void init();
-        bool platformStart();
-        void stop();
-        void platformDestroy();
-        static void setCurrentPluginView(PluginView*);
-#if ENABLE(NETSCAPE_PLUGIN_API)
-        NPError load(const FrameLoadRequest&amp;, bool sendNotification, void* notifyData);
-        NPError handlePost(const char* url, const char* target, uint32_t len, const char* buf, bool file, void* notifyData, bool sendNotification, bool allowHeaders);
-        NPError handlePostReadFile(Vector&lt;char&gt;&amp; buffer, uint32_t len, const char* buf);
-#endif
-        static void freeStringArray(char** stringArray, int length);
-        void setCallingPlugin(bool) const;
-
-        void invalidateWindowlessPluginRect(const IntRect&amp;);
-
-        virtual void mediaCanStart();
-
-#if OS(WINDOWS) &amp;&amp; ENABLE(NETSCAPE_PLUGIN_API)
-        void paintWindowedPluginIntoContext(GraphicsContext*, const IntRect&amp;);
-        static HDC WINAPI hookedBeginPaint(HWND, PAINTSTRUCT*);
-        static BOOL WINAPI hookedEndPaint(HWND, const PAINTSTRUCT*);
-#endif
-
-#if ENABLE(NETSCAPE_PLUGIN_API)
-        static bool platformGetValueStatic(NPNVariable variable, void* value, NPError* result);
-        bool platformGetValue(NPNVariable variable, void* value, NPError* result);
-#endif
-
-        RefPtr&lt;Frame&gt; m_parentFrame;
-        RefPtr&lt;PluginPackage&gt; m_plugin;
-        HTMLPlugInElement* m_element;
-        bool m_isStarted;
-        URL m_url;
-        PluginStatus m_status;
-        Vector&lt;IntRect&gt; m_invalidRects;
-
-        void performRequest(PluginRequest*);
-        void scheduleRequest(std::unique_ptr&lt;PluginRequest&gt;);
-        void requestTimerFired();
-        void invalidateTimerFired();
-        Timer m_requestTimer;
-        Timer m_invalidateTimer;
-
-        void popPopupsStateTimerFired();
-        Timer m_popPopupsStateTimer;
-
-        void lifeSupportTimerFired();
-        Timer m_lifeSupportTimer;
-
-#if ENABLE(NETSCAPE_PLUGIN_API)
-        bool dispatchNPEvent(NPEvent&amp;);
-#endif
-#if defined(XP_MACOSX) &amp;&amp; ENABLE(NETSCAPE_PLUGIN_API)
-        int16_t dispatchNPCocoaEvent(NPCocoaEvent&amp;);
-        bool m_updatedCocoaTextInputRequested;
-        bool m_keyDownSent;
-        uint16_t m_disregardKeyUpCounter;
-#endif
-
-#if defined(XP_MACOSX)
-        void handleWheelEvent(WheelEvent*);
-#endif
-        void updatePluginWidget();
-        void paintMissingPluginIcon(GraphicsContext*, const IntRect&amp;);
-
-        void handleKeyboardEvent(KeyboardEvent*);
-        void handleMouseEvent(MouseEvent*);
-#if defined(XP_UNIX) &amp;&amp; ENABLE(NETSCAPE_PLUGIN_API)
-        void handleFocusInEvent();
-        void handleFocusOutEvent();
-#endif
-
-#if OS(WINDOWS)
-        void paintIntoTransformedContext(HDC);
-        PassRefPtr&lt;Image&gt; snapshot();
-#endif
-
-        int m_mode;
-        int m_paramCount;
-        char** m_paramNames;
-        char** m_paramValues;
-        String m_pluginsPage;
-
-        String m_mimeType;
-        WTF::CString m_userAgent;
-
-#if ENABLE(NETSCAPE_PLUGIN_API)
-        NPP m_instance;
-        NPP_t m_instanceStruct;
-        NPWindow m_npWindow;
-#endif
-
-        Vector&lt;bool, 4&gt; m_popupStateStack;
-
-        HashSet&lt;RefPtr&lt;PluginStream&gt; &gt; m_streams;
-        Vector&lt;std::unique_ptr&lt;PluginRequest&gt;&gt; m_requests;
-
-        bool m_isWindowed;
-        bool m_isTransparent;
-        bool m_haveInitialized;
-        bool m_isWaitingToStart;
-
-#if defined(XP_UNIX)
-        bool m_needsXEmbed;
-#endif
-
-#if OS(WINDOWS) &amp;&amp; ENABLE(NETSCAPE_PLUGIN_API)
-        OwnPtr&lt;PluginMessageThrottlerWin&gt; m_messageThrottler;
-        WNDPROC m_pluginWndProc;
-        unsigned m_lastMessage;
-        bool m_isCallingPluginWndProc;
-        HDC m_wmPrintHDC;
-        bool m_haveUpdatedPluginWidget;
-#endif
-
-#if (PLATFORM(GTK) &amp;&amp; OS(WINDOWS)) || PLATFORM(EFL)
-        // On Mac OSX and Qt/Windows the plugin does not have its own native widget,
-        // but is using the containing window as its reference for positioning/painting.
-        PlatformPluginWidget m_window;
-public:
-        PlatformPluginWidget platformPluginWidget() const { return m_window; }
-        void setPlatformPluginWidget(PlatformPluginWidget widget) { m_window = widget; }
-#else
-public:
-        void setPlatformPluginWidget(PlatformPluginWidget widget) { setPlatformWidget(widget); }
-        PlatformPluginWidget platformPluginWidget() const { return platformWidget(); }
-#endif
-
-private:
-
-#if defined(XP_UNIX) || PLATFORM(GTK)
-        void setNPWindowIfNeeded();
-#elif defined(XP_MACOSX)
-        NP_CGContext m_npCgContext;
-        CGContextRef m_contextRef;
-
-        void setNPWindowIfNeeded();
-#endif
-
-#if defined(XP_UNIX) &amp;&amp; ENABLE(NETSCAPE_PLUGIN_API)
-        bool m_hasPendingGeometryChange;
-        Pixmap m_drawable;
-        Visual* m_visual;
-        Colormap m_colormap;
-        Display* m_pluginDisplay;
-
-        void initXEvent(XEvent* event);
-#endif
-
-#if PLATFORM(GTK)
-        static gboolean plugRemovedCallback(GtkSocket*, PluginView*);
-        static void plugAddedCallback(GtkSocket*, PluginView*);
-        void updateWidgetAllocationAndClip();
-        bool m_plugAdded;
-        IntRect m_delayedAllocation;
-#endif
-
-        IntRect m_clipRect; // The clip rect to apply to a windowed plug-in
-        IntRect m_windowRect; // Our window rect.
-
-        bool m_loadManually;
-        RefPtr&lt;PluginStream&gt; m_manualStream;
-
-        bool m_isJavaScriptPaused;
-
-        bool m_haveCalledSetWindow;
-
-        static PluginView* s_currentPluginView;
-    };
-
-inline PluginView* toPluginView(Widget* widget)
-{
-    ASSERT(!widget || widget-&gt;isPluginView());
-    return static_cast&lt;PluginView*&gt;(widget);
-}
-
-inline const PluginView* toPluginView(const Widget* widget)
-{
-    ASSERT(!widget || widget-&gt;isPluginView());
-    return static_cast&lt;const PluginView*&gt;(widget);
-}
-
-// This will catch anyone doing an unnecessary cast.
-void toPluginView(const PluginView*);
-
-} // namespace WebCore
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorepluginsnpapicpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/plugins/npapi.cpp (178218 => 178219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/plugins/npapi.cpp        2015-01-10 00:09:59 UTC (rev 178218)
+++ trunk/Source/WebCore/plugins/npapi.cpp        2015-01-10 00:16:52 UTC (rev 178219)
</span><span class="lines">@@ -1,208 +0,0 @@
</span><del>-/*
- * Copyright (C) 2006, 2007 Apple Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#include &quot;config.h&quot;
-
-#include &quot;Page.h&quot;
-#include &quot;PluginMainThreadScheduler.h&quot;
-#include &quot;PluginView.h&quot;
-#include &quot;npruntime_internal.h&quot;
-
-using namespace WebCore;
-
-// The plugin view is always the ndata of the instance,. Sometimes, plug-ins will call an instance-specific function
-// with a NULL instance. To workaround this, call the last plug-in view that made a call to a plug-in.
-// Currently, the current plug-in view is only set before NPP_New in PluginView::start.
-// This specifically works around Flash and Shockwave. When we call NPP_New, they call NPN_Useragent with a NULL instance.
-static PluginView* pluginViewForInstance(NPP instance)
-{
-    if (instance &amp;&amp; instance-&gt;ndata)
-        return static_cast&lt;PluginView*&gt;(instance-&gt;ndata);
-    return PluginView::currentPluginView();
-}
-
-void* NPN_MemAlloc(uint32_t size)
-{
-    return malloc(size);
-}
-
-void NPN_MemFree(void* ptr)
-{
-    free(ptr);
-}
-
-uint32_t NPN_MemFlush(uint32_t)
-{
-    // Do nothing
-    return 0;
-}
-
-void NPN_ReloadPlugins(NPBool reloadPages)
-{
-    Page::refreshPlugins(reloadPages);
-}
-
-NPError NPN_RequestRead(NPStream*, NPByteRange*)
-{
-    return NPERR_STREAM_NOT_SEEKABLE;
-}
-
-NPError NPN_GetURLNotify(NPP instance, const char* url, const char* target, void* notifyData)
-{
-    return pluginViewForInstance(instance)-&gt;getURLNotify(url, target, notifyData);
-}
-
-NPError NPN_GetURL(NPP instance, const char* url, const char* target)
-{
-    return pluginViewForInstance(instance)-&gt;getURL(url, target);
-}
-
-NPError NPN_PostURLNotify(NPP instance, const char* url, const char* target, uint32_t len, const char* buf, NPBool file, void* notifyData)
-{
-    return pluginViewForInstance(instance)-&gt;postURLNotify(url, target, len, buf, file, notifyData);
-}
-
-NPError NPN_PostURL(NPP instance, const char* url, const char* target, uint32_t len, const char* buf, NPBool file)
-{
-    return pluginViewForInstance(instance)-&gt;postURL(url, target, len, buf, file);
-}
-
-NPError NPN_NewStream(NPP instance, NPMIMEType type, const char* target, NPStream** stream)
-{
-    return pluginViewForInstance(instance)-&gt;newStream(type, target, stream);
-}
-
-int32_t NPN_Write(NPP instance, NPStream* stream, int32_t len, void* buffer)
-{
-    return pluginViewForInstance(instance)-&gt;write(stream, len, buffer);
-}
-
-NPError NPN_DestroyStream(NPP instance, NPStream* stream, NPReason reason)
-{
-    return pluginViewForInstance(instance)-&gt;destroyStream(stream, reason);
-}
-
-const char* NPN_UserAgent(NPP instance)
-{
-    PluginView* view = pluginViewForInstance(instance);
-
-     if (!view)
-         return PluginView::userAgentStatic();

-    return view-&gt;userAgent();
-}
-
-void NPN_Status(NPP instance, const char* message)
-{
-    pluginViewForInstance(instance)-&gt;status(message);
-}
-
-void NPN_InvalidateRect(NPP instance, NPRect* invalidRect)
-{
-    PluginView* view = pluginViewForInstance(instance);
-#if defined(XP_UNIX)
-    // NSPluginWrapper, a plugin wrapper binary that allows running 32-bit plugins
-    // on 64-bit architectures typically used in X11, will sometimes give us a null NPP here.
-    if (!view)
-        return;
-#endif
-    view-&gt;invalidateRect(invalidRect);
-}
-
-void NPN_InvalidateRegion(NPP instance, NPRegion invalidRegion)
-{
-    pluginViewForInstance(instance)-&gt;invalidateRegion(invalidRegion);
-}
-
-void NPN_ForceRedraw(NPP instance)
-{
-    pluginViewForInstance(instance)-&gt;forceRedraw();
-}
-
-NPError NPN_GetValue(NPP instance, NPNVariable variable, void* value)
-{
-    PluginView* view = pluginViewForInstance(instance);
-
-     if (!view)
-         return PluginView::getValueStatic(variable, value);
-
-    return pluginViewForInstance(instance)-&gt;getValue(variable, value);
-}
-
-NPError NPN_SetValue(NPP instance, NPPVariable variable, void* value)
-{
-   return pluginViewForInstance(instance)-&gt;setValue(variable, value);
-}
-
-void* NPN_GetJavaEnv()
-{
-    // Unsupported
-    return 0;
-}
-
-void* NPN_GetJavaPeer(NPP)
-{
-    // Unsupported
-    return 0;
-}
-
-void NPN_PushPopupsEnabledState(NPP instance, NPBool enabled)
-{
-    pluginViewForInstance(instance)-&gt;pushPopupsEnabledState(enabled);
-}
-
-void NPN_PopPopupsEnabledState(NPP instance)
-{
-    pluginViewForInstance(instance)-&gt;popPopupsEnabledState();
-}
-
-extern &quot;C&quot; typedef void PluginThreadAsyncCallFunction(void*);
-void NPN_PluginThreadAsyncCall(NPP instance, PluginThreadAsyncCallFunction func, void* userData)
-{
-    // Callback function type only differs from MainThreadFunction by being extern &quot;C&quot;, which doesn't affect calling convention on any compilers we use.
-    PluginMainThreadScheduler::scheduler().scheduleCall(instance, reinterpret_cast&lt;PluginMainThreadScheduler::MainThreadFunction*&gt;(func), userData);
-}
-
-NPError NPN_GetValueForURL(NPP instance, NPNURLVariable variable, const char* url, char** value, uint32_t* len)
-{
-    return pluginViewForInstance(instance)-&gt;getValueForURL(variable, url, value, len);
-}
-
-NPError NPN_SetValueForURL(NPP instance, NPNURLVariable variable, const char* url, const char* value, uint32_t len)
-{
-    return pluginViewForInstance(instance)-&gt;setValueForURL(variable, url, value, len);
-}
-
-NPError NPN_GetAuthenticationInfo(NPP instance, const char* protocol, const char* host, int32_t port, const char* scheme, const char* realm, char** username, uint32_t* ulen, char** password, uint32_t* plen)
-{
-    return pluginViewForInstance(instance)-&gt;getAuthenticationInfo(protocol, host, port, scheme, realm, username, ulen, password, plen);
-}
-
-NPError NPN_PopUpContextMenu(NPP instance, NPMenu* menu)
-{
-    UNUSED_PARAM(instance);
-    UNUSED_PARAM(menu);
-    return NPERR_NO_ERROR;
-}
</del></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (178218 => 178219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog        2015-01-10 00:09:59 UTC (rev 178218)
+++ trunk/Source/WebKit/ChangeLog        2015-01-10 00:16:52 UTC (rev 178219)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2015-01-06  Anders Carlsson  &lt;andersca@apple.com&gt;
+
+        Move the Windows only plug-in code to WebKit/win
+        https://bugs.webkit.org/show_bug.cgi?id=140133
+
+        Reviewed by Darin Adler.
+
+        * WebKit.vcxproj/WebKit/WebKit.vcxproj:
+        * WebKit.vcxproj/WebKit/WebKit.vcxproj.filters:
+
</ins><span class="cx"> 2015-01-08  Brent Fulgham  &lt;bfulgham@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Win] Unreviewed build fix after r178124.
</span></span></pre></div>
<a id="trunkSourceWebKitWebKitvcxprojWebKitWebKitvcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebKit.vcxproj/WebKit/WebKit.vcxproj (178218 => 178219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebKit.vcxproj/WebKit/WebKit.vcxproj        2015-01-10 00:09:59 UTC (rev 178218)
+++ trunk/Source/WebKit/WebKit.vcxproj/WebKit/WebKit.vcxproj        2015-01-10 00:16:52 UTC (rev 178219)
</span><span class="lines">@@ -294,6 +294,16 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\..\Storage\WebDatabaseProvider.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\..\Storage\WebStorageNamespaceProvider.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\..\cf\WebCoreSupport\WebInspectorClientCF.cpp&quot; /&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\..\win\Plugins\npapi.cpp&quot; /&gt;
+    &lt;ClCompile Include=&quot;..\..\win\Plugins\PluginDatabase.cpp&quot; /&gt;
+    &lt;ClCompile Include=&quot;..\..\win\Plugins\PluginDebug.cpp&quot; /&gt;
+    &lt;ClCompile Include=&quot;..\..\win\Plugins\PluginPackage.cpp&quot; /&gt;
+    &lt;ClCompile Include=&quot;..\..\win\Plugins\PluginStream.cpp&quot; /&gt;
+    &lt;ClCompile Include=&quot;..\..\win\Plugins\PluginView.cpp&quot; /&gt;
+    &lt;ClCompile Include=&quot;..\..\win\Plugins\PluginDatabaseWin.cpp&quot; /&gt;
+    &lt;ClCompile Include=&quot;..\..\win\Plugins\PluginMessageThrottlerWin.cpp&quot; /&gt;
+    &lt;ClCompile Include=&quot;..\..\win\Plugins\PluginPackageWin.cpp&quot; /&gt;
+    &lt;ClCompile Include=&quot;..\..\win\Plugins\PluginViewWin.cpp&quot; /&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\..\win\AccessibleBase.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\..\win\AccessibleDocument.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\..\win\AccessibleImage.cpp&quot; /&gt;
</span><span class="lines">@@ -436,6 +446,14 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\..\Storage\StorageTrackerClient.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\..\Storage\WebDatabaseProvider.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\..\Storage\WebStorageNamespaceProvider.h&quot; /&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\..\win\Plugins\PluginDatabase.h&quot; /&gt;
+    &lt;ClInclude Include=&quot;..\..\win\Plugins\PluginDebug.h&quot; /&gt;
+    &lt;ClInclude Include=&quot;..\..\win\Plugins\PluginPackage.h&quot; /&gt;
+    &lt;ClInclude Include=&quot;..\..\win\Plugins\PluginQuirkSet.h&quot; /&gt;
+    &lt;ClInclude Include=&quot;..\..\win\Plugins\PluginStrategy.h&quot; /&gt;
+    &lt;ClInclude Include=&quot;..\..\win\Plugins\PluginStream.h&quot; /&gt;
+    &lt;ClInclude Include=&quot;..\..\win\Plugins\PluginView.h&quot; /&gt;
+    &lt;ClInclude Include=&quot;..\..\win\Plugins\PluginMessageThrottlerWin.h&quot; /&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\..\win\AccessibleBase.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\..\win\AccessibleDocument.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\..\win\AccessibleImage.h&quot; /&gt;
</span></span></pre></div>
<a id="trunkSourceWebKitWebKitvcxprojWebKitWebKitvcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebKit.vcxproj/WebKit/WebKit.vcxproj.filters (178218 => 178219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebKit.vcxproj/WebKit/WebKit.vcxproj.filters        2015-01-10 00:09:59 UTC (rev 178218)
+++ trunk/Source/WebKit/WebKit.vcxproj/WebKit/WebKit.vcxproj.filters        2015-01-10 00:16:52 UTC (rev 178219)
</span><span class="lines">@@ -217,6 +217,36 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\..\win\WebSerializedJSValue.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;Sources&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\..\win\Plugins\npapi.cpp&quot;&gt;
+      &lt;Filter&gt;Sources&lt;/Filter&gt;
+    &lt;/ClCompile&gt;
+    &lt;ClCompile Include=&quot;..\..\win\Plugins\PluginDatabase.cpp&quot;&gt;
+      &lt;Filter&gt;Sources&lt;/Filter&gt;
+    &lt;/ClCompile&gt;
+    &lt;ClCompile Include=&quot;..\..\win\Plugins\PluginDebug.cpp&quot;&gt;
+      &lt;Filter&gt;Sources&lt;/Filter&gt;
+    &lt;/ClCompile&gt;
+    &lt;ClCompile Include=&quot;..\..\win\Plugins\PluginPackage.cpp&quot;&gt;
+      &lt;Filter&gt;Sources&lt;/Filter&gt;
+    &lt;/ClCompile&gt;
+    &lt;ClCompile Include=&quot;..\..\win\Plugins\PluginStream.cpp&quot;&gt;
+      &lt;Filter&gt;Sources&lt;/Filter&gt;
+    &lt;/ClCompile&gt;
+    &lt;ClCompile Include=&quot;..\..\win\Plugins\PluginView.cpp&quot;&gt;
+      &lt;Filter&gt;Sources&lt;/Filter&gt;
+    &lt;/ClCompile&gt;
+    &lt;ClCompile Include=&quot;..\..\win\Plugins\PluginDatabaseWin.cpp&quot;&gt;
+      &lt;Filter&gt;Sources&lt;/Filter&gt;
+    &lt;/ClCompile&gt;
+    &lt;ClCompile Include=&quot;..\..\win\Plugins\PluginMessageThrottlerWin.cpp&quot;&gt;
+      &lt;Filter&gt;Sources&lt;/Filter&gt;
+    &lt;/ClCompile&gt;
+    &lt;ClCompile Include=&quot;..\..\win\Plugins\PluginPackageWin.cpp&quot;&gt;
+      &lt;Filter&gt;Sources&lt;/Filter&gt;
+    &lt;/ClCompile&gt;
+    &lt;ClCompile Include=&quot;..\..\win\Plugins\PluginViewWin.cpp&quot;&gt;
+      &lt;Filter&gt;Sources&lt;/Filter&gt;
+    &lt;/ClCompile&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\..\Storage\StorageAreaImpl.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;Sources&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><span class="lines">@@ -558,6 +588,27 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\..\win\WebCoreSupport\AcceleratedCompositingContext.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;WebCoreSupport&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\..\win\Plugins\PluginDatabase.h&quot;&gt;
+      &lt;Filter&gt;Header Files&lt;/Filter&gt;
+    &lt;/ClInclude&gt;
+    &lt;ClInclude Include=&quot;..\..\win\Plugins\PluginDebug.h&quot;&gt;
+      &lt;Filter&gt;Header Files&lt;/Filter&gt;
+    &lt;/ClInclude&gt;
+    &lt;ClInclude Include=&quot;..\..\win\Plugins\PluginPackage.h&quot;&gt;
+      &lt;Filter&gt;Header Files&lt;/Filter&gt;
+    &lt;/ClInclude&gt;
+    &lt;ClInclude Include=&quot;..\..\win\Plugins\PluginQuirkSet.h&quot;&gt;
+      &lt;Filter&gt;Header Files&lt;/Filter&gt;
+    &lt;/ClInclude&gt;
+    &lt;ClInclude Include=&quot;..\..\win\Plugins\PluginStream.h&quot;&gt;
+      &lt;Filter&gt;Header Files&lt;/Filter&gt;
+    &lt;/ClInclude&gt;
+    &lt;ClInclude Include=&quot;..\..\win\Plugins\PluginView.h&quot;&gt;
+      &lt;Filter&gt;Header Files&lt;/Filter&gt;
+    &lt;/ClInclude&gt;
+    &lt;ClInclude Include=&quot;..\..\win\Plugins\PluginMessageThrottlerWin.h&quot;&gt;
+      &lt;Filter&gt;Header Files&lt;/Filter&gt;
+    &lt;/ClInclude&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\..\Storage\StorageAreaImpl.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;Sources&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span></span></pre></div>
<a id="trunkSourceWebKitWebKitvcxprojWebKitWebKitCommonprops"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebKit.vcxproj/WebKit/WebKitCommon.props (178218 => 178219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebKit.vcxproj/WebKit/WebKitCommon.props        2015-01-10 00:09:59 UTC (rev 178218)
+++ trunk/Source/WebKit/WebKit.vcxproj/WebKit/WebKitCommon.props        2015-01-10 00:16:52 UTC (rev 178219)
</span><span class="lines">@@ -5,7 +5,7 @@
</span><span class="cx">   &lt;/PropertyGroup&gt;
</span><span class="cx">   &lt;ItemDefinitionGroup&gt;
</span><span class="cx">     &lt;ClCompile&gt;
</span><del>-      &lt;AdditionalIncludeDirectories&gt;$(ProjectDir);$(ProjectDir)\..\..\win;$(ProjectDir)\..\..\win\WebCoreSupport;$(ProjectDir)\..\..\Storage;$(ConfigurationBuildDir)\include\WebKit;$(ConfigurationBuildDir)\Include;$(ConfigurationBuildDir)\Include\private;$(ConfigurationBuildDir)\Include\WebCore;$(ConfigurationBuildDir)\Include\WebCore\ForwardingHeaders;$(ConfigurationBuildDir)\Include\JavaScriptCore;$(ConfigurationBuildDir)\Include\private\JavaScriptCore;$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\WebKit\DerivedSources;$(WebKit_Libraries)\Include;$(WebKit_Libraries)\Include\private;$(WebKit_Libraries)\Include\WebCore;$(WebKit_Libraries)\Include\WebCore\ForwardingHeaders;$(WebKit_Libraries)\Include\JavaScriptCore;$(WebKit_Libraries)\Include\private\JavaScriptCore;$(IntDir)include;%(AdditionalIncludeDirectories)&lt;/AdditionalIncludeDirectories&gt;
</del><ins>+      &lt;AdditionalIncludeDirectories&gt;$(ProjectDir);$(ProjectDir)\..\..\win;$(ProjectDir)\..\..\win\Plugins;$(ProjectDir)\..\..\win\WebCoreSupport;$(ProjectDir)\..\..\Storage;$(ConfigurationBuildDir)\include\WebKit;$(ConfigurationBuildDir)\Include;$(ConfigurationBuildDir)\Include\private;$(ConfigurationBuildDir)\Include\WebCore;$(ConfigurationBuildDir)\Include\WebCore\ForwardingHeaders;$(ConfigurationBuildDir)\Include\JavaScriptCore;$(ConfigurationBuildDir)\Include\private\JavaScriptCore;$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\WebKit\DerivedSources;$(WebKit_Libraries)\Include;$(WebKit_Libraries)\Include\private;$(WebKit_Libraries)\Include\WebCore;$(WebKit_Libraries)\Include\WebCore\ForwardingHeaders;$(WebKit_Libraries)\Include\JavaScriptCore;$(WebKit_Libraries)\Include\private\JavaScriptCore;$(IntDir)include;%(AdditionalIncludeDirectories)&lt;/AdditionalIncludeDirectories&gt;
</ins><span class="cx">       &lt;PreprocessorDefinitions&gt;WEBKIT_EXPORTS;FRAMEWORK_NAME=WebKit;%(PreprocessorDefinitions)&lt;/PreprocessorDefinitions&gt;
</span><span class="cx">       &lt;PrecompiledHeader&gt;Use&lt;/PrecompiledHeader&gt;
</span><span class="cx">       &lt;PrecompiledHeaderFile&gt;WebKitPrefix.h&lt;/PrecompiledHeaderFile&gt;
</span></span></pre></div>
<a id="trunkSourceWebKitwinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/ChangeLog (178218 => 178219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/ChangeLog        2015-01-10 00:09:59 UTC (rev 178218)
+++ trunk/Source/WebKit/win/ChangeLog        2015-01-10 00:16:52 UTC (rev 178219)
</span><span class="lines">@@ -1,3 +1,308 @@
</span><ins>+2015-01-06  Anders Carlsson  &lt;andersca@apple.com&gt;
+
+        Move the Windows only plug-in code to WebKit/win
+        https://bugs.webkit.org/show_bug.cgi?id=140133
+
+        Reviewed by Darin Adler.
+
+        * Plugins/PaintHooks.asm: Renamed from Source/WebCore/plugins/win/PaintHooks.asm.
+        * Plugins/PluginDatabase.cpp: Renamed from Source/WebCore/plugins/PluginDatabase.cpp.
+        (WebCore::persistentPluginMetadataCachePath):
+        (WebCore::PluginDatabase::PluginDatabase):
+        (WebCore::PluginDatabase::installedPlugins):
+        (WebCore::PluginDatabase::isMIMETypeRegistered):
+        (WebCore::PluginDatabase::addExtraPluginDirectory):
+        (WebCore::PluginDatabase::refresh):
+        (WebCore::PluginDatabase::plugins):
+        (WebCore::PluginDatabase::preferredPluginCompare):
+        (WebCore::PluginDatabase::pluginForMIMEType):
+        (WebCore::PluginDatabase::MIMETypeForExtension):
+        (WebCore::PluginDatabase::findPlugin):
+        (WebCore::PluginDatabase::setPreferredPluginForMIMEType):
+        (WebCore::PluginDatabase::fileExistsAndIsNotDisabled):
+        (WebCore::PluginDatabase::getDeletedPlugins):
+        (WebCore::PluginDatabase::add):
+        (WebCore::PluginDatabase::remove):
+        (WebCore::PluginDatabase::clear):
+        (WebCore::PluginDatabase::removeDisabledPluginFile):
+        (WebCore::PluginDatabase::addDisabledPluginFile):
+        (WebCore::PluginDatabase::defaultPluginDirectories):
+        (WebCore::PluginDatabase::isPreferredPluginDirectory):
+        (WebCore::PluginDatabase::getPluginPathsInDirectories):
+        (WebCore::fillBufferWithContentsOfFile):
+        (WebCore::readUTF8String):
+        (WebCore::readTime):
+        (WebCore::PluginDatabase::loadPersistentMetadataCache):
+        (WebCore::writeUTF8String):
+        (WebCore::writeTime):
+        (WebCore::PluginDatabase::updatePersistentMetadataCache):
+        (WebCore::PluginDatabase::isPersistentMetadataCacheEnabled):
+        (WebCore::PluginDatabase::setPersistentMetadataCacheEnabled):
+        (WebCore::PluginDatabase::persistentMetadataCachePath):
+        (WebCore::PluginDatabase::setPersistentMetadataCachePath):
+        * Plugins/PluginDatabase.h: Renamed from Source/WebCore/plugins/PluginDatabase.h.
+        (WebCore::PluginDatabase::setPluginDirectories):
+        (WebCore::PluginDatabase::pluginDirectories):
+        * Plugins/PluginDatabaseWin.cpp: Renamed from Source/WebCore/plugins/win/PluginDatabaseWin.cpp.
+        (WebCore::addPluginPathsFromRegistry):
+        (WebCore::PluginDatabase::getPluginPathsInDirectories):
+        (WebCore::parseVersionString):
+        (WebCore::compareVersions):
+        (WebCore::addMozillaPluginDirectories):
+        (WebCore::addWindowsMediaPlayerPluginDirectory):
+        (WebCore::addAdobeAcrobatPluginDirectory):
+        (WebCore::addJavaPluginDirectory):
+        (WebCore::safariPluginsDirectory):
+        (WebCore::addMacromediaPluginDirectories):
+        (WebCore::PluginDatabase::defaultPluginDirectories):
+        (WebCore::PluginDatabase::isPreferredPluginDirectory):
+        * Plugins/PluginDebug.cpp: Renamed from Source/WebCore/plugins/PluginDebug.cpp.
+        (WebCore::prettyNameForNPError):
+        (WebCore::prettyNameForDrawingModel):
+        (WebCore::prettyNameForEventModel):
+        (WebCore::prettyNameForNPNVariable):
+        (WebCore::prettyNameForNPPVariable):
+        (WebCore::prettyNameForNPNURLVariable):
+        * Plugins/PluginDebug.h: Renamed from Source/WebCore/plugins/PluginDebug.h.
+        * Plugins/PluginMessageThrottlerWin.cpp: Renamed from Source/WebCore/plugins/win/PluginMessageThrottlerWin.cpp.
+        (WebCore::PluginMessageThrottlerWin::PluginMessageThrottlerWin):
+        (WebCore::PluginMessageThrottlerWin::~PluginMessageThrottlerWin):
+        (WebCore::PluginMessageThrottlerWin::appendMessage):
+        (WebCore::PluginMessageThrottlerWin::processQueuedMessage):
+        (WebCore::PluginMessageThrottlerWin::messageThrottleTimerFired):
+        (WebCore::PluginMessageThrottlerWin::allocateMessage):
+        (WebCore::PluginMessageThrottlerWin::isInlineMessage):
+        (WebCore::PluginMessageThrottlerWin::freeMessage):
+        * Plugins/PluginMessageThrottlerWin.h: Renamed from Source/WebCore/plugins/win/PluginMessageThrottlerWin.h.
+        * Plugins/PluginPackage.cpp: Renamed from Source/WebCore/plugins/PluginPackage.cpp.
+        (WebCore::PluginPackage::~PluginPackage):
+        (WebCore::PluginPackage::freeLibrarySoon):
+        (WebCore::PluginPackage::freeLibraryTimerFired):
+        (WebCore::PluginPackage::compare):
+        (WebCore::PluginPackage::PluginPackage):
+        (WebCore::PluginPackage::unload):
+        (WebCore::PluginPackage::unloadWithoutShutdown):
+        (WebCore::PluginPackage::setEnabled):
+        (WebCore::PluginPackage::createPackage):
+        (WebCore::PluginPackage::createPackageFromCache):
+        (WebCore::PluginPackage::determineQuirks):
+        (WebCore::PluginPackage::determineModuleVersionFromDescription):
+        (WebCore::getListFromVariantArgs):
+        (WebCore::makeSource):
+        (WebCore::NPN_Evaluate):
+        (WebCore::NPN_Invoke):
+        (WebCore::PluginPackage::initializeBrowserFuncs):
+        (WebCore::PluginPackage::hash):
+        (WebCore::PluginPackage::equal):
+        (WebCore::PluginPackage::compareFileVersion):
+        (WebCore::PluginPackage::ensurePluginLoaded):
+        * Plugins/PluginPackage.h: Renamed from Source/WebCore/plugins/PluginPackage.h.
+        (WebCore::PluginPackage::name):
+        (WebCore::PluginPackage::description):
+        (WebCore::PluginPackage::path):
+        (WebCore::PluginPackage::fileName):
+        (WebCore::PluginPackage::parentDirectory):
+        (WebCore::PluginPackage::module):
+        (WebCore::PluginPackage::lastModified):
+        (WebCore::PluginPackage::mimeToDescriptions):
+        (WebCore::PluginPackage::mimeToExtensions):
+        (WebCore::PluginPackage::isEnabled):
+        (WebCore::PluginPackage::pluginFuncs):
+        (WebCore::PluginPackage::quirks):
+        (WebCore::PluginPackage::version):
+        (WebCore::PluginPackage::fullMIMEDescription):
+        (WebCore::PluginPackageHash::hash):
+        (WebCore::PluginPackageHash::equal):
+        * Plugins/PluginPackageWin.cpp: Renamed from Source/WebCore/plugins/win/PluginPackageWin.cpp.
+        (WebCore::getVersionInfo):
+        (WebCore::PluginPackage::isPluginBlacklisted):
+        (WebCore::PluginPackage::determineQuirks):
+        (WebCore::PluginPackage::fetchInfo):
+        (WebCore::PluginPackage::load):
+        (WebCore::PluginPackage::hash):
+        (WebCore::PluginPackage::equal):
+        (WebCore::PluginPackage::NPVersion):
+        * Plugins/PluginQuirkSet.h: Renamed from Source/WebCore/plugins/PluginQuirkSet.h.
+        (WebCore::PluginQuirkSet::PluginQuirkSet):
+        (WebCore::PluginQuirkSet::add):
+        (WebCore::PluginQuirkSet::contains):
+        * Plugins/PluginStream.cpp: Renamed from Source/WebCore/plugins/PluginStream.cpp.
+        (WebCore::streams):
+        (WebCore::PluginStream::PluginStream):
+        (WebCore::PluginStream::~PluginStream):
+        (WebCore::PluginStream::start):
+        (WebCore::PluginStream::stop):
+        (WebCore::lastModifiedDate):
+        (WebCore::PluginStream::startStream):
+        (WebCore::PluginStream::ownerForStream):
+        (WebCore::PluginStream::cancelAndDestroyStream):
+        (WebCore::PluginStream::destroyStream):
+        (WebCore::PluginStream::delayDeliveryTimerFired):
+        (WebCore::PluginStream::deliverData):
+        (WebCore::PluginStream::sendJavaScriptStream):
+        (WebCore::PluginStream::didReceiveResponse):
+        (WebCore::PluginStream::didReceiveData):
+        (WebCore::PluginStream::didFail):
+        (WebCore::PluginStream::didFinishLoading):
+        (WebCore::PluginStream::wantsAllStreams):
+        * Plugins/PluginStream.h: Renamed from Source/WebCore/plugins/PluginStream.h.
+        (WebCore::PluginStreamClient::~PluginStreamClient):
+        (WebCore::PluginStreamClient::streamDidFinishLoading):
+        (WebCore::PluginStream::create):
+        (WebCore::PluginStream::setLoadManually):
+        * Plugins/PluginView.cpp: Renamed from Source/WebCore/plugins/PluginView.cpp.
+        (WebCore::instanceMap):
+        (WebCore::scriptStringIfJavaScriptURL):
+        (WebCore::PluginView::popPopupsStateTimerFired):
+        (WebCore::PluginView::windowClipRect):
+        (WebCore::PluginView::setFrameRect):
+        (WebCore::PluginView::frameRectsChanged):
+        (WebCore::PluginView::clipRectChanged):
+        (WebCore::PluginView::handleEvent):
+        (WebCore::PluginView::init):
+        (WebCore::PluginView::startOrAddToUnstartedList):
+        (WebCore::PluginView::start):
+        (WebCore::PluginView::mediaCanStart):
+        (WebCore::PluginView::~PluginView):
+        (WebCore::PluginView::stop):
+        (WebCore::PluginView::setCurrentPluginView):
+        (WebCore::PluginView::currentPluginView):
+        (WebCore::createUTF8String):
+        (WebCore::PluginView::performRequest):
+        (WebCore::PluginView::requestTimerFired):
+        (WebCore::PluginView::scheduleRequest):
+        (WebCore::PluginView::load):
+        (WebCore::makeURL):
+        (WebCore::PluginView::getURLNotify):
+        (WebCore::PluginView::getURL):
+        (WebCore::PluginView::postURLNotify):
+        (WebCore::PluginView::postURL):
+        (WebCore::PluginView::newStream):
+        (WebCore::PluginView::write):
+        (WebCore::PluginView::destroyStream):
+        (WebCore::PluginView::status):
+        (WebCore::PluginView::setValue):
+        (WebCore::PluginView::invalidateTimerFired):
+        (WebCore::PluginView::pushPopupsEnabledState):
+        (WebCore::PluginView::popPopupsEnabledState):
+        (WebCore::PluginView::arePopupsAllowed):
+        (WebCore::PluginView::setJavaScriptPaused):
+        (WebCore::PluginView::npObject):
+        (WebCore::PluginView::bindingInstance):
+        (WebCore::PluginView::disconnectStream):
+        (WebCore::PluginView::setParameters):
+        (WebCore::PluginView::PluginView):
+        (WebCore::PluginView::focusPluginElement):
+        (WebCore::PluginView::didReceiveResponse):
+        (WebCore::PluginView::didReceiveData):
+        (WebCore::PluginView::didFinishLoading):
+        (WebCore::PluginView::didFail):
+        (WebCore::PluginView::setCallingPlugin):
+        (WebCore::PluginView::isCallingPlugin):
+        (WebCore::PluginView::create):
+        (WebCore::PluginView::freeStringArray):
+        (WebCore::startsWithBlankLine):
+        (WebCore::locationAfterFirstBlankLine):
+        (WebCore::findEOL):
+        (WebCore::capitalizeRFC822HeaderFieldName):
+        (WebCore::parseRFC822HeaderFields):
+        (WebCore::PluginView::handlePost):
+        (WebCore::PluginView::invalidateWindowlessPluginRect):
+        (WebCore::PluginView::paintMissingPluginIcon):
+        (WebCore::PluginView::userAgent):
+        (WebCore::PluginView::userAgentStatic):
+        (WebCore::PluginView::lifeSupportTimerFired):
+        (WebCore::PluginView::keepAlive):
+        (WebCore::PluginView::getValueStatic):
+        (WebCore::PluginView::getValue):
+        (WebCore::getFrame):
+        (WebCore::PluginView::getValueForURL):
+        (WebCore::PluginView::setValueForURL):
+        (WebCore::PluginView::getAuthenticationInfo):
+        (WebCore::PluginView::privateBrowsingStateChanged):
+        * Plugins/PluginView.h: Renamed from Source/WebCore/plugins/PluginView.h.
+        (WebCore::PluginRequest::PluginRequest):
+        (WebCore::PluginRequest::frameLoadRequest):
+        (WebCore::PluginRequest::notifyData):
+        (WebCore::PluginRequest::sendNotification):
+        (WebCore::PluginRequest::shouldAllowPopups):
+        (WebCore::PluginManualLoader::~PluginManualLoader):
+        (WebCore::PluginView::plugin):
+        (WebCore::PluginView::instance):
+        (WebCore::PluginView::status):
+        (WebCore::PluginView::streamDidFinishLoading):
+        (WebCore::PluginView::parentFrame):
+        (WebCore::PluginView::pluginsPage):
+        (WebCore::PluginView::mimeType):
+        (WebCore::PluginView::url):
+        (WebCore::PluginView::pluginWndProc):
+        (WebCore::PluginView::platformPluginWidget):
+        (WebCore::PluginView::setPlatformPluginWidget):
+        (WebCore::toPluginView):
+        * Plugins/PluginViewWin.cpp: Renamed from Source/WebCore/plugins/win/PluginViewWin.cpp.
+        (windowHandleForPageClient):
+        (WebCore::PluginView::hookedBeginPaint):
+        (WebCore::PluginView::hookedEndPaint):
+        (WebCore::hook):
+        (WebCore::setUpOffscreenPaintingHooks):
+        (WebCore::registerPluginView):
+        (WebCore::PluginView::PluginViewWndProc):
+        (WebCore::isWindowsMessageUserGesture):
+        (WebCore::contentsToNativeWindow):
+        (WebCore::PluginView::wndProc):
+        (WebCore::PluginView::updatePluginWidget):
+        (WebCore::PluginView::setFocus):
+        (WebCore::PluginView::show):
+        (WebCore::PluginView::hide):
+        (WebCore::PluginView::dispatchNPEvent):
+        (WebCore::PluginView::paintIntoTransformedContext):
+        (WebCore::PluginView::paintWindowedPluginIntoContext):
+        (WebCore::PluginView::paint):
+        (WebCore::PluginView::handleKeyboardEvent):
+        (WebCore::PluginView::handleMouseEvent):
+        (WebCore::PluginView::setParent):
+        (WebCore::PluginView::setParentVisible):
+        (WebCore::PluginView::setNPWindowRect):
+        (WebCore::PluginView::handlePostReadFile):
+        (WebCore::PluginView::platformGetValueStatic):
+        (WebCore::PluginView::platformGetValue):
+        (WebCore::PluginView::invalidateRect):
+        (WebCore::PluginView::invalidateRegion):
+        (WebCore::PluginView::forceRedraw):
+        (WebCore::PluginView::platformStart):
+        (WebCore::PluginView::platformDestroy):
+        (WebCore::PluginView::snapshot):
+        * Plugins/npapi.cpp: Renamed from Source/WebCore/plugins/npapi.cpp.
+        (pluginViewForInstance):
+        (NPN_MemAlloc):
+        (NPN_MemFree):
+        (NPN_MemFlush):
+        (NPN_ReloadPlugins):
+        (NPN_RequestRead):
+        (NPN_GetURLNotify):
+        (NPN_GetURL):
+        (NPN_PostURLNotify):
+        (NPN_PostURL):
+        (NPN_NewStream):
+        (NPN_Write):
+        (NPN_DestroyStream):
+        (NPN_UserAgent):
+        (NPN_Status):
+        (NPN_InvalidateRect):
+        (NPN_InvalidateRegion):
+        (NPN_ForceRedraw):
+        (NPN_GetValue):
+        (NPN_SetValue):
+        (NPN_GetJavaEnv):
+        (NPN_GetJavaPeer):
+        (NPN_PushPopupsEnabledState):
+        (NPN_PopPopupsEnabledState):
+        (NPN_PluginThreadAsyncCall):
+        (NPN_GetValueForURL):
+        (NPN_SetValueForURL):
+        (NPN_GetAuthenticationInfo):
+        (NPN_PopUpContextMenu):
+
</ins><span class="cx"> 2015-01-08  Dean Jackson  &lt;dino@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Text not drawn or white-on-white for &quot;Close Page&quot;/&quot;Go Back&quot; button on safe browsing warning page
</span></span></pre></div>
<a id="trunkSourceWebKitwinPluginsPaintHooksasmfromrev178217trunkSourceWebCorepluginswinPaintHooksasm"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit/win/Plugins/PaintHooks.asm (from rev 178217, trunk/Source/WebCore/plugins/win/PaintHooks.asm) (0 => 178219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/Plugins/PaintHooks.asm                                (rev 0)
+++ trunk/Source/WebKit/win/Plugins/PaintHooks.asm        2015-01-10 00:16:52 UTC (rev 178219)
</span><span class="lines">@@ -0,0 +1,50 @@
</span><ins>+;/*
+;    Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
+;
+;    This library is free software; you can redistribute it and/or
+;    modify it under the terms of the GNU Library General Public
+;    License as published by the Free Software Foundation; either
+;    version 2 of the License, or (at your option) any later version.
+;
+;    This library is distributed in the hope that it will be useful,
+;    but WITHOUT ANY WARRANTY; without even the implied warranty of
+;    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;    Library General Public License for more details.
+;
+;    You should have received a copy of the GNU Library General Public License
+;    along with this library; see the file COPYING.LIB.  If not, write to
+;    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;    Boston, MA 02110-1301, USA.
+;*/
+
+;HDC __stdcall _HBeginPaint(HWND hWnd, LPPAINTSTRUCT lpPaint);
+
+PUBLIC  _HBeginPaint
+
+_TEXT   SEGMENT
+
+_HBeginPaint PROC
+     mov  r10,rcx
+     mov  eax,1017h
+     syscall
+     ret
+_HBeginPaint ENDP
+
+_TEXT   ENDS
+
+;BOOL __stdcall _HEndPaint(HWND hWnd, const PAINTSTRUCT* lpPaint);
+
+PUBLIC  _HEndPaint
+
+_TEXT   SEGMENT
+
+_HEndPaint PROC
+    mov  r10,rcx
+    mov  eax,1019h
+    syscall
+    ret
+_HEndPaint ENDP
+
+_TEXT   ENDS
+
+END
</ins></span></pre></div>
<a id="trunkSourceWebKitwinPluginsPluginDatabasecppfromrev178217trunkSourceWebCorepluginsPluginDatabasecpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit/win/Plugins/PluginDatabase.cpp (from rev 178217, trunk/Source/WebCore/plugins/PluginDatabase.cpp) (0 => 178219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/Plugins/PluginDatabase.cpp                                (rev 0)
+++ trunk/Source/WebKit/win/Plugins/PluginDatabase.cpp        2015-01-10 00:16:52 UTC (rev 178219)
</span><span class="lines">@@ -0,0 +1,677 @@
</span><ins>+/*
+ * Copyright (C) 2006, 2007 Apple Inc.  All rights reserved.
+ * Copyright (C) 2008 Collabora, Ltd.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;PluginDatabase.h&quot;
+
+#include &quot;Frame.h&quot;
+#include &quot;URL.h&quot;
+#include &quot;PluginPackage.h&quot;
+#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE)
+#include &quot;FileSystem.h&quot;
+#endif
+#include &lt;stdlib.h&gt;
+#include &lt;wtf/text/CString.h&gt;
+
+namespace WebCore {
+
+typedef HashMap&lt;String, RefPtr&lt;PluginPackage&gt; &gt; PluginPackageByNameMap;
+
+#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE)
+static const size_t maximumPersistentPluginMetadataCacheSize = 32768;
+
+static bool gPersistentPluginMetadataCacheIsEnabled;
+
+String&amp; persistentPluginMetadataCachePath()
+{
+    DEPRECATED_DEFINE_STATIC_LOCAL(String, cachePath, ());
+    return cachePath;
+}
+#endif
+
+PluginDatabase::PluginDatabase()
+#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE)
+    : m_persistentMetadataCacheIsLoaded(false)
+#endif
+{
+}
+
+PluginDatabase* PluginDatabase::installedPlugins(bool populate)
+{
+    static PluginDatabase* plugins = 0;
+
+    if (!plugins) {
+        plugins = new PluginDatabase;
+
+        if (populate) {
+            plugins-&gt;setPluginDirectories(PluginDatabase::defaultPluginDirectories());
+            plugins-&gt;refresh();
+        }
+    }
+
+    return plugins;
+}
+
+bool PluginDatabase::isMIMETypeRegistered(const String&amp; mimeType)
+{
+    if (mimeType.isNull())
+        return false;
+    if (m_registeredMIMETypes.contains(mimeType))
+        return true;
+    // No plugin was found, try refreshing the database and searching again
+    return (refresh() &amp;&amp; m_registeredMIMETypes.contains(mimeType));
+}
+
+void PluginDatabase::addExtraPluginDirectory(const String&amp; directory)
+{
+    m_pluginDirectories.append(directory);
+    refresh();
+}
+
+bool PluginDatabase::refresh()
+{
+#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE)
+    if (!m_persistentMetadataCacheIsLoaded)
+        loadPersistentMetadataCache();
+#endif
+    bool pluginSetChanged = false;
+
+    if (!m_plugins.isEmpty()) {
+        PluginSet pluginsToUnload;
+        getDeletedPlugins(pluginsToUnload);
+
+        // Unload plugins
+        PluginSet::const_iterator end = pluginsToUnload.end();
+        for (PluginSet::const_iterator it = pluginsToUnload.begin(); it != end; ++it)
+            remove(it-&gt;get());
+
+        pluginSetChanged = !pluginsToUnload.isEmpty();
+    }
+
+    HashSet&lt;String&gt; paths;
+    getPluginPathsInDirectories(paths);
+
+    HashMap&lt;String, time_t&gt; pathsWithTimes;
+
+    // We should only skip unchanged files if we didn't remove any plugins above. If we did remove
+    // any plugins, we need to look at every plugin file so that, e.g., if the user has two versions
+    // of RealPlayer installed and just removed the newer one, we'll pick up the older one.
+    bool shouldSkipUnchangedFiles = !pluginSetChanged;
+
+    HashSet&lt;String&gt;::const_iterator pathsEnd = paths.end();
+    for (HashSet&lt;String&gt;::const_iterator it = paths.begin(); it != pathsEnd; ++it) {
+        time_t lastModified;
+        if (!getFileModificationTime(*it, lastModified))
+            continue;
+
+        pathsWithTimes.add(*it, lastModified);
+
+        // If the path's timestamp hasn't changed since the last time we ran refresh(), we don't have to do anything.
+        if (shouldSkipUnchangedFiles &amp;&amp; m_pluginPathsWithTimes.get(*it) == lastModified)
+            continue;
+
+        if (RefPtr&lt;PluginPackage&gt; oldPackage = m_pluginsByPath.get(*it)) {
+            ASSERT(!shouldSkipUnchangedFiles || oldPackage-&gt;lastModified() != lastModified);
+            remove(oldPackage.get());
+        }
+
+        RefPtr&lt;PluginPackage&gt; package = PluginPackage::createPackage(*it, lastModified);
+        if (package &amp;&amp; add(package.release()))
+            pluginSetChanged = true;
+    }
+
+    // Cache all the paths we found with their timestamps for next time.
+    pathsWithTimes.swap(m_pluginPathsWithTimes);
+
+    if (!pluginSetChanged)
+        return false;
+
+#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE)
+    updatePersistentMetadataCache();
+#endif
+
+    m_registeredMIMETypes.clear();
+
+    // Register plug-in MIME types
+    PluginSet::const_iterator end = m_plugins.end();
+    for (PluginSet::const_iterator it = m_plugins.begin(); it != end; ++it) {
+        // Get MIME types
+        MIMEToDescriptionsMap::const_iterator map_it = (*it)-&gt;mimeToDescriptions().begin();
+        MIMEToDescriptionsMap::const_iterator map_end = (*it)-&gt;mimeToDescriptions().end();
+        for (; map_it != map_end; ++map_it)
+            m_registeredMIMETypes.add(map_it-&gt;key);
+    }
+
+    return true;
+}
+
+Vector&lt;PluginPackage*&gt; PluginDatabase::plugins() const
+{
+    Vector&lt;PluginPackage*&gt; result;
+
+    PluginSet::const_iterator end = m_plugins.end();
+    for (PluginSet::const_iterator it = m_plugins.begin(); it != end; ++it)
+        result.append((*it).get());
+
+    return result;
+}
+
+int PluginDatabase::preferredPluginCompare(const void* a, const void* b)
+{
+    PluginPackage* pluginA = *static_cast&lt;PluginPackage* const*&gt;(a);
+    PluginPackage* pluginB = *static_cast&lt;PluginPackage* const*&gt;(b);
+
+    return pluginA-&gt;compare(*pluginB);
+}
+
+PluginPackage* PluginDatabase::pluginForMIMEType(const String&amp; mimeType)
+{
+    if (mimeType.isEmpty())
+        return 0;
+
+    String key = mimeType.lower();
+    PluginSet::const_iterator end = m_plugins.end();
+    PluginPackage* preferredPlugin = m_preferredPlugins.get(key);
+    if (preferredPlugin
+        &amp;&amp; preferredPlugin-&gt;isEnabled()
+        &amp;&amp; preferredPlugin-&gt;mimeToDescriptions().contains(key)) {
+        return preferredPlugin;
+    }
+
+    Vector&lt;PluginPackage*, 2&gt; pluginChoices;
+
+    for (PluginSet::const_iterator it = m_plugins.begin(); it != end; ++it) {
+        PluginPackage* plugin = (*it).get();
+
+        if (!plugin-&gt;isEnabled())
+            continue;
+
+        if (plugin-&gt;mimeToDescriptions().contains(key)) {
+#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE)
+            if (!plugin-&gt;ensurePluginLoaded())
+                continue;
+#endif
+            pluginChoices.append(plugin);
+        }
+    }
+
+    if (pluginChoices.isEmpty())
+        return 0;
+
+    qsort(pluginChoices.data(), pluginChoices.size(), sizeof(PluginPackage*), PluginDatabase::preferredPluginCompare);
+
+    return pluginChoices[0];
+}
+
+String PluginDatabase::MIMETypeForExtension(const String&amp; extension) const
+{
+    if (extension.isEmpty())
+        return String();
+
+    PluginSet::const_iterator end = m_plugins.end();
+    String mimeType;
+    Vector&lt;PluginPackage*, 2&gt; pluginChoices;
+    HashMap&lt;PluginPackage*, String&gt; mimeTypeForPlugin;
+
+    for (PluginSet::const_iterator it = m_plugins.begin(); it != end; ++it) {
+        if (!(*it)-&gt;isEnabled())
+            continue;
+
+        MIMEToExtensionsMap::const_iterator mime_end = (*it)-&gt;mimeToExtensions().end();
+
+        for (MIMEToExtensionsMap::const_iterator mime_it = (*it)-&gt;mimeToExtensions().begin(); mime_it != mime_end; ++mime_it) {
+            mimeType = mime_it-&gt;key;
+            PluginPackage* preferredPlugin = m_preferredPlugins.get(mimeType);
+            const Vector&lt;String&gt;&amp; extensions = mime_it-&gt;value;
+            bool foundMapping = false;
+            for (unsigned i = 0; i &lt; extensions.size(); i++) {
+                if (equalIgnoringCase(extensions[i], extension)) {
+                    PluginPackage* plugin = (*it).get();
+
+                    if (preferredPlugin &amp;&amp; PluginPackage::equal(*plugin, *preferredPlugin))
+                        return mimeType;
+
+#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE)
+                    if (!plugin-&gt;ensurePluginLoaded())
+                        continue;
+#endif
+                    pluginChoices.append(plugin);
+                    mimeTypeForPlugin.add(plugin, mimeType);
+                    foundMapping = true;
+                    break;
+                }
+            }
+            if (foundMapping)
+                break;
+        }
+    }
+
+    if (pluginChoices.isEmpty())
+        return String();
+
+    qsort(pluginChoices.data(), pluginChoices.size(), sizeof(PluginPackage*), PluginDatabase::preferredPluginCompare);
+
+    return mimeTypeForPlugin.get(pluginChoices[0]);
+}
+
+PluginPackage* PluginDatabase::findPlugin(const URL&amp; url, String&amp; mimeType)
+{
+    if (!mimeType.isEmpty())
+        return pluginForMIMEType(mimeType);
+    
+    String filename = url.lastPathComponent();
+    if (filename.endsWith('/'))
+        return 0;
+    
+    int extensionPos = filename.reverseFind('.');
+    if (extensionPos == -1)
+        return 0;
+    
+    String mimeTypeForExtension = MIMETypeForExtension(filename.substring(extensionPos + 1));
+    PluginPackage* plugin = pluginForMIMEType(mimeTypeForExtension);
+    if (!plugin) {
+        // FIXME: if no plugin could be found, query Windows for the mime type
+        // corresponding to the extension.
+        return 0;
+    }
+    
+    mimeType = mimeTypeForExtension;
+    return plugin;
+}
+
+void PluginDatabase::setPreferredPluginForMIMEType(const String&amp; mimeType, PluginPackage* plugin)
+{
+    if (!plugin || plugin-&gt;mimeToExtensions().contains(mimeType))
+        m_preferredPlugins.set(mimeType.lower(), plugin);
+}
+
+bool PluginDatabase::fileExistsAndIsNotDisabled(const String&amp; filePath) const
+{
+    // Skip plugin files that are disabled by filename.
+    if (m_disabledPluginFiles.contains(pathGetFileName(filePath)))
+        return false;
+
+    return fileExists(filePath);
+}
+
+void PluginDatabase::getDeletedPlugins(PluginSet&amp; plugins) const
+{
+    PluginSet::const_iterator end = m_plugins.end();
+    for (PluginSet::const_iterator it = m_plugins.begin(); it != end; ++it) {
+        if (!fileExistsAndIsNotDisabled((*it)-&gt;path()))
+            plugins.add(*it);
+    }
+}
+
+bool PluginDatabase::add(PassRefPtr&lt;PluginPackage&gt; prpPackage)
+{
+    ASSERT_ARG(prpPackage, prpPackage);
+
+    RefPtr&lt;PluginPackage&gt; package = prpPackage;
+
+    if (!m_plugins.add(package).isNewEntry)
+        return false;
+
+    m_pluginsByPath.add(package-&gt;path(), package);
+    return true;
+}
+
+void PluginDatabase::remove(PluginPackage* package)
+{
+    MIMEToExtensionsMap::const_iterator it = package-&gt;mimeToExtensions().begin();
+    MIMEToExtensionsMap::const_iterator end = package-&gt;mimeToExtensions().end();
+    for ( ; it != end; ++it) {
+        PluginPackageByNameMap::iterator packageInMap = m_preferredPlugins.find(it-&gt;key);
+        if (packageInMap != m_preferredPlugins.end() &amp;&amp; packageInMap-&gt;value == package)
+            m_preferredPlugins.remove(packageInMap);
+    }
+
+    m_plugins.remove(package);
+    m_pluginsByPath.remove(package-&gt;path());
+}
+
+void PluginDatabase::clear()
+{
+    m_plugins.clear();
+    m_pluginsByPath.clear();
+    m_pluginPathsWithTimes.clear();
+    m_registeredMIMETypes.clear();
+    m_preferredPlugins.clear();
+#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE)
+    m_persistentMetadataCacheIsLoaded = false;
+#endif
+}
+
+bool PluginDatabase::removeDisabledPluginFile(const String&amp; fileName)
+{
+    return m_disabledPluginFiles.remove(fileName);
+}
+
+bool PluginDatabase::addDisabledPluginFile(const String&amp; fileName)
+{
+    return m_disabledPluginFiles.add(fileName).isNewEntry;
+}
+
+#if (!OS(WINDOWS) || !ENABLE(NETSCAPE_PLUGIN_API))
+// For Safari/Win the following three methods are implemented
+// in PluginDatabaseWin.cpp, but if we can use WebCore constructs
+// for the logic we should perhaps move it here under XP_WIN?
+
+Vector&lt;String&gt; PluginDatabase::defaultPluginDirectories()
+{
+    Vector&lt;String&gt; paths;
+
+    // Add paths specific to each platform
+#if defined(XP_UNIX)
+    String userPluginPath = homeDirectoryPath();
+    userPluginPath.append(String(&quot;/.mozilla/plugins&quot;));
+    paths.append(userPluginPath);
+
+    userPluginPath = homeDirectoryPath();
+    userPluginPath.append(String(&quot;/.netscape/plugins&quot;));
+    paths.append(userPluginPath);
+
+    paths.append(&quot;/usr/lib/browser/plugins&quot;);
+    paths.append(&quot;/usr/local/lib/mozilla/plugins&quot;);
+    paths.append(&quot;/usr/lib/firefox/plugins&quot;);
+    paths.append(&quot;/usr/lib64/browser-plugins&quot;);
+    paths.append(&quot;/usr/lib/browser-plugins&quot;);
+    paths.append(&quot;/usr/lib/mozilla/plugins&quot;);
+    paths.append(&quot;/usr/local/netscape/plugins&quot;);
+    paths.append(&quot;/opt/mozilla/plugins&quot;);
+    paths.append(&quot;/opt/mozilla/lib/plugins&quot;);
+    paths.append(&quot;/opt/netscape/plugins&quot;);
+    paths.append(&quot;/opt/netscape/communicator/plugins&quot;);
+    paths.append(&quot;/usr/lib/netscape/plugins&quot;);
+    paths.append(&quot;/usr/lib/netscape/plugins-libc5&quot;);
+    paths.append(&quot;/usr/lib/netscape/plugins-libc6&quot;);
+    paths.append(&quot;/usr/lib64/netscape/plugins&quot;);
+    paths.append(&quot;/usr/lib64/mozilla/plugins&quot;);
+    paths.append(&quot;/usr/lib/nsbrowser/plugins&quot;);
+    paths.append(&quot;/usr/lib64/nsbrowser/plugins&quot;);
+
+    String mozHome(getenv(&quot;MOZILLA_HOME&quot;));
+    mozHome.append(&quot;/plugins&quot;);
+    paths.append(mozHome);
+
+    Vector&lt;String&gt; mozPaths;
+    String mozPath(getenv(&quot;MOZ_PLUGIN_PATH&quot;));
+    mozPath.split(UChar(':'), /* allowEmptyEntries */ false, mozPaths);
+    paths.appendVector(mozPaths);
+#elif defined(XP_MACOSX)
+    String userPluginPath = homeDirectoryPath();
+    userPluginPath.append(String(&quot;/Library/Internet Plug-Ins&quot;));
+    paths.append(userPluginPath);
+    paths.append(&quot;/Library/Internet Plug-Ins&quot;);
+#elif defined(XP_WIN)
+    String userPluginPath = homeDirectoryPath();
+    userPluginPath.append(String(&quot;\\Application Data\\Mozilla\\plugins&quot;));
+    paths.append(userPluginPath);
+#endif
+
+    return paths;
+}
+
+bool PluginDatabase::isPreferredPluginDirectory(const String&amp; path)
+{
+    String preferredPath = homeDirectoryPath();
+
+#if defined(XP_UNIX)
+    preferredPath.append(String(&quot;/.mozilla/plugins&quot;));
+#elif defined(XP_MACOSX)
+    preferredPath.append(String(&quot;/Library/Internet Plug-Ins&quot;));
+#elif defined(XP_WIN)
+    preferredPath.append(String(&quot;\\Application Data\\Mozilla\\plugins&quot;));
+#endif
+
+    // TODO: We should normalize the path before doing a comparison.
+    return path == preferredPath;
+}
+
+void PluginDatabase::getPluginPathsInDirectories(HashSet&lt;String&gt;&amp; paths) const
+{
+    // FIXME: This should be a case insensitive set.
+    HashSet&lt;String&gt; uniqueFilenames;
+
+#if defined(XP_UNIX)
+    String fileNameFilter(&quot;*.so&quot;);
+#else
+    String fileNameFilter(&quot;&quot;);
+#endif
+
+    Vector&lt;String&gt;::const_iterator dirsEnd = m_pluginDirectories.end();
+    for (Vector&lt;String&gt;::const_iterator dIt = m_pluginDirectories.begin(); dIt != dirsEnd; ++dIt) {
+        Vector&lt;String&gt; pluginPaths = listDirectory(*dIt, fileNameFilter);
+        Vector&lt;String&gt;::const_iterator pluginsEnd = pluginPaths.end();
+        for (Vector&lt;String&gt;::const_iterator pIt = pluginPaths.begin(); pIt != pluginsEnd; ++pIt) {
+            if (!fileExistsAndIsNotDisabled(*pIt))
+                continue;
+
+            paths.add(*pIt);
+        }
+    }
+}
+
+#endif // !OS(WINDOWS)
+
+#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE)
+
+static void fillBufferWithContentsOfFile(PlatformFileHandle file, Vector&lt;char&gt;&amp; buffer)
+{
+    size_t bufferSize = 0;
+    size_t bufferCapacity = 1024;
+    buffer.resize(bufferCapacity);
+
+    do {
+        bufferSize += readFromFile(file, buffer.data() + bufferSize, bufferCapacity - bufferSize);
+        if (bufferSize == bufferCapacity) {
+            if (bufferCapacity &lt; maximumPersistentPluginMetadataCacheSize) {
+                bufferCapacity *= 2;
+                buffer.resize(bufferCapacity);
+            } else {
+                buffer.clear();
+                return;
+            }
+        } else
+            break;
+    } while (true);
+
+    buffer.shrink(bufferSize);
+}
+
+static bool readUTF8String(String&amp; resultString, char*&amp; start, const char* end)
+{
+    if (start &gt;= end)
+        return false;
+
+    int len = strlen(start);
+    resultString = String::fromUTF8(start, len);
+    start += len + 1;
+
+    return true;
+}
+
+static bool readTime(time_t&amp; resultTime, char*&amp; start, const char* end)
+{
+    if (start + sizeof(time_t) &gt;= end)
+        return false;
+
+    // The stream is not necessary aligned.
+    memcpy(&amp;resultTime, start, sizeof(time_t));
+    start += sizeof(time_t);
+
+    return true;
+}
+
+static const char schemaVersion = '1';
+static const char persistentPluginMetadataCacheFilename[] = &quot;PluginMetadataCache.bin&quot;;
+
+void PluginDatabase::loadPersistentMetadataCache()
+{
+    if (!isPersistentMetadataCacheEnabled() || persistentMetadataCachePath().isEmpty())
+        return;
+
+    PlatformFileHandle file;
+    String absoluteCachePath = pathByAppendingComponent(persistentMetadataCachePath(), persistentPluginMetadataCacheFilename);
+    file = openFile(absoluteCachePath, OpenForRead);
+
+    if (!isHandleValid(file))
+        return;
+
+    // Mark cache as loaded regardless of success or failure. If
+    // there's error in the cache, we won't try to load it anymore.
+    m_persistentMetadataCacheIsLoaded = true;
+
+    Vector&lt;char&gt; fileContents;
+    fillBufferWithContentsOfFile(file, fileContents);
+    closeFile(file);
+
+    if (fileContents.size() &lt; 2 || fileContents.first() != schemaVersion || fileContents.last() != '\0') {
+        LOG_ERROR(&quot;Unable to read plugin metadata cache: corrupt schema&quot;);
+        deleteFile(absoluteCachePath);
+        return;
+    }
+
+    char* bufferPos = fileContents.data() + 1;
+    char* end = fileContents.data() + fileContents.size();
+
+    PluginSet cachedPlugins;
+    HashMap&lt;String, time_t&gt; cachedPluginPathsWithTimes;
+    HashMap&lt;String, RefPtr&lt;PluginPackage&gt; &gt; cachedPluginsByPath;
+
+    while (bufferPos &lt; end) {
+        String path;
+        time_t lastModified;
+        String name;
+        String desc;
+        String mimeDesc;
+        if (!(readUTF8String(path, bufferPos, end)
+              &amp;&amp; readTime(lastModified, bufferPos, end)
+              &amp;&amp; readUTF8String(name, bufferPos, end)
+              &amp;&amp; readUTF8String(desc, bufferPos, end)
+              &amp;&amp; readUTF8String(mimeDesc, bufferPos, end))) {
+            LOG_ERROR(&quot;Unable to read plugin metadata cache: corrupt data&quot;);
+            deleteFile(absoluteCachePath);
+            return;
+        }
+
+        // Skip metadata that points to plugins from directories that
+        // are not part of plugin directory list anymore.
+        String pluginDirectoryName = directoryName(path);
+        if (m_pluginDirectories.find(pluginDirectoryName) == WTF::notFound)
+            continue;
+
+        RefPtr&lt;PluginPackage&gt; package = PluginPackage::createPackageFromCache(path, lastModified, name, desc, mimeDesc);
+
+        if (package &amp;&amp; cachedPlugins.add(package).isNewEntry) {
+            cachedPluginPathsWithTimes.add(package-&gt;path(), package-&gt;lastModified());
+            cachedPluginsByPath.add(package-&gt;path(), package);
+        }
+    }
+
+    m_plugins.swap(cachedPlugins);
+    m_pluginsByPath.swap(cachedPluginsByPath);
+    m_pluginPathsWithTimes.swap(cachedPluginPathsWithTimes);
+}
+
+static bool writeUTF8String(PlatformFileHandle file, const String&amp; string)
+{
+    CString utf8String = string.utf8();
+    int length = utf8String.length() + 1;
+    return writeToFile(file, utf8String.data(), length) == length;
+}
+
+static bool writeTime(PlatformFileHandle file, const time_t&amp; time)
+{
+    return writeToFile(file, reinterpret_cast&lt;const char*&gt;(&amp;time), sizeof(time_t)) == sizeof(time_t);
+}
+
+void PluginDatabase::updatePersistentMetadataCache()
+{
+    if (!isPersistentMetadataCacheEnabled() || persistentMetadataCachePath().isEmpty())
+        return;
+
+    makeAllDirectories(persistentMetadataCachePath());
+    String absoluteCachePath = pathByAppendingComponent(persistentMetadataCachePath(), persistentPluginMetadataCacheFilename);
+    deleteFile(absoluteCachePath);
+
+    if (m_plugins.isEmpty())
+        return;
+
+    PlatformFileHandle file;
+    file = openFile(absoluteCachePath, OpenForWrite);
+
+    if (!isHandleValid(file)) {
+        LOG_ERROR(&quot;Unable to open plugin metadata cache for saving&quot;);
+        return;
+    }
+
+    char localSchemaVersion = schemaVersion;
+    if (writeToFile(file, &amp;localSchemaVersion, 1) != 1) {
+        LOG_ERROR(&quot;Unable to write plugin metadata cache schema&quot;);
+        closeFile(file);
+        deleteFile(absoluteCachePath);
+        return;
+    }
+
+    PluginSet::const_iterator end = m_plugins.end();
+    for (PluginSet::const_iterator it = m_plugins.begin(); it != end; ++it) {
+        if (!(writeUTF8String(file, (*it)-&gt;path())
+              &amp;&amp; writeTime(file, (*it)-&gt;lastModified())
+              &amp;&amp; writeUTF8String(file, (*it)-&gt;name())
+              &amp;&amp; writeUTF8String(file, (*it)-&gt;description())
+              &amp;&amp; writeUTF8String(file, (*it)-&gt;fullMIMEDescription()))) {
+            LOG_ERROR(&quot;Unable to write plugin metadata to cache&quot;);
+            closeFile(file);
+            deleteFile(absoluteCachePath);
+            return;
+        }
+    }
+
+    closeFile(file);
+}
+
+bool PluginDatabase::isPersistentMetadataCacheEnabled()
+{
+    return gPersistentPluginMetadataCacheIsEnabled;
+}
+
+void PluginDatabase::setPersistentMetadataCacheEnabled(bool isEnabled)
+{
+    gPersistentPluginMetadataCacheIsEnabled = isEnabled;
+}
+
+String PluginDatabase::persistentMetadataCachePath()
+{
+    return WebCore::persistentPluginMetadataCachePath();
+}
+
+void PluginDatabase::setPersistentMetadataCachePath(const String&amp; persistentMetadataCachePath)
+{
+    WebCore::persistentPluginMetadataCachePath() = persistentMetadataCachePath;
+}
+#endif
+}
</ins></span></pre></div>
<a id="trunkSourceWebKitwinPluginsPluginDatabasehfromrev178217trunkSourceWebCorepluginsPluginDatabaseh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit/win/Plugins/PluginDatabase.h (from rev 178217, trunk/Source/WebCore/plugins/PluginDatabase.h) (0 => 178219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/Plugins/PluginDatabase.h                                (rev 0)
+++ trunk/Source/WebKit/win/Plugins/PluginDatabase.h        2015-01-10 00:16:52 UTC (rev 178219)
</span><span class="lines">@@ -0,0 +1,118 @@
</span><ins>+/*
+ * Copyright (C) 2006, 2007 Apple Inc.  All rights reserved.
+ * Copyright (C) 2008 Collabora, Ltd.  All rights reserved.
+ * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef PluginDatabase_h
+#define PluginDatabase_h
+
+#include &quot;PluginPackage.h&quot;
+#include &lt;wtf/HashSet.h&gt;
+#include &lt;wtf/Vector.h&gt;
+#include &lt;wtf/text/StringHash.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace WebCore {
+    class Element;
+    class Frame;
+    class IntSize;
+    class URL;
+    class PluginDatabaseClient;
+    class PluginPackage;
+
+    typedef HashSet&lt;RefPtr&lt;PluginPackage&gt;, PluginPackageHash, PluginPackageHashTraits&gt; PluginSet;
+
+    class PluginDatabase {
+        WTF_MAKE_NONCOPYABLE(PluginDatabase); WTF_MAKE_FAST_ALLOCATED;
+    public:
+        PluginDatabase();
+
+        // The first call to installedPlugins creates the plugin database
+        // and by default populates it with the plugins installed on the system.
+        // For testing purposes, it is possible to not populate the database
+        // automatically, as the plugins might affect the DRT results by
+        // writing to a.o. stderr.
+        static PluginDatabase* installedPlugins(bool populate = true);
+
+        bool refresh();
+        void clear();
+        Vector&lt;PluginPackage*&gt; plugins() const;
+        bool isMIMETypeRegistered(const String&amp; mimeType);
+        void addExtraPluginDirectory(const String&amp;);
+
+        static bool isPreferredPluginDirectory(const String&amp; directory);
+        static int preferredPluginCompare(const void*, const void*);
+
+        PluginPackage* findPlugin(const URL&amp;, String&amp; mimeType);
+        PluginPackage* pluginForMIMEType(const String&amp; mimeType);
+        void setPreferredPluginForMIMEType(const String&amp; mimeType, PluginPackage* plugin);
+
+        void setPluginDirectories(const Vector&lt;String&gt;&amp; directories)
+        {
+            clear();
+            m_pluginDirectories = directories;
+        }
+
+        bool removeDisabledPluginFile(const String&amp; fileName);
+        bool addDisabledPluginFile(const String&amp; fileName);
+        static Vector&lt;String&gt; defaultPluginDirectories();
+        Vector&lt;String&gt; pluginDirectories() const { return m_pluginDirectories; }
+
+        String MIMETypeForExtension(const String&amp; extension) const;
+#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE)
+        static bool isPersistentMetadataCacheEnabled();
+        static void setPersistentMetadataCacheEnabled(bool isEnabled);
+        static String persistentMetadataCachePath();
+        static void setPersistentMetadataCachePath(const String&amp; persistentMetadataCachePath);
+#endif
+
+    private:
+        void getPluginPathsInDirectories(HashSet&lt;String&gt;&amp;) const;
+        void getDeletedPlugins(PluginSet&amp;) const;
+        bool fileExistsAndIsNotDisabled(const String&amp;) const;
+
+        // Returns whether the plugin was actually added or not (it won't be added if it's a duplicate of an existing plugin).
+        bool add(PassRefPtr&lt;PluginPackage&gt;);
+        void remove(PluginPackage*);
+#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE)
+        void loadPersistentMetadataCache();
+        void updatePersistentMetadataCache();
+#endif
+
+        HashSet&lt;String&gt; m_disabledPluginFiles;
+        Vector&lt;String&gt; m_pluginDirectories;
+        HashSet&lt;String&gt; m_registeredMIMETypes;
+        PluginSet m_plugins;
+        HashMap&lt;String, RefPtr&lt;PluginPackage&gt; &gt; m_pluginsByPath;
+        HashMap&lt;String, time_t&gt; m_pluginPathsWithTimes;
+        HashMap&lt;String, RefPtr&lt;PluginPackage&gt; &gt; m_preferredPlugins;
+#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE)
+        bool m_persistentMetadataCacheIsLoaded;
+#endif
+    };
+
+} // namespace WebCore
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKitwinPluginsPluginDatabaseWincppfromrev178217trunkSourceWebCorepluginswinPluginDatabaseWincpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit/win/Plugins/PluginDatabaseWin.cpp (from rev 178217, trunk/Source/WebCore/plugins/win/PluginDatabaseWin.cpp) (0 => 178219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/Plugins/PluginDatabaseWin.cpp                                (rev 0)
+++ trunk/Source/WebKit/win/Plugins/PluginDatabaseWin.cpp        2015-01-10 00:16:52 UTC (rev 178219)
</span><span class="lines">@@ -0,0 +1,385 @@
</span><ins>+/*
+ * Copyright (C) 2006, 2007 Apple Inc.  All rights reserved.
+ * Copyright (C) 2008 Collabora, Ltd.  All rights reserved.
+ * Copyright (C) 2008-2009 Torch Mobile, Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#include &quot;config.h&quot;
+#include &quot;PluginDatabase.h&quot;
+
+#include &quot;Frame.h&quot;
+#include &quot;URL.h&quot;
+#include &quot;PluginPackage.h&quot;
+#include &lt;wtf/WindowsExtras.h&gt;
+
+namespace WebCore {
+
+static inline void addPluginPathsFromRegistry(HKEY rootKey, HashSet&lt;String&gt;&amp; paths)
+{
+    HKEY key;
+    HRESULT result = RegOpenKeyExW(rootKey, L&quot;Software\\MozillaPlugins&quot;, 0, KEY_ENUMERATE_SUB_KEYS, &amp;key);
+
+    if (result != ERROR_SUCCESS)
+        return;
+
+    wchar_t name[128];
+    FILETIME lastModified;
+
+    // Enumerate subkeys
+    for (int i = 0;; i++) {
+        DWORD nameLen = WTF_ARRAY_LENGTH(name);
+        result = RegEnumKeyExW(key, i, name, &amp;nameLen, 0, 0, 0, &amp;lastModified);
+
+        if (result != ERROR_SUCCESS)
+            break;
+
+        WCHAR pathStr[_MAX_PATH];
+        DWORD pathStrSize = sizeof(pathStr);
+        DWORD type;
+
+        result = getRegistryValue(key, name, L&quot;Path&quot;, &amp;type, pathStr, &amp;pathStrSize);
+        if (result != ERROR_SUCCESS || type != REG_SZ)
+            continue;
+
+        paths.add(String(pathStr, pathStrSize / sizeof(WCHAR) - 1));
+    }
+
+    RegCloseKey(key);
+}
+
+void PluginDatabase::getPluginPathsInDirectories(HashSet&lt;String&gt;&amp; paths) const
+{
+    // FIXME: This should be a case insensitive set.
+    HashSet&lt;String&gt; uniqueFilenames;
+
+    HANDLE hFind = INVALID_HANDLE_VALUE;
+    WIN32_FIND_DATAW findFileData;
+
+    String oldWMPPluginPath;
+    String newWMPPluginPath;
+
+    Vector&lt;String&gt;::const_iterator end = m_pluginDirectories.end();
+    for (Vector&lt;String&gt;::const_iterator it = m_pluginDirectories.begin(); it != end; ++it) {
+        String pattern = *it + &quot;\\*&quot;;
+
+        hFind = FindFirstFileW(pattern.charactersWithNullTermination().data(), &amp;findFileData);
+
+        if (hFind == INVALID_HANDLE_VALUE)
+            continue;
+
+        do {
+            if (findFileData.dwFileAttributes &amp; FILE_ATTRIBUTE_DIRECTORY)
+                continue;
+
+            String filename = String(findFileData.cFileName, wcslen(findFileData.cFileName));
+            if ((!filename.startsWith(&quot;np&quot;, false) || !filename.endsWith(&quot;dll&quot;, false)) &amp;&amp;
+                (!equalIgnoringCase(filename, &quot;Plugin.dll&quot;) || !it-&gt;endsWith(&quot;Shockwave 10&quot;, false)))
+                continue;
+
+            String fullPath = *it + &quot;\\&quot; + filename;
+            if (!uniqueFilenames.add(fullPath).isNewEntry)
+                continue;
+
+            paths.add(fullPath);
+
+            if (equalIgnoringCase(filename, &quot;npdsplay.dll&quot;))
+                oldWMPPluginPath = fullPath;
+            else if (equalIgnoringCase(filename, &quot;np-mswmp.dll&quot;))
+                newWMPPluginPath = fullPath;
+
+        } while (FindNextFileW(hFind, &amp;findFileData) != 0);
+
+        FindClose(hFind);
+    }
+
+    addPluginPathsFromRegistry(HKEY_LOCAL_MACHINE, paths);
+    addPluginPathsFromRegistry(HKEY_CURRENT_USER, paths);
+
+    // If both the old and new WMP plugin are present in the plugins set, 
+    // we remove the old one so we don't end up choosing the old one.
+    if (!oldWMPPluginPath.isEmpty() &amp;&amp; !newWMPPluginPath.isEmpty())
+        paths.remove(oldWMPPluginPath);
+}
+
+static inline Vector&lt;int&gt; parseVersionString(const String&amp; versionString)
+{
+    Vector&lt;int&gt; version;
+
+    unsigned startPos = 0;
+    unsigned endPos;
+    
+    while (startPos &lt; versionString.length()) {
+        for (endPos = startPos; endPos &lt; versionString.length(); ++endPos)
+            if (versionString[endPos] == '.' || versionString[endPos] == '_')
+                break;
+
+        int versionComponent = versionString.substring(startPos, endPos - startPos).toInt();
+        version.append(versionComponent);
+
+        startPos = endPos + 1;
+    }
+
+    return version;
+}
+
+// This returns whether versionA is higher than versionB
+static inline bool compareVersions(const Vector&lt;int&gt;&amp; versionA, const Vector&lt;int&gt;&amp; versionB)
+{
+    for (unsigned i = 0; i &lt; versionA.size(); i++) {
+        if (i &gt;= versionB.size())
+            return true;
+
+        if (versionA[i] &gt; versionB[i])
+            return true;
+        else if (versionA[i] &lt; versionB[i])
+            return false;
+    }
+
+    // If we come here, the versions are either the same or versionB has an extra component, just return false
+    return false;
+}
+
+static inline void addMozillaPluginDirectories(Vector&lt;String&gt;&amp; directories)
+{
+    // Enumerate all Mozilla plugin directories in the registry
+    HKEY key;
+    LONG result;
+    
+    result = RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT(&quot;Software\\Mozilla&quot;), 0, KEY_READ, &amp;key);
+    if (result == ERROR_SUCCESS) {
+        WCHAR name[128];
+        FILETIME lastModified;
+
+        // Enumerate subkeys
+        for (int i = 0;; i++) {
+            DWORD nameLen = sizeof(name) / sizeof(WCHAR);
+            result = RegEnumKeyExW(key, i, name, &amp;nameLen, 0, 0, 0, &amp;lastModified);
+
+            if (result != ERROR_SUCCESS)
+                break;
+
+            String extensionsPath = String(name, nameLen) + &quot;\\Extensions&quot;;
+            HKEY extensionsKey;
+
+            // Try opening the key
+            result = RegOpenKeyEx(key, extensionsPath.charactersWithNullTermination().data(), 0, KEY_READ, &amp;extensionsKey);
+
+            if (result == ERROR_SUCCESS) {
+                // Now get the plugins directory
+                WCHAR pluginsDirectoryStr[_MAX_PATH];
+                DWORD pluginsDirectorySize = sizeof(pluginsDirectoryStr);
+                DWORD type;
+
+                result = RegQueryValueEx(extensionsKey, TEXT(&quot;Plugins&quot;), 0, &amp;type, (LPBYTE)&amp;pluginsDirectoryStr, &amp;pluginsDirectorySize);
+
+                if (result == ERROR_SUCCESS &amp;&amp; type == REG_SZ)
+                    directories.append(String(pluginsDirectoryStr, pluginsDirectorySize / sizeof(WCHAR) - 1));
+
+                RegCloseKey(extensionsKey);
+            }
+        }
+        
+        RegCloseKey(key);
+    }
+}
+
+static inline void addWindowsMediaPlayerPluginDirectory(Vector&lt;String&gt;&amp; directories)
+{
+    // The new WMP Firefox plugin is installed in \PFiles\Plugins if it can't find any Firefox installs
+    WCHAR pluginDirectoryStr[_MAX_PATH + 1];
+    DWORD pluginDirectorySize = ::ExpandEnvironmentStringsW(TEXT(&quot;%SYSTEMDRIVE%\\PFiles\\Plugins&quot;), pluginDirectoryStr, WTF_ARRAY_LENGTH(pluginDirectoryStr));
+
+    if (pluginDirectorySize &gt; 0 &amp;&amp; pluginDirectorySize &lt;= WTF_ARRAY_LENGTH(pluginDirectoryStr))
+        directories.append(String(pluginDirectoryStr, pluginDirectorySize - 1));
+
+    DWORD type;
+    WCHAR installationDirectoryStr[_MAX_PATH];
+    DWORD installationDirectorySize = sizeof(installationDirectoryStr);
+
+    HRESULT result = getRegistryValue(HKEY_LOCAL_MACHINE, L&quot;Software\\Microsoft\\MediaPlayer&quot;, L&quot;Installation Directory&quot;, &amp;type, &amp;installationDirectoryStr, &amp;installationDirectorySize);
+
+    if (result == ERROR_SUCCESS &amp;&amp; type == REG_SZ)
+        directories.append(String(installationDirectoryStr, installationDirectorySize / sizeof(WCHAR) - 1));
+}
+
+static inline void addAdobeAcrobatPluginDirectory(Vector&lt;String&gt;&amp; directories)
+{
+    HKEY key;
+    HRESULT result = RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT(&quot;Software\\Adobe\\Acrobat Reader&quot;), 0, KEY_READ, &amp;key);
+    if (result != ERROR_SUCCESS)
+        return;
+
+    WCHAR name[128];
+    FILETIME lastModified;
+
+    Vector&lt;int&gt; latestAcrobatVersion;
+    String latestAcrobatVersionString;
+
+    // Enumerate subkeys
+    for (int i = 0;; i++) {
+        DWORD nameLen = sizeof(name) / sizeof(WCHAR);
+        result = RegEnumKeyExW(key, i, name, &amp;nameLen, 0, 0, 0, &amp;lastModified);
+
+        if (result != ERROR_SUCCESS)
+            break;
+
+        Vector&lt;int&gt; acrobatVersion = parseVersionString(String(name, nameLen));
+        if (compareVersions(acrobatVersion, latestAcrobatVersion)) {
+            latestAcrobatVersion = acrobatVersion;
+            latestAcrobatVersionString = String(name, nameLen);
+        }
+    }
+
+    if (!latestAcrobatVersionString.isNull()) {
+        DWORD type;
+        WCHAR acrobatInstallPathStr[_MAX_PATH];
+        DWORD acrobatInstallPathSize = sizeof(acrobatInstallPathStr);
+
+        String acrobatPluginKeyPath = &quot;Software\\Adobe\\Acrobat Reader\\&quot; + latestAcrobatVersionString + &quot;\\InstallPath&quot;;
+        result = getRegistryValue(HKEY_LOCAL_MACHINE, acrobatPluginKeyPath.charactersWithNullTermination().data(), 0, &amp;type, acrobatInstallPathStr, &amp;acrobatInstallPathSize);
+
+        if (result == ERROR_SUCCESS) {
+            String acrobatPluginDirectory = String(acrobatInstallPathStr, acrobatInstallPathSize / sizeof(WCHAR) - 1) + &quot;\\browser&quot;;
+            directories.append(acrobatPluginDirectory);
+        }
+    }
+
+    RegCloseKey(key);
+}
+
+static inline void addJavaPluginDirectory(Vector&lt;String&gt;&amp; directories)
+{
+    HKEY key;
+    HRESULT result = RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT(&quot;Software\\JavaSoft\\Java Plug-in&quot;), 0, KEY_READ, &amp;key);
+    if (result != ERROR_SUCCESS)
+        return;
+
+    WCHAR name[128];
+    FILETIME lastModified;
+
+    Vector&lt;int&gt; latestJavaVersion;
+    String latestJavaVersionString;
+
+    // Enumerate subkeys
+    for (int i = 0;; i++) {
+        DWORD nameLen = sizeof(name) / sizeof(WCHAR);
+        result = RegEnumKeyExW(key, i, name, &amp;nameLen, 0, 0, 0, &amp;lastModified);
+
+        if (result != ERROR_SUCCESS)
+            break;
+
+        Vector&lt;int&gt; javaVersion = parseVersionString(String(name, nameLen));
+        if (compareVersions(javaVersion, latestJavaVersion)) {
+            latestJavaVersion = javaVersion;
+            latestJavaVersionString = String(name, nameLen);
+        }
+    }
+
+    if (!latestJavaVersionString.isEmpty()) {
+        DWORD type;
+        WCHAR javaInstallPathStr[_MAX_PATH];
+        DWORD javaInstallPathSize = sizeof(javaInstallPathStr);
+        DWORD useNewPluginValue;
+        DWORD useNewPluginSize;
+
+        String javaPluginKeyPath = &quot;Software\\JavaSoft\\Java Plug-in\\&quot; + latestJavaVersionString;
+        result = getRegistryValue(HKEY_LOCAL_MACHINE, javaPluginKeyPath.charactersWithNullTermination().data(), L&quot;UseNewJavaPlugin&quot;, &amp;type, &amp;useNewPluginValue, &amp;useNewPluginSize);
+
+        if (result == ERROR_SUCCESS &amp;&amp; useNewPluginValue == 1) {
+            result = getRegistryValue(HKEY_LOCAL_MACHINE, javaPluginKeyPath.charactersWithNullTermination().data(), L&quot;JavaHome&quot;, &amp;type, javaInstallPathStr, &amp;javaInstallPathSize);
+            if (result == ERROR_SUCCESS) {
+                String javaPluginDirectory = String(javaInstallPathStr, javaInstallPathSize / sizeof(WCHAR) - 1) + &quot;\\bin\\new_plugin&quot;;
+                directories.append(javaPluginDirectory);
+            }
+        }
+    }
+
+    RegCloseKey(key);
+}
+
+static inline String safariPluginsDirectory()
+{
+    WCHAR moduleFileNameStr[_MAX_PATH];
+    static String pluginsDirectory;
+    static bool cachedPluginDirectory = false;
+
+    if (!cachedPluginDirectory) {
+        cachedPluginDirectory = true;
+
+        int moduleFileNameLen = GetModuleFileName(0, moduleFileNameStr, _MAX_PATH);
+
+        if (!moduleFileNameLen || moduleFileNameLen == _MAX_PATH)
+            goto exit;
+
+        if (!PathRemoveFileSpec(moduleFileNameStr))
+            goto exit;
+
+        pluginsDirectory = String(moduleFileNameStr) + &quot;\\Plugins&quot;;
+    }
+exit:
+    return pluginsDirectory;
+}
+
+static inline void addMacromediaPluginDirectories(Vector&lt;String&gt;&amp; directories)
+{
+    WCHAR systemDirectoryStr[MAX_PATH];
+
+    if (!GetSystemDirectory(systemDirectoryStr, WTF_ARRAY_LENGTH(systemDirectoryStr)))
+        return;
+
+    WCHAR macromediaDirectoryStr[MAX_PATH];
+
+    PathCombine(macromediaDirectoryStr, systemDirectoryStr, TEXT(&quot;macromed\\Flash&quot;));
+    directories.append(macromediaDirectoryStr);
+
+    PathCombine(macromediaDirectoryStr, systemDirectoryStr, TEXT(&quot;macromed\\Shockwave 10&quot;));
+    directories.append(macromediaDirectoryStr);
+}
+
+Vector&lt;String&gt; PluginDatabase::defaultPluginDirectories()
+{
+    Vector&lt;String&gt; directories;
+    String ourDirectory = safariPluginsDirectory();
+
+    if (!ourDirectory.isNull())
+        directories.append(ourDirectory);
+    addAdobeAcrobatPluginDirectory(directories);
+    addMozillaPluginDirectories(directories);
+    addWindowsMediaPlayerPluginDirectory(directories);
+    addMacromediaPluginDirectories(directories);
+
+    return directories;
+}
+
+bool PluginDatabase::isPreferredPluginDirectory(const String&amp; directory)
+{
+    String ourDirectory = safariPluginsDirectory();
+
+    if (!ourDirectory.isNull() &amp;&amp; !directory.isNull())
+        return ourDirectory == directory;
+
+    return false;
+}
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebKitwinPluginsPluginDebugcppfromrev178217trunkSourceWebCorepluginsPluginDebugcpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit/win/Plugins/PluginDebug.cpp (from rev 178217, trunk/Source/WebCore/plugins/PluginDebug.cpp) (0 => 178219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/Plugins/PluginDebug.cpp                                (rev 0)
+++ trunk/Source/WebKit/win/Plugins/PluginDebug.cpp        2015-01-10 00:16:52 UTC (rev 178219)
</span><span class="lines">@@ -0,0 +1,179 @@
</span><ins>+/*
+ * Copyright (C) 2006, 2007 Apple Inc.  All rights reserved.
+ * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;PluginDebug.h&quot;
+
+#include &lt;wtf/text/WTFString.h&gt;
+
+#if !LOG_DISABLED
+
+namespace WebCore {
+
+static const char* const errorStrings[] = {
+    &quot;No errors occurred.&quot;, /* NPERR_NO_ERROR */
+    &quot;Error with no specific error code occurred.&quot;, /* NPERR_GENERIC_ERROR */
+    &quot;Invalid instance passed to the plug-in.&quot;, /* NPERR_INVALID_INSTANCE_ERROR */
+    &quot;Function table invalid.&quot;, /* NPERR_INVALID_FUNCTABLE_ERROR */
+    &quot;Loading of plug-in failed.&quot;, /* NPERR_MODULE_LOAD_FAILED_ERROR */
+    &quot;Memory allocation failed.&quot;, /* NPERR_OUT_OF_MEMORY_ERROR */
+    &quot;Plug-in missing or invalid.&quot;, /* NPERR_INVALID_PLUGIN_ERROR */
+    &quot;Plug-in directory missing or invalid.&quot;, /* NPERR_INVALID_PLUGIN_DIR_ERROR */
+    &quot;Versions of plug-in and Communicator do not match.&quot;, /* NPERR_INCOMPATIBLE_VERSION_ERROR */
+    &quot;Parameter missing or invalid.&quot;, /* NPERR_INVALID_PARAM */
+    &quot;URL missing or invalid.&quot;, /* NPERR_INVALID_URL */
+    &quot;File missing or invalid.&quot;, /* NPERR_FILE_NOT_FOUND */
+    &quot;Stream contains no data.&quot;, /* NPERR_NO_DATA */
+    &quot;Seekable stream expected.&quot;, /* NPERR_STREAM_NOT_SEEKABLE */
+    &quot;Unknown error code&quot;
+};
+
+#ifdef XP_MACOSX
+static const char* const drawingModels[] = {
+    &quot;NPDrawingModelQuickDraw&quot;,
+    &quot;NPDrawingModelCoreGraphics&quot;,
+    &quot;NPDrawingModelOpenGL&quot;,
+    &quot;NPDrawingModelCoreAnimation&quot;
+};
+
+static const char* const eventModels[] = {
+    &quot;NPEventModelCarbon&quot;,
+    &quot;NPEventModelCocoa&quot;
+};
+#endif //XP_MACOSX
+
+const char* prettyNameForNPError(NPError error)
+{
+    return errorStrings[error];
+}
+
+#ifdef XP_MACOSX
+const char* prettyNameForDrawingModel(NPDrawingModel drawingModel)
+{
+    return drawingModels[drawingModel];
+}
+
+const char* prettyNameForEventModel(NPEventModel eventModel)
+{
+    return eventModels[eventModel];
+}
+#endif //XP_MACOSX
+
+CString prettyNameForNPNVariable(NPNVariable variable)
+{
+    switch (variable) {
+    case NPNVxDisplay: return &quot;NPNVxDisplay&quot;;
+    case NPNVxtAppContext: return &quot;NPNVxtAppContext&quot;;
+    case NPNVnetscapeWindow: return &quot;NPNVnetscapeWindow&quot;;
+    case NPNVjavascriptEnabledBool: return &quot;NPNVjavascriptEnabledBool&quot;;
+    case NPNVasdEnabledBool: return &quot;NPNVasdEnabledBool&quot;;
+    case NPNVisOfflineBool: return &quot;NPNVisOfflineBool&quot;;
+
+    case NPNVserviceManager: return &quot;NPNVserviceManager (not supported)&quot;;
+    case NPNVDOMElement: return &quot;NPNVDOMElement (not supported)&quot;;
+    case NPNVDOMWindow: return &quot;NPNVDOMWindow (not supported)&quot;;
+    case NPNVToolkit: return &quot;NPNVToolkit (not supported)&quot;;
+    case NPNVSupportsXEmbedBool: return &quot;NPNVSupportsXEmbedBool (not supported)&quot;;
+
+    case NPNVWindowNPObject: return &quot;NPNVWindowNPObject&quot;;
+    case NPNVPluginElementNPObject: return &quot;NPNVPluginElementNPObject&quot;;
+    case NPNVSupportsWindowless: return &quot;NPNVSupportsWindowless&quot;;
+    case NPNVprivateModeBool: return &quot;NPNVprivateModeBool&quot;;
+
+#ifdef XP_MACOSX
+    case NPNVpluginDrawingModel: return &quot;NPNVpluginDrawingModel&quot;;
+#ifndef NP_NO_QUICKDRAW
+    case NPNVsupportsQuickDrawBool: return &quot;NPNVsupportsQuickDrawBool&quot;;
+#endif
+    case NPNVsupportsCoreGraphicsBool: return &quot;NPNVsupportsCoreGraphicsBool&quot;;
+    case NPNVsupportsOpenGLBool: return &quot;NPNVsupportsOpenGLBool&quot;;
+    case NPNVsupportsCoreAnimationBool: return &quot;NPNVsupportsCoreAnimationBool&quot;;
+#ifndef NP_NO_CARBON
+    case NPNVsupportsCarbonBool: return &quot;NPNVsupportsCarbonBool&quot;;
+#endif
+    case NPNVsupportsCocoaBool: return &quot;NPNVsupportsCocoaBool&quot;;
+#endif
+
+    default: return &quot;Unknown variable&quot;;
+    }
+}
+
+CString prettyNameForNPPVariable(NPPVariable variable, void* value)
+{
+    switch (variable) {
+    case NPPVpluginNameString: return &quot;NPPVpluginNameString&quot;;
+    case NPPVpluginDescriptionString: return &quot;NPPVpluginDescriptionString&quot;;
+    case NPPVpluginWindowBool: return &quot;NPPVpluginWindowBool&quot;;
+    case NPPVpluginTransparentBool: return &quot;NPPVpluginTransparentBool&quot;;
+
+    case NPPVjavaClass: return &quot;NPPVjavaClass (not supported)&quot;;
+    case NPPVpluginWindowSize: return &quot;NPPVpluginWindowSize (not supported)&quot;;
+    case NPPVpluginTimerInterval: return &quot;NPPVpluginTimerInterval (not supported)&quot;;
+    case NPPVpluginScriptableInstance: return &quot;NPPVpluginScriptableInstance (not supported)&quot;;
+    case NPPVpluginScriptableIID: return &quot;NPPVpluginScriptableIID (not supported)&quot;;
+    case NPPVjavascriptPushCallerBool: return &quot;NPPVjavascriptPushCallerBool (not supported)&quot;;
+    case NPPVpluginKeepLibraryInMemory: return &quot;NPPVpluginKeepLibraryInMemory (not supported)&quot;;
+    case NPPVpluginNeedsXEmbed: return &quot;NPPVpluginNeedsXEmbed (not supported)&quot;;
+
+    case NPPVpluginScriptableNPObject: return &quot;NPPVpluginScriptableNPObject&quot;;
+
+    case NPPVformValue: return &quot;NPPVformValue (not supported)&quot;;
+    case NPPVpluginUrlRequestsDisplayedBool: return &quot;NPPVpluginUrlRequestsDisplayedBool (not supported)&quot;;
+
+    case NPPVpluginWantsAllNetworkStreams: return &quot;NPPVpluginWantsAllNetworkStreams&quot;;
+    case NPPVpluginCancelSrcStream: return &quot;NPPVpluginCancelSrcStream&quot;;
+
+#ifdef XP_MACOSX
+    case NPPVpluginDrawingModel: {
+        String result(&quot;NPPVpluginDrawingModel, &quot;);
+        result.append(prettyNameForDrawingModel(NPDrawingModel(uintptr_t(value))));
+        return result.latin1();
+    }
+    case NPPVpluginEventModel: {
+        String result(&quot;NPPVpluginEventModel, &quot;);
+        result.append(prettyNameForEventModel(NPEventModel(uintptr_t(value))));
+        return result.latin1();
+    }
+    case NPPVpluginCoreAnimationLayer: return &quot;NPPVpluginCoreAnimationLayer&quot;;
+#else
+    UNUSED_PARAM(value);
+#endif
+
+    default: return &quot;Unknown variable&quot;;
+    }
+}
+
+CString prettyNameForNPNURLVariable(NPNURLVariable variable)
+{
+    switch (variable) {
+    case NPNURLVCookie: return &quot;NPNURLVCookie&quot;;
+    case NPNURLVProxy: return &quot;NPNURLVProxy&quot;;
+    default: return &quot;Unknown variable&quot;;
+    }
+}
+} // namespace WebCore
+
+#endif // !LOG_DISABLED
</ins></span></pre></div>
<a id="trunkSourceWebKitwinPluginsPluginDebughfromrev178217trunkSourceWebCorepluginsPluginDebugh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit/win/Plugins/PluginDebug.h (from rev 178217, trunk/Source/WebCore/plugins/PluginDebug.h) (0 => 178219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/Plugins/PluginDebug.h                                (rev 0)
+++ trunk/Source/WebKit/win/Plugins/PluginDebug.h        2015-01-10 00:16:52 UTC (rev 178219)
</span><span class="lines">@@ -0,0 +1,55 @@
</span><ins>+/*
+ * Copyright (C) 2006, 2007 Apple Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#ifndef PluginDebug_h
+#define PluginDebug_h
+
+#include &quot;Logging.h&quot;
+#include &quot;npruntime_internal.h&quot;
+#include &lt;wtf/text/CString.h&gt;
+
+#define LOG_NPERROR(err) if (err != NPERR_NO_ERROR) LOG_VERBOSE(Plugins, &quot;%s\n&quot;, prettyNameForNPError(err))
+#define LOG_PLUGIN_NET_ERROR() LOG_VERBOSE(Plugins, &quot;Stream failed due to problems with network, disk I/O, lack of memory, or other problems.\n&quot;)
+
+#if !LOG_DISABLED
+
+namespace WebCore {
+
+const char* prettyNameForNPError(NPError error);
+
+CString prettyNameForNPNVariable(NPNVariable variable);
+CString prettyNameForNPPVariable(NPPVariable variable, void* value);
+CString prettyNameForNPNURLVariable(NPNURLVariable variable);
+
+#ifdef XP_MACOSX
+const char* prettyNameForDrawingModel(NPDrawingModel drawingModel);
+const char* prettyNameForEventModel(NPEventModel eventModel);
+#endif
+
+} // namespace WebCore
+
+#endif // !LOG_DISABLED
+
+#endif // PluginDebug_h
</ins></span></pre></div>
<a id="trunkSourceWebKitwinPluginsPluginMessageThrottlerWincppfromrev178217trunkSourceWebCorepluginswinPluginMessageThrottlerWincpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit/win/Plugins/PluginMessageThrottlerWin.cpp (from rev 178217, trunk/Source/WebCore/plugins/win/PluginMessageThrottlerWin.cpp) (0 => 178219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/Plugins/PluginMessageThrottlerWin.cpp                                (rev 0)
+++ trunk/Source/WebKit/win/Plugins/PluginMessageThrottlerWin.cpp        2015-01-10 00:16:52 UTC (rev 178219)
</span><span class="lines">@@ -0,0 +1,151 @@
</span><ins>+/*
+ * Copyright (C) 2006, 2007, 2008 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2008 Collabora, Ltd. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;PluginMessageThrottlerWin.h&quot;
+
+#include &quot;PluginView.h&quot;
+#include &lt;wtf/ASCIICType.h&gt;
+#include &lt;wtf/CurrentTime.h&gt;
+
+using namespace WTF;
+
+namespace WebCore {
+
+// Set a timer to make sure we process any queued messages at least every 16ms.
+// This value allows Flash 60 messages/second, which should be enough for video
+// playback, and also gets us over the limit for kicking into high-resolution
+// timer mode (see SharedTimerWin.cpp).
+static const double MessageThrottleTimeInterval = 0.016;
+
+// During a continuous stream of messages, process one every 5ms.
+static const double MessageDirectProcessingInterval = 0.005;
+
+PluginMessageThrottlerWin::PluginMessageThrottlerWin(PluginView* pluginView)
+    : m_pluginView(pluginView)
+    , m_back(0)
+    , m_front(0)
+    , m_messageThrottleTimer(*this, &amp;PluginMessageThrottlerWin::messageThrottleTimerFired)
+    , m_lastMessageTime(0)
+{
+    // Initialize the free list with our inline messages
+    for (unsigned i = 0; i &lt; NumInlineMessages - 1; i++)
+        m_inlineMessages[i].next = &amp;m_inlineMessages[i + 1];
+    m_inlineMessages[NumInlineMessages - 1].next = 0;
+    m_freeInlineMessages = &amp;m_inlineMessages[0];
+}
+
+PluginMessageThrottlerWin::~PluginMessageThrottlerWin()
+{
+    PluginMessage* next;
+
+    for (PluginMessage* message = m_front; message; message = next) {
+        next = message-&gt;next;
+        freeMessage(message);
+    }
+}
+
+void PluginMessageThrottlerWin::appendMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+    PluginMessage* message = allocateMessage();
+
+    message-&gt;hWnd = hWnd;
+    message-&gt;msg = msg;
+    message-&gt;wParam = wParam;
+    message-&gt;lParam = lParam;
+    message-&gt;next = 0;
+
+    if (m_back)
+        m_back-&gt;next = message;
+    m_back = message;
+    if (!m_front)
+        m_front = message;
+
+    // If it has been more than MessageDirectProcessingInterval between throttled messages,
+    // go ahead and process a message directly.
+    double currentTime = monotonicallyIncreasingTime();
+    if (currentTime - m_lastMessageTime &gt; MessageDirectProcessingInterval) {
+        processQueuedMessage();
+        m_lastMessageTime = currentTime;
+        if (!m_front)
+            return;
+    }
+
+    if (!m_messageThrottleTimer.isActive())
+        m_messageThrottleTimer.startOneShot(MessageThrottleTimeInterval);
+}
+
+void PluginMessageThrottlerWin::processQueuedMessage()
+{
+    PluginMessage* message = m_front;
+    m_front = m_front-&gt;next;
+    if (message == m_back)
+        m_back = 0;
+
+    // Protect the PluginView from destruction while calling its window proc.
+    // &lt;rdar://problem/6930280&gt;
+    RefPtr&lt;PluginView&gt; protect(m_pluginView);
+    ::CallWindowProc(m_pluginView-&gt;pluginWndProc(), message-&gt;hWnd, message-&gt;msg, message-&gt;wParam, message-&gt;lParam);
+
+    freeMessage(message);
+}
+
+void PluginMessageThrottlerWin::messageThrottleTimerFired()
+{
+    processQueuedMessage();
+
+    if (m_front)
+        m_messageThrottleTimer.startOneShot(MessageThrottleTimeInterval);
+}
+
+PluginMessage* PluginMessageThrottlerWin::allocateMessage()
+{
+    PluginMessage *message;
+
+    if (m_freeInlineMessages) {
+        message = m_freeInlineMessages;
+        m_freeInlineMessages = message-&gt;next;
+    } else
+        message = new PluginMessage;
+
+    return message;
+}
+
+bool PluginMessageThrottlerWin::isInlineMessage(PluginMessage* message)
+{
+    return message &gt;= &amp;m_inlineMessages[0] &amp;&amp; message &lt;= &amp;m_inlineMessages[NumInlineMessages - 1];
+}
+
+void PluginMessageThrottlerWin::freeMessage(PluginMessage* message)
+{
+    if (isInlineMessage(message)) {
+        message-&gt;next = m_freeInlineMessages;
+        m_freeInlineMessages = message;
+    } else
+        delete message;
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebKitwinPluginsPluginMessageThrottlerWinhfromrev178217trunkSourceWebCorepluginswinPluginMessageThrottlerWinh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit/win/Plugins/PluginMessageThrottlerWin.h (from rev 178217, trunk/Source/WebCore/plugins/win/PluginMessageThrottlerWin.h) (0 => 178219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/Plugins/PluginMessageThrottlerWin.h                                (rev 0)
+++ trunk/Source/WebKit/win/Plugins/PluginMessageThrottlerWin.h        2015-01-10 00:16:52 UTC (rev 178219)
</span><span class="lines">@@ -0,0 +1,74 @@
</span><ins>+/*
+ * Copyright (C) 2006, 2007, 2008 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2008 Collabora, Ltd. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef PluginMessageThrottlerWin_h
+#define PluginMessageThrottlerWin_h
+
+#include &quot;Timer.h&quot;
+
+#include &lt;windows.h&gt;
+
+namespace WebCore {
+    class PluginView;
+
+    struct PluginMessage {
+        HWND hWnd;
+        UINT msg;
+        WPARAM wParam;
+        LPARAM lParam;
+
+        struct PluginMessage* next;
+    };
+
+    class PluginMessageThrottlerWin {
+    public:
+        PluginMessageThrottlerWin(PluginView*);
+        ~PluginMessageThrottlerWin();
+
+        void appendMessage(HWND, UINT msg, WPARAM, LPARAM);
+
+    private:
+        void processQueuedMessage();
+        void messageThrottleTimerFired();
+        PluginMessage* allocateMessage();
+        bool isInlineMessage(PluginMessage* message);
+        void freeMessage(PluginMessage* message);
+
+        PluginView* m_pluginView;
+        PluginMessage* m_back;
+        PluginMessage* m_front;
+
+        static const int NumInlineMessages = 4;
+        PluginMessage m_inlineMessages[NumInlineMessages];
+        PluginMessage* m_freeInlineMessages;
+
+        Timer m_messageThrottleTimer;
+        double m_lastMessageTime;
+    };
+
+} // namespace WebCore
+
+#endif // PluginMessageThrottlerWin_h
</ins></span></pre></div>
<a id="trunkSourceWebKitwinPluginsPluginPackagecppfromrev178217trunkSourceWebCorepluginsPluginPackagecpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit/win/Plugins/PluginPackage.cpp (from rev 178217, trunk/Source/WebCore/plugins/PluginPackage.cpp) (0 => 178219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/Plugins/PluginPackage.cpp                                (rev 0)
+++ trunk/Source/WebKit/win/Plugins/PluginPackage.cpp        2015-01-10 00:16:52 UTC (rev 178219)
</span><span class="lines">@@ -0,0 +1,478 @@
</span><ins>+/*
+ * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2008 Collabora Ltd.  All rights reserved.
+ * Copyright (C) 2009 Holger Hans Peter Freyther
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;PluginPackage.h&quot;
+
+#include &quot;PluginDatabase.h&quot;
+#include &quot;PluginDebug.h&quot;
+#include &quot;PluginView.h&quot;
+#include &lt;JavaScriptCore/Completion.h&gt;
+#include &lt;JavaScriptCore/JSGlobalObject.h&gt;
+#include &lt;WebCore/IdentifierRep.h&gt;
+#include &lt;WebCore/MIMETypeRegistry.h&gt;
+#include &lt;WebCore/NP_jsobject.h&gt;
+#include &lt;WebCore/Timer.h&gt;
+#include &lt;WebCore/c_utility.h&gt;
+#include &lt;WebCore/npruntime_impl.h&gt;
+#include &lt;WebCore/runtime_root.h&gt;
+#include &lt;string.h&gt;
+#include &lt;wtf/text/CString.h&gt;
+
+namespace WebCore {
+
+PluginPackage::~PluginPackage()
+{
+    // This destructor gets called during refresh() if PluginDatabase's
+    // PluginSet hash is already populated, as it removes items from
+    // the hash table. Calling the destructor on a loaded plug-in of
+    // course would cause a crash, so we check to call unload before we
+    // ASSERT.
+    // FIXME: There is probably a better way to fix this.
+    if (!m_loadCount)
+        unloadWithoutShutdown();
+    else
+        unload();
+
+    ASSERT(!m_isLoaded);
+}
+
+void PluginPackage::freeLibrarySoon()
+{
+    ASSERT(!m_freeLibraryTimer.isActive());
+    ASSERT(m_module);
+    ASSERT(!m_loadCount);
+
+    m_freeLibraryTimer.startOneShot(0);
+}
+
+void PluginPackage::freeLibraryTimerFired()
+{
+    ASSERT(m_module);
+    // Do nothing if the module got loaded again meanwhile
+    if (!m_loadCount) {
+        unloadModule(m_module);
+        m_module = 0;
+    }
+}
+
+
+int PluginPackage::compare(const PluginPackage&amp; compareTo) const
+{
+    // Sort plug-ins that allow multiple instances first.
+    bool AallowsMultipleInstances = !quirks().contains(PluginQuirkDontAllowMultipleInstances);
+    bool BallowsMultipleInstances = !compareTo.quirks().contains(PluginQuirkDontAllowMultipleInstances);
+    if (AallowsMultipleInstances != BallowsMultipleInstances)
+        return AallowsMultipleInstances ? -1 : 1;
+
+    // Sort plug-ins in a preferred path first.
+    bool AisInPreferredDirectory = PluginDatabase::isPreferredPluginDirectory(parentDirectory());
+    bool BisInPreferredDirectory = PluginDatabase::isPreferredPluginDirectory(compareTo.parentDirectory());
+    if (AisInPreferredDirectory != BisInPreferredDirectory)
+        return AisInPreferredDirectory ? -1 : 1;
+
+    int diff = strcmp(name().utf8().data(), compareTo.name().utf8().data());
+    if (diff)
+        return diff;
+
+    diff = compareFileVersion(compareTo.version());
+    if (diff)
+        return diff;
+
+    return strcmp(parentDirectory().utf8().data(), compareTo.parentDirectory().utf8().data());
+}
+
+PluginPackage::PluginPackage(const String&amp; path, const time_t&amp; lastModified)
+    : m_isEnabled(true)
+    , m_isLoaded(false)
+    , m_loadCount(0)
+    , m_path(path)
+    , m_moduleVersion(0)
+    , m_module(0)
+    , m_lastModified(lastModified)
+    , m_freeLibraryTimer(*this, &amp;PluginPackage::freeLibraryTimerFired)
+#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE)
+    , m_infoIsFromCache(true)
+#endif
+{
+    m_fileName = pathGetFileName(m_path);
+    m_parentDirectory = m_path.left(m_path.length() - m_fileName.length() - 1);
+}
+
+void PluginPackage::unload()
+{
+    if (!m_isLoaded)
+        return;
+
+    if (--m_loadCount &gt; 0)
+        return;
+
+#if ENABLE(NETSCAPE_PLUGIN_API)
+    m_NPP_Shutdown();
+#endif
+
+    unloadWithoutShutdown();
+}
+
+void PluginPackage::unloadWithoutShutdown()
+{
+    if (!m_isLoaded)
+        return;
+
+    ASSERT(!m_loadCount);
+    ASSERT(m_module);
+
+    // &lt;rdar://5530519&gt;: Crash when closing tab with pdf file (Reader 7 only)
+    // If the plugin has subclassed its parent window, as with Reader 7, we may have
+    // gotten here by way of the plugin's internal window proc forwarding a message to our
+    // original window proc. If we free the plugin library from here, we will jump back
+    // to code we just freed when we return, so delay calling FreeLibrary at least until
+    // the next message loop
+    freeLibrarySoon();
+
+    m_isLoaded = false;
+}
+
+void PluginPackage::setEnabled(bool enabled)
+{
+    m_isEnabled = enabled;
+}
+
+PassRefPtr&lt;PluginPackage&gt; PluginPackage::createPackage(const String&amp; path, const time_t&amp; lastModified)
+{
+    RefPtr&lt;PluginPackage&gt; package = adoptRef(new PluginPackage(path, lastModified));
+
+    if (!package-&gt;fetchInfo())
+        return 0;
+
+    return package.release();
+}
+
+#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE)
+PassRefPtr&lt;PluginPackage&gt; PluginPackage::createPackageFromCache(const String&amp; path, const time_t&amp; lastModified, const String&amp; name, const String&amp; description, const String&amp; mimeDescription)
+{
+    RefPtr&lt;PluginPackage&gt; package = adoptRef(new PluginPackage(path, lastModified));
+    package-&gt;m_name = name;
+    package-&gt;m_description = description;
+    package-&gt;determineModuleVersionFromDescription();
+    package-&gt;setMIMEDescription(mimeDescription);
+    package-&gt;m_infoIsFromCache = true;
+    return package.release();
+}
+#endif
+
+#if defined(XP_UNIX)
+void PluginPackage::determineQuirks(const String&amp; mimeType)
+{
+    if (MIMETypeRegistry::isJavaAppletMIMEType(mimeType)) {
+        // Because a single process cannot create multiple VMs, and we cannot reliably unload a
+        // Java VM, we cannot unload the Java plugin, or we'll lose reference to our only VM
+        m_quirks.add(PluginQuirkDontUnloadPlugin);
+
+        // Setting the window region to an empty region causes bad scrolling repaint problems
+        // with the Java plug-in.
+        m_quirks.add(PluginQuirkDontClipToZeroRectWhenScrolling);
+        return;
+    }
+
+    if (mimeType == &quot;application/x-shockwave-flash&quot;) {
+        static const PlatformModuleVersion flashTenVersion(0x0a000000);
+
+        if (compareFileVersion(flashTenVersion) &gt;= 0) {
+            // Flash 10.0 b218 doesn't like having a NULL window handle
+            m_quirks.add(PluginQuirkDontSetNullWindowHandleOnDestroy);
+        } else {
+            // Flash 9 and older requests windowless plugins if we return a mozilla user agent
+            m_quirks.add(PluginQuirkWantsMozillaUserAgent);
+        }
+
+#if CPU(X86_64)
+        // 64-bit Flash freezes if right-click is sent in windowless mode
+        m_quirks.add(PluginQuirkIgnoreRightClickInWindowlessMode);
+#endif
+
+        m_quirks.add(PluginQuirkRequiresDefaultScreenDepth);
+        m_quirks.add(PluginQuirkThrottleInvalidate);
+        m_quirks.add(PluginQuirkThrottleWMUserPlusOneMessages);
+        m_quirks.add(PluginQuirkFlashURLNotifyBug);
+    }
+}
+#endif
+
+#if !OS(WINDOWS)
+void PluginPackage::determineModuleVersionFromDescription()
+{
+    // It's a bit lame to detect the plugin version by parsing it
+    // from the plugin description string, but it doesn't seem that
+    // version information is available in any standardized way at
+    // the module level, like in Windows
+
+    if (m_description.isEmpty())
+        return;
+
+    if (m_description.startsWith(&quot;Shockwave Flash&quot;) &amp;&amp; m_description.length() &gt;= 19) {
+        // The flash version as a PlatformModuleVersion differs on Unix from Windows
+        // since the revision can be larger than a 8 bits, so we allow it 16 here and
+        // push the major/minor up 8 bits. Thus on Unix, Flash's version may be
+        // 0x0a000000 instead of 0x000a0000.
+
+        Vector&lt;String&gt; versionParts;
+        m_description.substring(16).split(' ', /*allowEmptyEntries =*/ false, versionParts);
+        if (versionParts.isEmpty())
+            return;
+
+        if (versionParts.size() &gt;= 1) {
+            Vector&lt;String&gt; majorMinorParts;
+            versionParts[0].split('.', majorMinorParts);
+            if (majorMinorParts.size() &gt;= 1) {
+                bool converted = false;
+                unsigned major = majorMinorParts[0].toUInt(&amp;converted);
+                if (converted)
+                    m_moduleVersion = (major &amp; 0xff) &lt;&lt; 24;
+            }
+            if (majorMinorParts.size() == 2) {
+                bool converted = false;
+                unsigned minor = majorMinorParts[1].toUInt(&amp;converted);
+                if (converted)
+                    m_moduleVersion |= (minor &amp; 0xff) &lt;&lt; 16;
+            }
+        }
+
+        if (versionParts.size() &gt;= 2) {
+            String revision = versionParts[1];
+            if (revision.length() &gt; 1 &amp;&amp; (revision[0] == 'r' || revision[0] == 'b')) {
+                revision.remove(0, 1);
+                m_moduleVersion |= revision.toInt() &amp; 0xffff;
+            }
+        }
+    }
+}
+#endif
+
+#if ENABLE(NETSCAPE_PLUGIN_API)
+static void getListFromVariantArgs(JSC::ExecState* exec, const NPVariant* args, unsigned argCount, JSC::Bindings::RootObject* rootObject, JSC::MarkedArgumentBuffer&amp; aList)
+{
+    for (unsigned i = 0; i &lt; argCount; ++i)
+        aList.append(JSC::Bindings::convertNPVariantToValue(exec, &amp;args[i], rootObject));
+}
+
+static inline JSC::SourceCode makeSource(const String&amp; source, const String&amp; url = String(), const TextPosition&amp; startPosition = TextPosition::minimumPosition())
+{
+    return JSC::SourceCode(JSC::StringSourceProvider::create(source, url, startPosition), startPosition.m_line.oneBasedInt(), startPosition.m_column.oneBasedInt());
+}
+
+static bool NPN_Evaluate(NPP instance, NPObject* o, NPString* s, NPVariant* variant)
+{
+    if (o-&gt;_class == NPScriptObjectClass) {
+        JavaScriptObject* obj = reinterpret_cast&lt;JavaScriptObject*&gt;(o);
+
+        JSC::Bindings::RootObject* rootObject = obj-&gt;rootObject;
+        if (!rootObject || !rootObject-&gt;isValid())
+            return false;
+
+        // There is a crash in Flash when evaluating a script that destroys the
+        // PluginView, so we destroy it asynchronously.
+        PluginView::keepAlive(instance);
+
+        JSC::ExecState* exec = rootObject-&gt;globalObject()-&gt;globalExec();
+        JSC::JSLockHolder lock(exec);
+        String scriptString = JSC::Bindings::convertNPStringToUTF16(s);
+
+        JSC::JSValue returnValue = JSC::evaluate(rootObject-&gt;globalObject()-&gt;globalExec(), makeSource(scriptString), JSC::JSValue());
+
+        JSC::Bindings::convertValueToNPVariant(exec, returnValue, variant);
+        exec-&gt;clearException();
+        return true;
+    }
+
+    VOID_TO_NPVARIANT(*variant);
+    return false;
+}
+
+static bool NPN_Invoke(NPP npp, NPObject* o, NPIdentifier methodName, const NPVariant* args, uint32_t argCount, NPVariant* result)
+{
+    if (o-&gt;_class == NPScriptObjectClass) {
+        JavaScriptObject* obj = reinterpret_cast&lt;JavaScriptObject*&gt;(o);
+
+        IdentifierRep* i = static_cast&lt;IdentifierRep*&gt;(methodName);
+        if (!i-&gt;isString())
+            return false;
+
+        // Special case the &quot;eval&quot; method.
+        if (methodName == _NPN_GetStringIdentifier(&quot;eval&quot;)) {
+            if (argCount != 1)
+                return false;
+            if (args[0].type != NPVariantType_String)
+                return false;
+            return WebCore::NPN_Evaluate(npp, o, const_cast&lt;NPString*&gt;(&amp;args[0].value.stringValue), result);
+        }
+
+        // Look up the function object.
+        JSC::Bindings::RootObject* rootObject = obj-&gt;rootObject;
+        if (!rootObject || !rootObject-&gt;isValid())
+            return false;
+        JSC::ExecState* exec = rootObject-&gt;globalObject()-&gt;globalExec();
+        JSC::JSLockHolder lock(exec);
+        JSC::JSValue function = obj-&gt;imp-&gt;get(exec, JSC::Bindings::identifierFromNPIdentifier(exec, i-&gt;string()));
+        JSC::CallData callData;
+        JSC::CallType callType = getCallData(function, callData);
+        if (callType == JSC::CallTypeNone)
+            return false;
+
+        // Call the function object.
+        JSC::MarkedArgumentBuffer argList;
+        getListFromVariantArgs(exec, args, argCount, rootObject, argList);
+        JSC::JSValue resultV = JSC::call(exec, function, callType, callData, obj-&gt;imp, argList);
+
+        // Convert and return the result of the function call.
+        JSC::Bindings::convertValueToNPVariant(exec, resultV, result);
+        exec-&gt;clearException();
+        return true;
+    }
+
+    if (o-&gt;_class-&gt;invoke)
+        return o-&gt;_class-&gt;invoke(o, methodName, args, argCount, result);
+
+    VOID_TO_NPVARIANT(*result);
+    return true;
+}
+
+void PluginPackage::initializeBrowserFuncs()
+{
+    memset(&amp;m_browserFuncs, 0, sizeof(m_browserFuncs));
+    m_browserFuncs.size = sizeof(m_browserFuncs);
+    m_browserFuncs.version = NPVersion();
+
+    m_browserFuncs.geturl = NPN_GetURL;
+    m_browserFuncs.posturl = NPN_PostURL;
+    m_browserFuncs.requestread = NPN_RequestRead;
+    m_browserFuncs.newstream = NPN_NewStream;
+    m_browserFuncs.write = NPN_Write;
+    m_browserFuncs.destroystream = NPN_DestroyStream;
+    m_browserFuncs.status = NPN_Status;
+    m_browserFuncs.uagent = NPN_UserAgent;
+    m_browserFuncs.memalloc = NPN_MemAlloc;
+    m_browserFuncs.memfree = NPN_MemFree;
+    m_browserFuncs.memflush = NPN_MemFlush;
+    m_browserFuncs.reloadplugins = NPN_ReloadPlugins;
+    m_browserFuncs.geturlnotify = NPN_GetURLNotify;
+    m_browserFuncs.posturlnotify = NPN_PostURLNotify;
+    m_browserFuncs.getvalue = NPN_GetValue;
+    m_browserFuncs.setvalue = NPN_SetValue;
+    m_browserFuncs.invalidaterect = NPN_InvalidateRect;
+    m_browserFuncs.invalidateregion = NPN_InvalidateRegion;
+    m_browserFuncs.forceredraw = NPN_ForceRedraw;
+    m_browserFuncs.getJavaEnv = NPN_GetJavaEnv;
+    m_browserFuncs.getJavaPeer = NPN_GetJavaPeer;
+    m_browserFuncs.pushpopupsenabledstate = NPN_PushPopupsEnabledState;
+    m_browserFuncs.poppopupsenabledstate = NPN_PopPopupsEnabledState;
+    m_browserFuncs.pluginthreadasynccall = NPN_PluginThreadAsyncCall;
+
+    m_browserFuncs.releasevariantvalue = _NPN_ReleaseVariantValue;
+    m_browserFuncs.getstringidentifier = _NPN_GetStringIdentifier;
+    m_browserFuncs.getstringidentifiers = _NPN_GetStringIdentifiers;
+    m_browserFuncs.getintidentifier = _NPN_GetIntIdentifier;
+    m_browserFuncs.identifierisstring = _NPN_IdentifierIsString;
+    m_browserFuncs.utf8fromidentifier = _NPN_UTF8FromIdentifier;
+    m_browserFuncs.intfromidentifier = _NPN_IntFromIdentifier;
+    m_browserFuncs.createobject = _NPN_CreateObject;
+    m_browserFuncs.retainobject = _NPN_RetainObject;
+    m_browserFuncs.releaseobject = _NPN_ReleaseObject;
+    m_browserFuncs.invoke = WebCore::NPN_Invoke;
+    m_browserFuncs.invokeDefault = _NPN_InvokeDefault;
+    m_browserFuncs.evaluate = WebCore::NPN_Evaluate;
+    m_browserFuncs.getproperty = _NPN_GetProperty;
+    m_browserFuncs.setproperty = _NPN_SetProperty;
+    m_browserFuncs.removeproperty = _NPN_RemoveProperty;
+    m_browserFuncs.hasproperty = _NPN_HasProperty;
+    m_browserFuncs.hasmethod = _NPN_HasMethod;
+    m_browserFuncs.setexception = _NPN_SetException;
+    m_browserFuncs.enumerate = _NPN_Enumerate;
+    m_browserFuncs.construct = _NPN_Construct;
+    m_browserFuncs.getvalueforurl = NPN_GetValueForURL;
+    m_browserFuncs.setvalueforurl = NPN_SetValueForURL;
+    m_browserFuncs.getauthenticationinfo = NPN_GetAuthenticationInfo;
+
+    m_browserFuncs.popupcontextmenu = NPN_PopUpContextMenu;
+}
+#endif // ENABLE(NETSCAPE_PLUGIN_API)
+
+#if ENABLE(PLUGIN_PACKAGE_SIMPLE_HASH)
+unsigned PluginPackage::hash() const
+{
+    struct HashCodes {
+        unsigned hash;
+        time_t modifiedDate;
+    } hashCodes;
+
+    hashCodes.hash = m_path.impl()-&gt;hash();
+    hashCodes.modifiedDate = m_lastModified;
+
+    return StringHasher::hashMemory&lt;sizeof(hashCodes)&gt;(&amp;hashCodes);
+}
+
+bool PluginPackage::equal(const PluginPackage&amp; a, const PluginPackage&amp; b)
+{
+    return a.m_description == b.m_description;
+}
+#endif
+
+int PluginPackage::compareFileVersion(const PlatformModuleVersion&amp; compareVersion) const
+{
+    // return -1, 0, or 1 if plug-in version is less than, equal to, or greater than
+    // the passed version
+
+#if OS(WINDOWS)
+    if (m_moduleVersion.mostSig != compareVersion.mostSig)
+        return m_moduleVersion.mostSig &gt; compareVersion.mostSig ? 1 : -1;
+    if (m_moduleVersion.leastSig != compareVersion.leastSig)
+        return m_moduleVersion.leastSig &gt; compareVersion.leastSig ? 1 : -1;
+#else    
+    if (m_moduleVersion != compareVersion)
+        return m_moduleVersion &gt; compareVersion ? 1 : -1;
+#endif
+
+    return 0;
+}
+
+#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE)
+bool PluginPackage::ensurePluginLoaded()
+{
+    if (!m_infoIsFromCache)
+        return m_isLoaded;
+
+    m_quirks = PluginQuirkSet();
+    m_name = String();
+    m_description = String();
+    m_fullMIMEDescription = String();
+    m_moduleVersion = 0;
+
+    return fetchInfo();
+}
+#endif
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebKitwinPluginsPluginPackagehfromrev178217trunkSourceWebCorepluginsPluginPackageh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit/win/Plugins/PluginPackage.h (from rev 178217, trunk/Source/WebCore/plugins/PluginPackage.h) (0 => 178219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/Plugins/PluginPackage.h                                (rev 0)
+++ trunk/Source/WebKit/win/Plugins/PluginPackage.h        2015-01-10 00:16:52 UTC (rev 178219)
</span><span class="lines">@@ -0,0 +1,149 @@
</span><ins>+/*
+ * Copyright (C) 2006, 2007 Apple Inc.  All rights reserved.
+ * Copyright (C) 2008 Collabora, Ltd.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef PluginPackage_h
+#define PluginPackage_h
+
+#include &quot;FileSystem.h&quot;
+#include &quot;PluginQuirkSet.h&quot;
+#include &quot;Timer.h&quot;
+#if ENABLE(NETSCAPE_PLUGIN_API)
+#include &quot;npruntime_internal.h&quot;
+#endif
+#include &lt;wtf/HashMap.h&gt;
+#include &lt;wtf/RefCounted.h&gt;
+#include &lt;wtf/text/StringHash.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace WebCore {
+    typedef HashMap&lt;String, String&gt; MIMEToDescriptionsMap;
+    typedef HashMap&lt;String, Vector&lt;String&gt; &gt; MIMEToExtensionsMap;
+
+    class PluginPackage : public RefCounted&lt;PluginPackage&gt; {
+    public:
+        ~PluginPackage();
+        static PassRefPtr&lt;PluginPackage&gt; createPackage(const String&amp; path, const time_t&amp; lastModified);
+#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE)
+        static PassRefPtr&lt;PluginPackage&gt; createPackageFromCache(const String&amp; path, const time_t&amp; lastModified, const String&amp; name, const String&amp; description, const String&amp; mimeDescription);
+#endif
+
+        const String&amp; name() const { return m_name; }
+        const String&amp; description() const { return m_description; }
+        const String&amp; path() const { return m_path; }
+        const String&amp; fileName() const { return m_fileName; }
+        const String&amp; parentDirectory() const { return m_parentDirectory; }
+        PlatformModule module() const { return m_module; }
+        uint16_t NPVersion() const;
+        time_t lastModified() const { return m_lastModified; }
+
+        const MIMEToDescriptionsMap&amp; mimeToDescriptions() const { return m_mimeToDescriptions; }
+        const MIMEToExtensionsMap&amp; mimeToExtensions() const { return m_mimeToExtensions; }
+
+        unsigned hash() const;
+        static bool equal(const PluginPackage&amp; a, const PluginPackage&amp; b);
+
+        bool load();
+        void unload();
+        void unloadWithoutShutdown();
+
+        bool isEnabled() const { return m_isEnabled; }
+        void setEnabled(bool);
+
+#if ENABLE(NETSCAPE_PLUGIN_API)
+        const NPPluginFuncs* pluginFuncs() const { return &amp;m_pluginFuncs; }
+#endif
+        int compareFileVersion(const PlatformModuleVersion&amp;) const;
+        int compare(const PluginPackage&amp;) const;
+        PluginQuirkSet quirks() const { return m_quirks; }
+        const PlatformModuleVersion&amp; version() const { return m_moduleVersion; }
+
+#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE)
+        bool ensurePluginLoaded();
+        void setMIMEDescription(const String&amp; mimeDescription);
+        String fullMIMEDescription() const { return m_fullMIMEDescription;}
+#endif
+    private:
+        PluginPackage(const String&amp; path, const time_t&amp; lastModified);
+
+        bool fetchInfo();
+        bool isPluginBlacklisted();
+        void determineQuirks(const String&amp; mimeType);
+
+        void determineModuleVersionFromDescription();
+        void initializeBrowserFuncs();
+
+        bool m_isEnabled;
+        bool m_isLoaded;
+        int m_loadCount;
+
+        String m_description;
+        String m_path;
+        String m_fileName;
+        String m_name;
+        String m_parentDirectory;
+
+        PlatformModuleVersion m_moduleVersion;
+
+        MIMEToDescriptionsMap m_mimeToDescriptions;
+        MIMEToExtensionsMap m_mimeToExtensions;
+
+        PlatformModule m_module;
+        time_t m_lastModified;
+
+#if ENABLE(NETSCAPE_PLUGIN_API)
+        NPP_ShutdownProcPtr m_NPP_Shutdown;
+        NPPluginFuncs m_pluginFuncs;
+        NPNetscapeFuncs m_browserFuncs;
+#endif
+
+        void freeLibrarySoon();
+        void freeLibraryTimerFired();
+        Timer m_freeLibraryTimer;
+
+        PluginQuirkSet m_quirks;
+#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE)
+        String m_fullMIMEDescription;
+        bool m_infoIsFromCache;
+#endif
+    };
+
+    // FIXME: This is a workaround because PluginPackageHash is broken and may consider keys with different hashes as equal.
+    struct PluginPackageHashTraits : HashTraits&lt;RefPtr&lt;PluginPackage&gt; &gt; {
+        static const int minimumTableSize = 64;
+    };
+
+    struct PluginPackageHash {
+        static unsigned hash(const uintptr_t key) { return reinterpret_cast&lt;PluginPackage*&gt;(key)-&gt;hash(); }
+        static unsigned hash(const RefPtr&lt;PluginPackage&gt;&amp; key) { return key-&gt;hash(); }
+
+        static bool equal(const uintptr_t a, const uintptr_t b) { return equal(reinterpret_cast&lt;PluginPackage*&gt;(a), reinterpret_cast&lt;PluginPackage*&gt;(b)); }
+        static bool equal(const RefPtr&lt;PluginPackage&gt;&amp; a, const RefPtr&lt;PluginPackage&gt;&amp; b) { return PluginPackage::equal(*a.get(), *b.get()); }
+        static const bool safeToCompareToEmptyOrDeleted = false;
+    };
+
+} // namespace WebCore
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKitwinPluginsPluginPackageWincppfromrev178217trunkSourceWebCorepluginswinPluginPackageWincpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit/win/Plugins/PluginPackageWin.cpp (from rev 178217, trunk/Source/WebCore/plugins/win/PluginPackageWin.cpp) (0 => 178219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/Plugins/PluginPackageWin.cpp                                (rev 0)
+++ trunk/Source/WebKit/win/Plugins/PluginPackageWin.cpp        2015-01-10 00:16:52 UTC (rev 178219)
</span><span class="lines">@@ -0,0 +1,335 @@
</span><ins>+/*
+ * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2008 Collabora, Ltd.  All rights reserved.
+ * Copyright (C) 2009 Torch Mobile, Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+
+#include &quot;config.h&quot;
+#include &quot;PluginPackage.h&quot;
+
+#include &quot;MIMETypeRegistry.h&quot;
+#include &quot;PluginDatabase.h&quot;
+#include &quot;PluginDebug.h&quot;
+#include &quot;Timer.h&quot;
+#include &quot;npruntime_impl.h&quot;
+#include &lt;string.h&gt;
+#include &lt;wtf/StdLibExtras.h&gt;
+#include &lt;wtf/text/CString.h&gt;
+#include &lt;shlwapi.h&gt;
+
+namespace WebCore {
+
+static String getVersionInfo(const LPVOID versionInfoData, const String&amp; info)
+{
+    LPVOID buffer;
+    UINT bufferLength;
+    String subInfo = &quot;\\StringfileInfo\\040904E4\\&quot; + info;
+    bool retval = VerQueryValueW(versionInfoData,
+        const_cast&lt;UChar*&gt;(subInfo.charactersWithNullTermination().data()),
+        &amp;buffer, &amp;bufferLength);
+    if (!retval || bufferLength == 0)
+        return String();
+
+    // Subtract 1 from the length; we don't want the trailing null character.
+    return String(reinterpret_cast&lt;UChar*&gt;(buffer), bufferLength - 1);
+}
+
+bool PluginPackage::isPluginBlacklisted()
+{
+    if (name() == &quot;Citrix ICA Client&quot;) {
+        // The Citrix ICA Client plug-in requires a Mozilla-based browser; see &lt;rdar://6418681&gt;.
+        return true;
+    }
+
+    if (name() == &quot;Silverlight Plug-In&quot;) {
+        // workaround for &lt;rdar://5557379&gt; Crash in Silverlight when opening microsoft.com.
+        // the latest 1.0 version of Silverlight does not reproduce this crash, so allow it
+        // and any newer versions
+        static const PlatformModuleVersion slPluginMinRequired(0x51BE0000, 0x00010000);
+
+        if (compareFileVersion(slPluginMinRequired) &lt; 0)
+            return true;
+    } else if (equalIgnoringCase(fileName(), &quot;npmozax.dll&quot;)) {
+        // Bug 15217: Mozilla ActiveX control complains about missing xpcom_core.dll
+        return true;
+    } else if (equalIgnoringCase(fileName(), &quot;npwpf.dll&quot;)) {
+        // Bug 57119: Microsoft Windows Presentation Foundation (WPF) plug-in complains about missing xpcom.dll
+        return true;
+    } else if (name() == &quot;Yahoo Application State Plugin&quot;) {
+        // https://bugs.webkit.org/show_bug.cgi?id=26860
+        // Bug in Yahoo Application State plug-in earlier than 1.0.0.6 leads to heap corruption. 
+        static const PlatformModuleVersion yahooAppStatePluginMinRequired(0x00000006, 0x00010000);
+        if (compareFileVersion(yahooAppStatePluginMinRequired) &lt; 0)
+            return true;
+    }
+
+    return false;
+}
+
+void PluginPackage::determineQuirks(const String&amp; mimeType)
+{
+    if (mimeType == &quot;application/x-shockwave-flash&quot;) {
+        static const PlatformModuleVersion flashTenVersion(0x00000000, 0x000a0000);
+
+        // Pre 10 Flash only requests windowless plugins if we return a mozilla user agent
+        if (compareFileVersion(flashTenVersion) &lt; 0)
+            m_quirks.add(PluginQuirkWantsMozillaUserAgent);
+
+        m_quirks.add(PluginQuirkThrottleInvalidate);
+        m_quirks.add(PluginQuirkThrottleWMUserPlusOneMessages);
+        m_quirks.add(PluginQuirkFlashURLNotifyBug);
+    }
+
+    if (name().contains(&quot;Microsoft&quot;) &amp;&amp; name().contains(&quot;Windows Media&quot;)) {
+        // The WMP plugin sets its size on the first NPP_SetWindow call and never updates its size, so
+        // call SetWindow when the plugin view has a correct size
+        m_quirks.add(PluginQuirkDeferFirstSetWindowCall);
+
+        // Windowless mode does not work at all with the WMP plugin so just remove that parameter 
+        // and don't pass it to the plug-in.
+        m_quirks.add(PluginQuirkRemoveWindowlessVideoParam);
+
+        // WMP has a modal message loop that it enters whenever we call it or
+        // ask it to paint. This modal loop can deliver messages to other
+        // windows in WebKit at times when they are not expecting them (for
+        // example, delivering a WM_PAINT message during a layout), and these
+        // can cause crashes.
+        m_quirks.add(PluginQuirkHasModalMessageLoop);
+    }
+
+    if (name() == &quot;VLC Multimedia Plugin&quot; || name() == &quot;VLC Multimedia Plug-in&quot;) {
+        // VLC hangs on NPP_Destroy if we call NPP_SetWindow with a null window handle
+        m_quirks.add(PluginQuirkDontSetNullWindowHandleOnDestroy);
+
+        // VLC 0.8.6d and 0.8.6e crash if multiple instances are created.
+        // &lt;rdar://problem/5773070&gt; tracks allowing multiple instances when this
+        // bug is fixed.
+        m_quirks.add(PluginQuirkDontAllowMultipleInstances);
+    }
+
+    // The DivX plugin sets its size on the first NPP_SetWindow call and never updates its size, so
+    // call SetWindow when the plugin view has a correct size
+    if (mimeType == &quot;video/divx&quot;)
+        m_quirks.add(PluginQuirkDeferFirstSetWindowCall);
+
+    // FIXME: This is a workaround for a problem in our NPRuntime bindings; if a plug-in creates an
+    // NPObject and passes it to a function it's not possible to see what root object that NPObject belongs to.
+    // Thus, we don't know that the object should be invalidated when the plug-in instance goes away.
+    // See &lt;rdar://problem/5487742&gt;.
+    if (mimeType == &quot;application/x-silverlight&quot;)
+        m_quirks.add(PluginQuirkDontUnloadPlugin);
+
+    if (MIMETypeRegistry::isJavaAppletMIMEType(mimeType)) {
+        // Because a single process cannot create multiple VMs, and we cannot reliably unload a
+        // Java VM, we cannot unload the Java plugin, or we'll lose reference to our only VM
+        m_quirks.add(PluginQuirkDontUnloadPlugin);
+
+        // Setting the window region to an empty region causes bad scrolling repaint problems
+        // with the Java plug-in.
+        m_quirks.add(PluginQuirkDontClipToZeroRectWhenScrolling);
+    }
+
+    if (mimeType == &quot;audio/x-pn-realaudio-plugin&quot;) {
+        // Prevent the Real plugin from calling the Window Proc recursively, causing the stack to overflow.
+        m_quirks.add(PluginQuirkDontCallWndProcForSameMessageRecursively);
+
+        static const PlatformModuleVersion lastKnownUnloadableRealPlayerVersion(0x000B0B24, 0x00060000);
+
+        // Unloading RealPlayer versions newer than 10.5 can cause a hang; see rdar://5669317.
+        // FIXME: Resume unloading when this bug in the RealPlayer Plug-In is fixed (rdar://5713147)
+        if (compareFileVersion(lastKnownUnloadableRealPlayerVersion) &gt; 0)
+            m_quirks.add(PluginQuirkDontUnloadPlugin);
+    }
+}
+
+bool PluginPackage::fetchInfo()
+{
+    DWORD versionInfoSize, zeroHandle;
+    versionInfoSize = GetFileVersionInfoSizeW(const_cast&lt;UChar*&gt;(m_path.charactersWithNullTermination().data()), &amp;zeroHandle);
+    if (versionInfoSize == 0)
+        return false;
+
+    auto versionInfoData = std::make_unique&lt;char[]&gt;(versionInfoSize);
+
+    if (!GetFileVersionInfoW(const_cast&lt;UChar*&gt;(m_path.charactersWithNullTermination().data()),
+            0, versionInfoSize, versionInfoData.get()))
+        return false;
+
+    m_name = getVersionInfo(versionInfoData.get(), &quot;ProductName&quot;);
+    m_description = getVersionInfo(versionInfoData.get(), &quot;FileDescription&quot;);
+    if (m_name.isNull() || m_description.isNull())
+        return false;
+
+    VS_FIXEDFILEINFO* info;
+    UINT infoSize;
+    if (!VerQueryValueW(versionInfoData.get(), L&quot;\\&quot;, (LPVOID*) &amp;info, &amp;infoSize) || infoSize &lt; sizeof(VS_FIXEDFILEINFO))
+        return false;
+    m_moduleVersion.leastSig = info-&gt;dwFileVersionLS;
+    m_moduleVersion.mostSig = info-&gt;dwFileVersionMS;
+
+    if (isPluginBlacklisted())
+        return false;
+
+    Vector&lt;String&gt; types;
+    getVersionInfo(versionInfoData.get(), &quot;MIMEType&quot;).split('|', types);
+    Vector&lt;String&gt; extensionLists;
+    getVersionInfo(versionInfoData.get(), &quot;FileExtents&quot;).split('|', extensionLists);
+    Vector&lt;String&gt; descriptions;
+    getVersionInfo(versionInfoData.get(), &quot;FileOpenName&quot;).split('|', descriptions);
+
+    for (unsigned i = 0; i &lt; types.size(); i++) {
+        String type = types[i].lower();
+        String description = i &lt; descriptions.size() ? descriptions[i] : &quot;&quot;;
+        String extensionList = i &lt; extensionLists.size() ? extensionLists[i] : &quot;&quot;;
+
+        Vector&lt;String&gt; extensionsVector;
+        extensionList.split(',', extensionsVector);
+
+        // Get rid of the extension list that may be at the end of the description string.
+        int pos = description.find(&quot;(*&quot;);
+        if (pos != -1) {
+            // There might be a space that we need to get rid of.
+            if (pos &gt; 1 &amp;&amp; description[pos - 1] == ' ')
+                pos--;
+            description = description.left(pos);
+        }
+
+        // Determine the quirks for the MIME types this plug-in supports
+        determineQuirks(type);
+
+        m_mimeToExtensions.add(type, extensionsVector);
+        m_mimeToDescriptions.add(type, description);
+    }
+
+    return true;
+}
+
+bool PluginPackage::load()
+{
+    if (m_freeLibraryTimer.isActive()) {
+        ASSERT(m_module);
+        m_freeLibraryTimer.stop();
+    } else if (m_isLoaded) {
+        if (m_quirks.contains(PluginQuirkDontAllowMultipleInstances))
+            return false;
+        m_loadCount++;
+        return true;
+    } else {
+        WCHAR currentPath[MAX_PATH];
+
+        if (!::GetCurrentDirectoryW(MAX_PATH, currentPath))
+            return false;
+
+        String path = m_path.substring(0, m_path.reverseFind('\\'));
+
+        if (!::SetCurrentDirectoryW(path.charactersWithNullTermination().data()))
+            return false;
+
+        // Load the library
+        m_module = ::LoadLibraryExW(m_path.charactersWithNullTermination().data(), 0, LOAD_WITH_ALTERED_SEARCH_PATH);
+
+        if (!::SetCurrentDirectoryW(currentPath)) {
+            if (m_module)
+                ::FreeLibrary(m_module);
+            return false;
+        }
+    }
+
+    if (!m_module)
+        return false;
+
+    m_isLoaded = true;
+
+    NP_GetEntryPointsFuncPtr NP_GetEntryPoints = 0;
+    NP_InitializeFuncPtr NP_Initialize = 0;
+    NPError npErr;
+
+    NP_Initialize = (NP_InitializeFuncPtr)GetProcAddress(m_module, &quot;NP_Initialize&quot;);
+    NP_GetEntryPoints = (NP_GetEntryPointsFuncPtr)GetProcAddress(m_module, &quot;NP_GetEntryPoints&quot;);
+    m_NPP_Shutdown = (NPP_ShutdownProcPtr)GetProcAddress(m_module, &quot;NP_Shutdown&quot;);
+
+    if (!NP_Initialize || !NP_GetEntryPoints || !m_NPP_Shutdown)
+        goto abort;
+
+    memset(&amp;m_pluginFuncs, 0, sizeof(m_pluginFuncs));
+    m_pluginFuncs.size = sizeof(m_pluginFuncs);
+
+    npErr = NP_GetEntryPoints(&amp;m_pluginFuncs);
+    LOG_NPERROR(npErr);
+    if (npErr != NPERR_NO_ERROR)
+        goto abort;
+
+    initializeBrowserFuncs();
+
+    npErr = NP_Initialize(&amp;m_browserFuncs);
+    LOG_NPERROR(npErr);
+
+    if (npErr != NPERR_NO_ERROR)
+        goto abort;
+
+    m_loadCount++;
+    return true;
+
+abort:
+    unloadWithoutShutdown();
+    return false;
+}
+
+unsigned PluginPackage::hash() const
+{ 
+    const unsigned hashCodes[] = {
+        m_name.impl()-&gt;hash(),
+        m_description.impl()-&gt;hash(),
+        m_mimeToExtensions.size()
+    };
+
+    return StringHasher::hashMemory&lt;sizeof(hashCodes)&gt;(hashCodes);
+}
+
+bool PluginPackage::equal(const PluginPackage&amp; a, const PluginPackage&amp; b)
+{
+    if (a.m_name != b.m_name)
+        return false;
+
+    if (a.m_description != b.m_description)
+        return false;
+
+    if (a.m_mimeToExtensions.size() != b.m_mimeToExtensions.size())
+        return false;
+
+    MIMEToExtensionsMap::const_iterator::Keys end = a.m_mimeToExtensions.end().keys();
+    for (MIMEToExtensionsMap::const_iterator::Keys it = a.m_mimeToExtensions.begin().keys(); it != end; ++it) {
+        if (!b.m_mimeToExtensions.contains(*it))
+            return false;
+    }
+
+    return true;
+}
+
+uint16_t PluginPackage::NPVersion() const
+{
+    return NP_VERSION_MINOR;
+}
+}
</ins></span></pre></div>
<a id="trunkSourceWebKitwinPluginsPluginQuirkSethfromrev178217trunkSourceWebCorepluginsPluginQuirkSeth"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit/win/Plugins/PluginQuirkSet.h (from rev 178217, trunk/Source/WebCore/plugins/PluginQuirkSet.h) (0 => 178219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/Plugins/PluginQuirkSet.h                                (rev 0)
+++ trunk/Source/WebKit/win/Plugins/PluginQuirkSet.h        2015-01-10 00:16:52 UTC (rev 178219)
</span><span class="lines">@@ -0,0 +1,66 @@
</span><ins>+/*
+ * Copyright (C) 2008 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer. 
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution. 
+ * 3.  Neither the name of Apple Inc. (&quot;Apple&quot;) nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission. 
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS &quot;AS IS&quot; AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef PluginQuirkSet_h
+#define PluginQuirkSet_h
+
+
+namespace WebCore {
+
+    enum PluginQuirk {
+        PluginQuirkWantsMozillaUserAgent = 1 &lt;&lt; 0,
+        PluginQuirkDeferFirstSetWindowCall = 1 &lt;&lt; 1,
+        PluginQuirkThrottleInvalidate = 1 &lt;&lt; 2, 
+        PluginQuirkRemoveWindowlessVideoParam = 1 &lt;&lt; 3,
+        PluginQuirkThrottleWMUserPlusOneMessages = 1 &lt;&lt; 4,
+        PluginQuirkDontUnloadPlugin = 1 &lt;&lt; 5,
+        PluginQuirkDontCallWndProcForSameMessageRecursively = 1 &lt;&lt; 6,
+        PluginQuirkHasModalMessageLoop = 1 &lt;&lt; 7,
+        PluginQuirkFlashURLNotifyBug = 1 &lt;&lt; 8,
+        PluginQuirkDontClipToZeroRectWhenScrolling = 1 &lt;&lt; 9,
+        PluginQuirkDontSetNullWindowHandleOnDestroy = 1 &lt;&lt; 10,
+        PluginQuirkDontAllowMultipleInstances = 1 &lt;&lt; 11,
+        PluginQuirkRequiresGtkToolKit = 1 &lt;&lt; 12,
+        PluginQuirkRequiresDefaultScreenDepth = 1 &lt;&lt; 13,
+        PluginQuirkDontCallSetWindowMoreThanOnce = 1 &lt;&lt; 14,
+        PluginQuirkIgnoreRightClickInWindowlessMode = 1 &lt;&lt; 15,
+        PluginQuirkWantsChromeUserAgent = 1 &lt;&lt; 16
+    };
+
+    class PluginQuirkSet {
+        public:
+            PluginQuirkSet() : m_quirks(0) { }
+            void add(PluginQuirk quirk) { m_quirks |= quirk; }
+            bool contains(PluginQuirk quirk) const { return m_quirks &amp; quirk; }
+        private:
+            unsigned m_quirks;
+    };
+
+} // namespace WebCore
+
+#endif // PluginQuirkSet_h
</ins></span></pre></div>
<a id="trunkSourceWebKitwinPluginsPluginStreamcppfromrev178217trunkSourceWebCorepluginsPluginStreamcpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit/win/Plugins/PluginStream.cpp (from rev 178217, trunk/Source/WebCore/plugins/PluginStream.cpp) (0 => 178219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/Plugins/PluginStream.cpp                                (rev 0)
+++ trunk/Source/WebKit/win/Plugins/PluginStream.cpp        2015-01-10 00:16:52 UTC (rev 178219)
</span><span class="lines">@@ -0,0 +1,482 @@
</span><ins>+/*
+ * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2008 Collabora, Ltd. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#include &quot;config.h&quot;
+#include &quot;PluginStream.h&quot;
+
+#include &quot;DocumentLoader.h&quot;
+#include &quot;Frame.h&quot;
+#include &quot;FrameLoader.h&quot;
+#include &quot;HTTPHeaderNames.h&quot;
+#include &quot;PluginDebug.h&quot;
+#include &quot;ResourceLoadScheduler.h&quot;
+#include &quot;SharedBuffer.h&quot;
+#include &quot;SubresourceLoader.h&quot;
+#include &lt;wtf/StringExtras.h&gt;
+#include &lt;wtf/text/CString.h&gt;
+#include &lt;wtf/text/StringBuilder.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+// We use -2 here because some plugins like to return -1 to indicate error
+// and this way we won't clash with them.
+static const int WebReasonNone = -2;
+
+using std::max;
+using std::min;
+
+namespace WebCore {
+
+typedef HashMap&lt;NPStream*, NPP&gt; StreamMap;
+static StreamMap&amp; streams()
+{
+    static StreamMap staticStreams;
+    return staticStreams;
+}
+
+PluginStream::PluginStream(PluginStreamClient* client, Frame* frame, const ResourceRequest&amp; resourceRequest, bool sendNotification, void* notifyData, const NPPluginFuncs* pluginFuncs, NPP instance, const PluginQuirkSet&amp; quirks)
+    : m_resourceRequest(resourceRequest)
+    , m_client(client)
+    , m_frame(frame)
+    , m_notifyData(notifyData)
+    , m_sendNotification(sendNotification)
+    , m_streamState(StreamBeforeStarted)
+    , m_loadManually(false)
+    , m_delayDeliveryTimer(*this, &amp;PluginStream::delayDeliveryTimerFired)
+    , m_tempFileHandle(invalidPlatformFileHandle)
+    , m_pluginFuncs(pluginFuncs)
+    , m_instance(instance)
+    , m_quirks(quirks)
+{
+    ASSERT(m_instance);
+
+    m_stream.url = 0;
+    m_stream.ndata = 0;
+    m_stream.pdata = 0;
+    m_stream.end = 0;
+    m_stream.notifyData = 0;
+    m_stream.lastmodified = 0;
+    m_stream.headers = 0;
+
+    streams().add(&amp;m_stream, m_instance);
+}
+
+PluginStream::~PluginStream()
+{
+    ASSERT(m_streamState != StreamStarted);
+    ASSERT(!m_loader);
+
+    fastFree((char*)m_stream.url);
+
+    streams().remove(&amp;m_stream);
+}
+
+void PluginStream::start()
+{
+    ASSERT(!m_loadManually);
+    m_loader = resourceLoadScheduler()-&gt;schedulePluginStreamLoad(m_frame, this, m_resourceRequest);
+}
+
+void PluginStream::stop()
+{
+    m_streamState = StreamStopped;
+
+    if (m_loadManually) {
+        ASSERT(!m_loader);
+
+        DocumentLoader* documentLoader = m_frame-&gt;loader().activeDocumentLoader();
+        ASSERT(documentLoader);
+
+        if (documentLoader-&gt;isLoadingMainResource())
+            documentLoader-&gt;cancelMainResourceLoad(m_frame-&gt;loader().cancelledError(m_resourceRequest));
+
+        return;
+    }
+
+    if (m_loader) {
+        m_loader-&gt;cancel();
+        m_loader = 0;
+    }
+
+    m_client = 0;
+}
+
+static uint32_t lastModifiedDate(const ResourceResponse&amp; response)
+{
+    double lastModified = response.lastModified();
+    if (!std::isfinite(lastModified))
+        return 0;
+
+    return lastModified * 1000;
+}
+
+void PluginStream::startStream()
+{
+    ASSERT(m_streamState == StreamBeforeStarted);
+
+    const URL&amp; responseURL = m_resourceResponse.url();
+
+    // Some plugins (Flash) expect that javascript URLs are passed back decoded as this is the
+    // format used when requesting the URL.
+    if (protocolIsJavaScript(responseURL))
+        m_stream.url = fastStrDup(decodeURLEscapeSequences(responseURL.string()).utf8().data());
+    else
+        m_stream.url = fastStrDup(responseURL.string().utf8().data());
+
+    CString mimeTypeStr = m_resourceResponse.mimeType().utf8();
+
+    long long expectedContentLength = m_resourceResponse.expectedContentLength();
+
+    if (m_resourceResponse.isHTTP()) {
+        StringBuilder stringBuilder;
+        String separator = ASCIILiteral(&quot;: &quot;);
+
+        String statusLine = &quot;HTTP &quot; + String::number(m_resourceResponse.httpStatusCode()) + &quot; OK\n&quot;;
+        stringBuilder.append(statusLine);
+
+        HTTPHeaderMap::const_iterator end = m_resourceResponse.httpHeaderFields().end();
+        for (HTTPHeaderMap::const_iterator it = m_resourceResponse.httpHeaderFields().begin(); it != end; ++it) {
+            stringBuilder.append(it-&gt;key);
+            stringBuilder.append(separator);
+            stringBuilder.append(it-&gt;value);
+            stringBuilder.append('\n');
+        }
+
+        m_headers = stringBuilder.toString().utf8();
+
+        // If the content is encoded (most likely compressed), then don't send its length to the plugin,
+        // which is only interested in the decoded length, not yet known at the moment.
+        // &lt;rdar://problem/4470599&gt; tracks a request for -[NSURLResponse expectedContentLength] to incorporate this logic.
+        String contentEncoding = m_resourceResponse.httpHeaderField(HTTPHeaderName::ContentEncoding);
+        if (!contentEncoding.isNull() &amp;&amp; contentEncoding != &quot;identity&quot;)
+            expectedContentLength = -1;
+    }
+
+    m_stream.headers = m_headers.data();
+    m_stream.pdata = 0;
+    m_stream.ndata = this;
+    m_stream.end = max(expectedContentLength, 0LL);
+    m_stream.lastmodified = lastModifiedDate(m_resourceResponse);
+    m_stream.notifyData = m_notifyData;
+
+    m_transferMode = NP_NORMAL;
+    m_offset = 0;
+    m_reason = WebReasonNone;
+
+    // Protect the stream if destroystream is called from within the newstream handler
+    RefPtr&lt;PluginStream&gt; protect(this);
+
+    // calling into a plug-in could result in re-entrance if the plug-in yields
+    // control to the system (rdar://5744899). prevent this by deferring further
+    // loading while calling into the plug-in.
+    if (m_loader)
+        m_loader-&gt;setDefersLoading(true);
+    NPError npErr = m_pluginFuncs-&gt;newstream(m_instance, (NPMIMEType)mimeTypeStr.data(), &amp;m_stream, false, &amp;m_transferMode);
+    if (m_loader)
+        m_loader-&gt;setDefersLoading(false);
+    
+    // If the stream was destroyed in the call to newstream we return
+    if (m_reason != WebReasonNone)
+        return;
+        
+    if (npErr != NPERR_NO_ERROR) {
+        cancelAndDestroyStream(npErr);
+        return;
+    }
+
+    m_streamState = StreamStarted;
+
+    if (m_transferMode == NP_NORMAL)
+        return;
+
+    m_path = openTemporaryFile(&quot;WKP&quot;, m_tempFileHandle);
+
+    // Something went wrong, cancel loading the stream
+    if (!isHandleValid(m_tempFileHandle))
+        cancelAndDestroyStream(NPRES_NETWORK_ERR);
+}
+
+NPP PluginStream::ownerForStream(NPStream* stream)
+{
+    return streams().get(stream);
+}
+
+void PluginStream::cancelAndDestroyStream(NPReason reason)
+{
+    RefPtr&lt;PluginStream&gt; protect(this);
+
+    destroyStream(reason);
+    stop();
+}
+
+void PluginStream::destroyStream(NPReason reason)
+{
+    m_reason = reason;
+    if (m_reason != NPRES_DONE) {
+        // Stop any pending data from being streamed
+        if (m_deliveryData)
+            m_deliveryData-&gt;resize(0);
+    } else if (m_deliveryData &amp;&amp; m_deliveryData-&gt;size() &gt; 0) {
+        // There is more data to be streamed, don't destroy the stream now.
+        return;
+    }
+    destroyStream();
+}
+
+void PluginStream::destroyStream()
+{
+    if (m_streamState == StreamStopped)
+        return;
+
+    ASSERT(m_reason != WebReasonNone);
+    ASSERT(!m_deliveryData || m_deliveryData-&gt;size() == 0);
+
+    closeFile(m_tempFileHandle);
+
+    bool newStreamCalled = m_stream.ndata;
+
+    // Protect from destruction if:
+    //  NPN_DestroyStream is called from NPP_NewStream or
+    //  PluginStreamClient::streamDidFinishLoading() removes the last reference
+    RefPtr&lt;PluginStream&gt; protect(this);
+
+    if (newStreamCalled) {
+        if (m_reason == NPRES_DONE &amp;&amp; (m_transferMode == NP_ASFILE || m_transferMode == NP_ASFILEONLY)) {
+            ASSERT(!m_path.isNull());
+
+            if (m_loader)
+                m_loader-&gt;setDefersLoading(true);
+            m_pluginFuncs-&gt;asfile(m_instance, &amp;m_stream, m_path.utf8().data());
+            if (m_loader)
+                m_loader-&gt;setDefersLoading(false);
+        }
+
+        if (m_streamState != StreamBeforeStarted) {
+            if (m_loader)
+                m_loader-&gt;setDefersLoading(true);
+
+            NPError npErr = m_pluginFuncs-&gt;destroystream(m_instance, &amp;m_stream, m_reason);
+
+            if (m_loader)
+                m_loader-&gt;setDefersLoading(false);
+
+            LOG_NPERROR(npErr);
+        }
+
+        m_stream.ndata = 0;
+    }
+
+    if (m_sendNotification) {
+        // Flash 9 can dereference null if we call NPP_URLNotify without first calling NPP_NewStream
+        // for requests made with NPN_PostURLNotify; see &lt;rdar://5588807&gt;
+        if (m_loader)
+            m_loader-&gt;setDefersLoading(true);
+        if (!newStreamCalled &amp;&amp; m_quirks.contains(PluginQuirkFlashURLNotifyBug) &amp;&amp;
+            equalIgnoringCase(m_resourceRequest.httpMethod(), &quot;POST&quot;)) {
+            m_transferMode = NP_NORMAL;
+            m_stream.url = &quot;&quot;;
+            m_stream.notifyData = m_notifyData;
+
+            static char emptyMimeType[] = &quot;&quot;;
+            m_pluginFuncs-&gt;newstream(m_instance, emptyMimeType, &amp;m_stream, false, &amp;m_transferMode);
+            m_pluginFuncs-&gt;destroystream(m_instance, &amp;m_stream, m_reason);
+
+            // in successful requests, the URL is dynamically allocated and freed in our
+            // destructor, so reset it to 0
+            m_stream.url = 0;
+        }
+        m_pluginFuncs-&gt;urlnotify(m_instance, m_resourceRequest.url().string().utf8().data(), m_reason, m_notifyData);
+        if (m_loader)
+            m_loader-&gt;setDefersLoading(false);
+    }
+
+    m_streamState = StreamStopped;
+
+    if (!m_loadManually &amp;&amp; m_client)
+        m_client-&gt;streamDidFinishLoading(this);
+
+    if (!m_path.isNull())
+        deleteFile(m_path);
+}
+
+void PluginStream::delayDeliveryTimerFired()
+{
+    deliverData();
+}
+
+void PluginStream::deliverData()
+{
+    ASSERT(m_deliveryData);
+    
+    if (m_streamState == StreamStopped)
+        // FIXME: We should cancel our job in the SubresourceLoader on error so we don't reach this case
+        return;
+
+    ASSERT(m_streamState != StreamBeforeStarted);
+
+    if (!m_stream.ndata || m_deliveryData-&gt;size() == 0)
+        return;
+
+    int32_t totalBytes = m_deliveryData-&gt;size();
+    int32_t totalBytesDelivered = 0;
+
+    if (m_loader)
+        m_loader-&gt;setDefersLoading(true);
+    while (totalBytesDelivered &lt; totalBytes) {
+        int32_t deliveryBytes = m_pluginFuncs-&gt;writeready(m_instance, &amp;m_stream);
+
+        if (deliveryBytes &lt;= 0) {
+            m_delayDeliveryTimer.startOneShot(0);
+            break;
+        } else {
+            deliveryBytes = min(deliveryBytes, totalBytes - totalBytesDelivered);
+            int32_t dataLength = deliveryBytes;
+            char* data = m_deliveryData-&gt;data() + totalBytesDelivered;
+
+            // Write the data
+            deliveryBytes = m_pluginFuncs-&gt;write(m_instance, &amp;m_stream, m_offset, dataLength, (void*)data);
+            if (deliveryBytes &lt; 0) {
+                LOG_PLUGIN_NET_ERROR();
+                if (m_loader)
+                    m_loader-&gt;setDefersLoading(false);
+                cancelAndDestroyStream(NPRES_NETWORK_ERR);
+                return;
+            }
+            deliveryBytes = min(deliveryBytes, dataLength);
+            m_offset += deliveryBytes;
+            totalBytesDelivered += deliveryBytes;
+        }
+    }
+    if (m_loader)
+        m_loader-&gt;setDefersLoading(false);
+
+    if (totalBytesDelivered &gt; 0) {
+        if (totalBytesDelivered &lt; totalBytes) {
+            int remainingBytes = totalBytes - totalBytesDelivered;
+            memmove(m_deliveryData-&gt;data(), m_deliveryData-&gt;data() + totalBytesDelivered, remainingBytes);
+            m_deliveryData-&gt;resize(remainingBytes);
+        } else {
+            m_deliveryData-&gt;resize(0);
+            if (m_reason != WebReasonNone)
+                destroyStream();
+        }
+    } 
+}
+
+void PluginStream::sendJavaScriptStream(const URL&amp; requestURL, const CString&amp; resultString)
+{
+    didReceiveResponse(0, ResourceResponse(requestURL, &quot;text/plain&quot;, resultString.length(), &quot;&quot;));
+
+    if (m_streamState == StreamStopped)
+        return;
+
+    if (!resultString.isNull()) {
+        didReceiveData(0, resultString.data(), resultString.length());
+        if (m_streamState == StreamStopped)
+            return;
+    }
+
+    m_loader = 0;
+
+    destroyStream(resultString.isNull() ? NPRES_NETWORK_ERR : NPRES_DONE);
+}
+
+void PluginStream::didReceiveResponse(NetscapePlugInStreamLoader* loader, const ResourceResponse&amp; response)
+{
+    ASSERT_UNUSED(loader, loader == m_loader);
+    ASSERT(m_streamState == StreamBeforeStarted);
+
+    m_resourceResponse = response;
+
+    startStream();
+}
+
+void PluginStream::didReceiveData(NetscapePlugInStreamLoader* loader, const char* data, int length)
+{
+    ASSERT_UNUSED(loader, loader == m_loader);
+    ASSERT(m_streamState == StreamStarted);
+
+    // If the plug-in cancels the stream in deliverData it could be deleted, 
+    // so protect it here.
+    RefPtr&lt;PluginStream&gt; protect(this);
+
+    if (m_transferMode != NP_ASFILEONLY) {
+        if (!m_deliveryData)
+            m_deliveryData = std::make_unique&lt;Vector&lt;char&gt;&gt;();
+
+        int oldSize = m_deliveryData-&gt;size();
+        m_deliveryData-&gt;resize(oldSize + length);
+        memcpy(m_deliveryData-&gt;data() + oldSize, data, length);
+
+        deliverData();
+    }
+
+    if (m_streamState != StreamStopped &amp;&amp; isHandleValid(m_tempFileHandle)) {
+        int bytesWritten = writeToFile(m_tempFileHandle, data, length);
+        if (bytesWritten != length)
+            cancelAndDestroyStream(NPRES_NETWORK_ERR);
+    }
+}
+
+void PluginStream::didFail(NetscapePlugInStreamLoader* loader, const ResourceError&amp;)
+{
+    ASSERT_UNUSED(loader, loader == m_loader);
+
+    LOG_PLUGIN_NET_ERROR();
+
+    // destroyStream can result in our being deleted
+    RefPtr&lt;PluginStream&gt; protect(this);
+
+    destroyStream(NPRES_NETWORK_ERR);
+
+    m_loader = 0;
+}
+
+void PluginStream::didFinishLoading(NetscapePlugInStreamLoader* loader)
+{
+    ASSERT_UNUSED(loader, loader == m_loader);
+    ASSERT(m_streamState == StreamStarted);
+
+    // destroyStream can result in our being deleted
+    RefPtr&lt;PluginStream&gt; protect(this);
+
+    destroyStream(NPRES_DONE);
+
+    m_loader = 0;
+}
+
+bool PluginStream::wantsAllStreams() const
+{
+    if (!m_pluginFuncs-&gt;getvalue)
+        return false;
+
+    void* result = 0;
+    if (m_pluginFuncs-&gt;getvalue(m_instance, NPPVpluginWantsAllNetworkStreams, &amp;result) != NPERR_NO_ERROR)
+        return false;
+
+    return result != 0;
+}
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebKitwinPluginsPluginStreamhfromrev178217trunkSourceWebCorepluginsPluginStreamh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit/win/Plugins/PluginStream.h (from rev 178217, trunk/Source/WebCore/plugins/PluginStream.h) (0 => 178219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/Plugins/PluginStream.h                                (rev 0)
+++ trunk/Source/WebKit/win/Plugins/PluginStream.h        2015-01-10 00:16:52 UTC (rev 178219)
</span><span class="lines">@@ -0,0 +1,122 @@
</span><ins>+/*
+ * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2008 Collabora, Ltd. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#ifndef PluginStream_h
+#define PluginStream_h
+
+#include &quot;FileSystem.h&quot;
+#include &quot;URL.h&quot;
+#include &quot;NetscapePlugInStreamLoader.h&quot;
+#include &quot;PluginQuirkSet.h&quot;
+#include &quot;ResourceRequest.h&quot;
+#include &quot;ResourceResponse.h&quot;
+#include &quot;Timer.h&quot;
+#include &quot;npruntime_internal.h&quot;
+#include &lt;wtf/HashMap.h&gt;
+#include &lt;wtf/RefCounted.h&gt;
+#include &lt;wtf/Vector.h&gt;
+#include &lt;wtf/text/CString.h&gt;
+#include &lt;wtf/text/StringHash.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace WebCore {
+    class Frame;
+    class PluginStream;
+
+    enum PluginStreamState { StreamBeforeStarted, StreamStarted, StreamStopped };
+
+    class PluginStreamClient {
+    public:
+        virtual ~PluginStreamClient() {}
+        virtual void streamDidFinishLoading(PluginStream*) {}
+    };
+
+    class PluginStream : public RefCounted&lt;PluginStream&gt;, private NetscapePlugInStreamLoaderClient {
+    public:
+        static PassRefPtr&lt;PluginStream&gt; create(PluginStreamClient* client, Frame* frame, const ResourceRequest&amp; request, bool sendNotification, void* notifyData, const NPPluginFuncs* functions, NPP instance, const PluginQuirkSet&amp; quirks)
+        {
+            return adoptRef(new PluginStream(client, frame, request, sendNotification, notifyData, functions, instance, quirks));
+        }
+        virtual ~PluginStream();
+        
+        void start();
+        void stop();
+
+        void startStream();
+
+        void setLoadManually(bool loadManually) { m_loadManually = loadManually; }
+
+        void sendJavaScriptStream(const URL&amp; requestURL, const WTF::CString&amp; resultString);
+        void cancelAndDestroyStream(NPReason);
+
+        static NPP ownerForStream(NPStream*);
+
+        // NetscapePlugInStreamLoaderClient
+        virtual void didReceiveResponse(NetscapePlugInStreamLoader*, const ResourceResponse&amp;);
+        virtual void didReceiveData(NetscapePlugInStreamLoader*, const char*, int);
+        virtual void didFail(NetscapePlugInStreamLoader*, const ResourceError&amp;);
+        virtual void didFinishLoading(NetscapePlugInStreamLoader*);
+        virtual bool wantsAllStreams() const;
+
+    private:
+        PluginStream(PluginStreamClient*, Frame*, const ResourceRequest&amp;, bool sendNotification, void* notifyData, const NPPluginFuncs*, NPP instance, const PluginQuirkSet&amp;);
+
+        void deliverData();
+        void destroyStream(NPReason);
+        void destroyStream();
+
+        ResourceRequest m_resourceRequest;
+        ResourceResponse m_resourceResponse;
+
+        PluginStreamClient* m_client;
+        Frame* m_frame;
+        RefPtr&lt;NetscapePlugInStreamLoader&gt; m_loader;
+        void* m_notifyData;
+        bool m_sendNotification;
+        PluginStreamState m_streamState;
+        bool m_loadManually;
+
+        Timer m_delayDeliveryTimer;
+        void delayDeliveryTimerFired();
+
+        std::unique_ptr&lt;Vector&lt;char&gt;&gt; m_deliveryData;
+
+        PlatformFileHandle m_tempFileHandle;
+
+        const NPPluginFuncs* m_pluginFuncs;
+        NPP m_instance;
+        uint16_t m_transferMode;
+        int32_t m_offset;
+        CString m_headers;
+        String m_path;
+        NPReason m_reason;
+        NPStream m_stream;
+        PluginQuirkSet m_quirks;
+    };
+
+} // namespace WebCore
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKitwinPluginsPluginViewcppfromrev178217trunkSourceWebCorepluginsPluginViewcpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit/win/Plugins/PluginView.cpp (from rev 178217, trunk/Source/WebCore/plugins/PluginView.cpp) (0 => 178219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/Plugins/PluginView.cpp                                (rev 0)
+++ trunk/Source/WebKit/win/Plugins/PluginView.cpp        2015-01-10 00:16:52 UTC (rev 178219)
</span><span class="lines">@@ -0,0 +1,1489 @@
</span><ins>+/*
+ * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2008 Collabora Ltd. All rights reserved.
+ * Copyright (C) 2010 Girish Ramakrishnan &lt;girish@forwardbias.in&gt;
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#include &quot;config.h&quot;
+#include &quot;PluginView.h&quot;
+
+#include &quot;PluginDatabase.h&quot;
+#include &quot;PluginDebug.h&quot;
+#include &quot;PluginPackage.h&quot;
+#include &lt;WebCore/BridgeJSC.h&gt;
+#include &lt;WebCore/Chrome.h&gt;
+#include &lt;WebCore/CookieJar.h&gt;
+#include &lt;WebCore/Document.h&gt;
+#include &lt;WebCore/DocumentLoader.h&gt;
+#include &lt;WebCore/Element.h&gt;
+#include &lt;WebCore/FocusController.h&gt;
+#include &lt;WebCore/Frame.h&gt;
+#include &lt;WebCore/FrameLoadRequest.h&gt;
+#include &lt;WebCore/FrameLoader.h&gt;
+#include &lt;WebCore/FrameLoaderClient.h&gt;
+#include &lt;WebCore/FrameTree.h&gt;
+#include &lt;WebCore/FrameView.h&gt;
+#include &lt;WebCore/GraphicsContext.h&gt;
+#include &lt;WebCore/HTMLNames.h&gt;
+#include &lt;WebCore/HTMLPlugInElement.h&gt;
+#include &lt;WebCore/HTTPHeaderNames.h&gt;
+#include &lt;WebCore/Image.h&gt;
+#include &lt;WebCore/JSDOMBinding.h&gt;
+#include &lt;WebCore/JSDOMWindow.h&gt;
+#include &lt;WebCore/KeyboardEvent.h&gt;
+#include &lt;WebCore/MIMETypeRegistry.h&gt;
+#include &lt;WebCore/MouseEvent.h&gt;
+#include &lt;WebCore/NotImplemented.h&gt;
+#include &lt;WebCore/Page.h&gt;
+#include &lt;WebCore/PlatformMouseEvent.h&gt;
+#include &lt;WebCore/PluginMainThreadScheduler.h&gt;
+#include &lt;WebCore/ProxyServer.h&gt;
+#include &lt;WebCore/RenderBox.h&gt;
+#include &lt;WebCore/RenderObject.h&gt;
+#include &lt;WebCore/ScriptController.h&gt;
+#include &lt;WebCore/SecurityOrigin.h&gt;
+#include &lt;WebCore/Settings.h&gt;
+#include &lt;WebCore/UserGestureIndicator.h&gt;
+#include &lt;WebCore/WheelEvent.h&gt;
+#include &lt;WebCore/c_instance.h&gt;
+#include &lt;WebCore/npruntime_impl.h&gt;
+#include &lt;WebCore/runtime_root.h&gt;
+#include &lt;bindings/ScriptValue.h&gt;
+#include &lt;runtime/JSCJSValue.h&gt;
+#include &lt;runtime/JSLock.h&gt;
+#include &lt;wtf/ASCIICType.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+#if OS(WINDOWS) &amp;&amp; ENABLE(NETSCAPE_PLUGIN_API)
+#include &quot;PluginMessageThrottlerWin.h&quot;
+#endif
+
+using JSC::ExecState;
+using JSC::JSLock;
+using JSC::JSObject;
+using JSC::JSValue;
+
+#if ENABLE(NETSCAPE_PLUGIN_API)
+
+using std::min;
+
+using namespace WTF;
+
+namespace WebCore {
+
+using namespace HTMLNames;
+
+static int s_callingPlugin;
+
+typedef HashMap&lt;NPP, PluginView*&gt; InstanceMap;
+
+static InstanceMap&amp; instanceMap()
+{
+    static InstanceMap&amp; map = *new InstanceMap;
+    return map;
+}
+
+static String scriptStringIfJavaScriptURL(const URL&amp; url)
+{
+    if (!protocolIsJavaScript(url))
+        return String();
+
+    // This returns an unescaped string
+    return decodeURLEscapeSequences(url.string().substring(11));
+}
+
+PluginView* PluginView::s_currentPluginView = 0;
+
+void PluginView::popPopupsStateTimerFired()
+{
+    popPopupsEnabledState();
+}
+
+IntRect PluginView::windowClipRect() const
+{
+    // Start by clipping to our bounds.
+    IntRect clipRect(m_windowRect);
+    
+    // Take our element and get the clip rect from the enclosing layer and frame view.
+    FrameView* parentView = m_element-&gt;document().view();
+    clipRect.intersect(parentView-&gt;windowClipRectForFrameOwner(m_element, true));
+
+    return clipRect;
+}
+
+void PluginView::setFrameRect(const IntRect&amp; rect)
+{
+    if (m_element-&gt;document().printing())
+        return;
+
+    if (rect != frameRect())
+        Widget::setFrameRect(rect);
+
+    updatePluginWidget();
+
+#if OS(WINDOWS)
+    // On Windows always call plugin to change geometry.
+    setNPWindowRect(rect);
+#elif defined(XP_UNIX)
+    // On Unix, multiple calls to setNPWindow() in windowed mode causes Flash to crash
+    if (m_mode == NP_FULL || !m_isWindowed)
+        setNPWindowRect(rect);
+#endif
+}
+
+void PluginView::frameRectsChanged()
+{
+    updatePluginWidget();
+}
+
+void PluginView::clipRectChanged()
+{
+    updatePluginWidget();
+}
+
+void PluginView::handleEvent(Event* event)
+{
+    if (!m_plugin || m_isWindowed)
+        return;
+
+    // Protect the plug-in from deletion while dispatching the event.
+    RefPtr&lt;PluginView&gt; protect(this);
+
+    if (event-&gt;isMouseEvent())
+        handleMouseEvent(static_cast&lt;MouseEvent*&gt;(event));
+    else if (event-&gt;isKeyboardEvent())
+        handleKeyboardEvent(static_cast&lt;KeyboardEvent*&gt;(event));
+#if defined(XP_MACOSX)
+    else if (event-&gt;type() == eventNames().wheelEvent || event-&gt;type() == eventNames().mousewheelEvent)
+        handleWheelEvent(static_cast&lt;WheelEvent*&gt;(event));
+#endif
+    else if (event-&gt;type() == eventNames().contextmenuEvent)
+        event-&gt;setDefaultHandled(); // We don't know if the plug-in has handled mousedown event by displaying a context menu, so we never want WebKit to show a default one.
+#if defined(XP_UNIX) &amp;&amp; ENABLE(NETSCAPE_PLUGIN_API)
+    else if (event-&gt;type() == eventNames().focusoutEvent)
+        handleFocusOutEvent();
+    else if (event-&gt;type() == eventNames().focusinEvent)
+        handleFocusInEvent();
+#endif
+}
+
+void PluginView::init()
+{
+    if (m_haveInitialized)
+        return;
+
+    m_haveInitialized = true;
+
+    if (!m_plugin) {
+        ASSERT(m_status == PluginStatusCanNotFindPlugin);
+        return;
+    }
+
+    LOG(Plugins, &quot;PluginView::init(): Initializing plug-in '%s'&quot;, m_plugin-&gt;name().utf8().data());
+
+    if (!m_plugin-&gt;load()) {
+        m_plugin = 0;
+        m_status = PluginStatusCanNotLoadPlugin;
+        return;
+    }
+
+    if (!startOrAddToUnstartedList()) {
+        m_status = PluginStatusCanNotLoadPlugin;
+        return;
+    }
+
+    m_status = PluginStatusLoadedSuccessfully;
+}
+
+bool PluginView::startOrAddToUnstartedList()
+{
+    if (!m_parentFrame-&gt;page())
+        return false;
+
+    // We only delay starting the plug-in if we're going to kick off the load
+    // ourselves. Otherwise, the loader will try to deliver data before we've
+    // started the plug-in.
+    if (!m_loadManually &amp;&amp; !m_parentFrame-&gt;page()-&gt;canStartMedia()) {
+        m_parentFrame-&gt;document()-&gt;addMediaCanStartListener(this);
+        m_isWaitingToStart = true;
+        return true;
+    }
+
+    return start();
+}
+
+bool PluginView::start()
+{
+    if (m_isStarted)
+        return false;
+
+    m_isWaitingToStart = false;
+
+    PluginMainThreadScheduler::scheduler().registerPlugin(m_instance);
+
+    ASSERT(m_plugin);
+    ASSERT(m_plugin-&gt;pluginFuncs()-&gt;newp);
+
+    NPError npErr;
+    {
+        PluginView::setCurrentPluginView(this);
+        JSC::JSLock::DropAllLocks dropAllLocks(JSDOMWindowBase::commonVM());
+        setCallingPlugin(true);
+        npErr = m_plugin-&gt;pluginFuncs()-&gt;newp((NPMIMEType)m_mimeType.utf8().data(), m_instance, m_mode, m_paramCount, m_paramNames, m_paramValues, NULL);
+        setCallingPlugin(false);
+        LOG_NPERROR(npErr);
+        PluginView::setCurrentPluginView(0);
+    }
+
+    if (npErr != NPERR_NO_ERROR) {
+        m_status = PluginStatusCanNotLoadPlugin;
+        PluginMainThreadScheduler::scheduler().unregisterPlugin(m_instance);
+        return false;
+    }
+
+    m_isStarted = true;
+
+    if (!m_url.isEmpty() &amp;&amp; !m_loadManually) {
+        FrameLoadRequest frameLoadRequest(m_parentFrame-&gt;document()-&gt;securityOrigin());
+        frameLoadRequest.resourceRequest().setHTTPMethod(&quot;GET&quot;);
+        frameLoadRequest.resourceRequest().setURL(m_url);
+        load(frameLoadRequest, false, 0);
+    }
+
+    m_status = PluginStatusLoadedSuccessfully;
+
+    if (!platformStart())
+        m_status = PluginStatusCanNotLoadPlugin;
+
+    if (m_status != PluginStatusLoadedSuccessfully)
+        return false;
+
+    return true;
+}
+
+void PluginView::mediaCanStart()
+{
+    ASSERT(!m_isStarted);
+    if (!start())
+        parentFrame()-&gt;loader().client().dispatchDidFailToStartPlugin(this);
+}
+
+PluginView::~PluginView()
+{
+    LOG(Plugins, &quot;PluginView::~PluginView()&quot;);
+
+    ASSERT(!m_lifeSupportTimer.isActive());
+
+    // If we failed to find the plug-in, we'll return early in our constructor, and
+    // m_instance will be 0.
+    if (m_instance)
+        instanceMap().remove(m_instance);
+
+    if (m_isWaitingToStart)
+        m_parentFrame-&gt;document()-&gt;removeMediaCanStartListener(this);
+
+    stop();
+
+    freeStringArray(m_paramNames, m_paramCount);
+    freeStringArray(m_paramValues, m_paramCount);
+
+    platformDestroy();
+
+    m_parentFrame-&gt;script().cleanupScriptObjectsForPlugin(this);
+
+    if (m_plugin &amp;&amp; !(m_plugin-&gt;quirks().contains(PluginQuirkDontUnloadPlugin)))
+        m_plugin-&gt;unload();
+}
+
+void PluginView::stop()
+{
+    if (!m_isStarted)
+        return;
+
+    LOG(Plugins, &quot;PluginView::stop(): Stopping plug-in '%s'&quot;, m_plugin-&gt;name().utf8().data());
+
+    HashSet&lt;RefPtr&lt;PluginStream&gt; &gt; streams = m_streams;
+    HashSet&lt;RefPtr&lt;PluginStream&gt; &gt;::iterator end = streams.end();
+    for (HashSet&lt;RefPtr&lt;PluginStream&gt; &gt;::iterator it = streams.begin(); it != end; ++it) {
+        (*it)-&gt;stop();
+        disconnectStream((*it).get());
+    }
+
+    ASSERT(m_streams.isEmpty());
+
+    m_isStarted = false;
+
+    JSC::JSLock::DropAllLocks dropAllLocks(JSDOMWindowBase::commonVM());
+
+#if ENABLE(NETSCAPE_PLUGIN_API)
+#if defined(XP_WIN) &amp;&amp; !PLATFORM(GTK)
+    // Unsubclass the window
+    if (m_isWindowed) {
+        WNDPROC currentWndProc = (WNDPROC)GetWindowLongPtr(platformPluginWidget(), GWLP_WNDPROC);
+
+        if (currentWndProc == PluginViewWndProc)
+            SetWindowLongPtr(platformPluginWidget(), GWLP_WNDPROC, (LONG_PTR)m_pluginWndProc);
+    }
+#endif // !defined(XP_WIN) || PLATFORM(GTK)
+#endif // ENABLE(NETSCAPE_PLUGIN_API)
+
+#if !defined(XP_MACOSX)
+    // Clear the window
+    m_npWindow.window = 0;
+
+    if (m_plugin-&gt;pluginFuncs()-&gt;setwindow &amp;&amp; !m_plugin-&gt;quirks().contains(PluginQuirkDontSetNullWindowHandleOnDestroy)) {
+        PluginView::setCurrentPluginView(this);
+        setCallingPlugin(true);
+        m_plugin-&gt;pluginFuncs()-&gt;setwindow(m_instance, &amp;m_npWindow);
+        setCallingPlugin(false);
+        PluginView::setCurrentPluginView(0);
+    }
+
+#ifdef XP_UNIX
+    delete static_cast&lt;NPSetWindowCallbackStruct*&gt;(m_npWindow.ws_info);
+    m_npWindow.ws_info = 0;
+#endif
+
+#endif // !defined(XP_MACOSX)
+
+    PluginMainThreadScheduler::scheduler().unregisterPlugin(m_instance);
+
+    NPSavedData* savedData = 0;
+    PluginView::setCurrentPluginView(this);
+    setCallingPlugin(true);
+    NPError npErr = m_plugin-&gt;pluginFuncs()-&gt;destroy(m_instance, &amp;savedData);
+    setCallingPlugin(false);
+    LOG_NPERROR(npErr);
+    PluginView::setCurrentPluginView(0);
+
+#if ENABLE(NETSCAPE_PLUGIN_API)
+    if (savedData) {
+        // TODO: Actually save this data instead of just discarding it
+        if (savedData-&gt;buf)
+            NPN_MemFree(savedData-&gt;buf);
+        NPN_MemFree(savedData);
+    }
+#endif
+
+    m_instance-&gt;pdata = 0;
+}
+
+void PluginView::setCurrentPluginView(PluginView* pluginView)
+{
+    s_currentPluginView = pluginView;
+}
+
+PluginView* PluginView::currentPluginView()
+{
+    return s_currentPluginView;
+}
+
+static char* createUTF8String(const String&amp; str)
+{
+    CString cstr = str.utf8();
+    const size_t cstrLength = cstr.length();
+    char* result = reinterpret_cast&lt;char*&gt;(fastMalloc(cstrLength + 1));
+
+    memcpy(result, cstr.data(), cstrLength);
+    result[cstrLength] = '\0';
+
+    return result;
+}
+
+void PluginView::performRequest(PluginRequest* request)
+{
+    if (!m_isStarted)
+        return;
+
+    // don't let a plugin start any loads if it is no longer part of a document that is being 
+    // displayed unless the loads are in the same frame as the plugin.
+    const String&amp; targetFrameName = request-&gt;frameLoadRequest().frameName();
+    if (m_parentFrame-&gt;loader().documentLoader() != m_parentFrame-&gt;loader().activeDocumentLoader() &amp;&amp; (targetFrameName.isNull() || m_parentFrame-&gt;tree().find(targetFrameName) != m_parentFrame))
+        return;
+
+    URL requestURL = request-&gt;frameLoadRequest().resourceRequest().url();
+    String jsString = scriptStringIfJavaScriptURL(requestURL);
+
+    UserGestureIndicator gestureIndicator(request-&gt;shouldAllowPopups() ? DefinitelyProcessingUserGesture : PossiblyProcessingUserGesture);
+
+    if (jsString.isNull()) {
+        // if this is not a targeted request, create a stream for it. otherwise,
+        // just pass it off to the loader
+        if (targetFrameName.isEmpty()) {
+            RefPtr&lt;PluginStream&gt; stream = PluginStream::create(this, m_parentFrame.get(), request-&gt;frameLoadRequest().resourceRequest(), request-&gt;sendNotification(), request-&gt;notifyData(), plugin()-&gt;pluginFuncs(), instance(), m_plugin-&gt;quirks());
+            m_streams.add(stream);
+            stream-&gt;start();
+        } else {
+            // If the target frame is our frame, we could destroy the
+            // PluginView, so we protect it. &lt;rdar://problem/6991251&gt;
+            RefPtr&lt;PluginView&gt; protect(this);
+
+            FrameLoadRequest frameRequest(m_parentFrame.get(), request-&gt;frameLoadRequest().resourceRequest());
+            frameRequest.setFrameName(targetFrameName);
+            frameRequest.setShouldCheckNewWindowPolicy(true);
+            m_parentFrame-&gt;loader().load(frameRequest);
+
+            // FIXME: &lt;rdar://problem/4807469&gt; This should be sent when the document has finished loading
+            if (request-&gt;sendNotification()) {
+                PluginView::setCurrentPluginView(this);
+                JSC::JSLock::DropAllLocks dropAllLocks(JSDOMWindowBase::commonVM());
+                setCallingPlugin(true);
+                m_plugin-&gt;pluginFuncs()-&gt;urlnotify(m_instance, requestURL.string().utf8().data(), NPRES_DONE, request-&gt;notifyData());
+                setCallingPlugin(false);
+                PluginView::setCurrentPluginView(0);
+            }
+        }
+        return;
+    }
+
+    // Targeted JavaScript requests are only allowed on the frame that contains the JavaScript plugin
+    // and this has been made sure in ::load.
+    ASSERT(targetFrameName.isEmpty() || m_parentFrame-&gt;tree().find(targetFrameName) == m_parentFrame);
+    
+    // Executing a script can cause the plugin view to be destroyed, so we keep a reference to it.
+    RefPtr&lt;PluginView&gt; protector(this);
+    Deprecated::ScriptValue result = m_parentFrame-&gt;script().executeScript(jsString, request-&gt;shouldAllowPopups());
+
+    if (targetFrameName.isNull()) {
+        String resultString;
+
+        JSC::ExecState* scriptState = m_parentFrame-&gt;script().globalObject(pluginWorld())-&gt;globalExec();
+        CString cstr;
+        if (result.getString(scriptState, resultString))
+            cstr = resultString.utf8();
+
+        RefPtr&lt;PluginStream&gt; stream = PluginStream::create(this, m_parentFrame.get(), request-&gt;frameLoadRequest().resourceRequest(), request-&gt;sendNotification(), request-&gt;notifyData(), plugin()-&gt;pluginFuncs(), instance(), m_plugin-&gt;quirks());
+        m_streams.add(stream);
+        stream-&gt;sendJavaScriptStream(requestURL, cstr);
+    }
+}
+
+void PluginView::requestTimerFired()
+{
+    ASSERT(!m_requests.isEmpty());
+    ASSERT(!m_isJavaScriptPaused);
+
+    std::unique_ptr&lt;PluginRequest&gt; request = WTF::move(m_requests[0]);
+    m_requests.remove(0);
+    
+    // Schedule a new request before calling performRequest since the call to
+    // performRequest can cause the plugin view to be deleted.
+    if (!m_requests.isEmpty())
+        m_requestTimer.startOneShot(0);
+
+    performRequest(request.get());
+}
+
+void PluginView::scheduleRequest(std::unique_ptr&lt;PluginRequest&gt; request)
+{
+    m_requests.append(WTF::move(request));
+
+    if (!m_isJavaScriptPaused)
+        m_requestTimer.startOneShot(0);
+}
+
+NPError PluginView::load(const FrameLoadRequest&amp; frameLoadRequest, bool sendNotification, void* notifyData)
+{
+    ASSERT(frameLoadRequest.resourceRequest().httpMethod() == &quot;GET&quot; || frameLoadRequest.resourceRequest().httpMethod() == &quot;POST&quot;);
+
+    URL url = frameLoadRequest.resourceRequest().url();
+    
+    if (url.isEmpty())
+        return NPERR_INVALID_URL;
+
+    // Don't allow requests to be made when the document loader is stopping all loaders.
+    DocumentLoader* loader = m_parentFrame-&gt;loader().documentLoader();
+    if (!loader || loader-&gt;isStopping())
+        return NPERR_GENERIC_ERROR;
+
+    const String&amp; targetFrameName = frameLoadRequest.frameName();
+    String jsString = scriptStringIfJavaScriptURL(url);
+
+    if (!jsString.isNull()) {
+        // Return NPERR_GENERIC_ERROR if JS is disabled. This is what Mozilla does.
+        if (!m_parentFrame-&gt;script().canExecuteScripts(NotAboutToExecuteScript))
+            return NPERR_GENERIC_ERROR;
+
+        // For security reasons, only allow JS requests to be made on the frame that contains the plug-in.
+        if (!targetFrameName.isNull() &amp;&amp; m_parentFrame-&gt;tree().find(targetFrameName) != m_parentFrame)
+            return NPERR_INVALID_PARAM;
+    } else if (!m_parentFrame-&gt;document()-&gt;securityOrigin()-&gt;canDisplay(url))
+        return NPERR_GENERIC_ERROR;
+
+    scheduleRequest(std::make_unique&lt;PluginRequest&gt;(frameLoadRequest, sendNotification, notifyData, arePopupsAllowed()));
+
+    return NPERR_NO_ERROR;
+}
+
+static URL makeURL(const URL&amp; baseURL, const char* relativeURLString)
+{
+    String urlString = relativeURLString;
+
+    // Strip return characters.
+    urlString.replaceWithLiteral('\n', &quot;&quot;);
+    urlString.replaceWithLiteral('\r', &quot;&quot;);
+
+    return URL(baseURL, urlString);
+}
+
+NPError PluginView::getURLNotify(const char* url, const char* target, void* notifyData)
+{
+    FrameLoadRequest frameLoadRequest(m_parentFrame-&gt;document()-&gt;securityOrigin());
+
+    frameLoadRequest.setFrameName(target);
+    frameLoadRequest.resourceRequest().setHTTPMethod(&quot;GET&quot;);
+    frameLoadRequest.resourceRequest().setURL(makeURL(m_parentFrame-&gt;document()-&gt;baseURL(), url));
+
+    return load(frameLoadRequest, true, notifyData);
+}
+
+NPError PluginView::getURL(const char* url, const char* target)
+{
+    FrameLoadRequest frameLoadRequest(m_parentFrame-&gt;document()-&gt;securityOrigin());
+
+    frameLoadRequest.setFrameName(target);
+    frameLoadRequest.resourceRequest().setHTTPMethod(&quot;GET&quot;);
+    frameLoadRequest.resourceRequest().setURL(makeURL(m_parentFrame-&gt;document()-&gt;baseURL(), url));
+
+    return load(frameLoadRequest, false, 0);
+}
+
+NPError PluginView::postURLNotify(const char* url, const char* target, uint32_t len, const char* buf, NPBool file, void* notifyData)
+{
+    return handlePost(url, target, len, buf, file, notifyData, true, true);
+}
+
+NPError PluginView::postURL(const char* url, const char* target, uint32_t len, const char* buf, NPBool file)
+{
+    // As documented, only allow headers to be specified via NPP_PostURL when using a file.
+    return handlePost(url, target, len, buf, file, 0, false, file);
+}
+
+NPError PluginView::newStream(NPMIMEType, const char* /* target */, NPStream**)
+{
+    notImplemented();
+    // Unsupported
+    return NPERR_GENERIC_ERROR;
+}
+
+int32_t PluginView::write(NPStream*, int32_t /* len */, void* /* buffer */)
+{
+    notImplemented();
+    // Unsupported
+    return -1;
+}
+
+NPError PluginView::destroyStream(NPStream* stream, NPReason reason)
+{
+    if (!stream || PluginStream::ownerForStream(stream) != m_instance)
+        return NPERR_INVALID_INSTANCE_ERROR;
+
+    PluginStream* browserStream = static_cast&lt;PluginStream*&gt;(stream-&gt;ndata);
+    browserStream-&gt;cancelAndDestroyStream(reason);
+
+    return NPERR_NO_ERROR;
+}
+
+void PluginView::status(const char* message)
+{
+    if (Page* page = m_parentFrame-&gt;page())
+        page-&gt;chrome().setStatusbarText(m_parentFrame.get(), String::fromUTF8(message));
+}
+
+NPError PluginView::setValue(NPPVariable variable, void* value)
+{
+    LOG(Plugins, &quot;PluginView::setValue(%s): &quot;, prettyNameForNPPVariable(variable, value).data());
+
+    switch (variable) {
+    case NPPVpluginWindowBool:
+        m_isWindowed = value;
+        return NPERR_NO_ERROR;
+    case NPPVpluginTransparentBool:
+        m_isTransparent = value;
+        return NPERR_NO_ERROR;
+#if defined(XP_MACOSX)
+    case NPPVpluginDrawingModel: {
+        // Can only set drawing model inside NPP_New()
+        if (this != currentPluginView())
+           return NPERR_GENERIC_ERROR;
+
+        NPDrawingModel newDrawingModel = NPDrawingModel(uintptr_t(value));
+        switch (newDrawingModel) {
+        case NPDrawingModelCoreGraphics:
+            return NPERR_NO_ERROR;
+        case NPDrawingModelCoreAnimation:
+        default:
+            LOG(Plugins, &quot;Plugin asked for unsupported drawing model: %s&quot;,
+                    prettyNameForDrawingModel(newDrawingModel));
+            return NPERR_GENERIC_ERROR;
+        }
+    }
+
+    case NPPVpluginEventModel: {
+        // Can only set event model inside NPP_New()
+        if (this != currentPluginView())
+           return NPERR_GENERIC_ERROR;
+
+        NPEventModel newEventModel = NPEventModel(uintptr_t(value));
+        switch (newEventModel) {
+        case NPEventModelCocoa:
+            return NPERR_NO_ERROR;
+        default:
+            LOG(Plugins, &quot;Plugin asked for unsupported event model: %s&quot;,
+                    prettyNameForEventModel(newEventModel));
+            return NPERR_GENERIC_ERROR;
+        }
+    }
+#endif // defined(XP_MACOSX)
+
+    default:
+        notImplemented();
+        return NPERR_GENERIC_ERROR;
+    }
+}
+
+void PluginView::invalidateTimerFired()
+{
+    for (unsigned i = 0; i &lt; m_invalidRects.size(); i++)
+        invalidateRect(m_invalidRects[i]);
+    m_invalidRects.clear();
+}
+
+
+void PluginView::pushPopupsEnabledState(bool state)
+{
+    m_popupStateStack.append(state);
+}

+void PluginView::popPopupsEnabledState()
+{
+    m_popupStateStack.removeLast();
+}
+
+bool PluginView::arePopupsAllowed() const
+{
+    if (!m_popupStateStack.isEmpty())
+        return m_popupStateStack.last();
+
+    return false;
+}
+
+void PluginView::setJavaScriptPaused(bool paused)
+{
+    if (m_isJavaScriptPaused == paused)
+        return;
+    m_isJavaScriptPaused = paused;
+
+    if (m_isJavaScriptPaused)
+        m_requestTimer.stop();
+    else if (!m_requests.isEmpty())
+        m_requestTimer.startOneShot(0);
+}
+
+#if ENABLE(NETSCAPE_PLUGIN_API)
+NPObject* PluginView::npObject()
+{
+    NPObject* object = 0;
+
+    if (!m_isStarted || !m_plugin || !m_plugin-&gt;pluginFuncs()-&gt;getvalue)
+        return 0;
+
+    // On Windows, calling Java's NPN_GetValue can allow the message loop to
+    // run, allowing loading to take place or JavaScript to run. Protect the
+    // PluginView from destruction. &lt;rdar://problem/6978804&gt;
+    RefPtr&lt;PluginView&gt; protect(this);
+
+    NPError npErr;
+    {
+        PluginView::setCurrentPluginView(this);
+        JSC::JSLock::DropAllLocks dropAllLocks(JSDOMWindowBase::commonVM());
+        setCallingPlugin(true);
+        npErr = m_plugin-&gt;pluginFuncs()-&gt;getvalue(m_instance, NPPVpluginScriptableNPObject, &amp;object);
+        setCallingPlugin(false);
+        PluginView::setCurrentPluginView(0);
+    }
+
+    if (npErr != NPERR_NO_ERROR)
+        return 0;
+
+    return object;
+}
+#endif
+
+PassRefPtr&lt;JSC::Bindings::Instance&gt; PluginView::bindingInstance()
+{
+#if ENABLE(NETSCAPE_PLUGIN_API)
+    NPObject* object = npObject();
+    if (!object)
+        return 0;
+
+    if (hasOneRef()) {
+        // The renderer for the PluginView was destroyed during the above call, and
+        // the PluginView will be destroyed when this function returns, so we
+        // return null.
+        return 0;
+    }
+
+    RefPtr&lt;JSC::Bindings::RootObject&gt; root = m_parentFrame-&gt;script().createRootObject(this);
+    RefPtr&lt;JSC::Bindings::Instance&gt; instance = JSC::Bindings::CInstance::create(object, root.release());
+
+    _NPN_ReleaseObject(object);
+
+    return instance.release();
+#else
+    return 0;
+#endif
+}
+
+void PluginView::disconnectStream(PluginStream* stream)
+{
+    ASSERT(m_streams.contains(stream));
+
+    m_streams.remove(stream);
+}
+
+void PluginView::setParameters(const Vector&lt;String&gt;&amp; paramNames, const Vector&lt;String&gt;&amp; paramValues)
+{
+    ASSERT(paramNames.size() == paramValues.size());
+
+    unsigned size = paramNames.size();
+    unsigned paramCount = 0;
+
+    m_paramNames = reinterpret_cast&lt;char**&gt;(fastMalloc(sizeof(char*) * size));
+    m_paramValues = reinterpret_cast&lt;char**&gt;(fastMalloc(sizeof(char*) * size));
+
+    for (unsigned i = 0; i &lt; size; i++) {
+        if (m_plugin-&gt;quirks().contains(PluginQuirkRemoveWindowlessVideoParam) &amp;&amp; equalIgnoringCase(paramNames[i], &quot;windowlessvideo&quot;))
+            continue;
+
+        if (paramNames[i] == &quot;pluginspage&quot;)
+            m_pluginsPage = paramValues[i];
+
+        m_paramNames[paramCount] = createUTF8String(paramNames[i]);
+        m_paramValues[paramCount] = createUTF8String(paramValues[i]);
+
+        paramCount++;
+    }
+
+    m_paramCount = paramCount;
+}
+
+PluginView::PluginView(Frame* parentFrame, const IntSize&amp; size, PluginPackage* plugin, HTMLPlugInElement* element, const URL&amp; url, const Vector&lt;String&gt;&amp; paramNames, const Vector&lt;String&gt;&amp; paramValues, const String&amp; mimeType, bool loadManually)
+    : m_parentFrame(parentFrame)
+    , m_plugin(plugin)
+    , m_element(element)
+    , m_isStarted(false)
+    , m_url(url)
+    , m_status(PluginStatusLoadedSuccessfully)
+    , m_requestTimer(*this, &amp;PluginView::requestTimerFired)
+    , m_invalidateTimer(*this, &amp;PluginView::invalidateTimerFired)
+    , m_popPopupsStateTimer(*this, &amp;PluginView::popPopupsStateTimerFired)
+    , m_lifeSupportTimer(*this, &amp;PluginView::lifeSupportTimerFired)
+    , m_mode(loadManually ? NP_FULL : NP_EMBED)
+    , m_paramNames(0)
+    , m_paramValues(0)
+    , m_mimeType(mimeType)
+    , m_instance(0)
+#if defined(XP_MACOSX)
+    , m_isWindowed(false)
+    , m_updatedCocoaTextInputRequested(false)
+    , m_keyDownSent(false)
+    , m_disregardKeyUpCounter(0)
+#else
+    , m_isWindowed(true)
+#endif
+    , m_isTransparent(false)
+    , m_haveInitialized(false)
+    , m_isWaitingToStart(false)
+#if defined(XP_UNIX)
+    , m_needsXEmbed(false)
+#endif
+#if OS(WINDOWS) &amp;&amp; ENABLE(NETSCAPE_PLUGIN_API)
+    , m_pluginWndProc(0)
+    , m_lastMessage(0)
+    , m_isCallingPluginWndProc(false)
+    , m_wmPrintHDC(0)
+    , m_haveUpdatedPluginWidget(false)
+#endif
+#if PLATFORM(EFL)
+    , m_window(0)
+#endif
+#if defined(XP_MACOSX)
+    , m_contextRef(0)
+#endif
+#if defined(XP_UNIX) &amp;&amp; ENABLE(NETSCAPE_PLUGIN_API)
+    , m_hasPendingGeometryChange(true)
+    , m_drawable(0)
+    , m_visual(0)
+    , m_colormap(0)
+    , m_pluginDisplay(0)
+#endif
+    , m_loadManually(loadManually)
+    , m_manualStream(0)
+    , m_isJavaScriptPaused(false)
+    , m_haveCalledSetWindow(false)
+{
+    if (!m_plugin) {
+        m_status = PluginStatusCanNotFindPlugin;
+        return;
+    }
+
+    m_instance = &amp;m_instanceStruct;
+    m_instance-&gt;ndata = this;
+    m_instance-&gt;pdata = 0;
+
+    instanceMap().add(m_instance, this);
+
+    setParameters(paramNames, paramValues);
+
+    memset(&amp;m_npWindow, 0, sizeof(m_npWindow));
+#if defined(XP_MACOSX)
+    memset(&amp;m_npCgContext, 0, sizeof(m_npCgContext));
+#endif
+
+    resize(size);
+}
+
+void PluginView::focusPluginElement()
+{
+    if (Page* page = m_parentFrame-&gt;page())
+        page-&gt;focusController().setFocusedElement(m_element, m_parentFrame);
+    else
+        m_parentFrame-&gt;document()-&gt;setFocusedElement(m_element);
+}
+
+void PluginView::didReceiveResponse(const ResourceResponse&amp; response)
+{
+    if (m_status != PluginStatusLoadedSuccessfully)
+        return;
+
+    ASSERT(m_loadManually);
+    ASSERT(!m_manualStream);
+
+    m_manualStream = PluginStream::create(this, m_parentFrame.get(), m_parentFrame-&gt;loader().activeDocumentLoader()-&gt;request(), false, 0, plugin()-&gt;pluginFuncs(), instance(), m_plugin-&gt;quirks());
+    m_manualStream-&gt;setLoadManually(true);
+
+    m_manualStream-&gt;didReceiveResponse(0, response);
+}
+
+void PluginView::didReceiveData(const char* data, int length)
+{
+    if (m_status != PluginStatusLoadedSuccessfully)
+        return;
+
+    ASSERT(m_loadManually);
+    ASSERT(m_manualStream);
+    
+    m_manualStream-&gt;didReceiveData(0, data, length);
+}
+
+void PluginView::didFinishLoading()
+{
+    if (m_status != PluginStatusLoadedSuccessfully)
+        return;
+
+    ASSERT(m_loadManually);
+    ASSERT(m_manualStream);
+
+    m_manualStream-&gt;didFinishLoading(0);
+}
+
+void PluginView::didFail(const ResourceError&amp; error)
+{
+    if (m_status != PluginStatusLoadedSuccessfully)
+        return;
+
+    ASSERT(m_loadManually);
+    
+    if (m_manualStream)
+        m_manualStream-&gt;didFail(0, error);
+}
+
+void PluginView::setCallingPlugin(bool b) const
+{
+    if (!m_plugin-&gt;quirks().contains(PluginQuirkHasModalMessageLoop))
+        return;
+
+    if (b)
+        ++s_callingPlugin;
+    else
+        --s_callingPlugin;
+
+    ASSERT(s_callingPlugin &gt;= 0);
+}
+
+bool PluginView::isCallingPlugin()
+{
+    return s_callingPlugin &gt; 0;
+}
+
+PassRefPtr&lt;PluginView&gt; PluginView::create(Frame* parentFrame, const IntSize&amp; size, HTMLPlugInElement* element, const URL&amp; url, const Vector&lt;String&gt;&amp; paramNames, const Vector&lt;String&gt;&amp; paramValues, const String&amp; mimeType, bool loadManually)
+{
+    // if we fail to find a plugin for this MIME type, findPlugin will search for
+    // a plugin by the file extension and update the MIME type, so pass a mutable String
+    String mimeTypeCopy = mimeType;
+    PluginPackage* plugin = PluginDatabase::installedPlugins()-&gt;findPlugin(url, mimeTypeCopy);
+
+    // No plugin was found, try refreshing the database and searching again
+    if (!plugin &amp;&amp; PluginDatabase::installedPlugins()-&gt;refresh()) {
+        mimeTypeCopy = mimeType;
+        plugin = PluginDatabase::installedPlugins()-&gt;findPlugin(url, mimeTypeCopy);
+    }
+
+    return adoptRef(new PluginView(parentFrame, size, plugin, element, url, paramNames, paramValues, mimeTypeCopy, loadManually));
+}
+
+void PluginView::freeStringArray(char** stringArray, int length)
+{
+    if (!stringArray)
+        return;
+
+    for (int i = 0; i &lt; length; i++)
+        fastFree(stringArray[i]);
+
+    fastFree(stringArray);
+}
+
+static inline bool startsWithBlankLine(const Vector&lt;char&gt;&amp; buffer)
+{
+    return buffer.size() &gt; 0 &amp;&amp; buffer[0] == '\n';
+}
+
+static inline int locationAfterFirstBlankLine(const Vector&lt;char&gt;&amp; buffer)
+{
+    const char* bytes = buffer.data();
+    unsigned length = buffer.size();
+
+    for (unsigned i = 0; i &lt; length - 4; i++) {
+        // Support for Acrobat. It sends &quot;\n\n&quot;.
+        if (bytes[i] == '\n' &amp;&amp; bytes[i + 1] == '\n')
+            return i + 2;
+        
+        // Returns the position after 2 CRLF's or 1 CRLF if it is the first line.
+        if (bytes[i] == '\r' &amp;&amp; bytes[i + 1] == '\n') {
+            i += 2;
+            if (i == 2)
+                return i;
+            else if (bytes[i] == '\n')
+                // Support for Director. It sends &quot;\r\n\n&quot; (3880387).
+                return i + 1;
+            else if (bytes[i] == '\r' &amp;&amp; bytes[i + 1] == '\n')
+                // Support for Flash. It sends &quot;\r\n\r\n&quot; (3758113).
+                return i + 2;
+        }
+    }
+
+    return -1;
+}
+
+static inline const char* findEOL(const char* bytes, unsigned length)
+{
+    // According to the HTTP specification EOL is defined as
+    // a CRLF pair. Unfortunately, some servers will use LF
+    // instead. Worse yet, some servers will use a combination
+    // of both (e.g. &lt;header&gt;CRLFLF&lt;body&gt;), so findEOL needs
+    // to be more forgiving. It will now accept CRLF, LF or
+    // CR.
+    //
+    // It returns NULL if EOLF is not found or it will return
+    // a pointer to the first terminating character.
+    for (unsigned i = 0; i &lt; length; i++) {
+        if (bytes[i] == '\n')
+            return bytes + i;
+        if (bytes[i] == '\r') {
+            // Check to see if spanning buffer bounds
+            // (CRLF is across reads). If so, wait for
+            // next read.
+            if (i + 1 == length)
+                break;
+
+            return bytes + i;
+        }
+    }
+
+    return 0;
+}
+
+static inline String capitalizeRFC822HeaderFieldName(const String&amp; name)
+{
+    bool capitalizeCharacter = true;
+    String result;
+
+    for (unsigned i = 0; i &lt; name.length(); i++) {
+        UChar c;
+
+        if (capitalizeCharacter &amp;&amp; name[i] &gt;= 'a' &amp;&amp; name[i] &lt;= 'z')
+            c = toASCIIUpper(name[i]);
+        else if (!capitalizeCharacter &amp;&amp; name[i] &gt;= 'A' &amp;&amp; name[i] &lt;= 'Z')
+            c = toASCIILower(name[i]);
+        else
+            c = name[i];
+
+        if (name[i] == '-')
+            capitalizeCharacter = true;
+        else
+            capitalizeCharacter = false;
+
+        result.append(c);
+    }
+
+    return result;
+}
+
+static inline HTTPHeaderMap parseRFC822HeaderFields(const Vector&lt;char&gt;&amp; buffer, unsigned length)
+{
+    const char* bytes = buffer.data();
+    const char* eol;
+    String lastKey;
+    HTTPHeaderMap headerFields;
+
+    // Loop ove rlines until we're past the header, or we can't find any more end-of-lines
+    while ((eol = findEOL(bytes, length))) {
+        const char* line = bytes;
+        int lineLength = eol - bytes;
+        
+        // Move bytes to the character after the terminator as returned by findEOL.
+        bytes = eol + 1;
+        if ((*eol == '\r') &amp;&amp; (*bytes == '\n'))
+            bytes++; // Safe since findEOL won't return a spanning CRLF.
+
+        length -= (bytes - line);
+        if (lineLength == 0)
+            // Blank line; we're at the end of the header
+            break;
+        else if (*line == ' ' || *line == '\t') {
+            // Continuation of the previous header
+            if (lastKey.isNull()) {
+                // malformed header; ignore it and continue
+                continue;
+            } else {
+                // Merge the continuation of the previous header
+                String currentValue = headerFields.get(lastKey);
+                String newValue(line, lineLength);
+
+                headerFields.set(lastKey, currentValue + newValue);
+            }
+        } else {
+            // Brand new header
+            const char* colon;
+            for (colon = line; *colon != ':' &amp;&amp; colon != eol; colon++) {
+                // empty loop
+            }
+            if (colon == eol) 
+                // malformed header; ignore it and continue
+                continue;
+            else {
+                lastKey = capitalizeRFC822HeaderFieldName(String(line, colon - line));
+                String value;
+
+                for (colon++; colon != eol; colon++) {
+                    if (*colon != ' ' &amp;&amp; *colon != '\t')
+                        break;
+                }
+                if (colon == eol)
+                    value = &quot;&quot;;
+                else
+                    value = String(colon, eol - colon);
+
+                String oldValue = headerFields.get(lastKey);
+                if (!oldValue.isNull())
+                    value = oldValue + &quot;, &quot; + value;
+
+                headerFields.set(lastKey, value);
+            }
+        }
+    }
+
+    return headerFields;
+}
+
+NPError PluginView::handlePost(const char* url, const char* target, uint32_t len, const char* buf, bool file, void* notifyData, bool sendNotification, bool allowHeaders)
+{
+    if (!url || !len || !buf)
+        return NPERR_INVALID_PARAM;
+
+    FrameLoadRequest frameLoadRequest(m_parentFrame-&gt;document()-&gt;securityOrigin());
+
+    HTTPHeaderMap headerFields;
+    Vector&lt;char&gt; buffer;
+    
+    if (file) {
+        NPError readResult = handlePostReadFile(buffer, len, buf);
+        if(readResult != NPERR_NO_ERROR)
+            return readResult;
+    } else {
+        buffer.resize(len);
+        memcpy(buffer.data(), buf, len);
+    }
+
+    const char* postData = buffer.data();
+    int postDataLength = buffer.size();
+
+    if (allowHeaders) {
+        if (startsWithBlankLine(buffer)) {
+            postData++;
+            postDataLength--;
+        } else {
+            int location = locationAfterFirstBlankLine(buffer);
+            if (location != -1) {
+                // If the blank line is somewhere in the middle of the buffer, everything before is the header
+                headerFields = parseRFC822HeaderFields(buffer, location);
+                unsigned dataLength = buffer.size() - location;
+
+                // Sometimes plugins like to set Content-Length themselves when they post,
+                // but WebFoundation does not like that. So we will remove the header
+                // and instead truncate the data to the requested length.
+                String contentLength = headerFields.get(HTTPHeaderName::ContentLength);
+
+                if (!contentLength.isNull())
+                    dataLength = min(contentLength.toInt(), (int)dataLength);
+                headerFields.remove(HTTPHeaderName::ContentLength);
+
+                postData += location;
+                postDataLength = dataLength;
+            }
+        }
+    }
+
+    frameLoadRequest.resourceRequest().setHTTPMethod(&quot;POST&quot;);
+    frameLoadRequest.resourceRequest().setURL(makeURL(m_parentFrame-&gt;document()-&gt;baseURL(), url));
+    frameLoadRequest.resourceRequest().setHTTPHeaderFields(WTF::move(headerFields));
+    frameLoadRequest.resourceRequest().setHTTPBody(FormData::create(postData, postDataLength));
+    frameLoadRequest.setFrameName(target);
+
+    return load(frameLoadRequest, sendNotification, notifyData);
+}
+
+void PluginView::invalidateWindowlessPluginRect(const IntRect&amp; rect)
+{
+    if (!isVisible())
+        return;
+    
+    if (!m_element-&gt;renderer())
+        return;
+    auto&amp; renderer = downcast&lt;RenderBox&gt;(*m_element-&gt;renderer());
+    
+    IntRect dirtyRect = rect;
+    dirtyRect.move(renderer.borderLeft() + renderer.paddingLeft(), renderer.borderTop() + renderer.paddingTop());
+    renderer.repaintRectangle(dirtyRect);
+}
+
+void PluginView::paintMissingPluginIcon(GraphicsContext* context, const IntRect&amp; rect)
+{
+    static RefPtr&lt;Image&gt; nullPluginImage;
+    if (!nullPluginImage)
+        nullPluginImage = Image::loadPlatformResource(&quot;nullPlugin&quot;);
+
+    IntRect imageRect(frameRect().x(), frameRect().y(), nullPluginImage-&gt;width(), nullPluginImage-&gt;height());
+
+    int xOffset = (frameRect().width() - imageRect.width()) / 2;
+    int yOffset = (frameRect().height() - imageRect.height()) / 2;
+
+    imageRect.move(xOffset, yOffset);
+
+    if (!rect.intersects(imageRect))
+        return;
+
+    context-&gt;save();
+    context-&gt;clip(windowClipRect());
+    context-&gt;drawImage(nullPluginImage.get(), ColorSpaceDeviceRGB, imageRect.location());
+    context-&gt;restore();
+}
+
+static const char* MozillaUserAgent = &quot;Mozilla/5.0 (&quot;
+#if defined(XP_MACOSX)
+        &quot;Macintosh; U; Intel Mac OS X;&quot;
+#elif defined(XP_WIN)
+        &quot;Windows; U; Windows NT 5.1;&quot;
+#elif defined(XP_UNIX)
+// The Gtk port uses X11 plugins in Mac.
+#if OS(DARWIN) &amp;&amp; PLATFORM(GTK)
+    &quot;X11; U; Intel Mac OS X;&quot;
+#else
+    &quot;X11; U; Linux i686;&quot;
+#endif
+#endif
+        &quot; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0&quot;;
+
+static const char* const ChromeUserAgent = &quot;Mozilla/5.0 (&quot;
+#if defined(XP_MACOSX)
+    &quot;Macintosh; U; Intel Mac OS X;&quot;
+#elif defined(XP_WIN)
+    &quot;Windows; U; Windows NT 5.1;&quot;
+#elif defined(XP_UNIX)
+    // The Gtk port uses X11 plugins in Mac.
+#if OS(DARWIN) &amp;&amp; PLATFORM(GTK)
+    &quot;X11; U; Intel Mac OS X;&quot;
+#else
+    &quot;X11; U; Linux i686;&quot;
+#endif
+#endif
+    &quot; AppleWebKit/534.34 (KHTML, like Gecko) Chrome/19.0.1055.1 Safari/534.34&quot;;
+
+const char* PluginView::userAgent()
+{
+    if (m_plugin-&gt;quirks().contains(PluginQuirkWantsMozillaUserAgent))
+        return MozillaUserAgent;
+    else if (m_plugin-&gt;quirks().contains(PluginQuirkWantsChromeUserAgent))
+        return ChromeUserAgent;
+    if (m_userAgent.isNull())
+        m_userAgent = m_parentFrame-&gt;loader().userAgent(m_url).utf8();
+
+    return m_userAgent.data();
+}
+
+#if ENABLE(NETSCAPE_PLUGIN_API)
+const char* PluginView::userAgentStatic()
+{
+    return MozillaUserAgent;
+}
+#endif
+
+
+void PluginView::lifeSupportTimerFired()
+{
+    deref();
+}
+
+void PluginView::keepAlive()
+{
+    if (m_lifeSupportTimer.isActive())
+        return;
+
+    ref();
+    m_lifeSupportTimer.startOneShot(0);
+}
+
+#if ENABLE(NETSCAPE_PLUGIN_API)
+void PluginView::keepAlive(NPP instance)
+{
+    PluginView* view = instanceMap().get(instance);
+    if (!view)
+        return;
+
+    view-&gt;keepAlive();
+}
+
+NPError PluginView::getValueStatic(NPNVariable variable, void* value)
+{
+    LOG(Plugins, &quot;PluginView::getValueStatic(%s)&quot;, prettyNameForNPNVariable(variable).data());
+
+    NPError result;
+    if (platformGetValueStatic(variable, value, &amp;result))
+        return result;
+
+    return NPERR_GENERIC_ERROR;
+}
+
+NPError PluginView::getValue(NPNVariable variable, void* value)
+{
+    LOG(Plugins, &quot;PluginView::getValue(%s)&quot;, prettyNameForNPNVariable(variable).data());
+
+    NPError result;
+    if (platformGetValue(variable, value, &amp;result))
+        return result;
+
+    if (platformGetValueStatic(variable, value, &amp;result))
+        return result;
+
+    switch (variable) {
+    case NPNVWindowNPObject: {
+        if (m_isJavaScriptPaused)
+            return NPERR_GENERIC_ERROR;
+
+        NPObject* windowScriptObject = m_parentFrame-&gt;script().windowScriptNPObject();
+
+        // Return value is expected to be retained, as described here: &lt;http://www.mozilla.org/projects/plugin/npruntime.html&gt;
+        if (windowScriptObject)
+            _NPN_RetainObject(windowScriptObject);
+
+        void** v = (void**)value;
+        *v = windowScriptObject;
+
+        return NPERR_NO_ERROR;
+    }
+
+    case NPNVPluginElementNPObject: {
+        if (m_isJavaScriptPaused)
+            return NPERR_GENERIC_ERROR;
+
+        NPObject* pluginScriptObject = 0;
+
+        if (m_element-&gt;hasTagName(appletTag) || m_element-&gt;hasTagName(embedTag) || m_element-&gt;hasTagName(objectTag))
+            pluginScriptObject = m_element-&gt;getNPObject();
+
+        // Return value is expected to be retained, as described here: &lt;http://www.mozilla.org/projects/plugin/npruntime.html&gt;
+        if (pluginScriptObject)
+            _NPN_RetainObject(pluginScriptObject);
+
+        void** v = (void**)value;
+        *v = pluginScriptObject;
+
+        return NPERR_NO_ERROR;
+    }
+
+    case NPNVprivateModeBool: {
+        Page* page = m_parentFrame-&gt;page();
+        if (!page)
+            return NPERR_GENERIC_ERROR;
+        *((NPBool*)value) = page-&gt;usesEphemeralSession();
+        return NPERR_NO_ERROR;
+    }
+
+    default:
+        return NPERR_GENERIC_ERROR;
+    }
+}
+
+static Frame* getFrame(Frame* parentFrame, Element* element)
+{
+    if (parentFrame)
+        return parentFrame;
+    
+    return element-&gt;document().frame();
+}
+
+NPError PluginView::getValueForURL(NPNURLVariable variable, const char* url, char** value, uint32_t* len)
+{
+    LOG(Plugins, &quot;PluginView::getValueForURL(%s)&quot;, prettyNameForNPNURLVariable(variable).data());
+
+    NPError result = NPERR_NO_ERROR;
+
+    switch (variable) {
+    case NPNURLVCookie: {
+        URL u(m_parentFrame-&gt;document()-&gt;baseURL(), url);
+        if (u.isValid()) {
+            Frame* frame = getFrame(parentFrame(), m_element);
+            if (frame) {
+                const CString cookieStr = cookies(frame-&gt;document(), u).utf8();
+                if (!cookieStr.isNull()) {
+                    const int size = cookieStr.length();
+                    *value = static_cast&lt;char*&gt;(NPN_MemAlloc(size+1));
+                    if (*value) {
+                        memset(*value, 0, size+1);
+                        memcpy(*value, cookieStr.data(), size+1);
+                        if (len)
+                            *len = size;
+                    } else
+                        result = NPERR_OUT_OF_MEMORY_ERROR;
+                }
+            }
+        } else
+            result = NPERR_INVALID_URL;
+        break;
+    }
+    case NPNURLVProxy: {
+        URL u(m_parentFrame-&gt;document()-&gt;baseURL(), url);
+        if (u.isValid()) {
+            Frame* frame = getFrame(parentFrame(), m_element);
+            const FrameLoader* frameLoader = frame ? &amp;frame-&gt;loader() : 0;
+            const NetworkingContext* context = frameLoader ? frameLoader-&gt;networkingContext() : 0;
+            const CString proxyStr = toString(proxyServersForURL(u, context)).utf8();
+            if (!proxyStr.isNull()) {
+                const int size = proxyStr.length();
+                *value = static_cast&lt;char*&gt;(NPN_MemAlloc(size+1));
+                if (*value) {
+                    memset(*value, 0, size+1);
+                    memcpy(*value, proxyStr.data(), size+1);
+                    if (len)
+                        *len = size;
+                } else
+                    result = NPERR_OUT_OF_MEMORY_ERROR;
+            }
+        } else
+            result = NPERR_INVALID_URL;
+        break;
+    }
+    default:
+        result = NPERR_GENERIC_ERROR;
+        LOG(Plugins, &quot;PluginView::getValueForURL: %s&quot;, prettyNameForNPNURLVariable(variable).data());
+        break;
+    }
+
+    return result;
+}
+
+
+NPError PluginView::setValueForURL(NPNURLVariable variable, const char* url, const char* value, uint32_t len)
+{
+    LOG(Plugins, &quot;PluginView::setValueForURL(%s)&quot;, prettyNameForNPNURLVariable(variable).data());
+
+    NPError result = NPERR_NO_ERROR;
+
+    switch (variable) {
+    case NPNURLVCookie: {
+        URL u(m_parentFrame-&gt;document()-&gt;baseURL(), url);
+        if (u.isValid()) {
+            const String cookieStr = String::fromUTF8(value, len);
+            Frame* frame = getFrame(parentFrame(), m_element);
+            if (frame &amp;&amp; !cookieStr.isEmpty())
+                setCookies(frame-&gt;document(), u, cookieStr);
+        } else
+            result = NPERR_INVALID_URL;
+        break;
+    }
+    case NPNURLVProxy:
+        LOG(Plugins, &quot;PluginView::setValueForURL(%s): Plugins are NOT allowed to set proxy information.&quot;, prettyNameForNPNURLVariable(variable).data());
+        result = NPERR_GENERIC_ERROR;
+        break;
+    default:
+        LOG(Plugins, &quot;PluginView::setValueForURL: %s&quot;, prettyNameForNPNURLVariable(variable).data());
+        result = NPERR_GENERIC_ERROR;
+        break;
+    }
+
+    return result;
+}
+
+NPError PluginView::getAuthenticationInfo(const char* protocol, const char* host, int32_t port, const char* /* scheme */, const char* /* realm */, char**  /* username */, uint32_t* /* ulen */, char** /* password */, uint32_t* /* plen */)
+{
+#if LOG_DISABLED
+    UNUSED_PARAM(protocol);
+    UNUSED_PARAM(host);
+    UNUSED_PARAM(port);
+#endif
+    LOG(Plugins, &quot;PluginView::getAuthenticationInfo: protocol=%s, host=%s, port=%d&quot;, protocol, host, port);
+    notImplemented();
+    return NPERR_GENERIC_ERROR;
+}
+#endif
+
+void PluginView::privateBrowsingStateChanged(bool privateBrowsingEnabled)
+{
+    NPP_SetValueProcPtr setValue = m_plugin-&gt;pluginFuncs()-&gt;setvalue;
+    if (!setValue)
+        return;
+
+    PluginView::setCurrentPluginView(this);
+    JSC::JSLock::DropAllLocks dropAllLocks(JSDOMWindowBase::commonVM());
+    setCallingPlugin(true);
+    NPBool value = privateBrowsingEnabled;
+    setValue(m_instance, NPNVprivateModeBool, &amp;value);
+    setCallingPlugin(false);
+    PluginView::setCurrentPluginView(0);
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(NETSCAPE_PLUGIN_API)
</ins></span></pre></div>
<a id="trunkSourceWebKitwinPluginsPluginViewhfromrev178217trunkSourceWebCorepluginsPluginViewh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit/win/Plugins/PluginView.h (from rev 178217, trunk/Source/WebCore/plugins/PluginView.h) (0 => 178219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/Plugins/PluginView.h                                (rev 0)
+++ trunk/Source/WebKit/win/Plugins/PluginView.h        2015-01-10 00:16:52 UTC (rev 178219)
</span><span class="lines">@@ -0,0 +1,440 @@
</span><ins>+/*
+ * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2008 Collabora Ltd. All rights reserved.
+ * Copyright (C) 2009 Girish Ramakrishnan &lt;girish@forwardbias.in&gt;
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#ifndef PluginView_h
+#define PluginView_h
+
+#include &quot;FrameLoadRequest.h&quot;
+#include &quot;IntRect.h&quot;
+#include &quot;MediaCanStartListener.h&quot;
+#include &quot;PluginViewBase.h&quot;
+#include &quot;ResourceRequest.h&quot;
+#include &quot;Timer.h&quot;
+#include &lt;wtf/HashMap.h&gt;
+#include &lt;wtf/HashSet.h&gt;
+#include &lt;wtf/OwnPtr.h&gt;
+#include &lt;wtf/PassRefPtr.h&gt;
+#include &lt;wtf/RefPtr.h&gt;
+#include &lt;wtf/Vector.h&gt;
+#include &lt;wtf/text/CString.h&gt;
+
+#if ENABLE(NETSCAPE_PLUGIN_API)
+#include &quot;PluginStream.h&quot;
+#include &quot;npruntime_internal.h&quot;
+#endif
+
+#if OS(WINDOWS) &amp;&amp; PLATFORM(GTK)
+typedef struct HWND__* HWND;
+typedef HWND PlatformPluginWidget;
+#else
+typedef PlatformWidget PlatformPluginWidget;
+#endif
+#if PLATFORM(GTK)
+typedef struct _GtkSocket GtkSocket;
+#endif
+
+#if PLATFORM(X11)
+typedef unsigned long Window;
+typedef struct _XDisplay Display;
+#endif
+
+namespace JSC {
+    namespace Bindings {
+        class Instance;
+    }
+}
+
+namespace WebCore {
+    class Frame;
+    class FrameView;
+    class Image;
+    class HTMLPlugInElement;
+    class KeyboardEvent;
+    class MouseEvent;
+    class URL;
+#if OS(WINDOWS) &amp;&amp; ENABLE(NETSCAPE_PLUGIN_API)
+    class PluginMessageThrottlerWin;
+#endif
+    class PluginPackage;
+    class PluginRequest;
+    class PluginStream;
+    class ResourceError;
+    class ResourceResponse;
+    class WheelEvent;
+
+    enum PluginStatus {
+        PluginStatusCanNotFindPlugin,
+        PluginStatusCanNotLoadPlugin,
+        PluginStatusLoadedSuccessfully
+    };
+
+    class PluginRequest {
+        WTF_MAKE_NONCOPYABLE(PluginRequest); WTF_MAKE_FAST_ALLOCATED;
+    public:
+        PluginRequest(const FrameLoadRequest&amp; frameLoadRequest, bool sendNotification, void* notifyData, bool shouldAllowPopups)
+            : m_frameLoadRequest(frameLoadRequest)
+            , m_notifyData(notifyData)
+            , m_sendNotification(sendNotification)
+            , m_shouldAllowPopups(shouldAllowPopups) { }
+    public:
+        const FrameLoadRequest&amp; frameLoadRequest() const { return m_frameLoadRequest; }
+        void* notifyData() const { return m_notifyData; }
+        bool sendNotification() const { return m_sendNotification; }
+        bool shouldAllowPopups() const { return m_shouldAllowPopups; }
+    private:
+        FrameLoadRequest m_frameLoadRequest;
+        void* m_notifyData;
+        bool m_sendNotification;
+        bool m_shouldAllowPopups;
+    };
+
+    class PluginManualLoader {
+    public:
+        virtual ~PluginManualLoader() {}
+        virtual void didReceiveResponse(const ResourceResponse&amp;) = 0;
+        virtual void didReceiveData(const char*, int) = 0;
+        virtual void didFinishLoading() = 0;
+        virtual void didFail(const ResourceError&amp;) = 0;
+    };
+
+    class PluginView : public PluginViewBase
+#if ENABLE(NETSCAPE_PLUGIN_API)
+                     , private PluginStreamClient
+#endif
+                     , public PluginManualLoader
+                     , private MediaCanStartListener {
+    public:
+        static PassRefPtr&lt;PluginView&gt; create(Frame* parentFrame, const IntSize&amp;, HTMLPlugInElement*, const URL&amp;, const Vector&lt;String&gt;&amp; paramNames, const Vector&lt;String&gt;&amp; paramValues, const String&amp; mimeType, bool loadManually);
+        virtual ~PluginView();
+
+        PluginPackage* plugin() const { return m_plugin.get(); }
+#if ENABLE(NETSCAPE_PLUGIN_API)
+        NPP instance() const { return m_instance; }
+#endif
+
+        void setNPWindowRect(const IntRect&amp;);
+        static PluginView* currentPluginView();
+
+#if ENABLE(NETSCAPE_PLUGIN_API)
+        NPObject* npObject();
+#endif
+        PassRefPtr&lt;JSC::Bindings::Instance&gt; bindingInstance();
+
+        PluginStatus status() const { return m_status; }
+
+#if ENABLE(NETSCAPE_PLUGIN_API)
+        // NPN functions
+        NPError getURLNotify(const char* url, const char* target, void* notifyData);
+        NPError getURL(const char* url, const char* target);
+        NPError postURLNotify(const char* url, const char* target, uint32_t len, const char* but, NPBool file, void* notifyData);
+        NPError postURL(const char* url, const char* target, uint32_t len, const char* but, NPBool file);
+        NPError newStream(NPMIMEType type, const char* target, NPStream** stream);
+        int32_t write(NPStream* stream, int32_t len, void* buffer);
+        NPError destroyStream(NPStream* stream, NPReason reason);
+#endif
+        const char* userAgent();
+#if ENABLE(NETSCAPE_PLUGIN_API)
+        static const char* userAgentStatic();
+#endif
+        void status(const char* message);
+        
+#if ENABLE(NETSCAPE_PLUGIN_API)
+        NPError getValue(NPNVariable variable, void* value);
+        static NPError getValueStatic(NPNVariable variable, void* value);
+        NPError setValue(NPPVariable variable, void* value);
+        NPError getValueForURL(NPNURLVariable variable, const char* url, char** value, uint32_t* len);
+        NPError setValueForURL(NPNURLVariable variable, const char* url, const char* value, uint32_t len);
+        NPError getAuthenticationInfo(const char* protocol, const char* host, int32_t port, const char* scheme, const char* realm, char** username, uint32_t* ulen, char** password, uint32_t* plen);
+        void invalidateRect(NPRect*);
+        void invalidateRegion(NPRegion);
+#endif
+        void forceRedraw();
+        void pushPopupsEnabledState(bool state);
+        void popPopupsEnabledState();
+
+        virtual void invalidateRect(const IntRect&amp;);
+
+        bool arePopupsAllowed() const;
+
+        void setJavaScriptPaused(bool);
+
+        void privateBrowsingStateChanged(bool);
+
+        void disconnectStream(PluginStream*);
+        void streamDidFinishLoading(PluginStream* stream) { disconnectStream(stream); }
+
+        // Widget functions
+        virtual void setFrameRect(const IntRect&amp;);
+        virtual void frameRectsChanged();
+        virtual void setFocus(bool);
+        virtual void show();
+        virtual void hide();
+        virtual void paint(GraphicsContext*, const IntRect&amp;);
+        virtual void clipRectChanged() override;
+
+        // This method is used by plugins on all platforms to obtain a clip rect that includes clips set by WebCore,
+        // e.g., in overflow:auto sections.  The clip rects coordinates are in the containing window's coordinate space.
+        // This clip includes any clips that the widget itself sets up for its children.
+        IntRect windowClipRect() const;
+
+        virtual void handleEvent(Event*);
+        virtual void setParent(ScrollView*);
+        virtual void setParentVisible(bool);
+
+        virtual bool isPluginView() const override { return true; }
+
+        Frame* parentFrame() const { return m_parentFrame.get(); }
+
+        void focusPluginElement();
+
+        const String&amp; pluginsPage() const { return m_pluginsPage; }
+        const String&amp; mimeType() const { return m_mimeType; }
+        const URL&amp; url() const { return m_url; }
+
+#if defined(XP_MACOSX) &amp;&amp; ENABLE(NETSCAPE_PLUGIN_API)
+        bool popUpContextMenu(NPMenu*);
+#endif
+
+#if OS(WINDOWS) &amp;&amp; ENABLE(NETSCAPE_PLUGIN_API)
+        static LRESULT CALLBACK PluginViewWndProc(HWND, UINT, WPARAM, LPARAM);
+        LRESULT wndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
+        WNDPROC pluginWndProc() const { return m_pluginWndProc; }
+#endif
+
+        // Used for manual loading
+        void didReceiveResponse(const ResourceResponse&amp;);
+        void didReceiveData(const char*, int);
+        void didFinishLoading();
+        void didFail(const ResourceError&amp;);
+
+        static bool isCallingPlugin();
+
+        bool start();
+
+#if ENABLE(NETSCAPE_PLUGIN_API)
+        static void keepAlive(NPP);
+#endif
+        void keepAlive();
+
+#if PLATFORM(X11)
+        static Display* getPluginDisplay(Frame*);
+        static Window getRootWindow(Frame* parentFrame);
+#endif
+
+    private:
+        PluginView(Frame* parentFrame, const IntSize&amp;, PluginPackage*, HTMLPlugInElement*, const URL&amp;, const Vector&lt;String&gt;&amp; paramNames, const Vector&lt;String&gt;&amp; paramValues, const String&amp; mimeType, bool loadManually);
+
+        void setParameters(const Vector&lt;String&gt;&amp; paramNames, const Vector&lt;String&gt;&amp; paramValues);
+        bool startOrAddToUnstartedList();
+        void init();
+        bool platformStart();
+        void stop();
+        void platformDestroy();
+        static void setCurrentPluginView(PluginView*);
+#if ENABLE(NETSCAPE_PLUGIN_API)
+        NPError load(const FrameLoadRequest&amp;, bool sendNotification, void* notifyData);
+        NPError handlePost(const char* url, const char* target, uint32_t len, const char* buf, bool file, void* notifyData, bool sendNotification, bool allowHeaders);
+        NPError handlePostReadFile(Vector&lt;char&gt;&amp; buffer, uint32_t len, const char* buf);
+#endif
+        static void freeStringArray(char** stringArray, int length);
+        void setCallingPlugin(bool) const;
+
+        void invalidateWindowlessPluginRect(const IntRect&amp;);
+
+        virtual void mediaCanStart();
+
+#if OS(WINDOWS) &amp;&amp; ENABLE(NETSCAPE_PLUGIN_API)
+        void paintWindowedPluginIntoContext(GraphicsContext*, const IntRect&amp;);
+        static HDC WINAPI hookedBeginPaint(HWND, PAINTSTRUCT*);
+        static BOOL WINAPI hookedEndPaint(HWND, const PAINTSTRUCT*);
+#endif
+
+#if ENABLE(NETSCAPE_PLUGIN_API)
+        static bool platformGetValueStatic(NPNVariable variable, void* value, NPError* result);
+        bool platformGetValue(NPNVariable variable, void* value, NPError* result);
+#endif
+
+        RefPtr&lt;Frame&gt; m_parentFrame;
+        RefPtr&lt;PluginPackage&gt; m_plugin;
+        HTMLPlugInElement* m_element;
+        bool m_isStarted;
+        URL m_url;
+        PluginStatus m_status;
+        Vector&lt;IntRect&gt; m_invalidRects;
+
+        void performRequest(PluginRequest*);
+        void scheduleRequest(std::unique_ptr&lt;PluginRequest&gt;);
+        void requestTimerFired();
+        void invalidateTimerFired();
+        Timer m_requestTimer;
+        Timer m_invalidateTimer;
+
+        void popPopupsStateTimerFired();
+        Timer m_popPopupsStateTimer;
+
+        void lifeSupportTimerFired();
+        Timer m_lifeSupportTimer;
+
+#if ENABLE(NETSCAPE_PLUGIN_API)
+        bool dispatchNPEvent(NPEvent&amp;);
+#endif
+#if defined(XP_MACOSX) &amp;&amp; ENABLE(NETSCAPE_PLUGIN_API)
+        int16_t dispatchNPCocoaEvent(NPCocoaEvent&amp;);
+        bool m_updatedCocoaTextInputRequested;
+        bool m_keyDownSent;
+        uint16_t m_disregardKeyUpCounter;
+#endif
+
+#if defined(XP_MACOSX)
+        void handleWheelEvent(WheelEvent*);
+#endif
+        void updatePluginWidget();
+        void paintMissingPluginIcon(GraphicsContext*, const IntRect&amp;);
+
+        void handleKeyboardEvent(KeyboardEvent*);
+        void handleMouseEvent(MouseEvent*);
+#if defined(XP_UNIX) &amp;&amp; ENABLE(NETSCAPE_PLUGIN_API)
+        void handleFocusInEvent();
+        void handleFocusOutEvent();
+#endif
+
+#if OS(WINDOWS)
+        void paintIntoTransformedContext(HDC);
+        PassRefPtr&lt;Image&gt; snapshot();
+#endif
+
+        int m_mode;
+        int m_paramCount;
+        char** m_paramNames;
+        char** m_paramValues;
+        String m_pluginsPage;
+
+        String m_mimeType;
+        WTF::CString m_userAgent;
+
+#if ENABLE(NETSCAPE_PLUGIN_API)
+        NPP m_instance;
+        NPP_t m_instanceStruct;
+        NPWindow m_npWindow;
+#endif
+
+        Vector&lt;bool, 4&gt; m_popupStateStack;
+
+        HashSet&lt;RefPtr&lt;PluginStream&gt; &gt; m_streams;
+        Vector&lt;std::unique_ptr&lt;PluginRequest&gt;&gt; m_requests;
+
+        bool m_isWindowed;
+        bool m_isTransparent;
+        bool m_haveInitialized;
+        bool m_isWaitingToStart;
+
+#if defined(XP_UNIX)
+        bool m_needsXEmbed;
+#endif
+
+#if OS(WINDOWS) &amp;&amp; ENABLE(NETSCAPE_PLUGIN_API)
+        OwnPtr&lt;PluginMessageThrottlerWin&gt; m_messageThrottler;
+        WNDPROC m_pluginWndProc;
+        unsigned m_lastMessage;
+        bool m_isCallingPluginWndProc;
+        HDC m_wmPrintHDC;
+        bool m_haveUpdatedPluginWidget;
+#endif
+
+#if (PLATFORM(GTK) &amp;&amp; OS(WINDOWS)) || PLATFORM(EFL)
+        // On Mac OSX and Qt/Windows the plugin does not have its own native widget,
+        // but is using the containing window as its reference for positioning/painting.
+        PlatformPluginWidget m_window;
+public:
+        PlatformPluginWidget platformPluginWidget() const { return m_window; }
+        void setPlatformPluginWidget(PlatformPluginWidget widget) { m_window = widget; }
+#else
+public:
+        void setPlatformPluginWidget(PlatformPluginWidget widget) { setPlatformWidget(widget); }
+        PlatformPluginWidget platformPluginWidget() const { return platformWidget(); }
+#endif
+
+private:
+
+#if defined(XP_UNIX) || PLATFORM(GTK)
+        void setNPWindowIfNeeded();
+#elif defined(XP_MACOSX)
+        NP_CGContext m_npCgContext;
+        CGContextRef m_contextRef;
+
+        void setNPWindowIfNeeded();
+#endif
+
+#if defined(XP_UNIX) &amp;&amp; ENABLE(NETSCAPE_PLUGIN_API)
+        bool m_hasPendingGeometryChange;
+        Pixmap m_drawable;
+        Visual* m_visual;
+        Colormap m_colormap;
+        Display* m_pluginDisplay;
+
+        void initXEvent(XEvent* event);
+#endif
+
+#if PLATFORM(GTK)
+        static gboolean plugRemovedCallback(GtkSocket*, PluginView*);
+        static void plugAddedCallback(GtkSocket*, PluginView*);
+        void updateWidgetAllocationAndClip();
+        bool m_plugAdded;
+        IntRect m_delayedAllocation;
+#endif
+
+        IntRect m_clipRect; // The clip rect to apply to a windowed plug-in
+        IntRect m_windowRect; // Our window rect.
+
+        bool m_loadManually;
+        RefPtr&lt;PluginStream&gt; m_manualStream;
+
+        bool m_isJavaScriptPaused;
+
+        bool m_haveCalledSetWindow;
+
+        static PluginView* s_currentPluginView;
+    };
+
+inline PluginView* toPluginView(Widget* widget)
+{
+    ASSERT(!widget || widget-&gt;isPluginView());
+    return static_cast&lt;PluginView*&gt;(widget);
+}
+
+inline const PluginView* toPluginView(const Widget* widget)
+{
+    ASSERT(!widget || widget-&gt;isPluginView());
+    return static_cast&lt;const PluginView*&gt;(widget);
+}
+
+// This will catch anyone doing an unnecessary cast.
+void toPluginView(const PluginView*);
+
+} // namespace WebCore
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKitwinPluginsPluginViewWincppfromrev178217trunkSourceWebCorepluginswinPluginViewWincpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit/win/Plugins/PluginViewWin.cpp (from rev 178217, trunk/Source/WebCore/plugins/win/PluginViewWin.cpp) (0 => 178219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/Plugins/PluginViewWin.cpp                                (rev 0)
+++ trunk/Source/WebKit/win/Plugins/PluginViewWin.cpp        2015-01-10 00:16:52 UTC (rev 178219)
</span><span class="lines">@@ -0,0 +1,1011 @@
</span><ins>+/*
+ * Copyright (C) 2006, 2007, 2008, 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2008 Collabora Ltd. All rights reserved.
+ * Copyright (C) 2008-2009 Torch Mobile, Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#include &quot;config.h&quot;
+#include &quot;PluginView.h&quot;
+
+#include &lt;WebCore/BitmapImage.h&gt;
+#include &lt;WebCore/BitmapInfo.h&gt;
+#include &lt;WebCore/BridgeJSC.h&gt;
+#include &lt;WebCore/Chrome.h&gt;
+#include &lt;WebCore/ChromeClient.h&gt;
+#include &lt;WebCore/Document.h&gt;
+#include &lt;WebCore/DocumentLoader.h&gt;
+#include &lt;WebCore/Element.h&gt;
+#include &lt;WebCore/EventNames.h&gt;
+#include &lt;WebCore/FocusController.h&gt;
+#include &lt;WebCore/Frame.h&gt;
+#include &lt;WebCore/FrameLoadRequest.h&gt;
+#include &lt;WebCore/FrameLoader.h&gt;
+#include &lt;WebCore/FrameTree.h&gt;
+#include &lt;WebCore/FrameView.h&gt;
+#include &lt;WebCore/GraphicsContext.h&gt;
+#include &lt;WebCore/HTMLNames.h&gt;
+#include &lt;WebCore/HTMLPlugInElement.h&gt;
+#include &lt;WebCore/HostWindow.h&gt;
+#include &lt;WebCore/Image.h&gt;
+#include &lt;WebCore/JSDOMBinding.h&gt;
+#include &lt;WebCore/JSDOMWindow.h&gt;
+#include &lt;WebCore/KeyboardEvent.h&gt;
+#include &lt;WebCore/LocalWindowsContext.h&gt;
+#include &lt;WebCore/MIMETypeRegistry.h&gt;
+#include &lt;WebCore/MouseEvent.h&gt;
+#include &lt;WebCore/Page.h&gt;
+#include &lt;WebCore/PlatformMouseEvent.h&gt;
+#include &quot;PluginDatabase.h&quot;
+#include &quot;PluginDebug.h&quot;
+#include &quot;PluginMainThreadScheduler.h&quot;
+#include &quot;PluginMessageThrottlerWin.h&quot;
+#include &quot;PluginPackage.h&quot;
+#include &lt;WebCore/RenderWidget.h&gt;
+#include &lt;WebCore/Settings.h&gt;
+#include &lt;WebCore/WebCoreInstanceHandle.h&gt;
+#include &lt;WebCore/c_instance.h&gt;
+#include &lt;WebCore/npruntime_impl.h&gt;
+#include &lt;WebCore/runtime_root.h&gt;
+#include &lt;runtime/JSCJSValue.h&gt;
+#include &lt;runtime/JSLock.h&gt;
+#include &lt;wtf/ASCIICType.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+#include &lt;wtf/win/GDIObject.h&gt;
+
+#if USE(CAIRO)
+#include &quot;PlatformContextCairo.h&quot;
+#include &lt;cairo-win32.h&gt;
+#endif
+
+#if PLATFORM(GTK)
+#include &lt;gdk/gdkwin32.h&gt;
+#include &lt;gtk/gtk.h&gt;
+#endif
+
+static inline HWND windowHandleForPageClient(PlatformPageClient client)
+{
+#if PLATFORM(GTK)
+    if (!client)
+        return 0;
+    if (GdkWindow* window = gtk_widget_get_window(client))
+        return static_cast&lt;HWND&gt;(GDK_WINDOW_HWND(window));
+    return 0;
+#else
+    return client;
+#endif
+}
+
+using JSC::ExecState;
+using JSC::JSLock;
+using JSC::JSObject;
+
+using std::min;
+
+using namespace WTF;
+
+namespace WebCore {
+
+using namespace HTMLNames;
+
+const LPCWSTR kWebPluginViewdowClassName = L&quot;WebPluginView&quot;;
+const LPCWSTR kWebPluginViewProperty = L&quot;WebPluginViewProperty&quot;;
+
+// The code used to hook BeginPaint/EndPaint originally came from
+// &lt;http://www.fengyuan.com/article/wmprint.html&gt;.
+// Copyright (C) 2000 by Feng Yuan (www.fengyuan.com).
+
+static unsigned beginPaintSysCall;
+static BYTE* beginPaint;
+
+static unsigned endPaintSysCall;
+static BYTE* endPaint;
+
+typedef HDC (WINAPI *PtrBeginPaint)(HWND, PAINTSTRUCT*);
+typedef BOOL (WINAPI *PtrEndPaint)(HWND, const PAINTSTRUCT*);
+
+#if OS(WINDOWS) &amp;&amp; CPU(X86_64) &amp;&amp; COMPILER(MSVC)
+extern &quot;C&quot; HDC __stdcall _HBeginPaint(HWND hWnd, LPPAINTSTRUCT lpPaint);
+extern &quot;C&quot; BOOL __stdcall _HEndPaint(HWND hWnd, const PAINTSTRUCT* lpPaint);
+#endif
+
+HDC WINAPI PluginView::hookedBeginPaint(HWND hWnd, PAINTSTRUCT* lpPaint)
+{
+    PluginView* pluginView = reinterpret_cast&lt;PluginView*&gt;(GetProp(hWnd, kWebPluginViewProperty));
+    if (pluginView &amp;&amp; pluginView-&gt;m_wmPrintHDC) {
+        // We're secretly handling WM_PRINTCLIENT, so set up the PAINTSTRUCT so
+        // that the plugin will paint into the HDC we provide.
+        memset(lpPaint, 0, sizeof(PAINTSTRUCT));
+        lpPaint-&gt;hdc = pluginView-&gt;m_wmPrintHDC;
+        GetClientRect(hWnd, &amp;lpPaint-&gt;rcPaint);
+        return pluginView-&gt;m_wmPrintHDC;
+    }
+
+#if COMPILER(GCC)
+    HDC result;
+    asm (&quot;push    %2\n&quot;
+         &quot;push    %3\n&quot;
+         &quot;call    *%4\n&quot;
+         : &quot;=a&quot; (result)
+         : &quot;a&quot; (beginPaintSysCall), &quot;g&quot; (lpPaint), &quot;g&quot; (hWnd), &quot;m&quot; (beginPaint)
+         : &quot;memory&quot;
+        );
+    return result;
+#elif defined(_M_IX86)
+    // Call through to the original BeginPaint.
+    __asm   mov     eax, beginPaintSysCall
+    __asm   push    lpPaint
+    __asm   push    hWnd
+    __asm   call    beginPaint
+#else
+    return _HBeginPaint(hWnd, lpPaint);
+#endif
+}
+
+BOOL WINAPI PluginView::hookedEndPaint(HWND hWnd, const PAINTSTRUCT* lpPaint)
+{
+    PluginView* pluginView = reinterpret_cast&lt;PluginView*&gt;(GetProp(hWnd, kWebPluginViewProperty));
+    if (pluginView &amp;&amp; pluginView-&gt;m_wmPrintHDC) {
+        // We're secretly handling WM_PRINTCLIENT, so we don't have to do any
+        // cleanup.
+        return TRUE;
+    }
+
+#if COMPILER(GCC)
+    BOOL result;
+    asm (&quot;push   %2\n&quot;
+         &quot;push   %3\n&quot;
+         &quot;call   *%4\n&quot;
+         : &quot;=a&quot; (result)
+         : &quot;a&quot; (endPaintSysCall), &quot;g&quot; (lpPaint), &quot;g&quot; (hWnd), &quot;m&quot; (endPaint)
+        );
+    return result;
+#elif defined (_M_IX86)
+    // Call through to the original EndPaint.
+    __asm   mov     eax, endPaintSysCall
+    __asm   push    lpPaint
+    __asm   push    hWnd
+    __asm   call    endPaint
+#else
+    return _HEndPaint(hWnd, lpPaint);
+#endif
+}
+
+static void hook(const char* module, const char* proc, unsigned&amp; sysCallID, BYTE*&amp; pProc, const void* pNewProc)
+{
+    // See &lt;http://www.fengyuan.com/article/wmprint.html&gt; for an explanation of
+    // how this function works.
+
+    HINSTANCE hMod = GetModuleHandleA(module);
+
+    pProc = reinterpret_cast&lt;BYTE*&gt;(reinterpret_cast&lt;ptrdiff_t&gt;(GetProcAddress(hMod, proc)));
+
+#if COMPILER(GCC) || defined(_M_IX86)
+    if (pProc[0] != 0xB8)
+        return;
+
+    // FIXME: Should we be reading the bytes one-by-one instead of doing an
+    // unaligned read?
+    sysCallID = *reinterpret_cast&lt;unsigned*&gt;(pProc + 1);
+
+    DWORD flOldProtect;
+    if (!VirtualProtect(pProc, 5, PAGE_EXECUTE_READWRITE, &amp;flOldProtect))
+        return;
+
+    pProc[0] = 0xE9;
+    *reinterpret_cast&lt;unsigned*&gt;(pProc + 1) = reinterpret_cast&lt;intptr_t&gt;(pNewProc) - reinterpret_cast&lt;intptr_t&gt;(pProc + 5);
+
+    pProc += 5;
+#else
+    /* Disassembly of BeginPaint()
+    00000000779FC5B0 4C 8B D1         mov         r10,rcx
+    00000000779FC5B3 B8 17 10 00 00   mov         eax,1017h
+    00000000779FC5B8 0F 05            syscall
+    00000000779FC5BA C3               ret
+    00000000779FC5BB 90               nop
+    00000000779FC5BC 90               nop
+    00000000779FC5BD 90               nop
+    00000000779FC5BE 90               nop
+    00000000779FC5BF 90               nop
+    00000000779FC5C0 90               nop
+    00000000779FC5C1 90               nop
+    00000000779FC5C2 90               nop
+    00000000779FC5C3 90               nop
+    */
+    // Check for the signature as in the above disassembly
+    DWORD guard = 0xB8D18B4C;
+    if (*reinterpret_cast&lt;DWORD*&gt;(pProc) != guard)
+        return;
+
+    DWORD flOldProtect;
+    VirtualProtect(pProc, 12, PAGE_EXECUTE_READWRITE, &amp; flOldProtect);
+    pProc[0] = 0x48;    // mov rax, this
+    pProc[1] = 0xb8;
+    *(__int64*)(pProc+2) = (__int64)pNewProc;
+    pProc[10] = 0xff;   // jmp rax
+    pProc[11] = 0xe0;
+#endif
+}
+
+static void setUpOffscreenPaintingHooks(HDC (WINAPI*hookedBeginPaint)(HWND, PAINTSTRUCT*), BOOL (WINAPI*hookedEndPaint)(HWND, const PAINTSTRUCT*))
+{
+    static bool haveHooked = false;
+    if (haveHooked)
+        return;
+    haveHooked = true;
+
+    // Most (all?) windowed plugins don't seem to respond to WM_PRINTCLIENT, so
+    // we hook into BeginPaint/EndPaint to allow their normal WM_PAINT handling
+    // to draw into a given HDC. Note that this hooking affects the entire
+    // process.
+    hook(&quot;user32.dll&quot;, &quot;BeginPaint&quot;, beginPaintSysCall, beginPaint, reinterpret_cast&lt;const void *&gt;(reinterpret_cast&lt;ptrdiff_t&gt;(hookedBeginPaint)));
+    hook(&quot;user32.dll&quot;, &quot;EndPaint&quot;, endPaintSysCall, endPaint, reinterpret_cast&lt;const void *&gt;(reinterpret_cast&lt;ptrdiff_t&gt;(hookedEndPaint)));
+
+}
+
+static bool registerPluginView()
+{
+    static bool haveRegisteredWindowClass = false;
+    if (haveRegisteredWindowClass)
+        return true;
+
+    haveRegisteredWindowClass = true;
+
+#if PLATFORM(GTK)
+    WebCore::setInstanceHandle((HINSTANCE)(GetModuleHandle(0)));
+#endif
+
+    ASSERT(WebCore::instanceHandle());
+
+    WNDCLASSEX wcex;
+    wcex.cbSize = sizeof(WNDCLASSEX);
+    wcex.hIconSm        = 0;
+    wcex.style          = CS_DBLCLKS;
+    wcex.lpfnWndProc    = DefWindowProc;
+    wcex.cbClsExtra     = 0;
+    wcex.cbWndExtra     = 0;
+    wcex.hInstance      = WebCore::instanceHandle();
+    wcex.hIcon          = 0;
+    wcex.hCursor        = LoadCursor(0, IDC_ARROW);
+    wcex.hbrBackground  = (HBRUSH)COLOR_WINDOW;
+    wcex.lpszMenuName   = 0;
+    wcex.lpszClassName  = kWebPluginViewdowClassName;
+
+    return !!RegisterClassEx(&amp;wcex);
+}
+
+LRESULT CALLBACK PluginView::PluginViewWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
+{
+    PluginView* pluginView = reinterpret_cast&lt;PluginView*&gt;(GetProp(hWnd, kWebPluginViewProperty));
+
+    return pluginView-&gt;wndProc(hWnd, message, wParam, lParam);
+}
+
+static bool isWindowsMessageUserGesture(UINT message)
+{
+    switch (message) {
+        case WM_LBUTTONUP:
+        case WM_MBUTTONUP:
+        case WM_RBUTTONUP:
+        case WM_KEYUP:
+            return true;
+        default:
+            return false;
+    }
+}
+
+static inline IntPoint contentsToNativeWindow(FrameView* view, const IntPoint&amp; point)
+{
+    return view-&gt;contentsToWindow(point);
+}
+
+static inline IntRect contentsToNativeWindow(FrameView* view, const IntRect&amp; rect)
+{
+    return view-&gt;contentsToWindow(rect);
+}
+
+LRESULT
+PluginView::wndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
+{
+    // &lt;rdar://5711136&gt; Sometimes Flash will call SetCapture before creating
+    // a full-screen window and will not release it, which causes the
+    // full-screen window to never receive mouse events. We set/release capture
+    // on mouse down/up before sending the event to the plug-in to prevent that.
+    switch (message) {
+        case WM_LBUTTONDOWN:
+        case WM_MBUTTONDOWN:
+        case WM_RBUTTONDOWN:
+            ::SetCapture(hWnd);
+            break;
+        case WM_LBUTTONUP:
+        case WM_MBUTTONUP:
+        case WM_RBUTTONUP:
+            ::ReleaseCapture();
+            break;
+    }
+
+    if (message == m_lastMessage &amp;&amp;
+        m_plugin-&gt;quirks().contains(PluginQuirkDontCallWndProcForSameMessageRecursively) &amp;&amp; 
+        m_isCallingPluginWndProc)
+        return 1;
+
+    if (message == WM_USER + 1 &amp;&amp;
+        m_plugin-&gt;quirks().contains(PluginQuirkThrottleWMUserPlusOneMessages)) {
+        if (!m_messageThrottler)
+            m_messageThrottler = adoptPtr(new PluginMessageThrottlerWin(this));
+
+        m_messageThrottler-&gt;appendMessage(hWnd, message, wParam, lParam);
+        return 0;
+    }
+
+    m_lastMessage = message;
+    m_isCallingPluginWndProc = true;
+
+    // If the plug-in doesn't explicitly support changing the pop-up state, we enable
+    // popups for all user gestures.
+    // Note that we need to pop the state in a timer, because the Flash plug-in 
+    // pops up windows in response to a posted message.
+    if (m_plugin-&gt;pluginFuncs()-&gt;version &lt; NPVERS_HAS_POPUPS_ENABLED_STATE &amp;&amp;
+        isWindowsMessageUserGesture(message) &amp;&amp; !m_popPopupsStateTimer.isActive()) {
+
+        pushPopupsEnabledState(true);
+
+        m_popPopupsStateTimer.startOneShot(0);
+    }
+
+    if (message == WM_PRINTCLIENT) {
+        // Most (all?) windowed plugins don't respond to WM_PRINTCLIENT, so we
+        // change the message to WM_PAINT and rely on our hooked versions of
+        // BeginPaint/EndPaint to make the plugin draw into the given HDC.
+        message = WM_PAINT;
+        m_wmPrintHDC = reinterpret_cast&lt;HDC&gt;(wParam);
+    }
+
+    // Call the plug-in's window proc.
+    LRESULT result = ::CallWindowProc(m_pluginWndProc, hWnd, message, wParam, lParam);
+
+    m_wmPrintHDC = 0;
+
+    m_isCallingPluginWndProc = false;
+
+    return result;
+}
+
+void PluginView::updatePluginWidget()
+{
+    if (!parent())
+        return;
+
+    FrameView&amp; frameView = downcast&lt;FrameView&gt;(*parent());
+
+    IntRect oldWindowRect = m_windowRect;
+    IntRect oldClipRect = m_clipRect;
+
+    m_windowRect = IntRect(frameView.contentsToWindow(frameRect().location()), frameRect().size());
+    m_clipRect = windowClipRect();
+    m_clipRect.move(-m_windowRect.x(), -m_windowRect.y());
+
+    if (platformPluginWidget() &amp;&amp; (!m_haveUpdatedPluginWidget || m_windowRect != oldWindowRect || m_clipRect != oldClipRect)) {
+
+        setCallingPlugin(true);
+
+        // To prevent flashes while scrolling, we disable drawing during the window
+        // update process by clipping the window to the zero rect.
+
+        bool clipToZeroRect = !m_plugin-&gt;quirks().contains(PluginQuirkDontClipToZeroRectWhenScrolling);
+
+        if (clipToZeroRect) {
+            auto rgn = adoptGDIObject(::CreateRectRgn(0, 0, 0, 0));
+            ::SetWindowRgn(platformPluginWidget(), rgn.leak(), FALSE);
+        } else {
+            auto rgn = adoptGDIObject(::CreateRectRgn(m_clipRect.x(), m_clipRect.y(), m_clipRect.maxX(), m_clipRect.maxY()));
+            ::SetWindowRgn(platformPluginWidget(), rgn.leak(), TRUE);
+        }
+
+        if (!m_haveUpdatedPluginWidget || m_windowRect != oldWindowRect)
+            ::MoveWindow(platformPluginWidget(), m_windowRect.x(), m_windowRect.y(), m_windowRect.width(), m_windowRect.height(), TRUE);
+
+        if (clipToZeroRect) {
+            auto rgn = adoptGDIObject(::CreateRectRgn(m_clipRect.x(), m_clipRect.y(), m_clipRect.maxX(), m_clipRect.maxY()));
+            ::SetWindowRgn(platformPluginWidget(), rgn.leak(), TRUE);
+        }
+
+        setCallingPlugin(false);
+
+        m_haveUpdatedPluginWidget = true;
+    }
+}
+
+void PluginView::setFocus(bool focused)
+{
+    if (focused &amp;&amp; platformPluginWidget())
+        SetFocus(platformPluginWidget());
+
+    Widget::setFocus(focused);
+
+    if (!m_plugin || m_isWindowed)
+        return;
+
+    NPEvent npEvent;
+
+    npEvent.event = focused ? WM_SETFOCUS : WM_KILLFOCUS;
+    npEvent.wParam = 0;
+    npEvent.lParam = 0;
+
+    dispatchNPEvent(npEvent);
+}
+
+void PluginView::show()
+{
+    setSelfVisible(true);
+
+    if (isParentVisible() &amp;&amp; platformPluginWidget())
+        ShowWindow(platformPluginWidget(), SW_SHOWNA);
+
+    Widget::show();
+}
+
+void PluginView::hide()
+{
+    setSelfVisible(false);
+
+    if (isParentVisible() &amp;&amp; platformPluginWidget())
+        ShowWindow(platformPluginWidget(), SW_HIDE);
+
+    Widget::hide();
+}
+
+bool PluginView::dispatchNPEvent(NPEvent&amp; npEvent)
+{
+    if (!m_plugin-&gt;pluginFuncs()-&gt;event)
+        return true;
+
+    bool shouldPop = false;
+
+    if (m_plugin-&gt;pluginFuncs()-&gt;version &lt; NPVERS_HAS_POPUPS_ENABLED_STATE &amp;&amp; isWindowsMessageUserGesture(npEvent.event)) {
+        pushPopupsEnabledState(true);
+        shouldPop = true;
+    }
+
+    JSC::JSLock::DropAllLocks dropAllLocks(JSDOMWindowBase::commonVM());
+    setCallingPlugin(true);
+    bool accepted = !m_plugin-&gt;pluginFuncs()-&gt;event(m_instance, &amp;npEvent);
+    setCallingPlugin(false);
+
+    if (shouldPop) 
+        popPopupsEnabledState();
+
+    return accepted;
+}
+
+void PluginView::paintIntoTransformedContext(HDC hdc)
+{
+    if (m_isWindowed) {
+        SendMessage(platformPluginWidget(), WM_PRINTCLIENT, reinterpret_cast&lt;WPARAM&gt;(hdc), PRF_CLIENT | PRF_CHILDREN | PRF_OWNED);
+        return;
+    }
+
+    m_npWindow.type = NPWindowTypeDrawable;
+    m_npWindow.window = hdc;
+
+    WINDOWPOS windowpos = { 0, 0, 0, 0, 0, 0, 0 };
+
+    IntRect r = contentsToNativeWindow(downcast&lt;FrameView&gt;(parent()), frameRect());
+
+    windowpos.x = r.x();
+    windowpos.y = r.y();
+    windowpos.cx = r.width();
+    windowpos.cy = r.height();
+
+    NPEvent npEvent;
+    npEvent.event = WM_WINDOWPOSCHANGED;
+    npEvent.lParam = reinterpret_cast&lt;uintptr_t&gt;(&amp;windowpos);
+    npEvent.wParam = 0;
+
+    dispatchNPEvent(npEvent);
+
+    setNPWindowRect(frameRect());
+
+    npEvent.event = WM_PAINT;
+    npEvent.wParam = reinterpret_cast&lt;uintptr_t&gt;(hdc);
+
+    // This is supposed to be a pointer to the dirty rect, but it seems that the Flash plugin
+    // ignores it so we just pass null.
+    npEvent.lParam = 0;
+
+    dispatchNPEvent(npEvent);
+}
+
+void PluginView::paintWindowedPluginIntoContext(GraphicsContext* context, const IntRect&amp; rect)
+{
+#if !USE(WINGDI)
+    ASSERT(m_isWindowed);
+    ASSERT(context-&gt;shouldIncludeChildWindows());
+
+    IntPoint locationInWindow = downcast&lt;FrameView&gt;(*parent()).convertToContainingWindow(frameRect().location());
+
+    LocalWindowsContext windowsContext(context, frameRect(), false);
+
+#if USE(CAIRO)
+    // Must flush drawings up to this point to the backing metafile, otherwise the
+    // plugin region will be overwritten with any clear regions specified in the
+    // cairo-controlled portions of the rendering.
+    cairo_show_page(context-&gt;platformContext()-&gt;cr());
+#endif
+
+    HDC hdc = windowsContext.hdc();
+    XFORM originalTransform;
+    GetWorldTransform(hdc, &amp;originalTransform);
+
+    // The plugin expects the DC to be in client coordinates, so we translate
+    // the DC to make that so.
+    AffineTransform ctm = context-&gt;getCTM();
+    ctm.translate(locationInWindow.x(), locationInWindow.y());
+    XFORM transform = static_cast&lt;XFORM&gt;(ctm.toTransformationMatrix());
+
+    SetWorldTransform(hdc, &amp;transform);
+
+    paintIntoTransformedContext(hdc);
+
+    SetWorldTransform(hdc, &amp;originalTransform);
+#endif
+}
+
+void PluginView::paint(GraphicsContext* context, const IntRect&amp; rect)
+{
+    if (!m_isStarted) {
+        // Draw the &quot;missing plugin&quot; image
+        paintMissingPluginIcon(context, rect);
+        return;
+    }
+
+    if (context-&gt;paintingDisabled())
+        return;
+
+    // Ensure that we have called SetWindow before we try to paint.
+    if (!m_haveCalledSetWindow)
+        setNPWindowRect(frameRect());
+
+    if (m_isWindowed) {
+#if !USE(WINGDI)
+        if (context-&gt;shouldIncludeChildWindows())
+            paintWindowedPluginIntoContext(context, rect);
+#endif
+        return;
+    }
+
+    // In the GTK and Qt ports we draw in an offscreen buffer and don't want to use the window
+    // coordinates.
+#if PLATFORM(GTK)
+    IntRect rectInWindow(rect);
+    rectInWindow.intersect(frameRect());
+#else
+    IntRect rectInWindow = downcast&lt;FrameView&gt;(*parent()).contentsToWindow(frameRect());
+#endif
+    LocalWindowsContext windowsContext(context, rectInWindow, m_isTransparent);
+
+    // On Safari/Windows without transparency layers the GraphicsContext returns the HDC
+    // of the window and the plugin expects that the passed in DC has window coordinates.
+    // In the GTK and Qt ports we always draw in an offscreen buffer and therefore need
+    // to preserve the translation set in getWindowsContext.
+#if !PLATFORM(GTK)
+    if (!context-&gt;isInTransparencyLayer()) {
+        XFORM transform;
+        GetWorldTransform(windowsContext.hdc(), &amp;transform);
+        transform.eDx = 0;
+        transform.eDy = 0;
+        SetWorldTransform(windowsContext.hdc(), &amp;transform);
+    }
+#endif
+
+    paintIntoTransformedContext(windowsContext.hdc());
+}
+
+void PluginView::handleKeyboardEvent(KeyboardEvent* event)
+{
+    ASSERT(m_plugin &amp;&amp; !m_isWindowed);
+
+    NPEvent npEvent;
+
+    npEvent.wParam = event-&gt;keyCode();
+
+    if (event-&gt;type() == eventNames().keydownEvent) {
+        npEvent.event = WM_KEYDOWN;
+        npEvent.lParam = 0;
+    } else if (event-&gt;type() == eventNames().keypressEvent) {
+        npEvent.event = WM_CHAR;
+        npEvent.lParam = 0;
+    } else if (event-&gt;type() == eventNames().keyupEvent) {
+        npEvent.event = WM_KEYUP;
+        npEvent.lParam = 0x8000;
+    } else
+        return;
+
+    JSC::JSLock::DropAllLocks dropAllLocks(JSDOMWindowBase::commonVM());
+    if (dispatchNPEvent(npEvent))
+        event-&gt;setDefaultHandled();
+}
+
+extern bool ignoreNextSetCursor;
+
+void PluginView::handleMouseEvent(MouseEvent* event)
+{
+    ASSERT(m_plugin &amp;&amp; !m_isWindowed);
+
+    NPEvent npEvent;
+
+    IntPoint p = contentsToNativeWindow(downcast&lt;FrameView&gt;(parent()), IntPoint(event-&gt;pageX(), event-&gt;pageY()));
+
+    npEvent.lParam = MAKELPARAM(p.x(), p.y());
+    npEvent.wParam = 0;
+
+    if (event-&gt;ctrlKey())
+        npEvent.wParam |= MK_CONTROL;
+    if (event-&gt;shiftKey())
+        npEvent.wParam |= MK_SHIFT;
+
+    if (event-&gt;type() == eventNames().mousemoveEvent ||
+        event-&gt;type() == eventNames().mouseoutEvent || 
+        event-&gt;type() == eventNames().mouseoverEvent) {
+        npEvent.event = WM_MOUSEMOVE;
+        if (event-&gt;buttonDown())
+            switch (event-&gt;button()) {
+                case LeftButton:
+                    npEvent.wParam |= MK_LBUTTON;
+                    break;
+                case MiddleButton:
+                    npEvent.wParam |= MK_MBUTTON;
+                    break;
+                case RightButton:
+                    npEvent.wParam |= MK_RBUTTON;
+                break;
+            }
+    }
+    else if (event-&gt;type() == eventNames().mousedownEvent) {
+        focusPluginElement();
+        switch (event-&gt;button()) {
+            case 0:
+                npEvent.event = WM_LBUTTONDOWN;
+                break;
+            case 1:
+                npEvent.event = WM_MBUTTONDOWN;
+                break;
+            case 2:
+                npEvent.event = WM_RBUTTONDOWN;
+                break;
+        }
+    } else if (event-&gt;type() == eventNames().mouseupEvent) {
+        switch (event-&gt;button()) {
+            case 0:
+                npEvent.event = WM_LBUTTONUP;
+                break;
+            case 1:
+                npEvent.event = WM_MBUTTONUP;
+                break;
+            case 2:
+                npEvent.event = WM_RBUTTONUP;
+                break;
+        }
+    } else
+        return;
+
+    JSC::JSLock::DropAllLocks dropAllLocks(JSDOMWindowBase::commonVM());
+    // FIXME: Consider back porting the http://webkit.org/b/58108 fix here.
+    if (dispatchNPEvent(npEvent))
+        event-&gt;setDefaultHandled();
+
+#if !PLATFORM(GTK)
+    // Currently, Widget::setCursor is always called after this function in EventHandler.cpp
+    // and since we don't want that we set ignoreNextSetCursor to true here to prevent that.
+    ignoreNextSetCursor = true;
+    if (Page* page = m_parentFrame-&gt;page())
+        page-&gt;chrome().client().setLastSetCursorToCurrentCursor();
+#endif
+}
+
+void PluginView::setParent(ScrollView* parent)
+{
+    Widget::setParent(parent);
+
+    if (parent)
+        init();
+    else {
+        if (!platformPluginWidget())
+            return;
+
+        // If the plug-in window or one of its children have the focus, we need to 
+        // clear it to prevent the web view window from being focused because that can
+        // trigger a layout while the plugin element is being detached.
+        HWND focusedWindow = ::GetFocus();
+        if (platformPluginWidget() == focusedWindow || ::IsChild(platformPluginWidget(), focusedWindow))
+            ::SetFocus(0);
+    }
+}
+
+void PluginView::setParentVisible(bool visible)
+{
+    if (isParentVisible() == visible)
+        return;
+
+    Widget::setParentVisible(visible);
+
+    if (isSelfVisible() &amp;&amp; platformPluginWidget()) {
+        if (visible)
+            ShowWindow(platformPluginWidget(), SW_SHOWNA);
+        else
+            ShowWindow(platformPluginWidget(), SW_HIDE);
+    }
+}
+
+void PluginView::setNPWindowRect(const IntRect&amp; rect)
+{
+    if (!m_isStarted)
+        return;
+
+    // In the GTK port we draw in an offscreen buffer and don't want to use the window
+    // coordinates.
+# if PLATFORM(GTK)
+    IntPoint p = rect.location();
+# else
+    IntPoint p = downcast&lt;FrameView&gt;(*parent()).contentsToWindow(rect.location());
+# endif
+    m_npWindow.x = p.x();
+    m_npWindow.y = p.y();
+
+    m_npWindow.width = rect.width();
+    m_npWindow.height = rect.height();
+
+    m_npWindow.clipRect.right = rect.width();
+    m_npWindow.clipRect.bottom = rect.height();
+    m_npWindow.clipRect.left = 0;
+    m_npWindow.clipRect.top = 0;
+
+    if (m_plugin-&gt;pluginFuncs()-&gt;setwindow) {
+        JSC::JSLock::DropAllLocks dropAllLocks(JSDOMWindowBase::commonVM());
+        setCallingPlugin(true);
+        m_plugin-&gt;pluginFuncs()-&gt;setwindow(m_instance, &amp;m_npWindow);
+        setCallingPlugin(false);
+
+        m_haveCalledSetWindow = true;
+
+        if (!m_isWindowed)
+            return;
+
+        ASSERT(platformPluginWidget());
+
+        WNDPROC currentWndProc = (WNDPROC)GetWindowLongPtr(platformPluginWidget(), GWLP_WNDPROC);
+        if (currentWndProc != PluginViewWndProc)
+            m_pluginWndProc = (WNDPROC)SetWindowLongPtr(platformPluginWidget(), GWLP_WNDPROC, (LONG_PTR)PluginViewWndProc);
+    }
+}
+
+NPError PluginView::handlePostReadFile(Vector&lt;char&gt;&amp; buffer, uint32_t len, const char* buf)
+{
+    String filename(buf, len);
+
+    if (filename.startsWith(&quot;file:///&quot;))
+        filename = filename.substring(8);
+
+    // Get file info
+    WIN32_FILE_ATTRIBUTE_DATA attrs;
+    if (GetFileAttributesExW(filename.charactersWithNullTermination().data(), GetFileExInfoStandard, &amp;attrs) == 0)
+        return NPERR_FILE_NOT_FOUND;
+
+    if (attrs.dwFileAttributes &amp; FILE_ATTRIBUTE_DIRECTORY)
+        return NPERR_FILE_NOT_FOUND;
+
+    HANDLE fileHandle = CreateFileW(filename.charactersWithNullTermination().data(), FILE_READ_DATA, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0);
+    
+    if (fileHandle == INVALID_HANDLE_VALUE)
+        return NPERR_FILE_NOT_FOUND;
+
+    buffer.resize(attrs.nFileSizeLow);
+
+    DWORD bytesRead;
+    int retval = ReadFile(fileHandle, buffer.data(), attrs.nFileSizeLow, &amp;bytesRead, 0);
+
+    CloseHandle(fileHandle);
+
+    if (retval == 0 || bytesRead != attrs.nFileSizeLow)
+        return NPERR_FILE_NOT_FOUND;
+
+    return NPERR_NO_ERROR;
+}
+
+bool PluginView::platformGetValueStatic(NPNVariable, void*, NPError*)
+{
+    return false;
+}
+
+bool PluginView::platformGetValue(NPNVariable variable, void* value, NPError* result)
+{
+    switch (variable) {
+        case NPNVnetscapeWindow: {
+            HWND* w = reinterpret_cast&lt;HWND*&gt;(value);
+            *w = windowHandleForPageClient(parent() ? parent()-&gt;hostWindow()-&gt;platformPageClient() : 0);
+            *result = NPERR_NO_ERROR;
+            return true;
+        }
+
+        case NPNVSupportsWindowless: {
+            NPBool* flag = reinterpret_cast&lt;NPBool*&gt;(value);
+            *flag = TRUE;
+            *result = NPERR_NO_ERROR;
+            return true;
+        }
+
+    default:
+        return false;
+    }
+}
+
+void PluginView::invalidateRect(const IntRect&amp; rect)
+{
+    if (m_isWindowed) {
+        RECT invalidRect = { rect.x(), rect.y(), rect.maxX(), rect.maxY() };
+        ::InvalidateRect(platformPluginWidget(), &amp;invalidRect, false);
+        return;
+    }
+
+    invalidateWindowlessPluginRect(rect);
+}
+
+void PluginView::invalidateRect(NPRect* rect)
+{
+    if (!rect) {
+        invalidate();
+        return;
+    }
+
+    IntRect r(rect-&gt;left, rect-&gt;top, rect-&gt;right - rect-&gt;left, rect-&gt;bottom - rect-&gt;top);
+
+    if (m_isWindowed) {
+        RECT invalidRect = { r.x(), r.y(), r.maxX(), r.maxY() };
+        InvalidateRect(platformPluginWidget(), &amp;invalidRect, FALSE);
+    } else {
+        if (m_plugin-&gt;quirks().contains(PluginQuirkThrottleInvalidate)) {
+            m_invalidRects.append(r);
+            if (!m_invalidateTimer.isActive())
+                m_invalidateTimer.startOneShot(0.001);
+        } else
+            invalidateRect(r);
+    }
+}
+
+void PluginView::invalidateRegion(NPRegion region)
+{
+    if (m_isWindowed)
+        return;
+
+    RECT r;
+
+    if (GetRgnBox(region, &amp;r) == 0) {
+        invalidate();
+        return;
+    }
+
+    IntRect rect(IntPoint(r.left, r.top), IntSize(r.right-r.left, r.bottom-r.top));
+    invalidateRect(rect);
+}
+
+void PluginView::forceRedraw()
+{
+    if (m_isWindowed)
+        ::UpdateWindow(platformPluginWidget());
+    else
+        ::UpdateWindow(windowHandleForPageClient(parent() ? parent()-&gt;hostWindow()-&gt;platformPageClient() : 0));
+}
+
+bool PluginView::platformStart()
+{
+    ASSERT(m_isStarted);
+    ASSERT(m_status == PluginStatusLoadedSuccessfully);
+
+    if (m_isWindowed) {
+        registerPluginView();
+        setUpOffscreenPaintingHooks(hookedBeginPaint, hookedEndPaint);
+
+        DWORD flags = WS_CHILD;
+        if (isSelfVisible())
+            flags |= WS_VISIBLE;
+
+        HWND parentWindowHandle = windowHandleForPageClient(m_parentFrame-&gt;view()-&gt;hostWindow()-&gt;platformPageClient());
+        HWND window = ::CreateWindowEx(0, kWebPluginViewdowClassName, 0, flags,
+                                       0, 0, 0, 0, parentWindowHandle, 0, WebCore::instanceHandle(), 0);
+
+#if OS(WINDOWS) &amp;&amp; PLATFORM(GTK)
+        m_window = window;
+#else
+        setPlatformWidget(window);
+#endif
+
+        // Calling SetWindowLongPtrA here makes the window proc ASCII, which is required by at least
+        // the Shockwave Director plug-in.
+#if OS(WINDOWS) &amp;&amp; CPU(X86_64)
+        ::SetWindowLongPtrA(platformPluginWidget(), GWLP_WNDPROC, (LONG_PTR)DefWindowProcA);
+#else
+        ::SetWindowLongPtrA(platformPluginWidget(), GWL_WNDPROC, (LONG)DefWindowProcA);
+#endif
+        SetProp(platformPluginWidget(), kWebPluginViewProperty, this);
+
+        m_npWindow.type = NPWindowTypeWindow;
+        m_npWindow.window = platformPluginWidget();
+    } else {
+        m_npWindow.type = NPWindowTypeDrawable;
+        m_npWindow.window = 0;
+    }
+
+    updatePluginWidget();
+
+    if (!m_plugin-&gt;quirks().contains(PluginQuirkDeferFirstSetWindowCall))
+        setNPWindowRect(frameRect());
+
+    return true;
+}
+
+void PluginView::platformDestroy()
+{
+    if (!platformPluginWidget())
+        return;
+
+    DestroyWindow(platformPluginWidget());
+    setPlatformPluginWidget(0);
+}
+
+PassRefPtr&lt;Image&gt; PluginView::snapshot()
+{
+#if !PLATFORM(GTK) &amp;&amp; !USE(WINGDI)
+    auto hdc = adoptGDIObject(::CreateCompatibleDC(0));
+
+    if (!m_isWindowed) {
+        // Enable world transforms.
+        SetGraphicsMode(hdc.get(), GM_ADVANCED);
+
+        XFORM transform;
+        GetWorldTransform(hdc.get(), &amp;transform);
+
+        // Windowless plug-ins assume that they're drawing onto the view's DC.
+        // Translate the context so that the plug-in draws at (0, 0).
+        IntPoint position = downcast&lt;FrameView&gt;(*parent()).contentsToWindow(frameRect()).location();
+        transform.eDx = -position.x();
+        transform.eDy = -position.y();
+        SetWorldTransform(hdc.get(), &amp;transform);
+    }
+
+    void* bits;
+    BitmapInfo bmp = BitmapInfo::createBottomUp(frameRect().size());
+    auto hbmp = adoptGDIObject(::CreateDIBSection(0, &amp;bmp, DIB_RGB_COLORS, &amp;bits, 0, 0));
+
+    HBITMAP hbmpOld = static_cast&lt;HBITMAP&gt;(SelectObject(hdc.get(), hbmp.get()));
+
+    paintIntoTransformedContext(hdc.get());
+
+    SelectObject(hdc.get(), hbmpOld);
+
+    return BitmapImage::create(hbmp.get());
+#else
+    return 0;
+#endif
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebKitwinPluginsnpapicppfromrev178217trunkSourceWebCorepluginsnpapicpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit/win/Plugins/npapi.cpp (from rev 178217, trunk/Source/WebCore/plugins/npapi.cpp) (0 => 178219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/Plugins/npapi.cpp                                (rev 0)
+++ trunk/Source/WebKit/win/Plugins/npapi.cpp        2015-01-10 00:16:52 UTC (rev 178219)
</span><span class="lines">@@ -0,0 +1,208 @@
</span><ins>+/*
+ * Copyright (C) 2006, 2007 Apple Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#include &quot;config.h&quot;
+
+#include &quot;Page.h&quot;
+#include &quot;PluginMainThreadScheduler.h&quot;
+#include &quot;PluginView.h&quot;
+#include &quot;npruntime_internal.h&quot;
+
+using namespace WebCore;
+
+// The plugin view is always the ndata of the instance,. Sometimes, plug-ins will call an instance-specific function
+// with a NULL instance. To workaround this, call the last plug-in view that made a call to a plug-in.
+// Currently, the current plug-in view is only set before NPP_New in PluginView::start.
+// This specifically works around Flash and Shockwave. When we call NPP_New, they call NPN_Useragent with a NULL instance.
+static PluginView* pluginViewForInstance(NPP instance)
+{
+    if (instance &amp;&amp; instance-&gt;ndata)
+        return static_cast&lt;PluginView*&gt;(instance-&gt;ndata);
+    return PluginView::currentPluginView();
+}
+
+void* NPN_MemAlloc(uint32_t size)
+{
+    return malloc(size);
+}
+
+void NPN_MemFree(void* ptr)
+{
+    free(ptr);
+}
+
+uint32_t NPN_MemFlush(uint32_t)
+{
+    // Do nothing
+    return 0;
+}
+
+void NPN_ReloadPlugins(NPBool reloadPages)
+{
+    Page::refreshPlugins(reloadPages);
+}
+
+NPError NPN_RequestRead(NPStream*, NPByteRange*)
+{
+    return NPERR_STREAM_NOT_SEEKABLE;
+}
+
+NPError NPN_GetURLNotify(NPP instance, const char* url, const char* target, void* notifyData)
+{
+    return pluginViewForInstance(instance)-&gt;getURLNotify(url, target, notifyData);
+}
+
+NPError NPN_GetURL(NPP instance, const char* url, const char* target)
+{
+    return pluginViewForInstance(instance)-&gt;getURL(url, target);
+}
+
+NPError NPN_PostURLNotify(NPP instance, const char* url, const char* target, uint32_t len, const char* buf, NPBool file, void* notifyData)
+{
+    return pluginViewForInstance(instance)-&gt;postURLNotify(url, target, len, buf, file, notifyData);
+}
+
+NPError NPN_PostURL(NPP instance, const char* url, const char* target, uint32_t len, const char* buf, NPBool file)
+{
+    return pluginViewForInstance(instance)-&gt;postURL(url, target, len, buf, file);
+}
+
+NPError NPN_NewStream(NPP instance, NPMIMEType type, const char* target, NPStream** stream)
+{
+    return pluginViewForInstance(instance)-&gt;newStream(type, target, stream);
+}
+
+int32_t NPN_Write(NPP instance, NPStream* stream, int32_t len, void* buffer)
+{
+    return pluginViewForInstance(instance)-&gt;write(stream, len, buffer);
+}
+
+NPError NPN_DestroyStream(NPP instance, NPStream* stream, NPReason reason)
+{
+    return pluginViewForInstance(instance)-&gt;destroyStream(stream, reason);
+}
+
+const char* NPN_UserAgent(NPP instance)
+{
+    PluginView* view = pluginViewForInstance(instance);
+
+     if (!view)
+         return PluginView::userAgentStatic();

+    return view-&gt;userAgent();
+}
+
+void NPN_Status(NPP instance, const char* message)
+{
+    pluginViewForInstance(instance)-&gt;status(message);
+}
+
+void NPN_InvalidateRect(NPP instance, NPRect* invalidRect)
+{
+    PluginView* view = pluginViewForInstance(instance);
+#if defined(XP_UNIX)
+    // NSPluginWrapper, a plugin wrapper binary that allows running 32-bit plugins
+    // on 64-bit architectures typically used in X11, will sometimes give us a null NPP here.
+    if (!view)
+        return;
+#endif
+    view-&gt;invalidateRect(invalidRect);
+}
+
+void NPN_InvalidateRegion(NPP instance, NPRegion invalidRegion)
+{
+    pluginViewForInstance(instance)-&gt;invalidateRegion(invalidRegion);
+}
+
+void NPN_ForceRedraw(NPP instance)
+{
+    pluginViewForInstance(instance)-&gt;forceRedraw();
+}
+
+NPError NPN_GetValue(NPP instance, NPNVariable variable, void* value)
+{
+    PluginView* view = pluginViewForInstance(instance);
+
+     if (!view)
+         return PluginView::getValueStatic(variable, value);
+
+    return pluginViewForInstance(instance)-&gt;getValue(variable, value);
+}
+
+NPError NPN_SetValue(NPP instance, NPPVariable variable, void* value)
+{
+   return pluginViewForInstance(instance)-&gt;setValue(variable, value);
+}
+
+void* NPN_GetJavaEnv()
+{
+    // Unsupported
+    return 0;
+}
+
+void* NPN_GetJavaPeer(NPP)
+{
+    // Unsupported
+    return 0;
+}
+
+void NPN_PushPopupsEnabledState(NPP instance, NPBool enabled)
+{
+    pluginViewForInstance(instance)-&gt;pushPopupsEnabledState(enabled);
+}
+
+void NPN_PopPopupsEnabledState(NPP instance)
+{
+    pluginViewForInstance(instance)-&gt;popPopupsEnabledState();
+}
+
+extern &quot;C&quot; typedef void PluginThreadAsyncCallFunction(void*);
+void NPN_PluginThreadAsyncCall(NPP instance, PluginThreadAsyncCallFunction func, void* userData)
+{
+    // Callback function type only differs from MainThreadFunction by being extern &quot;C&quot;, which doesn't affect calling convention on any compilers we use.
+    PluginMainThreadScheduler::scheduler().scheduleCall(instance, reinterpret_cast&lt;PluginMainThreadScheduler::MainThreadFunction*&gt;(func), userData);
+}
+
+NPError NPN_GetValueForURL(NPP instance, NPNURLVariable variable, const char* url, char** value, uint32_t* len)
+{
+    return pluginViewForInstance(instance)-&gt;getValueForURL(variable, url, value, len);
+}
+
+NPError NPN_SetValueForURL(NPP instance, NPNURLVariable variable, const char* url, const char* value, uint32_t len)
+{
+    return pluginViewForInstance(instance)-&gt;setValueForURL(variable, url, value, len);
+}
+
+NPError NPN_GetAuthenticationInfo(NPP instance, const char* protocol, const char* host, int32_t port, const char* scheme, const char* realm, char** username, uint32_t* ulen, char** password, uint32_t* plen)
+{
+    return pluginViewForInstance(instance)-&gt;getAuthenticationInfo(protocol, host, port, scheme, realm, username, ulen, password, plen);
+}
+
+NPError NPN_PopUpContextMenu(NPP instance, NPMenu* menu)
+{
+    UNUSED_PARAM(instance);
+    UNUSED_PARAM(menu);
+    return NPERR_NO_ERROR;
+}
</ins></span></pre></div>
<a id="trunkSourceWebKitwinWebCoreSupportEmbeddedWidgeth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebCoreSupport/EmbeddedWidget.h (178218 => 178219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebCoreSupport/EmbeddedWidget.h        2015-01-10 00:09:59 UTC (rev 178218)
+++ trunk/Source/WebKit/win/WebCoreSupport/EmbeddedWidget.h        2015-01-10 00:16:52 UTC (rev 178219)
</span><span class="lines">@@ -26,10 +26,10 @@
</span><span class="cx"> #ifndef EmbeddedWidget_h
</span><span class="cx"> #define EmbeddedWidget_h
</span><span class="cx"> 
</span><ins>+#include &quot;PluginView.h&quot;
</ins><span class="cx"> #include &quot;WebKit.h&quot;
</span><span class="cx"> #include &lt;WebCore/COMPtr.h&gt;
</span><span class="cx"> #include &lt;WebCore/IntRect.h&gt;
</span><del>-#include &lt;WebCore/PluginView.h&gt;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> class HTMLPlugInElement;
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebCoreSupportWebFrameLoaderClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp (178218 => 178219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp        2015-01-10 00:09:59 UTC (rev 178218)
+++ trunk/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp        2015-01-10 00:16:52 UTC (rev 178219)
</span><span class="lines">@@ -35,6 +35,9 @@
</span><span class="cx"> #include &quot;EmbeddedWidget.h&quot;
</span><span class="cx"> #include &quot;MarshallingHelpers.h&quot;
</span><span class="cx"> #include &quot;NotImplemented.h&quot;
</span><ins>+#include &quot;PluginDatabase.h&quot;
+#include &quot;PluginPackage.h&quot;
+#include &quot;PluginView.h&quot;
</ins><span class="cx"> #include &quot;WebActionPropertyBag.h&quot;
</span><span class="cx"> #include &quot;WebCachedFramePlatformData.h&quot;
</span><span class="cx"> #include &quot;WebChromeClient.h&quot;
</span><span class="lines">@@ -73,9 +76,6 @@
</span><span class="cx"> #include &lt;WebCore/LocalizedStrings.h&gt;
</span><span class="cx"> #include &lt;WebCore/MIMETypeRegistry.h&gt;
</span><span class="cx"> #include &lt;WebCore/Page.h&gt;
</span><del>-#include &lt;WebCore/PluginDatabase.h&gt;
-#include &lt;WebCore/PluginPackage.h&gt;
-#include &lt;WebCore/PluginView.h&gt;
</del><span class="cx"> #include &lt;WebCore/PolicyChecker.h&gt;
</span><span class="cx"> #include &lt;WebCore/RenderWidget.h&gt;
</span><span class="cx"> #include &lt;WebCore/ResourceHandle.h&gt;
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebCoreSupportWebPlatformStrategiescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebCoreSupport/WebPlatformStrategies.cpp (178218 => 178219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebCoreSupport/WebPlatformStrategies.cpp        2015-01-10 00:09:59 UTC (rev 178218)
+++ trunk/Source/WebKit/win/WebCoreSupport/WebPlatformStrategies.cpp        2015-01-10 00:16:52 UTC (rev 178219)
</span><span class="lines">@@ -26,11 +26,11 @@
</span><span class="cx"> #include &quot;WebPlatformStrategies.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;FrameLoader.h&quot;
</span><ins>+#include &quot;PluginDatabase.h&quot;
</ins><span class="cx"> #include &quot;WebFrameNetworkingContext.h&quot;
</span><span class="cx"> #include &lt;WebCore/Page.h&gt;
</span><span class="cx"> #include &lt;WebCore/PageGroup.h&gt;
</span><span class="cx"> #include &lt;WebCore/PlatformCookieJar.h&gt;
</span><del>-#include &lt;WebCore/PluginDatabase.h&gt;
</del><span class="cx"> #if USE(CFNETWORK)
</span><span class="cx"> #include &lt;WebKitSystemInterface/WebKitSystemInterface.h&gt;
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebFramecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebFrame.cpp (178218 => 178219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebFrame.cpp        2015-01-10 00:09:59 UTC (rev 178218)
+++ trunk/Source/WebKit/win/WebFrame.cpp        2015-01-10 00:16:52 UTC (rev 178219)
</span><span class="lines">@@ -32,6 +32,8 @@
</span><span class="cx"> #include &quot;DOMCoreClasses.h&quot;
</span><span class="cx"> #include &quot;HTMLFrameOwnerElement.h&quot;
</span><span class="cx"> #include &quot;MarshallingHelpers.h&quot;
</span><ins>+#include &quot;PluginDatabase.h&quot;
+#include &quot;PluginView.h&quot;
</ins><span class="cx"> #include &quot;WebActionPropertyBag.h&quot;
</span><span class="cx"> #include &quot;WebChromeClient.h&quot;
</span><span class="cx"> #include &quot;WebDataSource.h&quot;
</span><span class="lines">@@ -85,8 +87,6 @@
</span><span class="cx"> #include &lt;WebCore/Page.h&gt;
</span><span class="cx"> #include &lt;WebCore/PlatformKeyboardEvent.h&gt;
</span><span class="cx"> #include &lt;WebCore/PluginData.h&gt;
</span><del>-#include &lt;WebCore/PluginDatabase.h&gt;
-#include &lt;WebCore/PluginView.h&gt;
</del><span class="cx"> #include &lt;WebCore/PolicyChecker.h&gt;
</span><span class="cx"> #include &lt;WebCore/PrintContext.h&gt;
</span><span class="cx"> #include &lt;WebCore/ResourceHandle.h&gt;
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebView.cpp (178218 => 178219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebView.cpp        2015-01-10 00:09:59 UTC (rev 178218)
+++ trunk/Source/WebKit/win/WebView.cpp        2015-01-10 00:16:52 UTC (rev 178219)
</span><span class="lines">@@ -32,6 +32,8 @@
</span><span class="cx"> #include &quot;DOMCoreClasses.h&quot;
</span><span class="cx"> #include &quot;FullscreenVideoController.h&quot;
</span><span class="cx"> #include &quot;MarshallingHelpers.h&quot;
</span><ins>+#include &quot;PluginDatabase.h&quot;
+#include &quot;PluginView.h&quot;
</ins><span class="cx"> #include &quot;ResourceLoadScheduler.h&quot;
</span><span class="cx"> #include &quot;SoftLinking.h&quot;
</span><span class="cx"> #include &quot;SubframeLoader.h&quot;
</span><span class="lines">@@ -127,8 +129,6 @@
</span><span class="cx"> #include &lt;WebCore/PlatformMouseEvent.h&gt;
</span><span class="cx"> #include &lt;WebCore/PlatformWheelEvent.h&gt;
</span><span class="cx"> #include &lt;WebCore/PluginData.h&gt;
</span><del>-#include &lt;WebCore/PluginDatabase.h&gt;
-#include &lt;WebCore/PluginView.h&gt;
</del><span class="cx"> #include &lt;WebCore/PopupMenu.h&gt;
</span><span class="cx"> #include &lt;WebCore/PopupMenuWin.h&gt;
</span><span class="cx"> #include &lt;WebCore/ProgressTracker.h&gt;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessPluginsunixPluginInfoStoreUnixcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp (178218 => 178219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp        2015-01-10 00:09:59 UTC (rev 178218)
+++ trunk/Source/WebKit2/UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp        2015-01-10 00:16:52 UTC (rev 178219)
</span><span class="lines">@@ -32,7 +32,6 @@
</span><span class="cx"> #include &quot;PluginInfoStore.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;NetscapePluginModule.h&quot;
</span><del>-#include &quot;PluginDatabase.h&quot;
</del><span class="cx"> #include &lt;WebCore/FileSystem.h&gt;
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(GTK)
</span></span></pre>
</div>
</div>

</body>
</html>