⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 185428 in webkit


Ignore:
Timestamp:
Jun 10, 2015, 1:47:15 PM (11 years ago)
Author:
Brent Fulgham
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.

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r185420 r185428  
     12015-06-10  Brent Fulgham  <bfulgham@apple.com>
     2
     3        [WK2] Do not indicate Media Keys are present when they are not
     4        https://bugs.webkit.org/show_bug.cgi?id=145713
     5        <rdar://problem/19752566>
     6
     7        Reviewed by Dean Jackson.
     8
     9        Correct the reporting of Media Key presence by checking for the actual
     10        media key file, not just the directory. Sometimes the directory will exist
     11        with no media key files (e.g., if a user navigates to the directory using
     12        the Finder).
     13
     14        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
     15        (WebKit::computeMediaKeyFile): Moved earlier in file so it could be used by
     16        the 'mediaKeyOrigins' method.
     17        (WebKit::WebsiteDataStore::mediaKeyOrigins): Only indicate we have a media key
     18        origin if the folder actually contains the media key file.
     19        (WebKit::WebsiteDataStore::removeMediaKeys): Use the existing 'computeMediaKeyFile',
     20        rather than manually building the file from strings.
     21
    1222015-06-09  Anders Carlsson  <andersca@apple.com>
    223
  • trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp

    r185420 r185428  
    895895#endif
    896896
     897static String computeMediaKeyFile(const String& mediaKeyDirectory)
     898{
     899    return WebCore::pathByAppendingComponent(mediaKeyDirectory, "SecureStop.plist");
     900}
     901
    897902Vector<RefPtr<WebCore::SecurityOrigin>> WebsiteDataStore::mediaKeyOrigins(const String& mediaKeysStorageDirectory)
    898903{
    … …  
    902907
    903908    for (const auto& originPath : WebCore::listDirectory(mediaKeysStorageDirectory, "*")) {
     909        auto mediaKeyFile = computeMediaKeyFile(originPath);
     910        if (!WebCore::fileExists(mediaKeyFile))
     911            continue;
     912
    904913        auto mediaKeyIdentifier = WebCore::pathGetFileName(originPath);
    905914
    … …  
    909918
    910919    return origins;
    911 }
    912 
    913 static String computeMediaKeyFile(const String& mediaKeyDirectory)
    914 {
    915     return WebCore::pathByAppendingComponent(mediaKeyDirectory, "SecureStop.plist");
    916920}
    917921
    … …  
    941945    for (const auto& origin : origins) {
    942946        auto mediaKeyDirectory = WebCore::pathByAppendingComponent(mediaKeysStorageDirectory, origin->databaseIdentifier());
    943         auto mediaKeyFile = WebCore::pathByAppendingComponent(mediaKeyDirectory, "SecureStop.plist");
     947        auto mediaKeyFile = computeMediaKeyFile(mediaKeyDirectory);
    944948
    945949        WebCore::deleteFile(mediaKeyFile);
Note: See TracChangeset for help on using the changeset viewer.