Implement QWebEnginePage::setHtml and setContent

Load a generated data: URL to carry the data.

This is not as efficient as it could be but the behavior matches and
this should be fine for now.

Change-Id: I26ad2e5976025a3044fb03f066074ce6dd34e575
Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
Refactor the callback mechanism used by runJavaScript

This prepares the way for other API made async like toHtml and
toPlainText.

Use a callback class with an implicit templated constructor to carry
the functor across the API boundary and avoid the intermediate helper
method as the ABI that we have to maintain.

Also pass the callback result through WebContentsAdapterClient using
a bookkeeping ID instead of transferring the callback to
WebContentsAdapter. This will allow other calls, which might not
already allow passing a callback functor, to use a consisten way
of carrying back the result to the top API layer.

Change-Id: Ia923767b9c1021a108c26da17d4c41878ef7cb95
Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
Add a stub message system to communicate with the blink WebView

This follows the model used by the Android WebView's AwRenderViewExt
class.

QtRenderViewObserverHost is attached to the WebContents and
QtRenderViewObserver is attached to the RenderView in the render
process. Both can exchange messages together and allow async commands
to be carried from WebContentsAdapter and the result sent back
through WebContentsAdapterClient.

This patch also adds a renderer subdirectory to start matching the
directory structure of Chromium.

Change-Id: I724ca2fe2a597dcd2a15e8e1a23c4eeba1190703
Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
Implement QWebEnginePage::toHtml and toPlainText

Those methods are now made asynchronous and need to be given a
callback to handle the result.

Update the code in the browser and fancybrowser examples using
std::bind when using C++11 or tr1::bind with C++03 (which should be
available with compilers on platforms that we support).

Add a (currently failing) earlyToHtml test to make sure that an empty
page doesn't crash because of a possibly incomplete attachment of
the QtRenderViewObserver.

Change-Id: I3ab7cb6f25b91b584dd80df5e4e9ad1e3214348e
Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
Make tst_QWebEngineFrame compile

Even though this code now test QWebEnginePage, keep it in its original
file to allow easier tracking of differences with QtWebkit.

Change-Id: Id001c2fcba0ee4a756fe5f32d8002e15368a191b
Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
Unskip and ajust tests using setHtml, setContent, toHtml and toPlainText

Replace direct calls of toHtml and toPlainText to use a blocking
helper function that spins a QEventLoop to wait for the async result.
This should work fine for tests where the event loop is less polluted
by other events that could cause code reentrancy through stacked stacks.

Change-Id: Ic46a06a9abad782a39a620ceecdc51c3bbb6b5a1
Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>