Remove WebCore::IOSApplication::isWebApp()
https://bugs.webkit.org/show_bug.cgi?id=181259

Reviewed by Alex Christensen.

Source/WebCore:

As of iOS 11, the Web.app process no longer uses WebKit directly, so IOSApplication::isWebApp()
is never true. Since it's no longer needed, remove it.

* platform/RuntimeApplicationChecks.h:
* platform/cocoa/RuntimeApplicationChecksCocoa.mm:
(WebCore::IOSApplication::isWebApp): Deleted.

Source/WebKit:

* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::defaultApplicationCacheDirectory):
    Remove the wording "this is not supported as of right now", as it seems to be supported
    since r247686, which added SPI on _WKWebsiteDataStoreConfiguration to set the application
    cache directory.

Source/WebKitLegacy/mac:

* WebCoreSupport/WebApplicationCache.mm:
(applicationCacheBundleIdentifier):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@251108 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 553cc0b..0030d2d 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,17 @@
+2019-10-14  David Quesada  <david_quesada@apple.com>
+
+        Remove WebCore::IOSApplication::isWebApp()
+        https://bugs.webkit.org/show_bug.cgi?id=181259
+
+        Reviewed by Alex Christensen.
+
+        As of iOS 11, the Web.app process no longer uses WebKit directly, so IOSApplication::isWebApp()
+        is never true. Since it's no longer needed, remove it.
+
+        * platform/RuntimeApplicationChecks.h:
+        * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
+        (WebCore::IOSApplication::isWebApp): Deleted.
+
 2019-10-14  Andy Estes  <aestes@apple.com>
 
         REGRESSION (r243682): Quick Look previews loaded from the memory cache render with the wrong content type
diff --git a/Source/WebCore/platform/RuntimeApplicationChecks.h b/Source/WebCore/platform/RuntimeApplicationChecks.h
index 08ac7b4..1e5aed3 100644
--- a/Source/WebCore/platform/RuntimeApplicationChecks.h
+++ b/Source/WebCore/platform/RuntimeApplicationChecks.h
@@ -86,7 +86,6 @@
 WEBCORE_EXPORT bool isDumpRenderTree();
 bool isMobileStore();
 bool isSpringBoard();
-WEBCORE_EXPORT bool isWebApp();
 WEBCORE_EXPORT bool isWebProcess();
 WEBCORE_EXPORT bool isIBooks();
 bool isIBooksStorytime();
diff --git a/Source/WebCore/platform/cocoa/RuntimeApplicationChecksCocoa.mm b/Source/WebCore/platform/cocoa/RuntimeApplicationChecksCocoa.mm
index d1861db..de4745b 100644
--- a/Source/WebCore/platform/cocoa/RuntimeApplicationChecksCocoa.mm
+++ b/Source/WebCore/platform/cocoa/RuntimeApplicationChecksCocoa.mm
@@ -258,12 +258,6 @@
     return isSpringBoard;
 }
 
-bool IOSApplication::isWebApp()
-{
-    static bool isWebApp = applicationBundleIsEqualTo("com.apple.webapp"_s);
-    return isWebApp;
-}
-
 // FIXME: this needs to be changed when the WebProcess is changed to an XPC service.
 bool IOSApplication::isWebProcess()
 {
diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog
index a83fa8e..29d4ba1 100644
--- a/Source/WebKit/ChangeLog
+++ b/Source/WebKit/ChangeLog
@@ -1,3 +1,16 @@
+2019-10-14  David Quesada  <david_quesada@apple.com>
+
+        Remove WebCore::IOSApplication::isWebApp()
+        https://bugs.webkit.org/show_bug.cgi?id=181259
+
+        Reviewed by Alex Christensen.
+
+        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
+        (WebKit::WebsiteDataStore::defaultApplicationCacheDirectory):
+            Remove the wording "this is not supported as of right now", as it seems to be supported
+            since r247686, which added SPI on _WKWebsiteDataStoreConfiguration to set the application
+            cache directory.
+
 2019-10-14  Wenson Hsieh  <wenson_hsieh@apple.com>
 
         [Clipboard API] Support writing multiple PasteboardCustomData with SharedBuffers to the pasteboard
diff --git a/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm b/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm
index 58d1f90..cd4ab9c 100644
--- a/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm
+++ b/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm
@@ -249,8 +249,8 @@
     // This quirk used to make these apps share application cache storage, but doesn't accomplish that any more.
     // Preserving it avoids the need to migrate data when upgrading.
     // FIXME: Ideally we should just have Safari, WebApp, and webbookmarksd create a data store with
-    // this application cache path, but that's not supported as of right now.
-    if (WebCore::IOSApplication::isMobileSafari() || WebCore::IOSApplication::isWebApp() || WebCore::IOSApplication::isWebBookmarksD()) {
+    // this application cache path.
+    if (WebCore::IOSApplication::isMobileSafari() || WebCore::IOSApplication::isWebBookmarksD()) {
         NSString *cachePath = [NSHomeDirectory() stringByAppendingPathComponent:@"Library/Caches/com.apple.WebAppCache"];
 
         return WebKit::stringByResolvingSymlinksInPath(cachePath.stringByStandardizingPath);
diff --git a/Source/WebKitLegacy/mac/ChangeLog b/Source/WebKitLegacy/mac/ChangeLog
index ca0f6e2..badbdfe 100644
--- a/Source/WebKitLegacy/mac/ChangeLog
+++ b/Source/WebKitLegacy/mac/ChangeLog
@@ -1,3 +1,13 @@
+2019-10-14  David Quesada  <david_quesada@apple.com>
+
+        Remove WebCore::IOSApplication::isWebApp()
+        https://bugs.webkit.org/show_bug.cgi?id=181259
+
+        Reviewed by Alex Christensen.
+
+        * WebCoreSupport/WebApplicationCache.mm:
+        (applicationCacheBundleIdentifier):
+
 2019-10-14  Wenson Hsieh  <wenson_hsieh@apple.com>
 
         [Clipboard API] Support writing multiple PasteboardCustomData with SharedBuffers to the pasteboard
diff --git a/Source/WebKitLegacy/mac/WebCoreSupport/WebApplicationCache.mm b/Source/WebKitLegacy/mac/WebCoreSupport/WebApplicationCache.mm
index fb010ff..a22781a 100644
--- a/Source/WebKitLegacy/mac/WebCoreSupport/WebApplicationCache.mm
+++ b/Source/WebKitLegacy/mac/WebCoreSupport/WebApplicationCache.mm
@@ -66,7 +66,7 @@
 #if PLATFORM(IOS_FAMILY)
     if (overrideBundleIdentifier)
         return overrideBundleIdentifier;
-    if (WebCore::IOSApplication::isMobileSafari() || WebCore::IOSApplication::isWebApp())
+    if (WebCore::IOSApplication::isMobileSafari())
         return @"com.apple.WebAppCache";
 #endif