Changeset 217923 in webkit
- Timestamp:
- Jun 7, 2017 10:02:48 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r217914 r217923 1 2017-06-07 Dan Bernstein <mitz@apple.com> 2 3 [Cocoa] additionalReadAccessAllowedURLs doesn’t preserve non-Latin-1 paths 4 https://bugs.webkit.org/show_bug.cgi?id=173086 5 6 Reviewed by Andy Estes. 7 8 We were incorrectly passing the fileSystemRepresentation of an NSURL into the WTF::String 9 constructor that expects a Latin-1 string. However, in general, fileSystemRepresentation is 10 not Latin-1. 11 12 * UIProcess/API/APIProcessPoolConfiguration.h: Changed m_additionalReadAccessAllowedPaths 13 from a Vector<WTF::String> into a Vector<WTF::CString>. 14 15 * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: 16 (-[_WKProcessPoolConfiguration additionalReadAccessAllowedURLs]): Updated for the change. 17 (-[_WKProcessPoolConfiguration setAdditionalReadAccessAllowedURLs:]): Ditto. 18 19 * UIProcess/WebProcessPool.cpp: 20 (WebKit::WebProcessPool::resolvePathsForSandboxExtensions): Ditto. 21 1 22 2017-06-07 Ryosuke Niwa <rniwa@webkit.org> 2 23 -
trunk/Source/WebKit2/UIProcess/API/APIProcessPoolConfiguration.h
r217743 r217923 32 32 #include <wtf/Ref.h> 33 33 #include <wtf/Vector.h> 34 #include <wtf/text/CString.h> 34 35 #include <wtf/text/WTFString.h> 35 36 … … 100 101 void setAlwaysRevalidatedURLSchemes(Vector<WTF::String>&& alwaysRevalidatedURLSchemes) { m_alwaysRevalidatedURLSchemes = WTFMove(alwaysRevalidatedURLSchemes); } 101 102 102 const Vector<WTF:: String>& additionalReadAccessAllowedPaths() { return m_additionalReadAccessAllowedPaths; }103 void setAdditionalReadAccessAllowedPaths(Vector<WTF:: String>&& additionalReadAccessAllowedPaths) { m_additionalReadAccessAllowedPaths = additionalReadAccessAllowedPaths; }103 const Vector<WTF::CString>& additionalReadAccessAllowedPaths() { return m_additionalReadAccessAllowedPaths; } 104 void setAdditionalReadAccessAllowedPaths(Vector<WTF::CString>&& additionalReadAccessAllowedPaths) { m_additionalReadAccessAllowedPaths = additionalReadAccessAllowedPaths; } 104 105 105 106 bool fullySynchronousModeIsAllowedForTesting() const { return m_fullySynchronousModeIsAllowedForTesting; } … … 159 160 Vector<WTF::String> m_cachePartitionedURLSchemes; 160 161 Vector<WTF::String> m_alwaysRevalidatedURLSchemes; 161 Vector<WTF:: String> m_additionalReadAccessAllowedPaths;162 Vector<WTF::CString> m_additionalReadAccessAllowedPaths; 162 163 bool m_fullySynchronousModeIsAllowedForTesting { false }; 163 164 bool m_ignoreSynchronousMessagingTimeoutsForTesting { false }; -
trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm
r217728 r217923 111 111 NSMutableArray *urls = [NSMutableArray arrayWithCapacity:paths.size()]; 112 112 for (const auto& path : paths) 113 [urls addObject:[NSURL fileURLWith Path:path]];113 [urls addObject:[NSURL fileURLWithFileSystemRepresentation:path.data() isDirectory:NO relativeToURL:nil]]; 114 114 115 115 return urls; … … 118 118 - (void)setAdditionalReadAccessAllowedURLs:(NSArray<NSURL *> *)additionalReadAccessAllowedURLs 119 119 { 120 Vector< String> paths;120 Vector<CString> paths; 121 121 paths.reserveInitialCapacity(additionalReadAccessAllowedURLs.count); 122 122 for (NSURL *url in additionalReadAccessAllowedURLs) { -
trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp
r217743 r217923 626 626 m_resolvedPaths.additionalWebProcessSandboxExtensionPaths.reserveCapacity(m_configuration->additionalReadAccessAllowedPaths().size()); 627 627 for (const auto& path : m_configuration->additionalReadAccessAllowedPaths()) 628 m_resolvedPaths.additionalWebProcessSandboxExtensionPaths.uncheckedAppend(resolvePathForSandboxExtension(path ));628 m_resolvedPaths.additionalWebProcessSandboxExtensionPaths.uncheckedAppend(resolvePathForSandboxExtension(path.data())); 629 629 630 630 platformResolvePathsForSandboxExtensions(); -
trunk/Tools/ChangeLog
r217920 r217923 1 2017-06-07 Dan Bernstein <mitz@apple.com> 2 3 [Cocoa] additionalReadAccessAllowedURLs doesn’t preserve non-Latin1 paths 4 https://bugs.webkit.org/show_bug.cgi?id=173086 5 6 Reviewed by Andy Estes. 7 8 * TestWebKitAPI/Tests/WebKit2Cocoa/AdditionalReadAccessAllowedURLs.mm: 9 (TEST): 10 1 11 2017-06-07 Alexey Proskuryakov <ap@apple.com> 2 12 -
trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/AdditionalReadAccessAllowedURLs.mm
r216203 r217923 57 57 EXPECT_TRUE(exceptionRaised); 58 58 59 NSURL *fileURLWithNonLatin1Path = [NSURL fileURLWithPath:@"/这是中文"]; 60 processPoolConfiguration.additionalReadAccessAllowedURLs = @[ fileURLWithNonLatin1Path ]; 61 EXPECT_TRUE([processPoolConfiguration.additionalReadAccessAllowedURLs.firstObject isEqual:fileURLWithNonLatin1Path]); 62 59 63 char temporaryDirectory[PATH_MAX]; 60 64 confstr(_CS_DARWIN_USER_TEMP_DIR, temporaryDirectory, sizeof(temporaryDirectory));
Note: See TracChangeset
for help on using the changeset viewer.