Diff
Modified: trunk/Source/WTF/ChangeLog (233379 => 233380)
--- trunk/Source/WTF/ChangeLog 2018-06-30 00:06:25 UTC (rev 233379)
+++ trunk/Source/WTF/ChangeLog 2018-06-30 00:23:43 UTC (rev 233380)
@@ -1,3 +1,29 @@
+2018-06-29 Darin Adler <[email protected]>
+
+ [Cocoa] reduce unnecessary use of .mm source files in WTF, spruce up some implementation details
+ https://bugs.webkit.org/show_bug.cgi?id=186924
+
+ Reviewed by Anders Carlsson.
+
+ * WTF.xcodeproj/project.pbxproj: Update for file and directory renames, file type changes,
+ and deletions.
+
+ * wtf/MemoryPressureHandler.cpp:
+ (WTF::MemoryPressureHandler::holdOff): Deleted empty placeholder; this one is not needed.
+
+ * wtf/PlatformMac.cmake: Update for file and directory renames, file type changes,
+ and deletions.
+
+ * wtf/cocoa/CPUTimeCocoa.cpp: Renamed from Source/WTF/wtf/cocoa/CPUTimeCocoa.mm.
+
+ * wtf/text/cocoa/StringImplCocoa.mm: Renamed from Source/WTF/wtf/text/mac/StringImplMac.mm.
+ Also removed an unneeded include.
+
+ * wtf/text/cocoa/StringViewCocoa.mm: Renamed from Source/WTF/wtf/text/mac/StringViewObjC.mm.
+
+ * wtf/text/cocoa/TextBreakIteratorInternalICUCocoa.cpp: Renamed from
+ Source/WTF/wtf/text/mac/TextBreakIteratorInternalICUMac.mm.
+
2018-06-28 Olivia Barnett <[email protected]>
Find in page for typographic quotes does not find low (German) quotes
Modified: trunk/Source/WTF/WTF.xcodeproj/project.pbxproj (233379 => 233380)
--- trunk/Source/WTF/WTF.xcodeproj/project.pbxproj 2018-06-30 00:06:25 UTC (rev 233379)
+++ trunk/Source/WTF/WTF.xcodeproj/project.pbxproj 2018-06-30 00:23:43 UTC (rev 233380)
@@ -60,7 +60,7 @@
1C181C8F1D307AB800F5FA16 /* UTextProvider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C181C891D307AB800F5FA16 /* UTextProvider.cpp */; };
1C181C911D307AB800F5FA16 /* UTextProviderLatin1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C181C8B1D307AB800F5FA16 /* UTextProviderLatin1.cpp */; };
1C181C931D307AB800F5FA16 /* UTextProviderUTF16.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C181C8D1D307AB800F5FA16 /* UTextProviderUTF16.cpp */; };
- 1C181C961D30800A00F5FA16 /* TextBreakIteratorInternalICUMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1C181C951D30800A00F5FA16 /* TextBreakIteratorInternalICUMac.mm */; };
+ 1C181C961D30800A00F5FA16 /* TextBreakIteratorInternalICUCocoa.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C181C951D30800A00F5FA16 /* TextBreakIteratorInternalICUCocoa.cpp */; };
1FA47C8A152502DA00568D1B /* WebCoreThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1FA47C88152502DA00568D1B /* WebCoreThread.cpp */; };
2CCD892A15C0390200285083 /* GregorianDateTime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2CCD892915C0390200285083 /* GregorianDateTime.cpp */; };
2CDED0EF18115C38004DBA70 /* RunLoopCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2CDED0EE18115C38004DBA70 /* RunLoopCF.cpp */; };
@@ -82,7 +82,7 @@
7AF023B52061E17000A8EFD6 /* ProcessPrivilege.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7AF023B42061E16F00A8EFD6 /* ProcessPrivilege.cpp */; };
7AFEC6B11EB22B5900DADE36 /* UUID.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7AFEC6B01EB22B5900DADE36 /* UUID.cpp */; };
8134013815B092FD001FF0B8 /* Base64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8134013615B092FD001FF0B8 /* Base64.cpp */; };
- 93934BD318A1E8C300D0D6A1 /* StringViewObjC.mm in Sources */ = {isa = PBXBuildFile; fileRef = 93934BD218A1E8C300D0D6A1 /* StringViewObjC.mm */; };
+ 93934BD318A1E8C300D0D6A1 /* StringViewCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 93934BD218A1E8C300D0D6A1 /* StringViewCocoa.mm */; };
93934BD518A1F16900D0D6A1 /* StringViewCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93934BD418A1F16900D0D6A1 /* StringViewCF.cpp */; };
93F1993E19D7958D00C2390B /* StringView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93F1993D19D7958D00C2390B /* StringView.cpp */; };
9BC70F05176C379D00101DEC /* AtomicStringTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9BC70F04176C379D00101DEC /* AtomicStringTable.cpp */; };
@@ -89,7 +89,7 @@
A3B725EC987446AD93F1A440 /* RandomDevice.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C8F597CA2A57417FBAB92FD6 /* RandomDevice.cpp */; };
A3E4DD931F3A803400DED0B4 /* TextStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A3E4DD911F3A803400DED0B4 /* TextStream.cpp */; };
A5BA15F3182433A900A82E69 /* StringMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5BA15F2182433A900A82E69 /* StringMac.mm */; };
- A5BA15F51824348000A82E69 /* StringImplMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5BA15F41824348000A82E69 /* StringImplMac.mm */; };
+ A5BA15F51824348000A82E69 /* StringImplCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5BA15F41824348000A82E69 /* StringImplCocoa.mm */; };
A5BA15FA182435A600A82E69 /* AtomicStringImplCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5BA15F7182435A600A82E69 /* AtomicStringImplCF.cpp */; };
A5BA15FB182435A600A82E69 /* StringCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5BA15F8182435A600A82E69 /* StringCF.cpp */; };
A5BA15FC182435A600A82E69 /* StringImplCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5BA15F9182435A600A82E69 /* StringImplCF.cpp */; };
@@ -142,12 +142,13 @@
C2BCFC401F61D13000C9222C /* Language.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2BCFC3E1F61D13000C9222C /* Language.cpp */; };
C2BCFC421F61D61600C9222C /* LanguageCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2BCFC411F61D61600C9222C /* LanguageCF.cpp */; };
C2BCFC551F621F3F00C9222C /* LineEnding.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2BCFC531F621F3F00C9222C /* LineEnding.cpp */; };
+ C805EF39E5F14481A96D39FC /* ASCIILiteral.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C6F050790D9C432A99085E75 /* ASCIILiteral.cpp */; };
CD5497AC15857D0300B5BC30 /* MediaTime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD5497AA15857D0300B5BC30 /* MediaTime.cpp */; };
DCEE22011CEA7551000C2396 /* BlockObjCExceptions.mm in Sources */ = {isa = PBXBuildFile; fileRef = DCEE21FD1CEA7551000C2396 /* BlockObjCExceptions.mm */; };
E15556F518A0CC18006F48FB /* CryptographicUtilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E15556F318A0CC18006F48FB /* CryptographicUtilities.cpp */; };
E311FB171F0A568B003C08DE /* ThreadGroup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E311FB151F0A568B003C08DE /* ThreadGroup.cpp */; };
E388886F20C9095100E632BC /* WorkerPool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E388886D20C9095100E632BC /* WorkerPool.cpp */; };
- E38C41251EB4E04C0042957D /* CPUTimeCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = E38C41241EB4E04C0042957D /* CPUTimeCocoa.mm */; };
+ E38C41251EB4E04C0042957D /* CPUTimeCocoa.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38C41241EB4E04C0042957D /* CPUTimeCocoa.cpp */; };
E38C41281EB4E0680042957D /* CPUTime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38C41261EB4E0680042957D /* CPUTime.cpp */; };
E38D6E271F5522E300A75CC4 /* StringBuilderJSON.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38D6E261F5522E300A75CC4 /* StringBuilderJSON.cpp */; };
E3A32BC41FC830E2007D7E76 /* JSValueMalloc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E3A32BC21FC830E2007D7E76 /* JSValueMalloc.cpp */; };
@@ -156,7 +157,6 @@
FE05FAFF1FE5007500093230 /* WTFAssertions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE05FAFE1FE5007500093230 /* WTFAssertions.cpp */; };
FE85416E1FBE285D008DA5DA /* Poisoned.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE85416C1FBE285B008DA5DA /* Poisoned.cpp */; };
FEDACD3D1630F83F00C69634 /* StackStats.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FEDACD3B1630F83F00C69634 /* StackStats.cpp */; };
- C805EF39E5F14481A96D39FC /* ASCIILiteral.cpp in Resources */ = {isa = PBXBuildFile; fileRef = C6F050790D9C432A99085E75 /* ASCIILiteral.cpp */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -314,7 +314,7 @@
1C181C8C1D307AB800F5FA16 /* UTextProviderLatin1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UTextProviderLatin1.h; sourceTree = "<group>"; };
1C181C8D1D307AB800F5FA16 /* UTextProviderUTF16.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UTextProviderUTF16.cpp; sourceTree = "<group>"; };
1C181C8E1D307AB800F5FA16 /* UTextProviderUTF16.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UTextProviderUTF16.h; sourceTree = "<group>"; };
- 1C181C951D30800A00F5FA16 /* TextBreakIteratorInternalICUMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = TextBreakIteratorInternalICUMac.mm; path = mac/TextBreakIteratorInternalICUMac.mm; sourceTree = "<group>"; };
+ 1C181C951D30800A00F5FA16 /* TextBreakIteratorInternalICUCocoa.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextBreakIteratorInternalICUCocoa.cpp; sourceTree = "<group>"; };
1CCDB1491E566626006C73C0 /* TextBreakIteratorCF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TextBreakIteratorCF.h; path = cf/TextBreakIteratorCF.h; sourceTree = "<group>"; };
1CCDB14D1E566898006C73C0 /* TextBreakIteratorICU.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextBreakIteratorICU.h; sourceTree = "<group>"; };
1CCDB1511E566BC5006C73C0 /* CFStringSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CFStringSPI.h; path = cf/CFStringSPI.h; sourceTree = "<group>"; };
@@ -332,6 +332,7 @@
3137E1D7DBD84AC38FAE4D34 /* IndexSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IndexSet.h; sourceTree = "<group>"; };
313EDEC9778E49C9BEA91CFC /* StackTrace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StackTrace.cpp; sourceTree = "<group>"; };
37C7CC291EA40A73007BD956 /* WeakLinking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeakLinking.h; sourceTree = "<group>"; };
+ 382029E246C84B0099FD6764 /* ASCIILiteral.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASCIILiteral.h; sourceTree = "<group>"; };
391BD6BA4D164FD294F9A93D /* StdMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StdMap.h; sourceTree = "<group>"; };
413FE8F51F8D2EAB00F6D7D7 /* CallbackAggregator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallbackAggregator.h; sourceTree = "<group>"; };
430B47871AAAAC1A001223DA /* StringCommon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringCommon.h; sourceTree = "<group>"; };
@@ -406,7 +407,7 @@
83FBA93119DF459700F30ADB /* TypeCasts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TypeCasts.h; sourceTree = "<group>"; };
86F46F5F1A2840EE00CCBF22 /* RefCounter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RefCounter.h; sourceTree = "<group>"; };
933D63191FCB6AB90032ECD6 /* StringHasher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringHasher.h; sourceTree = "<group>"; };
- 93934BD218A1E8C300D0D6A1 /* StringViewObjC.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = StringViewObjC.mm; path = mac/StringViewObjC.mm; sourceTree = "<group>"; };
+ 93934BD218A1E8C300D0D6A1 /* StringViewCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = StringViewCocoa.mm; sourceTree = "<group>"; };
93934BD418A1F16900D0D6A1 /* StringViewCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StringViewCF.cpp; path = cf/StringViewCF.cpp; sourceTree = "<group>"; };
93AC91A718942FC400244939 /* LChar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LChar.h; sourceTree = "<group>"; };
93D191CF20CAECE800C51B8E /* FoundationSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FoundationSPI.h; sourceTree = "<group>"; };
@@ -425,8 +426,8 @@
A5098AFF1C169E0700087797 /* SandboxSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SandboxSPI.h; sourceTree = "<group>"; };
A5098B011C16A4F900087797 /* SecuritySPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SecuritySPI.h; sourceTree = "<group>"; };
A561F30F1DF2642100FF675D /* DeprecatedOptional.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeprecatedOptional.h; sourceTree = "<group>"; };
- A5BA15F2182433A900A82E69 /* StringMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = StringMac.mm; path = mac/StringMac.mm; sourceTree = "<group>"; };
- A5BA15F41824348000A82E69 /* StringImplMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = StringImplMac.mm; path = mac/StringImplMac.mm; sourceTree = "<group>"; };
+ A5BA15F2182433A900A82E69 /* StringMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = StringMac.mm; path = ../mac/StringMac.mm; sourceTree = "<group>"; };
+ A5BA15F41824348000A82E69 /* StringImplCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = StringImplCocoa.mm; sourceTree = "<group>"; };
A5BA15F7182435A600A82E69 /* AtomicStringImplCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AtomicStringImplCF.cpp; path = cf/AtomicStringImplCF.cpp; sourceTree = "<group>"; };
A5BA15F8182435A600A82E69 /* StringCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StringCF.cpp; path = cf/StringCF.cpp; sourceTree = "<group>"; };
A5BA15F9182435A600A82E69 /* StringImplCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StringImplCF.cpp; path = cf/StringImplCF.cpp; sourceTree = "<group>"; };
@@ -601,6 +602,7 @@
C2BCFC531F621F3F00C9222C /* LineEnding.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LineEnding.cpp; sourceTree = "<group>"; };
C2BCFC541F621F3F00C9222C /* LineEnding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LineEnding.h; sourceTree = "<group>"; };
C4F8A93619C65EB400B2B15D /* Stopwatch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Stopwatch.h; sourceTree = "<group>"; };
+ C6F050790D9C432A99085E75 /* ASCIILiteral.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ASCIILiteral.cpp; sourceTree = "<group>"; };
C8F597CA2A57417FBAB92FD6 /* RandomDevice.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RandomDevice.cpp; sourceTree = "<group>"; };
CD5497AA15857D0300B5BC30 /* MediaTime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaTime.cpp; sourceTree = "<group>"; };
CD5497AB15857D0300B5BC30 /* MediaTime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaTime.h; sourceTree = "<group>"; };
@@ -622,7 +624,7 @@
E33D5F871FBED66700BF625E /* RecursableLambda.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RecursableLambda.h; sourceTree = "<group>"; };
E388886D20C9095100E632BC /* WorkerPool.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WorkerPool.cpp; sourceTree = "<group>"; };
E388886E20C9095100E632BC /* WorkerPool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WorkerPool.h; sourceTree = "<group>"; };
- E38C41241EB4E04C0042957D /* CPUTimeCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CPUTimeCocoa.mm; sourceTree = "<group>"; };
+ E38C41241EB4E04C0042957D /* CPUTimeCocoa.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CPUTimeCocoa.cpp; sourceTree = "<group>"; };
E38C41261EB4E0680042957D /* CPUTime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CPUTime.cpp; sourceTree = "<group>"; };
E38C41271EB4E0680042957D /* CPUTime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPUTime.h; sourceTree = "<group>"; };
E38D6E261F5522E300A75CC4 /* StringBuilderJSON.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StringBuilderJSON.cpp; sourceTree = "<group>"; };
@@ -650,8 +652,6 @@
FEDACD3C1630F83F00C69634 /* StackStats.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StackStats.h; sourceTree = "<group>"; };
FEF295BF20B49DCB00CF283A /* UTF8ConversionError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UTF8ConversionError.h; sourceTree = "<group>"; };
FF0A436588954F3CB07DBECA /* StdList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StdList.h; sourceTree = "<group>"; };
- 382029E246C84B0099FD6764 /* ASCIILiteral.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASCIILiteral.h; sourceTree = "<group>"; };
- C6F050790D9C432A99085E75 /* ASCIILiteral.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ASCIILiteral.cpp; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -768,15 +768,15 @@
name = Source;
sourceTree = "<group>";
};
- A5BA15F11824339F00A82E69 /* mac */ = {
+ A5BA15F11824339F00A82E69 /* cocoa */ = {
isa = PBXGroup;
children = (
- A5BA15F41824348000A82E69 /* StringImplMac.mm */,
+ A5BA15F41824348000A82E69 /* StringImplCocoa.mm */,
A5BA15F2182433A900A82E69 /* StringMac.mm */,
- 93934BD218A1E8C300D0D6A1 /* StringViewObjC.mm */,
- 1C181C951D30800A00F5FA16 /* TextBreakIteratorInternalICUMac.mm */,
+ 93934BD218A1E8C300D0D6A1 /* StringViewCocoa.mm */,
+ 1C181C951D30800A00F5FA16 /* TextBreakIteratorInternalICUCocoa.cpp */,
);
- name = mac;
+ path = cocoa;
sourceTree = "<group>";
};
A5BA15F61824359E00A82E69 /* cf */ = {
@@ -1183,8 +1183,8 @@
isa = PBXGroup;
children = (
A5BA15F61824359E00A82E69 /* cf */,
+ A5BA15F11824339F00A82E69 /* cocoa */,
1C181C881D307AB800F5FA16 /* icu */,
- A5BA15F11824339F00A82E69 /* mac */,
A8A4731C151A825B004123FF /* ASCIIFastPath.h */,
C6F050790D9C432A99085E75 /* ASCIILiteral.cpp */,
382029E246C84B0099FD6764 /* ASCIILiteral.h */,
@@ -1329,7 +1329,7 @@
isa = PBXGroup;
children = (
1469419B16EAB10A0024E146 /* AutodrainedPool.cpp */,
- E38C41241EB4E04C0042957D /* CPUTimeCocoa.mm */,
+ E38C41241EB4E04C0042957D /* CPUTimeCocoa.cpp */,
143DDE9520C8BC37007F76FA /* Entitlements.cpp */,
143DDE9720C8BE99007F76FA /* Entitlements.h */,
7A6EBA3320746C34004F9C44 /* MachSendRight.cpp */,
@@ -1447,7 +1447,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
- C805EF39E5F14481A96D39FC /* ASCIILiteral.cpp in Resources */,
+ C805EF39E5F14481A96D39FC /* ASCIILiteral.cpp in Sources */,
A8A47386151A825B004123FF /* Assertions.cpp in Sources */,
A8A47435151A825B004123FF /* AtomicString.cpp in Sources */,
70ECA60D1B02426800449739 /* AtomicStringImpl.cpp in Sources */,
@@ -1469,7 +1469,7 @@
0F30CB5A1FCDF134004B5323 /* ConcurrentPtrHashSet.cpp in Sources */,
0F8E85DB1FD485B000691889 /* CountingLock.cpp in Sources */,
E38C41281EB4E0680042957D /* CPUTime.cpp in Sources */,
- E38C41251EB4E04C0042957D /* CPUTimeCocoa.mm in Sources */,
+ E38C41251EB4E04C0042957D /* CPUTimeCocoa.cpp in Sources */,
515F794E1CFC9F4A00CCED93 /* CrossThreadCopier.cpp in Sources */,
517F82D71FD22F3000DA3DEA /* CrossThreadTaskHandler.cpp in Sources */,
A8A4739A151A825B004123FF /* CryptographicallyRandomNumber.cpp in Sources */,
@@ -1547,17 +1547,17 @@
A5BA15FB182435A600A82E69 /* StringCF.cpp in Sources */,
A8A47440151A825B004123FF /* StringImpl.cpp in Sources */,
A5BA15FC182435A600A82E69 /* StringImplCF.cpp in Sources */,
- A5BA15F51824348000A82E69 /* StringImplMac.mm in Sources */,
A5BA15F3182433A900A82E69 /* StringMac.mm in Sources */,
+ A5BA15F51824348000A82E69 /* StringImplCocoa.mm in Sources */,
0FDDBFA71666DFA300C55FEF /* StringPrintStream.cpp in Sources */,
93F1993E19D7958D00C2390B /* StringView.cpp in Sources */,
93934BD518A1F16900D0D6A1 /* StringViewCF.cpp in Sources */,
- 93934BD318A1E8C300D0D6A1 /* StringViewObjC.mm in Sources */,
+ 93934BD318A1E8C300D0D6A1 /* StringViewCocoa.mm in Sources */,
A8A473B7151A825B004123FF /* strtod.cc in Sources */,
52183012C99E476A84EEBEA8 /* SymbolImpl.cpp in Sources */,
70A993FE1AD7151300FA615B /* SymbolRegistry.cpp in Sources */,
1C181C7F1D3078DA00F5FA16 /* TextBreakIterator.cpp in Sources */,
- 1C181C961D30800A00F5FA16 /* TextBreakIteratorInternalICUMac.mm in Sources */,
+ 1C181C961D30800A00F5FA16 /* TextBreakIteratorInternalICUCocoa.cpp in Sources */,
A3E4DD931F3A803400DED0B4 /* TextStream.cpp in Sources */,
E311FB171F0A568B003C08DE /* ThreadGroup.cpp in Sources */,
A8A4744A151A825B004123FF /* Threading.cpp in Sources */,
Modified: trunk/Source/WTF/wtf/MemoryPressureHandler.cpp (233379 => 233380)
--- trunk/Source/WTF/wtf/MemoryPressureHandler.cpp 2018-06-30 00:06:25 UTC (rev 233379)
+++ trunk/Source/WTF/wtf/MemoryPressureHandler.cpp 2018-06-30 00:23:43 UTC (rev 233380)
@@ -286,7 +286,6 @@
#if !PLATFORM(COCOA) && !OS(LINUX) && !OS(WINDOWS)
void MemoryPressureHandler::install() { }
void MemoryPressureHandler::uninstall() { }
-void MemoryPressureHandler::holdOff(Seconds) { }
void MemoryPressureHandler::respondToMemoryPressure(Critical, Synchronous) { }
void MemoryPressureHandler::platformReleaseMemory(Critical) { }
std::optional<MemoryPressureHandler::ReliefLogger::MemoryUsage> MemoryPressureHandler::ReliefLogger::platformMemoryUsage() { return std::nullopt; }
Modified: trunk/Source/WTF/wtf/PlatformMac.cmake (233379 => 233380)
--- trunk/Source/WTF/wtf/PlatformMac.cmake 2018-06-30 00:06:25 UTC (rev 233379)
+++ trunk/Source/WTF/wtf/PlatformMac.cmake 2018-06-30 00:23:43 UTC (rev 233380)
@@ -41,8 +41,8 @@
cf/LanguageCF.cpp
cf/RunLoopCF.cpp
- cocoa/AutodrainedPool.mm
- cocoa/CPUTimeCocoa.mm
+ cocoa/AutodrainedPool.cpp
+ cocoa/CPUTimeCocoa.cpp
cocoa/Entitlements.cpp
cocoa/MachSendRight.cpp
cocoa/MemoryFootprintCocoa.cpp
@@ -57,10 +57,9 @@
text/cf/StringImplCF.cpp
text/cf/StringViewCF.cpp
- text/mac/StringImplMac.mm
- text/mac/StringMac.mm
- text/mac/StringViewObjC.mm
- text/mac/TextBreakIteratorInternalICUMac.mm
+ text/cocoa/StringImplCocoa.mm
+ text/cocoa/StringViewCocoa.mm
+ text/cocoa/TextBreakIteratorInternalICUMac.mm
)
list(APPEND WTF_PRIVATE_INCLUDE_DIRECTORIES
Copied: trunk/Source/WTF/wtf/cocoa/CPUTimeCocoa.cpp (from rev 233377, trunk/Source/WTF/wtf/cocoa/CPUTimeCocoa.mm) (0 => 233380)
--- trunk/Source/WTF/wtf/cocoa/CPUTimeCocoa.cpp (rev 0)
+++ trunk/Source/WTF/wtf/cocoa/CPUTimeCocoa.cpp 2018-06-30 00:23:43 UTC (rev 233380)
@@ -0,0 +1,86 @@
+/*
+ * Copyright (C) 2017-2018 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "CPUTime.h"
+
+#import "MachSendRight.h"
+#import <mach/mach.h>
+#import <mach/mach_time.h>
+#import <mach/task.h>
+#import <mach/task_info.h>
+#import <mach/thread_info.h>
+#import <sys/time.h>
+
+namespace WTF {
+
+static const int64_t microsecondsPerSecond = 1000000;
+
+static int64_t timeValueToMicroseconds(const time_value_t& value)
+{
+ int64_t result = value.seconds;
+ result *= microsecondsPerSecond;
+ result += value.microseconds;
+ return result;
+}
+
+std::optional<CPUTime> CPUTime::get()
+{
+ // Account for current threads.
+ task_thread_times_info threadInfoData;
+ mach_msg_type_number_t threadInfoCount = TASK_THREAD_TIMES_INFO_COUNT;
+ kern_return_t result = task_info(mach_task_self(), TASK_THREAD_TIMES_INFO, reinterpret_cast<task_info_t>(&threadInfoData), &threadInfoCount);
+ if (result != KERN_SUCCESS)
+ return std::nullopt;
+
+ int64_t userTime = timeValueToMicroseconds(threadInfoData.user_time);
+ int64_t systemTime = timeValueToMicroseconds(threadInfoData.system_time);
+
+ // Account for termined threads.
+ task_basic_info taskInfoData;
+ mach_msg_type_number_t taskInfoCount = TASK_BASIC_INFO_COUNT;
+ result = task_info(mach_task_self(), TASK_BASIC_INFO, reinterpret_cast<task_info_t>(&taskInfoData), &taskInfoCount);
+ if (result != KERN_SUCCESS)
+ return std::nullopt;
+
+ userTime += timeValueToMicroseconds(taskInfoData.user_time);
+ systemTime += timeValueToMicroseconds(taskInfoData.system_time);
+
+ return CPUTime { MonotonicTime::now(), Seconds::fromMicroseconds(userTime), Seconds::fromMicroseconds(systemTime) };
+}
+
+Seconds CPUTime::forCurrentThread()
+{
+ mach_msg_type_number_t infoCount = THREAD_BASIC_INFO_COUNT;
+ thread_basic_info_data_t info;
+
+ auto threadPort = MachSendRight::adopt(mach_thread_self());
+ auto ret = thread_info(threadPort.sendRight(), THREAD_BASIC_INFO, reinterpret_cast<thread_info_t>(&info), &infoCount);
+ RELEASE_ASSERT(ret == KERN_SUCCESS);
+
+ return Seconds(info.user_time.seconds + info.system_time.seconds) + Seconds::fromMicroseconds(info.user_time.microseconds + info.system_time.microseconds);
+}
+
+}
Deleted: trunk/Source/WTF/wtf/cocoa/CPUTimeCocoa.mm (233379 => 233380)
--- trunk/Source/WTF/wtf/cocoa/CPUTimeCocoa.mm 2018-06-30 00:06:25 UTC (rev 233379)
+++ trunk/Source/WTF/wtf/cocoa/CPUTimeCocoa.mm 2018-06-30 00:23:43 UTC (rev 233380)
@@ -1,86 +0,0 @@
-/*
- * Copyright (C) 2017-2018 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import "config.h"
-#import "CPUTime.h"
-
-#import "MachSendRight.h"
-#import <mach/mach.h>
-#import <mach/mach_time.h>
-#import <mach/task.h>
-#import <mach/task_info.h>
-#import <mach/thread_info.h>
-#import <sys/time.h>
-
-namespace WTF {
-
-static const int64_t microsecondsPerSecond = 1000000;
-
-static int64_t timeValueToMicroseconds(const time_value_t& value)
-{
- int64_t result = value.seconds;
- result *= microsecondsPerSecond;
- result += value.microseconds;
- return result;
-}
-
-std::optional<CPUTime> CPUTime::get()
-{
- // Account for current threads.
- task_thread_times_info threadInfoData;
- mach_msg_type_number_t threadInfoCount = TASK_THREAD_TIMES_INFO_COUNT;
- kern_return_t result = task_info(mach_task_self(), TASK_THREAD_TIMES_INFO, reinterpret_cast<task_info_t>(&threadInfoData), &threadInfoCount);
- if (result != KERN_SUCCESS)
- return std::nullopt;
-
- int64_t userTime = timeValueToMicroseconds(threadInfoData.user_time);
- int64_t systemTime = timeValueToMicroseconds(threadInfoData.system_time);
-
- // Account for termined threads.
- task_basic_info taskInfoData;
- mach_msg_type_number_t taskInfoCount = TASK_BASIC_INFO_COUNT;
- result = task_info(mach_task_self(), TASK_BASIC_INFO, reinterpret_cast<task_info_t>(&taskInfoData), &taskInfoCount);
- if (result != KERN_SUCCESS)
- return std::nullopt;
-
- userTime += timeValueToMicroseconds(taskInfoData.user_time);
- systemTime += timeValueToMicroseconds(taskInfoData.system_time);
-
- return CPUTime { MonotonicTime::now(), Seconds::fromMicroseconds(userTime), Seconds::fromMicroseconds(systemTime) };
-}
-
-Seconds CPUTime::forCurrentThread()
-{
- mach_msg_type_number_t infoCount = THREAD_BASIC_INFO_COUNT;
- thread_basic_info_data_t info;
-
- auto threadPort = MachSendRight::adopt(mach_thread_self());
- auto ret = thread_info(threadPort.sendRight(), THREAD_BASIC_INFO, reinterpret_cast<thread_info_t>(&info), &infoCount);
- RELEASE_ASSERT(ret == KERN_SUCCESS);
-
- return Seconds(info.user_time.seconds + info.system_time.seconds) + Seconds::fromMicroseconds(info.user_time.microseconds + info.system_time.microseconds);
-}
-
-}
Copied: trunk/Source/WTF/wtf/text/cocoa/StringImplCocoa.mm (from rev 233377, trunk/Source/WTF/wtf/text/mac/StringImplMac.mm) (0 => 233380)
--- trunk/Source/WTF/wtf/text/cocoa/StringImplCocoa.mm (rev 0)
+++ trunk/Source/WTF/wtf/text/cocoa/StringImplCocoa.mm 2018-06-30 00:23:43 UTC (rev 233380)
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2006, 2009 Apple Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#import "config.h"
+#import "StringImpl.h"
+
+#import "RetainPtr.h"
+
+namespace WTF {
+
+StringImpl::operator NSString *()
+{
+ return createCFString().bridgingAutorelease();
+}
+
+}
Copied: trunk/Source/WTF/wtf/text/cocoa/StringViewCocoa.mm (from rev 233377, trunk/Source/WTF/wtf/text/mac/StringViewObjC.mm) (0 => 233380)
--- trunk/Source/WTF/wtf/text/cocoa/StringViewCocoa.mm (rev 0)
+++ trunk/Source/WTF/wtf/text/cocoa/StringViewCocoa.mm 2018-06-30 00:23:43 UTC (rev 233380)
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "StringView.h"
+
+#import "RetainPtr.h"
+
+namespace WTF {
+
+RetainPtr<NSString> StringView::createNSString() const
+{
+ if (is8Bit())
+ return adoptNS([[NSString alloc] initWithBytes:const_cast<LChar*>(characters8()) length:length() encoding:NSISOLatin1StringEncoding]);
+
+ return adoptNS([[NSString alloc] initWithCharacters:const_cast<UChar*>(characters16()) length:length()]);
+}
+
+RetainPtr<NSString> StringView::createNSStringWithoutCopying() const
+{
+ if (is8Bit())
+ return adoptNS([[NSString alloc] initWithBytesNoCopy:const_cast<LChar*>(characters8()) length:length() encoding:NSISOLatin1StringEncoding freeWhenDone:NO]);
+
+ return adoptNS([[NSString alloc] initWithCharactersNoCopy:const_cast<UChar*>(characters16()) length:length() freeWhenDone:NO]);
+}
+
+}
Copied: trunk/Source/WTF/wtf/text/cocoa/TextBreakIteratorInternalICUCocoa.cpp (from rev 233377, trunk/Source/WTF/wtf/text/mac/TextBreakIteratorInternalICUMac.mm) (0 => 233380)
--- trunk/Source/WTF/wtf/text/cocoa/TextBreakIteratorInternalICUCocoa.cpp (rev 0)
+++ trunk/Source/WTF/wtf/text/cocoa/TextBreakIteratorInternalICUCocoa.cpp 2018-06-30 00:23:43 UTC (rev 233380)
@@ -0,0 +1,117 @@
+/*
+ * Copyright (C) 2007, 2009 Apple Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "config.h"
+#include "TextBreakIteratorInternalICU.h"
+
+#include "TextBreakIterator.h"
+#include <wtf/RetainPtr.h>
+
+namespace WTF {
+
+static Variant<TextBreakIteratorICU, TextBreakIteratorPlatform> mapModeToBackingIterator(StringView string, TextBreakIterator::Mode mode, const AtomicString& locale)
+{
+ switch (mode) {
+ case TextBreakIterator::Mode::Line:
+ return TextBreakIteratorICU(string, TextBreakIteratorICU::Mode::Line, locale.string().utf8().data());
+ case TextBreakIterator::Mode::Caret:
+ return TextBreakIteratorCF(string, TextBreakIteratorCF::Mode::Caret);
+ case TextBreakIterator::Mode::Delete:
+ return TextBreakIteratorCF(string, TextBreakIteratorCF::Mode::Delete);
+ }
+}
+
+TextBreakIterator::TextBreakIterator(StringView string, Mode mode, const AtomicString& locale)
+ : m_backing(mapModeToBackingIterator(string, mode, locale))
+ , m_mode(mode)
+ , m_locale(locale)
+{
+}
+
+static const int maxLocaleStringLength = 32;
+
+static inline RetainPtr<CFStringRef> textBreakLocalePreference()
+{
+ RetainPtr<CFPropertyListRef> locale = adoptCF(CFPreferencesCopyValue(CFSTR("AppleTextBreakLocale"),
+ kCFPreferencesAnyApplication, kCFPreferencesCurrentUser, kCFPreferencesAnyHost));
+ if (!locale || CFGetTypeID(locale.get()) != CFStringGetTypeID())
+ return nullptr;
+ return static_cast<CFStringRef>(locale.get());
+}
+
+static RetainPtr<CFStringRef> topLanguagePreference()
+{
+ RetainPtr<CFArrayRef> languagesArray = adoptCF(CFLocaleCopyPreferredLanguages());
+ if (!languagesArray)
+ return nullptr;
+ if (!CFArrayGetCount(languagesArray.get()))
+ return nullptr;
+ return static_cast<CFStringRef>(CFArrayGetValueAtIndex(languagesArray.get(), 0));
+}
+
+static void getLocale(CFStringRef locale, char localeStringBuffer[maxLocaleStringLength])
+{
+ // Empty string means "root locale", and that is what we use if we can't get a preference.
+ localeStringBuffer[0] = 0;
+ if (!locale)
+ return;
+ CFStringGetCString(locale, localeStringBuffer, maxLocaleStringLength, kCFStringEncodingASCII);
+}
+
+static void getSearchLocale(char localeStringBuffer[maxLocaleStringLength])
+{
+ getLocale(topLanguagePreference().get(), localeStringBuffer);
+}
+
+const char* currentSearchLocaleID()
+{
+ static char localeStringBuffer[maxLocaleStringLength];
+ static bool gotSearchLocale = false;
+ if (!gotSearchLocale) {
+ getSearchLocale(localeStringBuffer);
+ gotSearchLocale = true;
+ }
+ return localeStringBuffer;
+}
+
+static void getTextBreakLocale(char localeStringBuffer[maxLocaleStringLength])
+{
+ // If there is no text break locale, use the top language preference.
+ RetainPtr<CFStringRef> locale = textBreakLocalePreference();
+ if (locale) {
+ if (RetainPtr<CFStringRef> canonicalLocale = adoptCF(CFLocaleCreateCanonicalLanguageIdentifierFromString(kCFAllocatorDefault, locale.get())))
+ locale = canonicalLocale;
+ } else
+ locale = topLanguagePreference();
+ getLocale(locale.get(), localeStringBuffer);
+}
+
+const char* currentTextBreakLocaleID()
+{
+ static char localeStringBuffer[maxLocaleStringLength];
+ static bool gotTextBreakLocale = false;
+ if (!gotTextBreakLocale) {
+ getTextBreakLocale(localeStringBuffer);
+ gotTextBreakLocale = true;
+ }
+ return localeStringBuffer;
+}
+
+}
Deleted: trunk/Source/WTF/wtf/text/mac/StringImplMac.mm (233379 => 233380)
--- trunk/Source/WTF/wtf/text/mac/StringImplMac.mm 2018-06-30 00:06:25 UTC (rev 233379)
+++ trunk/Source/WTF/wtf/text/mac/StringImplMac.mm 2018-06-30 00:23:43 UTC (rev 233380)
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2006, 2009 Apple Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#import "config.h"
-#import "StringImpl.h"
-
-#import "ObjcRuntimeExtras.h"
-#import "RetainPtr.h"
-
-namespace WTF {
-
-StringImpl::operator NSString *()
-{
- return createCFString().bridgingAutorelease();
-}
-
-}
Deleted: trunk/Source/WTF/wtf/text/mac/StringViewObjC.mm (233379 => 233380)
--- trunk/Source/WTF/wtf/text/mac/StringViewObjC.mm 2018-06-30 00:06:25 UTC (rev 233379)
+++ trunk/Source/WTF/wtf/text/mac/StringViewObjC.mm 2018-06-30 00:23:43 UTC (rev 233380)
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import "config.h"
-#import "StringView.h"
-
-#import "RetainPtr.h"
-
-namespace WTF {
-
-RetainPtr<NSString> StringView::createNSString() const
-{
- if (is8Bit())
- return adoptNS([[NSString alloc] initWithBytes:const_cast<LChar*>(characters8()) length:length() encoding:NSISOLatin1StringEncoding]);
-
- return adoptNS([[NSString alloc] initWithCharacters:const_cast<UChar*>(characters16()) length:length()]);
-}
-
-RetainPtr<NSString> StringView::createNSStringWithoutCopying() const
-{
- if (is8Bit())
- return adoptNS([[NSString alloc] initWithBytesNoCopy:const_cast<LChar*>(characters8()) length:length() encoding:NSISOLatin1StringEncoding freeWhenDone:NO]);
-
- return adoptNS([[NSString alloc] initWithCharactersNoCopy:const_cast<UChar*>(characters16()) length:length() freeWhenDone:NO]);
-}
-
-}
Deleted: trunk/Source/WTF/wtf/text/mac/TextBreakIteratorInternalICUMac.mm (233379 => 233380)
--- trunk/Source/WTF/wtf/text/mac/TextBreakIteratorInternalICUMac.mm 2018-06-30 00:06:25 UTC (rev 233379)
+++ trunk/Source/WTF/wtf/text/mac/TextBreakIteratorInternalICUMac.mm 2018-06-30 00:23:43 UTC (rev 233380)
@@ -1,117 +0,0 @@
-/*
- * Copyright (C) 2007, 2009 Apple Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#include "config.h"
-#include "TextBreakIteratorInternalICU.h"
-
-#include "TextBreakIterator.h"
-#include <wtf/RetainPtr.h>
-
-namespace WTF {
-
-static Variant<TextBreakIteratorICU, TextBreakIteratorPlatform> mapModeToBackingIterator(StringView string, TextBreakIterator::Mode mode, const AtomicString& locale)
-{
- switch (mode) {
- case TextBreakIterator::Mode::Line:
- return TextBreakIteratorICU(string, TextBreakIteratorICU::Mode::Line, locale.string().utf8().data());
- case TextBreakIterator::Mode::Caret:
- return TextBreakIteratorCF(string, TextBreakIteratorCF::Mode::Caret);
- case TextBreakIterator::Mode::Delete:
- return TextBreakIteratorCF(string, TextBreakIteratorCF::Mode::Delete);
- }
-}
-
-TextBreakIterator::TextBreakIterator(StringView string, Mode mode, const AtomicString& locale)
- : m_backing(mapModeToBackingIterator(string, mode, locale))
- , m_mode(mode)
- , m_locale(locale)
-{
-}
-
-static const int maxLocaleStringLength = 32;
-
-static inline RetainPtr<CFStringRef> textBreakLocalePreference()
-{
- RetainPtr<CFPropertyListRef> locale = adoptCF(CFPreferencesCopyValue(CFSTR("AppleTextBreakLocale"),
- kCFPreferencesAnyApplication, kCFPreferencesCurrentUser, kCFPreferencesAnyHost));
- if (!locale || CFGetTypeID(locale.get()) != CFStringGetTypeID())
- return nullptr;
- return static_cast<CFStringRef>(locale.get());
-}
-
-static RetainPtr<CFStringRef> topLanguagePreference()
-{
- RetainPtr<CFArrayRef> languagesArray = adoptCF(CFLocaleCopyPreferredLanguages());
- if (!languagesArray)
- return nullptr;
- if (!CFArrayGetCount(languagesArray.get()))
- return nullptr;
- return static_cast<CFStringRef>(CFArrayGetValueAtIndex(languagesArray.get(), 0));
-}
-
-static void getLocale(CFStringRef locale, char localeStringBuffer[maxLocaleStringLength])
-{
- // Empty string means "root locale", and that is what we use if we can't get a preference.
- localeStringBuffer[0] = 0;
- if (!locale)
- return;
- CFStringGetCString(locale, localeStringBuffer, maxLocaleStringLength, kCFStringEncodingASCII);
-}
-
-static void getSearchLocale(char localeStringBuffer[maxLocaleStringLength])
-{
- getLocale(topLanguagePreference().get(), localeStringBuffer);
-}
-
-const char* currentSearchLocaleID()
-{
- static char localeStringBuffer[maxLocaleStringLength];
- static bool gotSearchLocale = false;
- if (!gotSearchLocale) {
- getSearchLocale(localeStringBuffer);
- gotSearchLocale = true;
- }
- return localeStringBuffer;
-}
-
-static void getTextBreakLocale(char localeStringBuffer[maxLocaleStringLength])
-{
- // If there is no text break locale, use the top language preference.
- RetainPtr<CFStringRef> locale = textBreakLocalePreference();
- if (locale) {
- if (RetainPtr<CFStringRef> canonicalLocale = adoptCF(CFLocaleCreateCanonicalLanguageIdentifierFromString(kCFAllocatorDefault, locale.get())))
- locale = canonicalLocale;
- } else
- locale = topLanguagePreference();
- getLocale(locale.get(), localeStringBuffer);
-}
-
-const char* currentTextBreakLocaleID()
-{
- static char localeStringBuffer[maxLocaleStringLength];
- static bool gotTextBreakLocale = false;
- if (!gotTextBreakLocale) {
- getTextBreakLocale(localeStringBuffer);
- gotTextBreakLocale = true;
- }
- return localeStringBuffer;
-}
-
-}