Title: [185428] trunk/Source/WebKit2
- Revision
- 185428
- Author
- [email protected]
- Date
- 2015-06-10 13:47:15 -0700 (Wed, 10 Jun 2015)
Log Message
[WK2] Do not indicate Media Keys are present when they are not
https://bugs.webkit.org/show_bug.cgi?id=145713
<rdar://problem/19752566>
Reviewed by Dean Jackson.
Correct the reporting of Media Key presence by checking for the actual
media key file, not just the directory. Sometimes the directory will exist
with no media key files (e.g., if a user navigates to the directory using
the Finder).
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::computeMediaKeyFile): Moved earlier in file so it could be used by
the 'mediaKeyOrigins' method.
(WebKit::WebsiteDataStore::mediaKeyOrigins): Only indicate we have a media key
origin if the folder actually contains the media key file.
(WebKit::WebsiteDataStore::removeMediaKeys): Use the existing 'computeMediaKeyFile',
rather than manually building the file from strings.
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (185427 => 185428)
--- trunk/Source/WebKit2/ChangeLog 2015-06-10 20:35:14 UTC (rev 185427)
+++ trunk/Source/WebKit2/ChangeLog 2015-06-10 20:47:15 UTC (rev 185428)
@@ -1,3 +1,24 @@
+2015-06-10 Brent Fulgham <[email protected]>
+
+ [WK2] Do not indicate Media Keys are present when they are not
+ https://bugs.webkit.org/show_bug.cgi?id=145713
+ <rdar://problem/19752566>
+
+ Reviewed by Dean Jackson.
+
+ Correct the reporting of Media Key presence by checking for the actual
+ media key file, not just the directory. Sometimes the directory will exist
+ with no media key files (e.g., if a user navigates to the directory using
+ the Finder).
+
+ * UIProcess/WebsiteData/WebsiteDataStore.cpp:
+ (WebKit::computeMediaKeyFile): Moved earlier in file so it could be used by
+ the 'mediaKeyOrigins' method.
+ (WebKit::WebsiteDataStore::mediaKeyOrigins): Only indicate we have a media key
+ origin if the folder actually contains the media key file.
+ (WebKit::WebsiteDataStore::removeMediaKeys): Use the existing 'computeMediaKeyFile',
+ rather than manually building the file from strings.
+
2015-06-09 Anders Carlsson <[email protected]>
Support fetching website data
Modified: trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp (185427 => 185428)
--- trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp 2015-06-10 20:35:14 UTC (rev 185427)
+++ trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp 2015-06-10 20:47:15 UTC (rev 185428)
@@ -894,6 +894,11 @@
}
#endif
+static String computeMediaKeyFile(const String& mediaKeyDirectory)
+{
+ return WebCore::pathByAppendingComponent(mediaKeyDirectory, "SecureStop.plist");
+}
+
Vector<RefPtr<WebCore::SecurityOrigin>> WebsiteDataStore::mediaKeyOrigins(const String& mediaKeysStorageDirectory)
{
ASSERT(!mediaKeysStorageDirectory.isEmpty());
@@ -901,6 +906,10 @@
Vector<RefPtr<WebCore::SecurityOrigin>> origins;
for (const auto& originPath : WebCore::listDirectory(mediaKeysStorageDirectory, "*")) {
+ auto mediaKeyFile = computeMediaKeyFile(originPath);
+ if (!WebCore::fileExists(mediaKeyFile))
+ continue;
+
auto mediaKeyIdentifier = WebCore::pathGetFileName(originPath);
if (auto securityOrigin = WebCore::SecurityOrigin::maybeCreateFromDatabaseIdentifier(mediaKeyIdentifier))
@@ -910,11 +919,6 @@
return origins;
}
-static String computeMediaKeyFile(const String& mediaKeyDirectory)
-{
- return WebCore::pathByAppendingComponent(mediaKeyDirectory, "SecureStop.plist");
-}
-
void WebsiteDataStore::removeMediaKeys(const String& mediaKeysStorageDirectory, std::chrono::system_clock::time_point modifiedSince)
{
ASSERT(!mediaKeysStorageDirectory.isEmpty());
@@ -940,7 +944,7 @@
for (const auto& origin : origins) {
auto mediaKeyDirectory = WebCore::pathByAppendingComponent(mediaKeysStorageDirectory, origin->databaseIdentifier());
- auto mediaKeyFile = WebCore::pathByAppendingComponent(mediaKeyDirectory, "SecureStop.plist");
+ auto mediaKeyFile = computeMediaKeyFile(mediaKeyDirectory);
WebCore::deleteFile(mediaKeyFile);
WebCore::deleteEmptyDirectory(mediaKeyDirectory);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes