Changeset 220389 in webkit
- Timestamp:
- Aug 8, 2017 12:29:22 AM (7 years ago)
- Location:
- branches/safari-604-branch/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-604-branch/Source/WebCore/ChangeLog
r220339 r220389 1 2017-08-08 Jason Marcell <jmarcell@apple.com> 2 3 Cherry-pick r220247. rdar://problem/33754443 4 5 2017-08-03 Jer Noble <jer.noble@apple.com> 6 7 [EME][Mac] SecureStop left on disk in Private Browsing mode. 8 https://bugs.webkit.org/show_bug.cgi?id=175162 9 10 Reviewed by Eric Carlson. 11 12 Return an empty string from mediaKeysStorageDirectory() when the page indicates that storage should 13 be ephemeral(). Previously, an empty string in this case would be treated as an error. Instead, treat 14 an empty string as valid, and do not try to store or retrieve session information to disk in that case. 15 16 * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp: 17 (WebCore::WebKitMediaKeySession::mediaKeysStorageDirectory const): 18 * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm: 19 (WebCore::CDMSessionAVContentKeySession::releaseKeys): 20 (WebCore::CDMSessionAVContentKeySession::update): 21 (WebCore::CDMSessionAVContentKeySession::generateKeyReleaseMessage): 22 (WebCore::CDMSessionAVContentKeySession::contentKeySession): 23 * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm: 24 (WebCore::CDMSessionMediaSourceAVFObjC::storagePath const): 25 1 26 2017-08-07 Jason Marcell <jmarcell@apple.com> 2 27 -
branches/safari-604-branch/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp
r215160 r220389 33 33 #include "ExceptionCode.h" 34 34 #include "FileSystem.h" 35 #include "Page.h" 35 36 #include "SecurityOriginData.h" 36 37 #include "Settings.h" … … 224 225 return emptyString(); 225 226 227 auto* page = document->page(); 228 if (!page || page->usesEphemeralSession()) 229 return emptyString(); 230 226 231 auto storageDirectory = document->settings().mediaKeysStorageDirectory(); 227 232 if (storageDirectory.isEmpty()) -
branches/safari-604-branch/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm
r219191 r220389 46 46 SOFT_LINK_CLASS_OPTIONAL(AVFoundation, AVContentKeySession); 47 47 SOFT_LINK_CONSTANT_MAY_FAIL(AVFoundation, AVContentKeyRequestProtocolVersionsKey, NSString *) 48 SOFT_LINK_CONSTANT_MAY_FAIL(AVFoundation, AVContentKeySystemFairPlayStreaming, NSString *) 49 50 typedef NSString *AVContentKeySystem; 48 51 49 52 @interface AVContentKeySession : NSObject 53 + (instancetype)contentKeySessionWithKeySystem:(AVContentKeySystem)keySystem; 50 54 - (instancetype)initWithStorageDirectoryAtURL:(NSURL *)storageURL; 51 55 @property (assign) id delegate; … … 192 196 return; 193 197 198 auto storagePath = this->storagePath(); 199 if (storagePath.isEmpty()) 200 return; 201 194 202 RetainPtr<NSData> certificateData = adoptNS([[NSData alloc] initWithBytes:m_certificate->data() length:m_certificate->length()]); 195 NSArray* expiredSessions = [getAVContentKeySessionClass() pendingExpiredSessionReportsWithAppIdentifier:certificateData.get() storageDirectoryAtURL:[NSURL fileURLWithPath:storagePath ()]];203 NSArray* expiredSessions = [getAVContentKeySessionClass() pendingExpiredSessionReportsWithAppIdentifier:certificateData.get() storageDirectoryAtURL:[NSURL fileURLWithPath:storagePath]]; 196 204 for (NSData* expiredSessionData in expiredSessions) { 197 205 NSDictionary *expiredSession = [NSPropertyListSerialization propertyListWithData:expiredSessionData options:kCFPropertyListImmutable format:nullptr error:nullptr]; … … 240 248 LOG(Media, "CDMSessionAVContentKeySession::update(%p) - acknowleding secure stop message", this); 241 249 242 if (!m_expiredSession) { 250 String storagePath = this->storagePath(); 251 if (!m_expiredSession || storagePath.isEmpty()) { 243 252 errorCode = MediaPlayer::InvalidPlayerState; 244 253 return false; … … 248 257 249 258 if ([getAVContentKeySessionClass() respondsToSelector:@selector(removePendingExpiredSessionReports:withAppIdentifier:storageDirectoryAtURL:)]) 250 [getAVContentKeySessionClass() removePendingExpiredSessionReports:@[m_expiredSession.get()] withAppIdentifier:certificateData.get() storageDirectoryAtURL:[NSURL fileURLWithPath:storagePath ()]];259 [getAVContentKeySessionClass() removePendingExpiredSessionReports:@[m_expiredSession.get()] withAppIdentifier:certificateData.get() storageDirectoryAtURL:[NSURL fileURLWithPath:storagePath]]; 251 260 m_expiredSession = nullptr; 252 261 return true; … … 316 325 RetainPtr<NSData> certificateData = adoptNS([[NSData alloc] initWithBytes:m_certificate->data() length:m_certificate->length()]); 317 326 318 if (![getAVContentKeySessionClass() respondsToSelector:@selector(pendingExpiredSessionReportsWithAppIdentifier:storageDirectoryAtURL:)]) { 327 String storagePath = this->storagePath(); 328 if (storagePath.isEmpty() || ![getAVContentKeySessionClass() respondsToSelector:@selector(pendingExpiredSessionReportsWithAppIdentifier:storageDirectoryAtURL:)]) { 319 329 errorCode = MediaPlayer::KeySystemNotSupported; 320 330 systemCode = '!mor'; … … 322 332 } 323 333 324 NSArray* expiredSessions = [getAVContentKeySessionClass() pendingExpiredSessionReportsWithAppIdentifier:certificateData.get() storageDirectoryAtURL:[NSURL fileURLWithPath:storagePath ()]];334 NSArray* expiredSessions = [getAVContentKeySessionClass() pendingExpiredSessionReportsWithAppIdentifier:certificateData.get() storageDirectoryAtURL:[NSURL fileURLWithPath:storagePath]]; 325 335 if (![expiredSessions count]) { 326 336 LOG(Media, "CDMSessionAVContentKeySession::generateKeyReleaseMessage(%p) - no expired sessions found", this); … … 346 356 AVContentKeySession* CDMSessionAVContentKeySession::contentKeySession() 347 357 { 348 if (!m_contentKeySession) { 349 350 String storagePath = this->storagePath(); 351 if (storagePath.isEmpty()) 358 if (m_contentKeySession) 359 return m_contentKeySession.get(); 360 361 String storagePath = this->storagePath(); 362 if (storagePath.isEmpty()) { 363 if (![getAVContentKeySessionClass() respondsToSelector:@selector(contentKeySessionWithKeySystem:)] || !canLoadAVContentKeySystemFairPlayStreaming()) 352 364 return nil; 353 365 366 m_contentKeySession = [getAVContentKeySessionClass() contentKeySessionWithKeySystem:getAVContentKeySystemFairPlayStreaming()]; 367 } else { 354 368 String storageDirectory = directoryName(storagePath); 355 369 … … 360 374 361 375 m_contentKeySession = adoptNS([allocAVContentKeySessionInstance() initWithStorageDirectoryAtURL:[NSURL fileURLWithPath:storagePath]]); 362 m_contentKeySession.get().delegate = m_contentKeySessionDelegate.get();363 } 364 376 } 377 378 m_contentKeySession.get().delegate = m_contentKeySessionDelegate.get(); 365 379 return m_contentKeySession.get(); 366 380 } -
branches/safari-604-branch/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm
r206811 r220389 99 99 String CDMSessionMediaSourceAVFObjC::storagePath() const 100 100 { 101 return m_client ? pathByAppendingComponent(m_client->mediaKeysStorageDirectory(), "SecureStop.plist") : emptyString(); 101 if (!m_client) 102 return emptyString(); 103 104 String storageDirectory = m_client->mediaKeysStorageDirectory(); 105 if (storageDirectory.isEmpty()) 106 return emptyString(); 107 108 return pathByAppendingComponent(storageDirectory, "SecureStop.plist"); 102 109 } 103 110
Note: See TracChangeset
for help on using the changeset viewer.