RESOLVED FIXED145394
WKWebsiteDataStore should handle media keys
https://bugs.webkit.org/show_bug.cgi?id=145394
Summary WKWebsiteDataStore should handle media keys
Anders Carlsson
Reported 2015-05-26 15:44:05 PDT
WKWebsiteDataStore should handle media keys
Attachments
Patch (21.90 KB, patch)
2015-05-26 16:09 PDT, Anders Carlsson
darin: review+
Anders Carlsson
Comment 1 2015-05-26 16:09:38 PDT
Darin Adler
Comment 2 2015-05-27 11:35:43 PDT
Comment on attachment 253754 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=253754&action=review Looks good. Nits only. > Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp:145 > + struct CallbackAggregator final : public ThreadSafeRefCounted<CallbackAggregator> { Not sure we need “public” here since struct derivation is public by default. Style question, I guess. > Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp:349 > + WTF::StringCapture mediaKeysStorageDirectory { m_mediaKeysStorageDirectory }; Should just be StringCapture, right? Why the WTF prefix? > Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp:818 > + for (const auto& originPath : WebCore::listDirectory(mediaKeysStorageDirectory, "*")) { Not sure the const here is needed or helpful. > Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp:837 > + for (const auto& mediaKeyDirectory : WebCore::listDirectory(mediaKeysStorageDirectory, "*")) { Not sure the const here is needed or helpful. > Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp:859 > + for (const auto& origin : origins) { Not sure the const here is needed or helpful. > Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp:862 > + auto mediaKeyDirectory = WebCore::pathByAppendingComponent(mediaKeysStorageDirectory, origin->databaseIdentifier()); > + > + auto mediaKeyFile = WebCore::pathByAppendingComponent(mediaKeyDirectory, "SecureStop.plist"); I’d omit this blank line.
Anders Carlsson
Comment 3 2015-05-27 11:50:11 PDT
(In reply to comment #2) > Comment on attachment 253754 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=253754&action=review > > Looks good. Nits only. > > > Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp:145 > > + struct CallbackAggregator final : public ThreadSafeRefCounted<CallbackAggregator> { > > Not sure we need “public” here since struct derivation is public by default. > Style question, I guess. I got rid of it. > > > Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp:349 > > + WTF::StringCapture mediaKeysStorageDirectory { m_mediaKeysStorageDirectory }; > > Should just be StringCapture, right? Why the WTF prefix? I blame autocomplete! > > > Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp:818 > > + for (const auto& originPath : WebCore::listDirectory(mediaKeysStorageDirectory, "*")) { > > Not sure the const here is needed or helpful. I think it's helpful because there's no point in allowing mutation of the strings returned. > > + > > + auto mediaKeyFile = WebCore::pathByAppendingComponent(mediaKeyDirectory, "SecureStop.plist"); > > I’d omit this blank line.
Anders Carlsson
Comment 4 2015-05-27 11:54:10 PDT
Darin Adler
Comment 5 2015-05-27 11:56:49 PDT
Comment on attachment 253754 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=253754&action=review > Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp:841 > + if (!WebCore::fileExists(mediaKeyFile)) > + continue; Wait, why do we need this? Won’t getFileModificationTime fail if the file doesn’t exist? I suggest deleting this code.
Note You need to log in before you can comment on or make changes to this bug.