Title: [180946] trunk/Source
Revision
180946
Author
ander...@apple.com
Date
2015-03-03 11:56:32 -0800 (Tue, 03 Mar 2015)

Log Message

Use the correct display name for website data for local files
https://bugs.webkit.org/show_bug.cgi?id=142228

Reviewed by Dan Bernstein.

Source/WebCore:

* English.lproj/Localizable.strings:
Add local file display name.

* platform/spi/cf/CFNetworkSPI.h:
Add kCFHTTPCookieLocalFileDomain declaration.

Source/WebKit2:

* UIProcess/WebsiteData/WebsiteDataRecord.cpp:
(displayNameForLocalFiles):
Add new helper function.

(WebKit::WebsiteDataRecord::displayNameForCookieHostName):
Check if the hostname is kCFHTTPCookieLocalFileDomain.

(WebKit::WebsiteDataRecord::displayNameForOrigin):
Handle file URLs as well.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (180945 => 180946)


--- trunk/Source/WebCore/ChangeLog	2015-03-03 19:14:24 UTC (rev 180945)
+++ trunk/Source/WebCore/ChangeLog	2015-03-03 19:56:32 UTC (rev 180946)
@@ -1,3 +1,16 @@
+2015-03-03  Anders Carlsson  <ander...@apple.com>
+
+        Use the correct display name for website data for local files
+        https://bugs.webkit.org/show_bug.cgi?id=142228
+
+        Reviewed by Dan Bernstein.
+
+        * English.lproj/Localizable.strings:
+        Add local file display name.
+
+        * platform/spi/cf/CFNetworkSPI.h:
+        Add kCFHTTPCookieLocalFileDomain declaration.
+
 2015-03-03  Myles C. Maxfield  <mmaxfi...@apple.com>
 
         BreakingContext cleanup

Modified: trunk/Source/WebCore/English.lproj/Localizable.strings (180945 => 180946)


--- trunk/Source/WebCore/English.lproj/Localizable.strings	2015-03-03 19:14:24 UTC (rev 180945)
+++ trunk/Source/WebCore/English.lproj/Localizable.strings	2015-03-03 19:56:32 UTC (rev 180946)
@@ -316,6 +316,9 @@
 /* Media controller status message when the media is loading */
 "Loading..." = "Loading...";
 
+/* 'Website' name displayed when local documents have stored local data */
+"Local documents on your computer" = "Local documents on your computer";
+
 /* Look Up in Dictionary context menu item */
 "Look Up in Dictionary" = "Look Up in Dictionary";
 

Modified: trunk/Source/WebCore/platform/spi/cf/CFNetworkSPI.h (180945 => 180946)


--- trunk/Source/WebCore/platform/spi/cf/CFNetworkSPI.h	2015-03-03 19:14:24 UTC (rev 180945)
+++ trunk/Source/WebCore/platform/spi/cf/CFNetworkSPI.h	2015-03-03 19:56:32 UTC (rev 180946)
@@ -87,6 +87,8 @@
 
 EXTERN_C void CFURLConnectionInvalidateConnectionCache();
 
+EXTERN_C CFStringRef const kCFHTTPCookieLocalFileDomain;
+
 // FIXME: We should only forward declare this SPI when building for iOS without the Apple Internal SDK.
 // As a workaround for <rdar://problem/19025016>, we must forward declare this SPI regardless of whether
 // we are building with the Apple Internal SDK.

Modified: trunk/Source/WebKit2/ChangeLog (180945 => 180946)


--- trunk/Source/WebKit2/ChangeLog	2015-03-03 19:14:24 UTC (rev 180945)
+++ trunk/Source/WebKit2/ChangeLog	2015-03-03 19:56:32 UTC (rev 180946)
@@ -1,3 +1,20 @@
+2015-03-03  Anders Carlsson  <ander...@apple.com>
+
+        Use the correct display name for website data for local files
+        https://bugs.webkit.org/show_bug.cgi?id=142228
+
+        Reviewed by Dan Bernstein.
+
+        * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
+        (displayNameForLocalFiles):
+        Add new helper function.
+
+        (WebKit::WebsiteDataRecord::displayNameForCookieHostName):
+        Check if the hostname is kCFHTTPCookieLocalFileDomain.
+
+        (WebKit::WebsiteDataRecord::displayNameForOrigin):
+        Handle file URLs as well.
+
 2015-03-03  Enrica Casucci  <enr...@apple.com>
 
         Fixed typo in platform guard in http://trac.webkit.org/changeset/180939.

Modified: trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataRecord.cpp (180945 => 180946)


--- trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataRecord.cpp	2015-03-03 19:14:24 UTC (rev 180945)
+++ trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataRecord.cpp	2015-03-03 19:56:32 UTC (rev 180946)
@@ -26,13 +26,28 @@
 #include "config.h"
 #include "WebsiteDataRecord.h"
 
+#include <WebCore/LocalizedStrings.h>
 #include <WebCore/PublicSuffix.h>
 #include <WebCore/SecurityOrigin.h>
 
+#if PLATFORM(COCOA)
+#import <WebCore/CFNetworkSPI.h>
+#endif
+
+static String displayNameForLocalFiles()
+{
+    return WEB_UI_STRING("Local documents on your computer", "'Website' name displayed when local documents have stored local data");
+}
+
 namespace WebKit {
 
 String WebsiteDataRecord::displayNameForCookieHostName(const String& hostName)
 {
+#if PLATFORM(COCOA)
+    if (hostName == String(kCFHTTPCookieLocalFileDomain))
+        return displayNameForLocalFiles();
+#endif
+
     // FIXME: This needs to handle the local file domain for cookies.
 
 #if ENABLE(PUBLIC_SUFFIX_LIST)
@@ -46,10 +61,8 @@
 {
     const auto& protocol = securityOrigin.protocol();
 
-    if (protocol == "file") {
-        // FIXME: Handle this. Return a localized display name.
-        ASSERT_NOT_REACHED();
-    }
+    if (protocol == "file")
+        return displayNameForLocalFiles();
 
 #if ENABLE(PUBLIC_SUFFIX_LIST)
     if (protocol == "http" || protocol == "https")
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to