WebKit Bugzilla
Attachment 348404 Details for
Bug 189082
: Rename wtf/text/mac/StringMac.mm to wtf/text/cocoa/StringCocoa.mm
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch v1
bug-189082-20180829094626.patch (text/plain), 10.03 KB, created by
David Kilzer (:ddkilzer)
on 2018-08-29 09:46:27 PDT
(
hide
)
Description:
Patch v1
Filename:
MIME Type:
Creator:
David Kilzer (:ddkilzer)
Created:
2018-08-29 09:46:27 PDT
Size:
10.03 KB
patch
obsolete
>Subversion Revision: 235455 >diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog >index 96cac60b419914fc89ec507f98148a39e6407742..08a0492f4b1b7ea8a64c2825f48e5540058f3e4d 100644 >--- a/Source/WTF/ChangeLog >+++ b/Source/WTF/ChangeLog >@@ -1,3 +1,22 @@ >+2018-08-29 David Kilzer <ddkilzer@apple.com> >+ >+ Rename wtf/text/mac/StringMac.mm to wtf/text/cococa/StringCococa.mm >+ <https://webkit.org/b/189082> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Includes a drive-by fix for a webkit-style warning: >+ >+ ERROR: Source/WTF/wtf/text/cocoa/StringCocoa.mm:34: Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons. [readability/comparison_to_zero] [5] >+ >+ * WTF.xcodeproj/project.pbxproj: Update for move and rename. >+ * wtf/PlatformMac.cmake: Add missing cocoa/StringCocoa.mm source >+ file. Drive-by fix for rename of >+ TextBreakIteratorInternalICUMac.mm to >+ TextBreakIteratorInternalICUCocoa.cpp. >+ * wtf/text/cocoa/StringCocoa.mm: Renamed from Source/WTF/wtf/text/mac/StringMac.mm. >+ (WTF::String::String): >+ > 2018-08-27 Yusuke Suzuki <yusukesuzuki@slowstart.org> > > [WebAssembly] Parse wasm modules in a streaming fashion >diff --git a/Source/WTF/WTF.xcodeproj/project.pbxproj b/Source/WTF/WTF.xcodeproj/project.pbxproj >index 45b5ceaecf0e02ec5d65167787675c689d35245d..a19a6cce7c17ca091e7d1727b02dd71e98f8ccff 100644 >--- a/Source/WTF/WTF.xcodeproj/project.pbxproj >+++ b/Source/WTF/WTF.xcodeproj/project.pbxproj >@@ -88,7 +88,7 @@ > 9BC70F05176C379D00101DEC /* AtomicStringTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9BC70F04176C379D00101DEC /* AtomicStringTable.cpp */; }; > 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 */; }; >+ A5BA15F3182433A900A82E69 /* StringCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5BA15F2182433A900A82E69 /* StringCocoa.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 */; }; >@@ -427,7 +427,7 @@ > 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>"; }; >+ A5BA15F2182433A900A82E69 /* StringCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = StringCocoa.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; path = AtomicStringImplCF.cpp; sourceTree = "<group>"; }; > A5BA15F8182435A600A82E69 /* StringCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StringCF.cpp; sourceTree = "<group>"; }; >@@ -776,8 +776,8 @@ > A5BA15F11824339F00A82E69 /* cocoa */ = { > isa = PBXGroup; > children = ( >+ A5BA15F2182433A900A82E69 /* StringCocoa.mm */, > A5BA15F41824348000A82E69 /* StringImplCocoa.mm */, >- A5BA15F2182433A900A82E69 /* StringMac.mm */, > 93934BD218A1E8C300D0D6A1 /* StringViewCocoa.mm */, > 1C181C951D30800A00F5FA16 /* TextBreakIteratorInternalICUCocoa.cpp */, > ); >@@ -1555,10 +1555,10 @@ > A8A4743C151A825B004123FF /* StringBuilder.cpp in Sources */, > E38D6E271F5522E300A75CC4 /* StringBuilderJSON.cpp in Sources */, > A5BA15FB182435A600A82E69 /* StringCF.cpp in Sources */, >+ A5BA15F3182433A900A82E69 /* StringCocoa.mm in Sources */, > A8A47440151A825B004123FF /* StringImpl.cpp in Sources */, > A5BA15FC182435A600A82E69 /* StringImplCF.cpp in Sources */, > A5BA15F51824348000A82E69 /* StringImplCocoa.mm in Sources */, >- A5BA15F3182433A900A82E69 /* StringMac.mm in Sources */, > 0FDDBFA71666DFA300C55FEF /* StringPrintStream.cpp in Sources */, > 93F1993E19D7958D00C2390B /* StringView.cpp in Sources */, > 93934BD518A1F16900D0D6A1 /* StringViewCF.cpp in Sources */, >diff --git a/Source/WTF/wtf/PlatformMac.cmake b/Source/WTF/wtf/PlatformMac.cmake >index 7837236fcd6d3ada7f1e1fb137c73765a75e74cf..c6513884808474aa8e09d064f4eec1cbb0e29263 100644 >--- a/Source/WTF/wtf/PlatformMac.cmake >+++ b/Source/WTF/wtf/PlatformMac.cmake >@@ -57,9 +57,10 @@ list(APPEND WTF_SOURCES > text/cf/StringImplCF.cpp > text/cf/StringViewCF.cpp > >+ text/cocoa/StringCocoa.mm > text/cocoa/StringImplCocoa.mm > text/cocoa/StringViewCocoa.mm >- text/cocoa/TextBreakIteratorInternalICUMac.mm >+ text/cocoa/TextBreakIteratorInternalICUCocoa.cpp > ) > > list(APPEND WTF_PRIVATE_INCLUDE_DIRECTORIES >diff --git a/Source/WTF/wtf/text/cocoa/StringCocoa.mm b/Source/WTF/wtf/text/cocoa/StringCocoa.mm >new file mode 100644 >index 0000000000000000000000000000000000000000..c6940aac125b42eba996969bb707f341f8aba771 >--- /dev/null >+++ b/Source/WTF/wtf/text/cocoa/StringCocoa.mm >@@ -0,0 +1,51 @@ >+/* >+ * Copyright (C) 2006-2018 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 "WTFString.h" >+ >+#include <CoreFoundation/CFString.h> >+ >+namespace WTF { >+ >+String::String(NSString *str) >+{ >+ if (!str) >+ return; >+ >+ CFIndex size = CFStringGetLength(reinterpret_cast<CFStringRef>(str)); >+ if (!size) >+ m_impl = StringImpl::empty(); >+ else { >+ Vector<LChar, 1024> lcharBuffer(size); >+ CFIndex usedBufLen; >+ CFIndex convertedsize = CFStringGetBytes(reinterpret_cast<CFStringRef>(str), CFRangeMake(0, size), kCFStringEncodingISOLatin1, 0, false, lcharBuffer.data(), size, &usedBufLen); >+ if ((convertedsize == size) && (usedBufLen == size)) { >+ m_impl = StringImpl::create(lcharBuffer.data(), size); >+ return; >+ } >+ >+ Vector<UChar, 1024> ucharBuffer(size); >+ CFStringGetCharacters(reinterpret_cast<CFStringRef>(str), CFRangeMake(0, size), ucharBuffer.data()); >+ m_impl = StringImpl::create(ucharBuffer.data(), size); >+ } >+} >+ >+} >diff --git a/Source/WTF/wtf/text/mac/StringMac.mm b/Source/WTF/wtf/text/mac/StringMac.mm >deleted file mode 100644 >index 34e5c1a84fdd32779448309d48c1d908755ff1ed..0000000000000000000000000000000000000000 >--- a/Source/WTF/wtf/text/mac/StringMac.mm >+++ /dev/null >@@ -1,51 +0,0 @@ >-/* >- * Copyright (C) 2006 Apple Inc. >- * >- * 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 "WTFString.h" >- >-#include <CoreFoundation/CFString.h> >- >-namespace WTF { >- >-String::String(NSString *str) >-{ >- if (!str) >- return; >- >- CFIndex size = CFStringGetLength(reinterpret_cast<CFStringRef>(str)); >- if (size == 0) >- m_impl = StringImpl::empty(); >- else { >- Vector<LChar, 1024> lcharBuffer(size); >- CFIndex usedBufLen; >- CFIndex convertedsize = CFStringGetBytes(reinterpret_cast<CFStringRef>(str), CFRangeMake(0, size), kCFStringEncodingISOLatin1, 0, false, lcharBuffer.data(), size, &usedBufLen); >- if ((convertedsize == size) && (usedBufLen == size)) { >- m_impl = StringImpl::create(lcharBuffer.data(), size); >- return; >- } >- >- Vector<UChar, 1024> ucharBuffer(size); >- CFStringGetCharacters(reinterpret_cast<CFStringRef>(str), CFRangeMake(0, size), ucharBuffer.data()); >- m_impl = StringImpl::create(ucharBuffer.data(), size); >- } >-} >- >-}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 189082
: 348404