Don't crash when the DataDetectors framework is unavailable.
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 Aug 2014 22:31:04 +0000 (22:31 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 Aug 2014 22:31:04 +0000 (22:31 +0000)
<rdar://problem/18106066> and https://bugs.webkit.org/show_bug.cgi?id=136234

Reviewed by Tim Horton.

* WebProcess/WebPage/mac/ServicesOverlayController.mm:
(WebKit::ServicesOverlayController::buildPhoneNumberHighlights): Bail if DD.framework didn’t soft link.
(WebKit::ServicesOverlayController::buildSelectionHighlight): Ditto.

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

Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/mac/ServicesOverlayController.mm

index d972f15..e250859 100644 (file)
@@ -1,3 +1,14 @@
+2014-08-25  Brady Eidson  <beidson@apple.com>
+
+        Don't crash when the DataDetectors framework is unavailable.
+        <rdar://problem/18106066> and https://bugs.webkit.org/show_bug.cgi?id=136234
+
+        Reviewed by Tim Horton.
+
+        * WebProcess/WebPage/mac/ServicesOverlayController.mm:
+        (WebKit::ServicesOverlayController::buildPhoneNumberHighlights): Bail if DD.framework didn’t soft link.
+        (WebKit::ServicesOverlayController::buildSelectionHighlight): Ditto.
+
 2014-08-25  Antti Koivisto  <antti@apple.com>
 
         Remove load scheduling code from network process
index 6062807..12e001e 100644 (file)
@@ -475,6 +475,9 @@ void ServicesOverlayController::removeAllPotentialHighlightsOfType(Highlight::Ty
 
 void ServicesOverlayController::buildPhoneNumberHighlights()
 {
+    if (!DataDetectorsLibrary())
+        return;
+
     HashSet<RefPtr<Highlight>> newPotentialHighlights;
 
     Frame* mainFrame = m_webPage.mainFrame();
@@ -510,6 +513,9 @@ void ServicesOverlayController::buildPhoneNumberHighlights()
 
 void ServicesOverlayController::buildSelectionHighlight()
 {
+    if (!DataDetectorsLibrary())
+        return;
+
     HashSet<RefPtr<Highlight>> newPotentialHighlights;
 
     Vector<CGRect> cgRects;