Changeset 162531 in webkit
- Timestamp:
- Jan 22, 2014 10:29:18 AM (10 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 2 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r162519 r162531 1 2014-01-22 Jer Noble <jer.noble@apple.com> 2 3 [Mac][WK2] Unable to play video protected by session cookies 4 https://bugs.webkit.org/show_bug.cgi?id=127207 5 6 Reviewed by Sam Weinig. 7 8 Recent changes in our underlying media frameworks caused our shimmed methods 9 in CookieStorageShim to stop being called. Insert an objective-c shim in addition 10 to our original shim to intercept pulling cookies out of cookie storage. 11 12 * Shared/mac/CookieStorageShim.mm: Renamed from Source/WebKit2/Shared/mac/CookieStorageShim.cpp. 13 (WebKit::CookieStorageShim::initialize): Insert the shim. 14 (-[WKNSURLSessionLocal _copyCookiesForRequestUsingAllAppropriateStorageSemantics:]): 15 Pass through to webKitCookieStorageCopyRequestHeaderFieldsForURL(). 16 * WebKit2.xcodeproj/project.pbxproj: Rename CookieStorageShim.cpp -> .mm. 17 1 18 2014-01-22 Yongjun Zhang <yongjun_zhang@apple.com> 2 19 -
trunk/Source/WebKit2/Shared/mac/CookieStorageShim.mm
r162530 r162531 36 36 #include "WebProcess.h" 37 37 #include <WebCore/URL.h> 38 #include <WebCore/SoftLinking.h> 38 39 #include <dlfcn.h> 39 40 #include <wtf/MainThread.h> … … 41 42 #include <wtf/text/WTFString.h> 42 43 44 typedef const struct _CFURLRequest* CFURLRequestRef; 45 46 SOFT_LINK_FRAMEWORK(CFNetwork) 47 SOFT_LINK(CFNetwork, CFURLRequestGetURL, CFURLRef, (CFURLRequestRef request), (request)) 48 43 49 using namespace WebCore; 50 51 @interface WKNSURLSessionLocal : NSObject 52 - (CFDictionaryRef) _copyCookiesForRequestUsingAllAppropriateStorageSemantics:(CFURLRequestRef) request; 53 @end 44 54 45 55 namespace WebKit { … … 70 80 if (func) 71 81 func(callbacks); 82 83 Class __NSURLSessionLocalClass = objc_getClass("__NSURLSessionLocal"); 84 if (!__NSURLSessionLocalClass) 85 return; 86 87 Method original = class_getInstanceMethod(__NSURLSessionLocalClass, @selector(_copyCookiesForRequestUsingAllAppropriateStorageSemantics:)); 88 if (!original) 89 return; 90 91 Method replacement = class_getInstanceMethod([WKNSURLSessionLocal class], @selector(_copyCookiesForRequestUsingAllAppropriateStorageSemantics:)); 92 ASSERT(replacement); 93 94 method_exchangeImplementations(original, replacement); 72 95 } 73 96 74 97 } 75 98 99 @implementation WKNSURLSessionLocal 100 - (CFDictionaryRef)_copyCookiesForRequestUsingAllAppropriateStorageSemantics:(CFURLRequestRef) request 101 { 102 return WebKit::webKitCookieStorageCopyRequestHeaderFieldsForURL(nullptr, CFURLRequestGetURL(request)); 103 } 104 @end 105 76 106 #endif // ENABLE(NETWORK_PROCESS) -
trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
r162488 r162531 1329 1329 CDC3830817211890008A2FC3 /* WebProcessShim.dylib in Copy WebProcessShim */ = {isa = PBXBuildFile; fileRef = CDC3830617211799008A2FC3 /* WebProcessShim.dylib */; }; 1330 1330 CDC3830C17212282008A2FC3 /* CookieStorageShimLibrary.h in Headers */ = {isa = PBXBuildFile; fileRef = CDC3830B172121CE008A2FC3 /* CookieStorageShimLibrary.h */; }; 1331 CDC3831017212440008A2FC3 /* CookieStorageShim. cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDC3830D1721242D008A2FC3 /* CookieStorageShim.cpp*/; };1331 CDC3831017212440008A2FC3 /* CookieStorageShim.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDC3830D1721242D008A2FC3 /* CookieStorageShim.mm */; }; 1332 1332 CDCA85C8132ABA4E00E961DF /* WKFullScreenWindowController.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDCA85C6132ABA4E00E961DF /* WKFullScreenWindowController.mm */; }; 1333 1333 CDCA85C9132ABA4E00E961DF /* WKFullScreenWindowController.h in Headers */ = {isa = PBXBuildFile; fileRef = CDCA85C7132ABA4E00E961DF /* WKFullScreenWindowController.h */; }; … … 3061 3061 CDC3830617211799008A2FC3 /* WebProcessShim.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = WebProcessShim.dylib; sourceTree = BUILT_PRODUCTS_DIR; }; 3062 3062 CDC3830B172121CE008A2FC3 /* CookieStorageShimLibrary.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CookieStorageShimLibrary.h; sourceTree = "<group>"; }; 3063 CDC3830D1721242D008A2FC3 /* CookieStorageShim. cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CookieStorageShim.cpp; sourceTree = "<group>"; };3063 CDC3830D1721242D008A2FC3 /* CookieStorageShim.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CookieStorageShim.mm; sourceTree = "<group>"; }; 3064 3064 CDC3830E1721242D008A2FC3 /* CookieStorageShim.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CookieStorageShim.h; sourceTree = "<group>"; }; 3065 3065 CDC8F4881725E67800166F6E /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = "<absolute>"; }; … … 5166 5166 1A2A4AFD158693920090C9E9 /* ColorSpaceData.mm */, 5167 5167 1A6F9FB611E1408500DB1371 /* CommandLineMac.cpp */, 5168 CDC3830D1721242D008A2FC3 /* CookieStorageShim. cpp*/,5168 CDC3830D1721242D008A2FC3 /* CookieStorageShim.mm */, 5169 5169 CDC3830E1721242D008A2FC3 /* CookieStorageShim.h */, 5170 5170 CDC382F9172116D3008A2FC3 /* CookieStorageShimLibrary.cpp */, … … 7458 7458 515E772F184015800007203F /* UniqueIDBDatabase.cpp in Sources */, 7459 7459 2DA049B3180CCCD300AAFA9E /* PlatformCALayerRemote.cpp in Sources */, 7460 CDC3831017212440008A2FC3 /* CookieStorageShim. cppin Sources */,7460 CDC3831017212440008A2FC3 /* CookieStorageShim.mm in Sources */, 7461 7461 B878B616133428DC006888E9 /* CorrectionPanel.mm in Sources */, 7462 7462 2989A411167D1834004F96D2 /* CustomProtocolManagerMac.mm in Sources */,
Note: See TracChangeset
for help on using the changeset viewer.