Add support for handling WebGL load policies.
https://bugs.webkit.org/show_bug.cgi?id=126935
<rdar://problem/15790448>.

Reviewed by Brent Fulgham.

* WebCore.xcodeproj/project.pbxproj: Copy over HTMLCanvasElement.h to the private headers directory.
* html/HTMLCanvasElement.cpp: Show the policy dialog and retrieve policies as necessary.
(WebCore::HTMLCanvasElement::getContext): Make sure that WebGL is allowed on the site.
                                          If it isn't, be sure to notify the frame loader client that
                                          the site is trying to create a WebGL context.

Boiler plate code for sending messages to and from the UI and Web Process. 

* loader/FrameLoaderClient.h:
(WebCore::FrameLoaderClient::webGLPolicyForHost): Used to get the WebGL load policy for a site.
* loader/FrameLoaderTypes.h:
* page/ChromeClient.h:
(WebCore::ChromeClient::webGLContextCreated): Called when a site is creating a WebGL context.
* UIProcess/API/C/WKAPICast.h:
(WebKit::toWebGLLoadPolicy):
* UIProcess/API/C/WKPageLoaderClient.h:
* UIProcess/API/C/WKPageUIClient.h:
* UIProcess/WebLoaderClient.cpp:
(WebKit::WebLoaderClient::webGLLoadPolicy):
* UIProcess/WebLoaderClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::webGLContextCreated):
(WebKit::WebPageProxy::webGLPolicyForHost):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/WebUIClient.cpp:
(WebKit::WebUIClient::webGLContextCreated):
* UIProcess/WebUIClient.h:
* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::platformCreateInspectorPage):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::webGLContextCreated):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::webGLPolicyForHost):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
* WebProcess/WebPage/WebPage.cpp: A sendSync is used here to get the webGLPolicyForHost message sent between the Web and UI process.
                                  In the future this will be replaced with a strategy is non-blocking.
(WebKit::WebPage::getWebGLPolicyForHost):
* WebProcess/WebPage/WebPage.h:
* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController awakeFromNib]):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::createWebViewWithOptions):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162000 268f45cc-cd09-0410-ab3c-d52691b4dbfc
27 files changed