[Qt][Mac] Remove Carbon and QuickDraw support for plugins.

https://bugs.webkit.org/show_bug.cgi?id=116619
Reviewed by Tor Arne Vestbø.

They are only enabled for 32bit builds of QtWebKit and are rarely tested.
Other browsers support them through a 32bit host process.
PluginViewMac.mm is only used by Qt since the Wx port was removed.

- Only support the Cocoa event model
- Only support the CoreGraphics drawing model
- Remove all NP_NO_CARBON and NP_NO_QUICKDRAW blocks in PluginViewMac.mm

* plugins/PluginView.cpp:
(WebCore::PluginView::setValue):
(WebCore::PluginView::PluginView):
* plugins/PluginView.h:
* plugins/mac/PluginViewMac.mm:
(WebCore::PluginView::platformStart):
(WebCore::PluginView::platformDestroy):
(WebCore::PluginView::platformGetValueStatic):
(WebCore::PluginView::setFocus):
(WebCore::PluginView::setNPWindowIfNeeded):
(WebCore::PluginView::paint):
(WebCore::PluginView::handleWheelEvent):
(WebCore::PluginView::handleMouseEvent):
(WebCore::PluginView::handleKeyboardEvent):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151106 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Conflicts:
	Source/WebCore/plugins/mac/PluginViewMac.mm

Change-Id: Id4939dfe00a306299ab54c28b03f949ce4beb4d8
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
[Qt][Mac] Allow drawing plugins with QWindow by always using an intermediate bitmap.

https://bugs.webkit.org/show_bug.cgi?id=116620
Reviewed by Tor Arne Vestbø.

The isolation of QWidget along with QPA in Qt5 is abstracting away the native CGContext
of a QWidget and we would need to create a non-public API to be able to achieve it.
Instead of adding complexity to this rarely touched code, always draw into an
intermediate bitmap that we then paint into our QPainter afterward.

- Use CGBitmapContextCreate to allocate a buffer directly instead of creating a QPixmap
  and extract an CGContextRef out of it.
- Get rid of the "if (platformPluginWidget())" code path since we don't paint directly
  into the QWidget's backing store anymore.
- Always use m_contextRef to draw the plugin instead of alternating between direct and
  indirect drawing.

* plugins/PluginView.cpp:
(WebCore::PluginView::PluginView):
* plugins/PluginView.h:
* plugins/mac/PluginViewMac.mm:
(WebCore::createBitmapContext):
(WebCore::PluginView::platformStart):
(WebCore::PluginView::platformDestroy):
(WebCore::PluginView::setFocus):
(WebCore::PluginView::setNPWindowIfNeeded):
(WebCore::PluginView::updatePluginWidget):
(WebCore::PluginView::paint):
(WebCore::PluginView::invalidateRect):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151107 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Conflicts:
	Source/WebCore/plugins/PluginView.h
	Source/WebCore/plugins/mac/PluginViewMac.mm

Change-Id: I1006dcf3c08c14ca0d144532372de33f815fbc23
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
[Qt] Re-enable plugins on Mac.

https://bugs.webkit.org/show_bug.cgi?id=116622
Reviewed by Tor Arne Vestbø.

Source/WebCore:

* platform/FileSystem.h:
* platform/qt/FileSystemQt.cpp:
(WebCore::unloadModule):
  - Q_WS_* aren't defined since Qt5, use Q_OS_MACX instead.
* plugins/mac/PluginPackageMac.cpp:
(WebCore::PluginPackage::fetchInfo):
(WebCore::PluginPackage::load):
  - createCFString now does the adoption itself.
* plugins/mac/PluginViewMac.mm:
  - Add missing include.

Source/WebKit/qt:

* WebCoreSupport/ChromeClientQt.cpp:
(WebCore::ChromeClientQt::windowResizerRect):
  - Add missing parenthese.

Tools:

Plugins on Mac were only enabled if !embedded but the later was set if
QPA is enabled, which is the default since Qt 5.0.

Remove references to 'embedded' and fix various build issues,
PluginViewMac.mm and PluginPackageMac.cpp haven't been compiled since a few
months.

* DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro:
* qmake/mkspecs/features/features.prf:
* qmake/mkspecs/features/unix/default_pre.prf:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151109 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Conflicts:
	Source/WebCore/platform/FileSystem.h
	Source/WebCore/plugins/mac/PluginPackageMac.cpp

Change-Id: I38dc6170ca868b54f8092aa6b271ace4911a2390
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
[Qt] Fix a crash under ~PingLoader when the QNAM on the page has been destroyed.

https://bugs.webkit.org/show_bug.cgi?id=116035
Reviewed by Simon Hausmann.

Source/WebCore:

Reproduced with arora which does destroy the QNetworkAccessManager in some situations.
The problem is that PingLoader can still be pending meanwhile, holding a ResourceHandle
with a dangling pointer to a QNetworkReply destroyed with the QNetworkAccessManager.

* platform/network/qt/QNetworkReplyHandler.cpp:
(WebCore::QNetworkReplyWrapper::QNetworkReplyWrapper):
  Set the parent to 0 like we did before the introduction of QNetworkReplyWrapper.
(WebCore::QNetworkReplyWrapper::release):

Source/WebKit/qt:

* tests/qwebpage/tst_qwebpage.cpp:
(tst_QWebPage::networkReplyParentChanged):

Change-Id: Id53db216a6252f8471d6fa97093312843213e48d
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150057 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
[Qt] Fix a crash under ~PingLoader when the QNAM on the page has been destroyed.

https://bugs.webkit.org/show_bug.cgi?id=116035
Reviewed by Allan Sandfeld Jensen.

Source/WebCore:

The previous fix only moved the crash location from WebKit down to QNetworkReplyHttpImpl
which expects its QNetworkAccessManager to still be alive.

Fix it by watching the QNetworkReply's destroyed() signal and avoid the dangling pointer
instead. The QNetworkReply doesn't need to be aborted in this case anyway.

* platform/network/qt/QNetworkReplyHandler.cpp:
(WebCore::QNetworkReplyWrapper::QNetworkReplyWrapper):
(WebCore::QNetworkReplyWrapper::release):
(WebCore::QNetworkReplyWrapper::stopForwarding):
  Rename resetConnections to stopForwarding since not all connections are related
  to data forwarding to the client anymore.
(WebCore::QNetworkReplyWrapper::receiveMetaData):
(WebCore::QNetworkReplyWrapper::replyDestroyed):
(WebCore::QNetworkReplyWrapper::didReceiveFinished):
* platform/network/qt/QNetworkReplyHandler.h:
(QNetworkReplyWrapper):

Source/WebKit/qt:

* tests/qwebpage/tst_qwebpage.cpp:
(tst_QWebPage::networkReplyParentDidntChange): Change test to match the new expectation.
(tst_QWebPage::destroyQNAMBeforeAbortDoesntCrash):

Change-Id: I5e82b8ccc8fccf496669af8de76888e367480f67
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150120 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>