Expose the main frame's document to injected bundles via the Objective-C API
https://bugs.webkit.org/show_bug.cgi?id=99133

Patch by Sam Weinig.

Reviewed by Anders Carlsson.

Allow a bundle to declare a principle class which will be instantiated
by WebKit2 and passed an object to which WKBundleClient calls are
forwarded and which can access the main frame's WKDOMDocument.

* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm: Instantiate
the bundle's principle class forward WKBundleClient calls to it.
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
Add a property called mainFrameDocument which returns a WKDOMDocument.
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerInternal.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInInternal.h:
* WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
(WebKit::InjectedBundle::load): Initialize the shared
WKWebProcessPlugInController with the bundle's principle class.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131138 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Stop using Connection::deprecatedSend in WebConnection
https://bugs.webkit.org/show_bug.cgi?id=99130

Reviewed by Sam Weinig.

Instead of using deprecatedSend, just encode the data using a separate ArgumentEncoder and pass it along as a DataReference.

* DerivedSources.make:
* DerivedSources.pri:
* GNUmakefile.list.am:
Add new files.

* Platform/CoreIPC/MessageID.h:
Add WebConnectionMessageClass.

* Shared/WebConnection.cpp:
(WebKit::WebConnection::WebConnection):
Make WebConnection hold on to the CoreIPC::Connection.

(WebKit::WebConnection::postMessage):
Ask the subclasses to encode the body data, then send it.

(WebKit::WebConnection::handleMessage):
Ask the subclasses to decode the body data, then call didReceiveClient.

(WebKit::WebConnection::invalidate):
Null out m_connection.

* Shared/WebConnection.h:
(WebKit::WebConnection::connection):

* Shared/WebConnection.messages.in: Added.

* UIProcess/WebConnectionToWebProcess.cpp:
(WebKit::WebConnectionToWebProcess::WebConnectionToWebProcess):
Pass the connection to the WebConnection initializer.

(WebKit::WebConnectionToWebProcess::encodeMessageBody):
(WebKit::WebConnectionToWebProcess::decodeMessageBody):
Encode and decode the message body.

(WebKit::WebConnectionToWebProcess::didReceiveMessage):
Handle WebConnection messages.

* WebKit2.xcodeproj/project.pbxproj:
Add new files.

* WebProcess/WebConnectionToUIProcess.cpp:
(WebKit::WebConnectionToUIProcess::WebConnectionToUIProcess):
Pass the connection to the WebConnection initializer.

(WebKit::WebConnectionToUIProcess::encodeMessageBody):
(WebKit::WebConnectionToUIProcess::decodeMessageBody):
Encode and decode the message body.

(WebKit::WebConnectionToUIProcess::didReceiveMessage):
Handle WebConnection messages.

* win/WebKit2.vcproj:
Add new files.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131139 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Unreviewed gardening, TestExpectations updated.

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131140 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix the 32-bit Mac build after r131138.

* WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
(WebKit::InjectedBundle::load):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131141 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Unreviewed gardening, TestExpectation updated.

* platform/chromium/TestExpectations:

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