Block exceptions when trying to convert attributed strings to RTF and RTFD
https://bugs.webkit.org/show_bug.cgi?id=132778
<rdar://problem/16675805>

Reviewed by Darin Adler.

When the iOS WebHTMLConverter was upstreamed, converting some attributed strings to RTF and RTFD
started throwing Objective-C exceptions (see <rdar://problem/16876920>).

In WebKit2, we now crash on unhandled exceptions so work around that crash by adding exception blocking macros.

* editing/ios/EditorIOS.mm:
(WebCore::dataInRTFDFormat):
(WebCore::dataInRTFFormat):
* editing/mac/EditorMac.mm:
(WebCore::dataInRTFDFormat):
(WebCore::dataInRTFFormat):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168579 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION (r166853): fast/preloader/document-write.html is very flaky
https://bugs.webkit.org/show_bug.cgi?id=130942

Reviewed by Anders Carlsson.

Source/WebCore:
* style/StyleResolveTree.cpp:
(WebCore::Style::suspendMemoryCacheClientCalls): Use a RefPtr to the main
frame as a weak pointer to a Page that will work unless the page is destroyed.
The old code tried to do it with a RefPtr to a document, but as the FIXME
points out, that won't work if the document is disassociated with its frame.

LayoutTests:
* platform/mac/TestExpectations: Turned the test back on.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168580 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make -[WKNavigationResponse frame] SPI and only expose -[WKNavigationResponse isMainFrame]
https://bugs.webkit.org/show_bug.cgi?id=132781
<rdar://problem/16868319>

Reviewed by Darin Adler.

* UIProcess/API/Cocoa/WKNavigationResponse.h:
* UIProcess/API/Cocoa/WKNavigationResponse.mm:
(-[WKNavigationResponse description]):
(-[WKNavigationResponse isMainFrameNavigation]):
(-[WKNavigationResponse _frame]):
(-[WKNavigationResponse frame]): Deleted.
(-[WKNavigationResponse setFrame:]): Deleted.
* UIProcess/API/Cocoa/WKNavigationResponseInternal.h:
* UIProcess/API/Cocoa/WKNavigationResponsePrivate.h: Added.
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::PolicyClient::decidePolicyForResponse):
* WebKit2.xcodeproj/project.pbxproj:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168581 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Follow-up fix.

Reviewed by Darin Adler.

* UIProcess/API/Cocoa/WKNavigationResponse.h:
* UIProcess/API/Cocoa/WKNavigationResponse.mm:
(-[WKNavigationResponse isForMainFrame]):
Use a slightly better name.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168582 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Simplify createDataAvailableSource
https://bugs.webkit.org/show_bug.cgi?id=132782
<rdar://problem/16815202>

Reviewed by Sam Weinig.

* Platform/IPC/mac/ConnectionMac.mm: Renamed from Source/WebKit2/Platform/IPC/mac/ConnectionMac.cpp.
Rename to make this Objective-C++ so we get the lambda-to-block conversion.

(IPC::createDataAvailableSource):
Make this a function template and just pass the function directly to dispatch_source_set_event_handler.

(IPC::Connection::open):
Use lambdas instead of WTF::bind, so we'll make sure the connection is kept alive.

* WebKit2.xcodeproj/project.pbxproj:
Update for ConnectionMac.cpp to ConnectionMac.mm rename.

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