Changeset 215807 in webkit
- Timestamp:
- Apr 26, 2017 10:08:51 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r215806 r215807 1 2017-04-25 Alex Christensen <achristensen@webkit.org> 2 3 Encoded filename should be decoded for WKContentExtension.identifier 4 https://bugs.webkit.org/show_bug.cgi?id=171316 5 6 Reviewed by Andy Estes. 7 8 * platform/FileSystem.h: 9 1 10 2017-04-26 Frederic Wang <fwang@igalia.com> 2 11 -
trunk/Source/WebCore/platform/FileSystem.h
r215290 r215807 191 191 // Encode a string for use within a file name. 192 192 WEBCORE_EXPORT String encodeForFileName(const String&); 193 String decodeFromFilename(const String&);193 WEBCORE_EXPORT String decodeFromFilename(const String&); 194 194 195 195 WEBCORE_EXPORT bool filesHaveSameVolume(const String&, const String&); -
trunk/Source/WebKit2/ChangeLog
r215801 r215807 1 2017-04-25 Alex Christensen <achristensen@webkit.org> 2 3 Encoded filename should be decoded for WKContentExtension.identifier 4 https://bugs.webkit.org/show_bug.cgi?id=171316 5 6 Reviewed by Andy Estes. 7 8 * UIProcess/API/APIContentExtensionStore.cpp: 9 (API::createExtension): 10 (API::ContentExtensionStore::lookupContentExtension): 11 (API::ContentExtensionStore::getAvailableContentExtensionIdentifiers): 12 1 13 2017-04-26 Andrew Gold <agold@apple.com> 2 14 -
trunk/Source/WebKit2/UIProcess/API/APIContentExtensionStore.cpp
r215209 r215807 335 335 } 336 336 337 static Ref Ptr<API::ContentExtension> createExtension(const String& identifier, const ContentExtensionMetaData& metaData, const Data& fileData)337 static Ref<API::ContentExtension> createExtension(const String& identifier, const ContentExtensionMetaData& metaData, const Data& fileData) 338 338 { 339 339 auto sharedMemory = WebKit::SharedMemory::create(const_cast<uint8_t*>(fileData.data()), fileData.size(), WebKit::SharedMemory::Protection::ReadOnly); … … 384 384 385 385 RunLoop::main().dispatch([protectedThis = WTFMove(protectedThis), identifier = WTFMove(identifier), fileData = WTFMove(fileData), metaData = WTFMove(metaData), completionHandler = WTFMove(completionHandler)] { 386 RefPtr<API::ContentExtension> contentExtension = createExtension(identifier, metaData, fileData); 387 completionHandler(contentExtension, { }); 386 completionHandler(createExtension(identifier, metaData, fileData), { }); 388 387 }); 389 388 }); … … 399 398 const auto prefixLength = constructedPathPrefix().length(); 400 399 for (const auto& path : fullPaths) 401 identifiers.uncheckedAppend( path.substring(path.reverseFind('/') + 1 + prefixLength));400 identifiers.uncheckedAppend(WebCore::decodeFromFilename(path.substring(path.reverseFind('/') + 1 + prefixLength))); 402 401 403 402 RunLoop::main().dispatch([protectedThis = WTFMove(protectedThis), completionHandler = WTFMove(completionHandler), identifiers = WTFMove(identifiers)]() mutable { -
trunk/Tools/ChangeLog
r215790 r215807 1 2017-04-25 Alex Christensen <achristensen@webkit.org> 2 3 Encoded filename should be decoded for WKContentExtension.identifier 4 https://bugs.webkit.org/show_bug.cgi?id=171316 5 6 Reviewed by Andy Estes. 7 8 * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: 9 * TestWebKitAPI/Tests/WebKit2Cocoa/WKContentExtensionStore.mm: Copied from Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WKUserContentExtensionStore.mm. 10 (TEST_F): 11 * TestWebKitAPI/Tests/WebKit2Cocoa/WKUserContentExtensionStore.mm: Removed. 12 1 13 2017-04-25 Alex Christensen <achristensen@webkit.org> 2 14 -
trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
r215790 r215807 204 204 5C9E59421D3EB5AC00E3C62E /* ApplicationCache.db-shm in Copy Resources */ = {isa = PBXBuildFile; fileRef = 5C9E593F1D3EB1DE00E3C62E /* ApplicationCache.db-shm */; }; 205 205 5C9E59431D3EB5AC00E3C62E /* ApplicationCache.db-wal in Copy Resources */ = {isa = PBXBuildFile; fileRef = 5C9E59401D3EB1DE00E3C62E /* ApplicationCache.db-wal */; }; 206 5CE354D91E70DA5C00BEFE3B /* WK UserContentExtensionStore.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5CE354D81E70D9C300BEFE3B /* WKUserContentExtensionStore.mm */; };206 5CE354D91E70DA5C00BEFE3B /* WKContentExtensionStore.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5CE354D81E70D9C300BEFE3B /* WKContentExtensionStore.mm */; }; 207 207 5E4B1D2E1D404C6100053621 /* WKScrollViewDelegateCrash.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5E4B1D2C1D404C6100053621 /* WKScrollViewDelegateCrash.mm */; }; 208 208 631EFFF61E7B5E8D00D2EBB8 /* Geolocation.mm in Sources */ = {isa = PBXBuildFile; fileRef = 631EFFF51E7B5E8D00D2EBB8 /* Geolocation.mm */; }; … … 1153 1153 5C9E593F1D3EB1DE00E3C62E /* ApplicationCache.db-shm */ = {isa = PBXFileReference; lastKnownFileType = file; path = "ApplicationCache.db-shm"; sourceTree = "<group>"; }; 1154 1154 5C9E59401D3EB1DE00E3C62E /* ApplicationCache.db-wal */ = {isa = PBXFileReference; lastKnownFileType = file; path = "ApplicationCache.db-wal"; sourceTree = "<group>"; }; 1155 5CE354D81E70D9C300BEFE3B /* WK UserContentExtensionStore.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKUserContentExtensionStore.mm; sourceTree = "<group>"; };1155 5CE354D81E70D9C300BEFE3B /* WKContentExtensionStore.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKContentExtensionStore.mm; sourceTree = "<group>"; }; 1156 1156 5E4B1D2C1D404C6100053621 /* WKScrollViewDelegateCrash.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WKScrollViewDelegateCrash.mm; path = ../ios/WKScrollViewDelegateCrash.mm; sourceTree = "<group>"; }; 1157 1157 631EFFF51E7B5E8D00D2EBB8 /* Geolocation.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Geolocation.mm; sourceTree = "<group>"; }; … … 1745 1745 5E4B1D2C1D404C6100053621 /* WKScrollViewDelegateCrash.mm */, 1746 1746 51C683DD1EA134DB00650183 /* WKURLSchemeHandler-1.mm */, 1747 5CE354D81E70D9C300BEFE3B /* WK UserContentExtensionStore.mm */,1747 5CE354D81E70D9C300BEFE3B /* WKContentExtensionStore.mm */, 1748 1748 2EFF06D61D8AF34A0004BB30 /* WKWebViewCandidateTests.mm */, 1749 1749 7C417F311D19E14800B8EF53 /* WKWebViewDefaultNavigationDelegate.mm */, … … 3054 3054 5C7964101EB0278D0075D74C /* EventModifiers.cpp in Sources */, 3055 3055 2D4CF8BD1D8360CC0001CE8D /* WKThumbnailView.mm in Sources */, 3056 5CE354D91E70DA5C00BEFE3B /* WK UserContentExtensionStore.mm in Sources */,3056 5CE354D91E70DA5C00BEFE3B /* WKContentExtensionStore.mm in Sources */, 3057 3057 2EFF06D71D8AF34A0004BB30 /* WKWebViewCandidateTests.mm in Sources */, 3058 3058 A14FC5851B89739100D107EB /* WKWebViewConfigurationExtras.mm in Sources */, -
trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WKContentExtensionStore.mm
r215806 r215807 105 105 } 106 106 107 TEST_F(WKContentExtensionStoreTest, EncodedIdentifier) 108 { 109 // FIXME: U+00C4 causes problems here. Using the output of encodeForFileName with 110 // the filesystem changes it to U+0041 followed by U+0308 111 NSString *identifier = @":;%25%+25И😍"; 112 __block bool done = false; 113 [[WKContentExtensionStore defaultStore] compileContentExtensionForIdentifier:identifier encodedContentExtension:basicFilter completionHandler:^(WKContentExtension *filter, NSError *error) { 114 115 EXPECT_STREQ(filter.identifier.UTF8String, identifier.UTF8String); 116 117 [[WKContentExtensionStore defaultStore] getAvailableContentExtensionIdentifiers:^(NSArray<NSString *> *identifiers) { 118 EXPECT_EQ(identifiers.count, 1u); 119 EXPECT_EQ(identifiers[0].length, identifier.length); 120 EXPECT_STREQ(identifiers[0].UTF8String, identifier.UTF8String); 121 122 done = true; 123 }]; 124 }]; 125 TestWebKitAPI::Util::run(&done); 126 } 127 107 128 TEST_F(WKContentExtensionStoreTest, NonExistingIdentifierLookup) 108 129 {
Note: See TracChangeset
for help on using the changeset viewer.