[Cocoa] Rename LocaleMac to LocaleCocoa
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Feb 2020 04:12:39 +0000 (04:12 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Feb 2020 04:12:39 +0000 (04:12 +0000)
https://bugs.webkit.org/show_bug.cgi?id=207371

Reviewed by Simon Fraser.

It's used by all the Cocoa platforms.

No new tests because there is no behavior change.

* PlatformMac.cmake:
* SourcesCocoa.txt:
* WebCore.order:
* WebCore.xcodeproj/project.pbxproj:
* page/cocoa/MemoryReleaseCocoa.mm:
(WebCore::platformReleaseMemory):
* platform/graphics/cocoa/FontCocoa.mm:
(WebCore::Font::applyTransforms const):
* platform/text/cocoa/LocaleCocoa.h: Renamed from Source/WebCore/platform/text/mac/LocaleMac.h.
* platform/text/mac/LocaleMac.mm: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256007 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/PlatformMac.cmake
Source/WebCore/SourcesCocoa.txt
Source/WebCore/WebCore.order
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/page/cocoa/MemoryReleaseCocoa.mm
Source/WebCore/platform/graphics/cocoa/FontCocoa.mm
Source/WebCore/platform/text/cocoa/LocaleCocoa.h [moved from Source/WebCore/platform/text/mac/LocaleMac.h with 96% similarity]
Source/WebCore/platform/text/cocoa/LocaleCocoa.mm [moved from Source/WebCore/platform/text/mac/LocaleMac.mm with 89% similarity]

index 8efd2a3..fe10fbe 100644 (file)
@@ -1,3 +1,25 @@
+2020-02-06  Myles C. Maxfield  <mmaxfield@apple.com>
+
+        [Cocoa] Rename LocaleMac to LocaleCocoa
+        https://bugs.webkit.org/show_bug.cgi?id=207371
+
+        Reviewed by Simon Fraser.
+
+        It's used by all the Cocoa platforms.
+
+        No new tests because there is no behavior change.
+
+        * PlatformMac.cmake:
+        * SourcesCocoa.txt:
+        * WebCore.order:
+        * WebCore.xcodeproj/project.pbxproj:
+        * page/cocoa/MemoryReleaseCocoa.mm:
+        (WebCore::platformReleaseMemory):
+        * platform/graphics/cocoa/FontCocoa.mm:
+        (WebCore::Font::applyTransforms const):
+        * platform/text/cocoa/LocaleCocoa.h: Renamed from Source/WebCore/platform/text/mac/LocaleMac.h.
+        * platform/text/mac/LocaleMac.mm: Removed.
+
 2020-02-06  Tim Horton  <timothy_horton@apple.com>
 
         macCatalyst: Unnecessary I-beam over images in editable areas
index 199b6dd..bf4ad32 100644 (file)
@@ -430,9 +430,10 @@ list(APPEND WebCore_SOURCES
     platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm
     platform/network/mac/WebCoreURLResponse.mm
 
+    platform/text/cocoa/LocaleCocoa.mm
+
     platform/text/cf/HyphenationCF.cpp
 
-    platform/text/mac/LocaleMac.mm
     platform/text/mac/TextBoundaries.mm
     platform/text/mac/TextCheckingMac.mm
     platform/text/mac/TextEncodingRegistryMac.mm
index 4de75df..257c113 100644 (file)
@@ -537,10 +537,11 @@ platform/network/mac/WebCoreURLResponse.mm
 
 platform/text/cf/HyphenationCF.cpp
 
+platform/text/cocoa/LocaleCocoa.mm
+
 platform/text/ios/LocalizedDateCache.mm
 platform/text/ios/TextEncodingRegistryIOS.mm
 
-platform/text/mac/LocaleMac.mm
 platform/text/mac/TextBoundaries.mm
 platform/text/mac/TextCheckingMac.mm
 platform/text/mac/TextEncodingRegistryMac.mm
index 37d245e..34f1a72 100644 (file)
@@ -23173,7 +23173,7 @@ __ZTVN7WebCore14LabelsNodeListE
 __ZTVN7WebCore16LegacyWebArchiveE
 __ZTVN7WebCore10LinkLoaderE
 __ZTVN7WebCore17LoadableTextTrackE
-__ZTVN7WebCore9LocaleMacE
+__ZTVN7WebCore9LocaleCocoaE
 __ZZN7WebCore16scriptNameToCodeERKN3WTF6StringEE18scriptNameCodeList
 __ZZN7WebCore34localeToScriptCodeForFontSelectionERKN3WTF6StringEE16localeScriptList
 __ZTVN7WebCore18MainResourceLoaderE
index febf05e..560801d 100644 (file)
                F55B3DDC1251F12D003EF269 /* TimeInputType.h in Headers */ = {isa = PBXBuildFile; fileRef = F55B3DA81251F12D003EF269 /* TimeInputType.h */; };
                F55B3DDE1251F12D003EF269 /* URLInputType.h in Headers */ = {isa = PBXBuildFile; fileRef = F55B3DAA1251F12D003EF269 /* URLInputType.h */; };
                F55B3DE01251F12D003EF269 /* WeekInputType.h in Headers */ = {isa = PBXBuildFile; fileRef = F55B3DAC1251F12D003EF269 /* WeekInputType.h */; };
-               F5973DE015CFB2030027F804 /* LocaleMac.h in Headers */ = {isa = PBXBuildFile; fileRef = F5973DDE15CFB2030027F804 /* LocaleMac.h */; };
+               F5973DE015CFB2030027F804 /* LocaleCocoa.h in Headers */ = {isa = PBXBuildFile; fileRef = F5973DDE15CFB2030027F804 /* LocaleCocoa.h */; };
                F59C96001255B23F000623C0 /* BaseDateAndTimeInputType.h in Headers */ = {isa = PBXBuildFile; fileRef = F59C95FE1255B23F000623C0 /* BaseDateAndTimeInputType.h */; };
                F5A154281279534D00D0B0C0 /* ValidationMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = F5A154261279534D00D0B0C0 /* ValidationMessage.h */; };
                F5C041DB0FFCA7CE00839D4A /* HTMLDataListElement.h in Headers */ = {isa = PBXBuildFile; fileRef = F5C041D80FFCA7CE00839D4A /* HTMLDataListElement.h */; settings = {ATTRIBUTES = (Private, ); }; };
                F587864902DE3A9A01EA4122 /* CachePolicy.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = CachePolicy.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F587866202DE3B1101EA4122 /* SSLKeyGenerator.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = SSLKeyGenerator.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F587868402DE3B8601EA4122 /* Cursor.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = Cursor.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               F5973DDE15CFB2030027F804 /* LocaleMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LocaleMac.h; sourceTree = "<group>"; };
-               F5973DDF15CFB2030027F804 /* LocaleMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LocaleMac.mm; sourceTree = "<group>"; };
+               F5973DDE15CFB2030027F804 /* LocaleCocoa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LocaleCocoa.h; sourceTree = "<group>"; };
+               F5973DDF15CFB2030027F804 /* LocaleCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = LocaleCocoa.mm; path = "../cocoa/LocaleCocoa.mm"; sourceTree = "<group>"; };
                F59C95FD1255B23F000623C0 /* BaseDateAndTimeInputType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BaseDateAndTimeInputType.cpp; sourceTree = "<group>"; };
                F59C95FE1255B23F000623C0 /* BaseDateAndTimeInputType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseDateAndTimeInputType.h; sourceTree = "<group>"; };
                F5A154251279534D00D0B0C0 /* ValidationMessage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ValidationMessage.cpp; sourceTree = "<group>"; };
                        name = Products;
                        sourceTree = "<group>";
                };
+               1C165E4F23ECF55E00B0FCFB /* cocoa */ = {
+                       isa = PBXGroup;
+                       children = (
+                               F5973DDE15CFB2030027F804 /* LocaleCocoa.h */,
+                               F5973DDF15CFB2030027F804 /* LocaleCocoa.mm */,
+                       );
+                       path = cocoa;
+                       sourceTree = "<group>";
+               };
                1C5FAECA0DCFD8C900D58F78 /* Inspector */ = {
                        isa = PBXGroup;
                        children = (
                        isa = PBXGroup;
                        children = (
                                B2B264590D00A77E000ACC1D /* cf */,
+                               1C165E4F23ECF55E00B0FCFB /* cocoa */,
                                A516E8B2136E04C00076C3C0 /* ios */,
                                B2C3D9F90D006C1D00EF6F26 /* mac */,
                                B2C3D9F20D006C1D00EF6F26 /* BidiContext.cpp */,
                B2C3D9F90D006C1D00EF6F26 /* mac */ = {
                        isa = PBXGroup;
                        children = (
-                               F5973DDE15CFB2030027F804 /* LocaleMac.h */,
-                               F5973DDF15CFB2030027F804 /* LocaleMac.mm */,
                                B2AFFC8C0D00A5DF0030074D /* TextBoundaries.mm */,
                                CEA84720212622AD00940809 /* TextCheckingMac.mm */,
                                A1F55DC41F54D3F000EDB75F /* TextEncodingRegistryMac.mm */,
                                06E81ED70AB5D5E900C87837 /* LocalCurrentGraphicsContext.h in Headers */,
                                1C43DE6B22AB4B8A001527D9 /* LocalCurrentTraitCollection.h in Headers */,
                                445775E520472F73008DCE5D /* LocalDefaultSystemAppearance.h in Headers */,
-                               F5973DE015CFB2030027F804 /* LocaleMac.h in Headers */,
+                               F5973DE015CFB2030027F804 /* LocaleCocoa.h in Headers */,
                                7633A72613D8B33A008501B6 /* LocaleToScriptMapping.h in Headers */,
                                A516E8B7136E04DB0076C3C0 /* LocalizedDateCache.h in Headers */,
                                935207BE09BD410A00F2038D /* LocalizedStrings.h in Headers */,
index 7cb8680..73f80bd 100644 (file)
@@ -30,7 +30,7 @@
 #import "GCController.h"
 #import "IOSurfacePool.h"
 #import "LayerPool.h"
-#import "LocaleMac.h"
+#import "LocaleCocoa.h"
 #import "SystemFontDatabaseCoreText.h"
 #import <notify.h>
 #import <pal/spi/ios/GraphicsServicesSPI.h>
@@ -56,7 +56,7 @@ void platformReleaseMemory(Critical)
     GSFontPurgeFontCache();
 #endif
 
-    LocaleMac::releaseMemory();
+    LocaleCocoa::releaseMemory();
 
     for (auto& pool : LayerPool::allLayerPools())
         pool->drain();
index 93b8bb1..dfb080d 100644 (file)
@@ -32,7 +32,7 @@
 #import "FontCache.h"
 #import "FontCascade.h"
 #import "FontDescription.h"
-#import "LocaleMac.h"
+#import "LocaleCocoa.h"
 #import "OpenTypeCG.h"
 #import "SharedBuffer.h"
 #import <CoreText/CoreText.h>
@@ -560,7 +560,7 @@ void Font::applyTransforms(GlyphBuffer& glyphBuffer, unsigned beginningIndex, bo
         *newGlyphsPointer = glyphBuffer.glyphs(beginningIndex);
         *newAdvancesPointer = glyphBuffer.advances(beginningIndex);
     };
-    CTFontTransformGlyphsWithLanguage(m_platformData.ctFont(), glyphBuffer.glyphs(beginningIndex), reinterpret_cast<CGSize*>(glyphBuffer.advances(beginningIndex)), glyphBuffer.size() - beginningIndex, options, LocaleMac::canonicalLanguageIdentifierFromString(locale).string().createCFString().get(), handler);
+    CTFontTransformGlyphsWithLanguage(m_platformData.ctFont(), glyphBuffer.glyphs(beginningIndex), reinterpret_cast<CGSize*>(glyphBuffer.advances(beginningIndex)), glyphBuffer.size() - beginningIndex, options, LocaleCocoa::canonicalLanguageIdentifierFromString(locale).string().createCFString().get(), handler);
 #else
     UNUSED_PARAM(locale);
     CTFontTransformGlyphs(m_platformData.ctFont(), glyphBuffer.glyphs(beginningIndex), reinterpret_cast<CGSize*>(glyphBuffer.advances(beginningIndex)), glyphBuffer.size() - beginningIndex, options);
@@ -28,8 +28,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef LocaleMac_h
-#define LocaleMac_h
+#pragma once
 
 #include "PlatformLocale.h"
 #include <wtf/Forward.h>
@@ -45,10 +44,10 @@ namespace WebCore {
 
 class DateComponents;
 
-class LocaleMac : public Locale {
+class LocaleCocoa : public Locale {
 public:
-    explicit LocaleMac(NSLocale*);
-    ~LocaleMac();
+    explicit LocaleCocoa(NSLocale*);
+    ~LocaleCocoa();
 
 #if ENABLE(DATE_AND_TIME_INPUT_TYPES)
     String formatDateTime(const DateComponents&, FormatType = FormatTypeUnspecified) override;
@@ -99,4 +98,3 @@ private:
 };
 
 } // namespace WebCore
-#endif
@@ -29,7 +29,7 @@
  */
 
 #include "config.h"
-#include "LocaleMac.h"
+#include "LocaleCocoa.h"
 
 #import "LocalizedStrings.h"
 #import <Foundation/NSDateFormatter.h>
@@ -69,7 +69,7 @@ static RetainPtr<NSLocale> determineLocale(const String& locale)
 
 std::unique_ptr<Locale> Locale::create(const AtomString& locale)
 {
-    return makeUnique<LocaleMac>(determineLocale(locale.string()).get());
+    return makeUnique<LocaleCocoa>(determineLocale(locale.string()).get());
 }
 
 static RetainPtr<NSDateFormatter> createDateTimeFormatter(NSLocale* locale, NSCalendar* calendar, NSDateFormatterStyle dateStyle, NSDateFormatterStyle timeStyle)
@@ -83,7 +83,7 @@ static RetainPtr<NSDateFormatter> createDateTimeFormatter(NSLocale* locale, NSCa
     return adoptNS(formatter);
 }
 
-LocaleMac::LocaleMac(NSLocale* locale)
+LocaleCocoa::LocaleCocoa(NSLocale* locale)
     : m_locale(locale)
     , m_gregorianCalendar(adoptNS([[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian]))
     , m_didInitializeNumberData(false)
@@ -96,17 +96,17 @@ LocaleMac::LocaleMac(NSLocale* locale)
     [m_gregorianCalendar.get() setLocale:m_locale.get()];
 }
 
-LocaleMac::~LocaleMac()
+LocaleCocoa::~LocaleCocoa()
 {
 }
 
-RetainPtr<NSDateFormatter> LocaleMac::shortDateFormatter()
+RetainPtr<NSDateFormatter> LocaleCocoa::shortDateFormatter()
 {
     return createDateTimeFormatter(m_locale.get(), m_gregorianCalendar.get(), NSDateFormatterShortStyle, NSDateFormatterNoStyle);
 }
 
 #if ENABLE(DATE_AND_TIME_INPUT_TYPES)
-String LocaleMac::formatDateTime(const DateComponents& dateComponents, FormatType)
+String LocaleCocoa::formatDateTime(const DateComponents& dateComponents, FormatType)
 {
     double msec = dateComponents.millisecondsSinceEpoch();
     DateComponents::Type type = dateComponents.type();
@@ -125,7 +125,7 @@ String LocaleMac::formatDateTime(const DateComponents& dateComponents, FormatTyp
     return [dateFormatter stringFromDate:date];
 }
 
-const Vector<String>& LocaleMac::monthLabels()
+const Vector<String>& LocaleCocoa::monthLabels()
 {
     if (!m_monthLabels.isEmpty())
         return m_monthLabels;
@@ -141,27 +141,27 @@ const Vector<String>& LocaleMac::monthLabels()
     return m_monthLabels;
 }
 
-RetainPtr<NSDateFormatter> LocaleMac::timeFormatter()
+RetainPtr<NSDateFormatter> LocaleCocoa::timeFormatter()
 {
     return createDateTimeFormatter(m_locale.get(), m_gregorianCalendar.get(), NSDateFormatterNoStyle, NSDateFormatterMediumStyle);
 }
 
-RetainPtr<NSDateFormatter> LocaleMac::shortTimeFormatter()
+RetainPtr<NSDateFormatter> LocaleCocoa::shortTimeFormatter()
 {
     return createDateTimeFormatter(m_locale.get(), m_gregorianCalendar.get(), NSDateFormatterNoStyle, NSDateFormatterShortStyle);
 }
 
-RetainPtr<NSDateFormatter> LocaleMac::dateTimeFormatterWithSeconds()
+RetainPtr<NSDateFormatter> LocaleCocoa::dateTimeFormatterWithSeconds()
 {
     return createDateTimeFormatter(m_locale.get(), m_gregorianCalendar.get(), NSDateFormatterShortStyle, NSDateFormatterMediumStyle);
 }
 
-RetainPtr<NSDateFormatter> LocaleMac::dateTimeFormatterWithoutSeconds()
+RetainPtr<NSDateFormatter> LocaleCocoa::dateTimeFormatterWithoutSeconds()
 {
     return createDateTimeFormatter(m_locale.get(), m_gregorianCalendar.get(), NSDateFormatterShortStyle, NSDateFormatterShortStyle);
 }
 
-String LocaleMac::dateFormat()
+String LocaleCocoa::dateFormat()
 {
     if (!m_dateFormat.isNull())
         return m_dateFormat;
@@ -169,7 +169,7 @@ String LocaleMac::dateFormat()
     return m_dateFormat;
 }
 
-String LocaleMac::monthFormat()
+String LocaleCocoa::monthFormat()
 {
     if (!m_monthFormat.isNull())
         return m_monthFormat;
@@ -179,7 +179,7 @@ String LocaleMac::monthFormat()
     return m_monthFormat;
 }
 
-String LocaleMac::shortMonthFormat()
+String LocaleCocoa::shortMonthFormat()
 {
     if (!m_shortMonthFormat.isNull())
         return m_shortMonthFormat;
@@ -187,7 +187,7 @@ String LocaleMac::shortMonthFormat()
     return m_shortMonthFormat;
 }
 
-String LocaleMac::timeFormat()
+String LocaleCocoa::timeFormat()
 {
     if (!m_timeFormatWithSeconds.isNull())
         return m_timeFormatWithSeconds;
@@ -195,7 +195,7 @@ String LocaleMac::timeFormat()
     return m_timeFormatWithSeconds;
 }
 
-String LocaleMac::shortTimeFormat()
+String LocaleCocoa::shortTimeFormat()
 {
     if (!m_timeFormatWithoutSeconds.isNull())
         return m_timeFormatWithoutSeconds;
@@ -203,7 +203,7 @@ String LocaleMac::shortTimeFormat()
     return m_timeFormatWithoutSeconds;
 }
 
-String LocaleMac::dateTimeFormatWithSeconds()
+String LocaleCocoa::dateTimeFormatWithSeconds()
 {
     if (!m_dateTimeFormatWithSeconds.isNull())
         return m_dateTimeFormatWithSeconds;
@@ -211,7 +211,7 @@ String LocaleMac::dateTimeFormatWithSeconds()
     return m_dateTimeFormatWithSeconds;
 }
 
-String LocaleMac::dateTimeFormatWithoutSeconds()
+String LocaleCocoa::dateTimeFormatWithoutSeconds()
 {
     if (!m_dateTimeFormatWithoutSeconds.isNull())
         return m_dateTimeFormatWithoutSeconds;
@@ -219,7 +219,7 @@ String LocaleMac::dateTimeFormatWithoutSeconds()
     return m_dateTimeFormatWithoutSeconds;
 }
 
-const Vector<String>& LocaleMac::shortMonthLabels()
+const Vector<String>& LocaleCocoa::shortMonthLabels()
 {
     if (!m_shortMonthLabels.isEmpty())
         return m_shortMonthLabels;
@@ -235,7 +235,7 @@ const Vector<String>& LocaleMac::shortMonthLabels()
     return m_shortMonthLabels;
 }
 
-const Vector<String>& LocaleMac::standAloneMonthLabels()
+const Vector<String>& LocaleCocoa::standAloneMonthLabels()
 {
     if (!m_standAloneMonthLabels.isEmpty())
         return m_standAloneMonthLabels;
@@ -250,7 +250,7 @@ const Vector<String>& LocaleMac::standAloneMonthLabels()
     return m_standAloneMonthLabels;
 }
 
-const Vector<String>& LocaleMac::shortStandAloneMonthLabels()
+const Vector<String>& LocaleCocoa::shortStandAloneMonthLabels()
 {
     if (!m_shortStandAloneMonthLabels.isEmpty())
         return m_shortStandAloneMonthLabels;
@@ -265,7 +265,7 @@ const Vector<String>& LocaleMac::shortStandAloneMonthLabels()
     return m_shortStandAloneMonthLabels;
 }
 
-const Vector<String>& LocaleMac::timeAMPMLabels()
+const Vector<String>& LocaleCocoa::timeAMPMLabels()
 {
     if (!m_timeAMPMLabels.isEmpty())
         return m_timeAMPMLabels;
@@ -286,19 +286,19 @@ static CanonicalLocaleMap& canonicalLocaleMap()
     return canonicalLocaleMap.get();
 }
 
-AtomString LocaleMac::canonicalLanguageIdentifierFromString(const AtomString& string)
+AtomString LocaleCocoa::canonicalLanguageIdentifierFromString(const AtomString& string)
 {
     return canonicalLocaleMap().ensure(string, [&] {
         return [NSLocale canonicalLanguageIdentifierFromString:string];
     }).iterator->value;
 }
 
-void LocaleMac::releaseMemory()
+void LocaleCocoa::releaseMemory()
 {
     canonicalLocaleMap().clear();
 }
 
-void LocaleMac::initializeLocaleData()
+void LocaleCocoa::initializeLocaleData()
 {
     if (m_didInitializeNumberData)
         return;