Diff
Modified: trunk/Source/WTF/ChangeLog (215517 => 215518)
--- trunk/Source/WTF/ChangeLog 2017-04-19 17:12:37 UTC (rev 215517)
+++ trunk/Source/WTF/ChangeLog 2017-04-19 17:57:53 UTC (rev 215518)
@@ -1,3 +1,19 @@
+2017-04-19 Sam Weinig <[email protected]>
+
+ Move notFound into its own file
+ https://bugs.webkit.org/show_bug.cgi?id=170972
+
+ Reviewed by Zalan Bujtas.
+
+ It is odd to require including <wtf/Vector.h> just to use WTF::notFound.
+ This is not causing any current problems, but does in few changes I have
+ queued up.
+
+ * WTF.xcodeproj/project.pbxproj:
+ * wtf/NotFound.h: Added.
+ * wtf/Vector.h:
+ * wtf/text/StringCommon.h:
+
2017-04-18 Carlos Garcia Campos <[email protected]>
[GLIB] Define priorities also for async network IO tasks
Modified: trunk/Source/WTF/WTF.xcodeproj/project.pbxproj (215517 => 215518)
--- trunk/Source/WTF/WTF.xcodeproj/project.pbxproj 2017-04-19 17:12:37 UTC (rev 215517)
+++ trunk/Source/WTF/WTF.xcodeproj/project.pbxproj 2017-04-19 17:57:53 UTC (rev 215518)
@@ -166,6 +166,7 @@
7CD4C2701E2C82B900929470 /* StringConcatenateNumbers.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CD4C26F1E2C82B900929470 /* StringConcatenateNumbers.h */; };
7CDD7FF8186D291E007433CD /* IteratorAdaptors.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CDD7FF7186D291E007433CD /* IteratorAdaptors.h */; };
7CDD7FFA186D2A54007433CD /* IteratorRange.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CDD7FF9186D2A54007433CD /* IteratorRange.h */; };
+ 7CEAE5AD1EA6E10F00DB6890 /* NotFound.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CEAE5AC1EA6E10F00DB6890 /* NotFound.h */; };
7E29C33E15FFD79B00516D61 /* ObjcRuntimeExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E29C33D15FFD79B00516D61 /* ObjcRuntimeExtras.h */; };
8134013815B092FD001FF0B8 /* Base64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8134013615B092FD001FF0B8 /* Base64.cpp */; };
8134013915B092FD001FF0B8 /* Base64.h in Headers */ = {isa = PBXBuildFile; fileRef = 8134013715B092FD001FF0B8 /* Base64.h */; };
@@ -570,6 +571,7 @@
7CD4C26F1E2C82B900929470 /* StringConcatenateNumbers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringConcatenateNumbers.h; sourceTree = "<group>"; };
7CDD7FF7186D291E007433CD /* IteratorAdaptors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IteratorAdaptors.h; sourceTree = "<group>"; };
7CDD7FF9186D2A54007433CD /* IteratorRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IteratorRange.h; sourceTree = "<group>"; };
+ 7CEAE5AC1EA6E10F00DB6890 /* NotFound.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NotFound.h; sourceTree = "<group>"; };
7E29C33D15FFD79B00516D61 /* ObjcRuntimeExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ObjcRuntimeExtras.h; sourceTree = "<group>"; };
8134013615B092FD001FF0B8 /* Base64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Base64.cpp; sourceTree = "<group>"; };
8134013715B092FD001FF0B8 /* Base64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Base64.h; sourceTree = "<group>"; };
@@ -1090,6 +1092,7 @@
1A3F6BE6174ADA2100B2EEA7 /* NeverDestroyed.h */,
0F0D85B317234CB100338210 /* NoLock.h */,
A8A472D0151A825B004123FF /* Noncopyable.h */,
+ 7CEAE5AC1EA6E10F00DB6890 /* NotFound.h */,
A8A472D5151A825B004123FF /* NumberOfCores.cpp */,
A8A472D6151A825B004123FF /* NumberOfCores.h */,
7E29C33D15FFD79B00516D61 /* ObjcRuntimeExtras.h */,
@@ -1626,6 +1629,7 @@
0F2AC5611E89F70C0001EE3F /* Range.h in Headers */,
A8A4742C151A825B004123FF /* StringExtras.h in Headers */,
A8A4743F151A825B004123FF /* StringHash.h in Headers */,
+ 7CEAE5AD1EA6E10F00DB6890 /* NotFound.h in Headers */,
A748745417A0BDAE00FA04CB /* StringHashDumpContext.h in Headers */,
A8A47441151A825B004123FF /* StringImpl.h in Headers */,
A8A47442151A825B004123FF /* StringOperators.h in Headers */,
Added: trunk/Source/WTF/wtf/NotFound.h (0 => 215518)
--- trunk/Source/WTF/wtf/NotFound.h (rev 0)
+++ trunk/Source/WTF/wtf/NotFound.h 2017-04-19 17:57:53 UTC (rev 215518)
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2017 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.
+ */
+
+#pragma once
+
+namespace WTF {
+
+constexpr size_t notFound = static_cast<size_t>(-1);
+
+}
+
+using WTF::notFound;
Modified: trunk/Source/WTF/wtf/Vector.h (215517 => 215518)
--- trunk/Source/WTF/wtf/Vector.h 2017-04-19 17:12:37 UTC (rev 215517)
+++ trunk/Source/WTF/wtf/Vector.h 2017-04-19 17:57:53 UTC (rev 215518)
@@ -18,8 +18,7 @@
*
*/
-#ifndef WTF_Vector_h
-#define WTF_Vector_h
+#pragma once
#include <initializer_list>
#include <limits>
@@ -30,6 +29,7 @@
#include <wtf/FastMalloc.h>
#include <wtf/MallocPtr.h>
#include <wtf/Noncopyable.h>
+#include <wtf/NotFound.h>
#include <wtf/StdLibExtras.h>
#include <wtf/ValueCheck.h>
#include <wtf/VectorTraits.h>
@@ -40,8 +40,6 @@
namespace WTF {
-const size_t notFound = static_cast<size_t>(-1);
-
template <bool needsDestruction, typename T>
struct VectorDestructor;
@@ -1532,7 +1530,4 @@
using WTF::Vector;
using WTF::UnsafeVectorOverflow;
-using WTF::notFound;
using WTF::removeRepeatedElements;
-
-#endif // WTF_Vector_h
Modified: trunk/Source/WTF/wtf/text/StringCommon.h (215517 => 215518)
--- trunk/Source/WTF/wtf/text/StringCommon.h 2017-04-19 17:12:37 UTC (rev 215517)
+++ trunk/Source/WTF/wtf/text/StringCommon.h 2017-04-19 17:57:53 UTC (rev 215518)
@@ -23,11 +23,11 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef StringCommon_h
-#define StringCommon_h
+#pragma once
#include <unicode/uchar.h>
#include <wtf/ASCIICType.h>
+#include <wtf/NotFound.h>
namespace WTF {
@@ -652,5 +652,3 @@
using WTF::equalIgnoringASCIICase;
using WTF::equalLettersIgnoringASCIICase;
-
-#endif // StringCommon_h