Title: [247688] trunk/Source
Revision
247688
Author
simon.fra...@apple.com
Date
2019-07-22 11:05:16 -0700 (Mon, 22 Jul 2019)

Log Message

Make some constructors explicit
https://bugs.webkit.org/show_bug.cgi?id=199981

Reviewed by Daniel Bates.

Make explicit public constructors of objects that take POD or String& arguments,
to reduce the changes of the compiler doing implicit conversions.

Source/WebCore:

* Modules/indexeddb/server/IndexValueEntry.h:
* Modules/indexeddb/server/IndexValueStore.h:
* Modules/indexeddb/shared/IDBDatabaseInfo.h:
* Modules/webdatabase/ChangeVersionData.h:
(WebCore::ChangeVersionData::ChangeVersionData):
* Modules/webdatabase/OriginLock.h:
* Modules/websockets/WebSocketExtensionParser.h:
(WebCore::WebSocketExtensionParser::WebSocketExtensionParser):
* bindings/js/ScriptCachedFrameData.h:
* contentextensions/URLFilterParser.cpp:
(WebCore::ContentExtensions::PatternParser::PatternParser):
* css/parser/CSSTokenizer.h:
* css/parser/SizesAttributeParser.h:
* dom/SpaceSplitString.cpp:
(WebCore::TokenIsEqualToCStringTokenProcessor::TokenIsEqualToCStringTokenProcessor):
* html/FormController.cpp:
(WebCore::SavedFormState::appendControlState):
(WebCore::SavedFormState::takeControlState):
* loader/ProgressTracker.cpp:
(WebCore::ProgressItem::ProgressItem):
* page/DragController.cpp:
(WebCore::DragController::DragController):
(WebCore::DragController::performDragOperation):
* page/DragController.h:
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::AnimationPropertyWrapperBase::AnimationPropertyWrapperBase):
* page/ios/DOMTimerHoldingTank.h:
(WebCore::DeferDOMTimersForScope::DeferDOMTimersForScope):
* platform/CountedUserActivity.h:
(WebCore::CountedUserActivity::CountedUserActivity):
* platform/audio/DirectConvolver.h:
* platform/audio/DownSampler.h:
* platform/audio/DynamicsCompressorKernel.h:
* platform/audio/EqualPowerPanner.h:
* platform/audio/MultiChannelResampler.h:
* platform/audio/ReverbAccumulationBuffer.h:
* platform/audio/ReverbInputBuffer.h:
* platform/audio/SincResampler.cpp:
* platform/audio/UpSampler.h:
* platform/audio/ios/AudioFileReaderIOS.h:
* platform/audio/mac/AudioFileReaderMac.h:
* platform/audio/mac/AudioSessionMac.cpp:
(WebCore::AudioSessionPrivate::AudioSessionPrivate):
* platform/cf/KeyedDecoderCF.h:
* platform/graphics/WidthIterator.cpp:
(WebCore::OriginalAdvancesForCharacterTreatedAsSpace::OriginalAdvancesForCharacterTreatedAsSpace):
* platform/graphics/cocoa/FontCacheCoreText.h:
(WebCore::SynthesisPair::SynthesisPair):
* platform/graphics/displaylists/DisplayListItems.h:
(WebCore::DisplayList::DrawingItem::DrawingItem):
* platform/network/cf/ResourceRequest.h:
(WebCore::ResourceRequest::ResourceRequest):
* platform/text/TextCodecICU.h:
* rendering/RenderTableSection.h:
(WebCore::CellSpan::CellSpan):
* rendering/shapes/RasterShape.cpp:
* rendering/shapes/RasterShape.h:
(WebCore::RasterShapeIntervals::RasterShapeIntervals):
* testing/MockLibWebRTCPeerConnection.h:
(WebCore::MockLibWebRTCIceCandidate::MockLibWebRTCIceCandidate):

Source/WebCore/PAL:

* pal/system/cocoa/SleepDisablerCocoa.cpp:
(PAL::SleepDisablerCocoa::SleepDisablerCocoa):
* pal/system/cocoa/SleepDisablerCocoa.h:

Source/WebKit:

* Platform/Module.h:
* WebProcess/WebPage/WebInspector.cpp:
(WebKit::WebInspector::openInNewTab):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (247687 => 247688)


--- trunk/Source/WebCore/ChangeLog	2019-07-22 17:34:55 UTC (rev 247687)
+++ trunk/Source/WebCore/ChangeLog	2019-07-22 18:05:16 UTC (rev 247688)
@@ -1,3 +1,74 @@
+2019-07-22  Simon Fraser  <simon.fra...@apple.com>
+
+        Make some constructors explicit
+        https://bugs.webkit.org/show_bug.cgi?id=199981
+
+        Reviewed by Daniel Bates.
+
+        Make explicit public constructors of objects that take POD or String& arguments,
+        to reduce the changes of the compiler doing implicit conversions.
+
+        * Modules/indexeddb/server/IndexValueEntry.h:
+        * Modules/indexeddb/server/IndexValueStore.h:
+        * Modules/indexeddb/shared/IDBDatabaseInfo.h:
+        * Modules/webdatabase/ChangeVersionData.h:
+        (WebCore::ChangeVersionData::ChangeVersionData):
+        * Modules/webdatabase/OriginLock.h:
+        * Modules/websockets/WebSocketExtensionParser.h:
+        (WebCore::WebSocketExtensionParser::WebSocketExtensionParser):
+        * bindings/js/ScriptCachedFrameData.h:
+        * contentextensions/URLFilterParser.cpp:
+        (WebCore::ContentExtensions::PatternParser::PatternParser):
+        * css/parser/CSSTokenizer.h:
+        * css/parser/SizesAttributeParser.h:
+        * dom/SpaceSplitString.cpp:
+        (WebCore::TokenIsEqualToCStringTokenProcessor::TokenIsEqualToCStringTokenProcessor):
+        * html/FormController.cpp:
+        (WebCore::SavedFormState::appendControlState):
+        (WebCore::SavedFormState::takeControlState):
+        * loader/ProgressTracker.cpp:
+        (WebCore::ProgressItem::ProgressItem):
+        * page/DragController.cpp:
+        (WebCore::DragController::DragController):
+        (WebCore::DragController::performDragOperation):
+        * page/DragController.h:
+        * page/animation/CSSPropertyAnimation.cpp:
+        (WebCore::AnimationPropertyWrapperBase::AnimationPropertyWrapperBase):
+        * page/ios/DOMTimerHoldingTank.h:
+        (WebCore::DeferDOMTimersForScope::DeferDOMTimersForScope):
+        * platform/CountedUserActivity.h:
+        (WebCore::CountedUserActivity::CountedUserActivity):
+        * platform/audio/DirectConvolver.h:
+        * platform/audio/DownSampler.h:
+        * platform/audio/DynamicsCompressorKernel.h:
+        * platform/audio/EqualPowerPanner.h:
+        * platform/audio/MultiChannelResampler.h:
+        * platform/audio/ReverbAccumulationBuffer.h:
+        * platform/audio/ReverbInputBuffer.h:
+        * platform/audio/SincResampler.cpp:
+        * platform/audio/UpSampler.h:
+        * platform/audio/ios/AudioFileReaderIOS.h:
+        * platform/audio/mac/AudioFileReaderMac.h:
+        * platform/audio/mac/AudioSessionMac.cpp:
+        (WebCore::AudioSessionPrivate::AudioSessionPrivate):
+        * platform/cf/KeyedDecoderCF.h:
+        * platform/graphics/WidthIterator.cpp:
+        (WebCore::OriginalAdvancesForCharacterTreatedAsSpace::OriginalAdvancesForCharacterTreatedAsSpace):
+        * platform/graphics/cocoa/FontCacheCoreText.h:
+        (WebCore::SynthesisPair::SynthesisPair):
+        * platform/graphics/displaylists/DisplayListItems.h:
+        (WebCore::DisplayList::DrawingItem::DrawingItem):
+        * platform/network/cf/ResourceRequest.h:
+        (WebCore::ResourceRequest::ResourceRequest):
+        * platform/text/TextCodecICU.h:
+        * rendering/RenderTableSection.h:
+        (WebCore::CellSpan::CellSpan):
+        * rendering/shapes/RasterShape.cpp:
+        * rendering/shapes/RasterShape.h:
+        (WebCore::RasterShapeIntervals::RasterShapeIntervals):
+        * testing/MockLibWebRTCPeerConnection.h:
+        (WebCore::MockLibWebRTCIceCandidate::MockLibWebRTCIceCandidate):
+
 2019-07-22  Rob Buis  <rb...@igalia.com>
 
         Remove some unneeded code in MathOperator

Modified: trunk/Source/WebCore/Modules/indexeddb/server/IndexValueEntry.h (247687 => 247688)


--- trunk/Source/WebCore/Modules/indexeddb/server/IndexValueEntry.h	2019-07-22 17:34:55 UTC (rev 247687)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IndexValueEntry.h	2019-07-22 18:05:16 UTC (rev 247688)
@@ -40,7 +40,7 @@
 class IndexValueEntry {
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    IndexValueEntry(bool unique);
+    explicit IndexValueEntry(bool unique);
     ~IndexValueEntry();
 
     void addKey(const IDBKeyData&);

Modified: trunk/Source/WebCore/Modules/indexeddb/server/IndexValueStore.h (247687 => 247688)


--- trunk/Source/WebCore/Modules/indexeddb/server/IndexValueStore.h	2019-07-22 17:34:55 UTC (rev 247687)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IndexValueStore.h	2019-07-22 18:05:16 UTC (rev 247688)
@@ -47,7 +47,7 @@
 class IndexValueStore {
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    IndexValueStore(bool unique);
+    explicit IndexValueStore(bool unique);
 
     const IDBKeyData* lowestValueForKey(const IDBKeyData&) const;
     Vector<IDBKeyData> allValuesForKey(const IDBKeyData&, uint32_t limit) const;

Modified: trunk/Source/WebCore/Modules/indexeddb/shared/IDBDatabaseInfo.h (247687 => 247688)


--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBDatabaseInfo.h	2019-07-22 17:34:55 UTC (rev 247687)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBDatabaseInfo.h	2019-07-22 18:05:16 UTC (rev 247688)
@@ -35,7 +35,7 @@
 class IDBDatabaseInfo {
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    IDBDatabaseInfo(const String& name, uint64_t version);
+    explicit IDBDatabaseInfo(const String& name, uint64_t version);
 
     enum IsolatedCopyTag { IsolatedCopy };
     IDBDatabaseInfo(const IDBDatabaseInfo&, IsolatedCopyTag);

Modified: trunk/Source/WebCore/Modules/webdatabase/ChangeVersionData.h (247687 => 247688)


--- trunk/Source/WebCore/Modules/webdatabase/ChangeVersionData.h	2019-07-22 17:34:55 UTC (rev 247687)
+++ trunk/Source/WebCore/Modules/webdatabase/ChangeVersionData.h	2019-07-22 18:05:16 UTC (rev 247688)
@@ -31,7 +31,7 @@
 
 class ChangeVersionData {
 public:
-    ChangeVersionData(String oldVersion, String newVersion)
+    explicit ChangeVersionData(String oldVersion, String newVersion)
         : m_oldVersion(oldVersion), m_newVersion(newVersion) { }
 
     String oldVersion() const { return m_oldVersion; }

Modified: trunk/Source/WebCore/Modules/webdatabase/OriginLock.h (247687 => 247688)


--- trunk/Source/WebCore/Modules/webdatabase/OriginLock.h	2019-07-22 17:34:55 UTC (rev 247687)
+++ trunk/Source/WebCore/Modules/webdatabase/OriginLock.h	2019-07-22 18:05:16 UTC (rev 247688)
@@ -35,7 +35,7 @@
 class OriginLock : public ThreadSafeRefCounted<OriginLock> {
     WTF_MAKE_NONCOPYABLE(OriginLock); WTF_MAKE_FAST_ALLOCATED;
 public:
-    OriginLock(String originPath);
+    explicit OriginLock(String originPath);
     WEBCORE_EXPORT ~OriginLock();
 
     void lock();

Modified: trunk/Source/WebCore/Modules/websockets/WebSocketExtensionParser.h (247687 => 247688)


--- trunk/Source/WebCore/Modules/websockets/WebSocketExtensionParser.h	2019-07-22 17:34:55 UTC (rev 247687)
+++ trunk/Source/WebCore/Modules/websockets/WebSocketExtensionParser.h	2019-07-22 18:05:16 UTC (rev 247688)
@@ -38,7 +38,7 @@
 
 class WebSocketExtensionParser {
 public:
-    WebSocketExtensionParser(const char* start, const char* end)
+    explicit WebSocketExtensionParser(const char* start, const char* end)
         : m_current(start)
         , m_end(end)
     {

Modified: trunk/Source/WebCore/PAL/ChangeLog (247687 => 247688)


--- trunk/Source/WebCore/PAL/ChangeLog	2019-07-22 17:34:55 UTC (rev 247687)
+++ trunk/Source/WebCore/PAL/ChangeLog	2019-07-22 18:05:16 UTC (rev 247688)
@@ -1,3 +1,17 @@
+2019-07-22  Simon Fraser  <simon.fra...@apple.com>
+
+        Make some constructors explicit
+        https://bugs.webkit.org/show_bug.cgi?id=199981
+
+        Reviewed by Daniel Bates.
+
+        Make explicit public constructors of objects that take POD or String& arguments,
+        to reduce the changes of the compiler doing implicit conversions.
+
+        * pal/system/cocoa/SleepDisablerCocoa.cpp:
+        (PAL::SleepDisablerCocoa::SleepDisablerCocoa):
+        * pal/system/cocoa/SleepDisablerCocoa.h:
+
 2019-07-21  Myles C. Maxfield  <mmaxfi...@apple.com>
 
         [iOS] Fast and complex text codepaths disagree about how to lay out bopomofo with tone marks

Modified: trunk/Source/WebCore/PAL/pal/system/cocoa/SleepDisablerCocoa.cpp (247687 => 247688)


--- trunk/Source/WebCore/PAL/pal/system/cocoa/SleepDisablerCocoa.cpp	2019-07-22 17:34:55 UTC (rev 247687)
+++ trunk/Source/WebCore/PAL/pal/system/cocoa/SleepDisablerCocoa.cpp	2019-07-22 18:05:16 UTC (rev 247688)
@@ -40,7 +40,6 @@
 
 SleepDisablerCocoa::SleepDisablerCocoa(const char* reason, Type type)
     : SleepDisabler(reason, type)
-    , m_sleepAssertion(0)
 {
     RetainPtr<CFStringRef> reasonCF = adoptCF(CFStringCreateWithCString(kCFAllocatorDefault, reason, kCFStringEncodingUTF8));
 

Modified: trunk/Source/WebCore/PAL/pal/system/cocoa/SleepDisablerCocoa.h (247687 => 247688)


--- trunk/Source/WebCore/PAL/pal/system/cocoa/SleepDisablerCocoa.h	2019-07-22 17:34:55 UTC (rev 247687)
+++ trunk/Source/WebCore/PAL/pal/system/cocoa/SleepDisablerCocoa.h	2019-07-22 18:05:16 UTC (rev 247688)
@@ -33,11 +33,11 @@
 
 class SleepDisablerCocoa : public SleepDisabler {
 public:
-    SleepDisablerCocoa(const char*, Type);
+    explicit SleepDisablerCocoa(const char*, Type);
     virtual ~SleepDisablerCocoa();
 
 private:
-    uint32_t m_sleepAssertion;
+    uint32_t m_sleepAssertion { 0 };
 };
 
 } // namespace PAL

Modified: trunk/Source/WebCore/bindings/js/ScriptCachedFrameData.h (247687 => 247688)


--- trunk/Source/WebCore/bindings/js/ScriptCachedFrameData.h	2019-07-22 17:34:55 UTC (rev 247687)
+++ trunk/Source/WebCore/bindings/js/ScriptCachedFrameData.h	2019-07-22 18:05:16 UTC (rev 247688)
@@ -43,7 +43,7 @@
 class ScriptCachedFrameData {
     WTF_MAKE_NONCOPYABLE(ScriptCachedFrameData); WTF_MAKE_FAST_ALLOCATED;
 public:
-    ScriptCachedFrameData(Frame&);
+    explicit ScriptCachedFrameData(Frame&);
     ~ScriptCachedFrameData();
 
     void restore(Frame&);

Modified: trunk/Source/WebCore/contentextensions/URLFilterParser.cpp (247687 => 247688)


--- trunk/Source/WebCore/contentextensions/URLFilterParser.cpp	2019-07-22 17:34:55 UTC (rev 247687)
+++ trunk/Source/WebCore/contentextensions/URLFilterParser.cpp	2019-07-22 18:05:16 UTC (rev 247688)
@@ -40,7 +40,7 @@
 
 class PatternParser {
 public:
-    PatternParser(bool patternIsCaseSensitive)
+    explicit PatternParser(bool patternIsCaseSensitive)
         : m_patternIsCaseSensitive(patternIsCaseSensitive)
         , m_parseStatus(URLFilterParser::Ok)
     {

Modified: trunk/Source/WebCore/css/parser/CSSTokenizer.h (247687 => 247688)


--- trunk/Source/WebCore/css/parser/CSSTokenizer.h	2019-07-22 17:34:55 UTC (rev 247687)
+++ trunk/Source/WebCore/css/parser/CSSTokenizer.h	2019-07-22 18:05:16 UTC (rev 247688)
@@ -45,7 +45,7 @@
     WTF_MAKE_NONCOPYABLE(CSSTokenizer);
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    CSSTokenizer(const String&);
+    explicit CSSTokenizer(const String&);
     CSSTokenizer(const String&, CSSParserObserverWrapper&); // For the inspector
 
     CSSParserTokenRange tokenRange() const;

Modified: trunk/Source/WebCore/css/parser/SizesAttributeParser.h (247687 => 247688)


--- trunk/Source/WebCore/css/parser/SizesAttributeParser.h	2019-07-22 17:34:55 UTC (rev 247687)
+++ trunk/Source/WebCore/css/parser/SizesAttributeParser.h	2019-07-22 18:05:16 UTC (rev 247688)
@@ -41,7 +41,7 @@
     
 class SizesAttributeParser {
 public:
-    SizesAttributeParser(const String&, const Document&);
+    explicit SizesAttributeParser(const String&, const Document&);
 
     float length();
 

Modified: trunk/Source/WebCore/dom/SpaceSplitString.cpp (247687 => 247688)


--- trunk/Source/WebCore/dom/SpaceSplitString.cpp	2019-07-22 17:34:55 UTC (rev 247687)
+++ trunk/Source/WebCore/dom/SpaceSplitString.cpp	2019-07-22 18:05:16 UTC (rev 247688)
@@ -103,7 +103,7 @@
 
 class TokenIsEqualToCStringTokenProcessor {
 public:
-    TokenIsEqualToCStringTokenProcessor(const char* referenceString, unsigned referenceStringLength)
+    explicit TokenIsEqualToCStringTokenProcessor(const char* referenceString, unsigned referenceStringLength)
         : m_referenceString(referenceString)
         , m_referenceStringLength(referenceStringLength)
         , m_referenceStringWasFound(false)

Modified: trunk/Source/WebCore/html/FormController.cpp (247687 => 247688)


--- trunk/Source/WebCore/html/FormController.cpp	2019-07-22 17:34:55 UTC (rev 247687)
+++ trunk/Source/WebCore/html/FormController.cpp	2019-07-22 18:05:16 UTC (rev 247688)
@@ -79,7 +79,7 @@
 
 class FormElementKey {
 public:
-    FormElementKey(AtomStringImpl* = 0, AtomStringImpl* = 0);
+    explicit FormElementKey(AtomStringImpl* = nullptr, AtomStringImpl* = nullptr);
     ~FormElementKey();
     FormElementKey(const FormElementKey&);
     FormElementKey& operator=(const FormElementKey&);
@@ -229,13 +229,13 @@
 
 void SavedFormState::appendControlState(const AtomString& name, const AtomString& type, const FormControlState& state)
 {
-    m_stateForNewFormElements.add({ name.impl(), type.impl() }, Deque<FormControlState> { }).iterator->value.append(state);
+    m_stateForNewFormElements.add(FormElementKey { name.impl(), type.impl() }, Deque<FormControlState> { }).iterator->value.append(state);
     ++m_controlStateCount;
 }
 
 FormControlState SavedFormState::takeControlState(const AtomString& name, const AtomString& type)
 {
-    auto iterator = m_stateForNewFormElements.find({ name.impl(), type.impl() });
+    auto iterator = m_stateForNewFormElements.find(FormElementKey { name.impl(), type.impl() });
     if (iterator == m_stateForNewFormElements.end())
         return { };
 

Modified: trunk/Source/WebCore/loader/ProgressTracker.cpp (247687 => 247688)


--- trunk/Source/WebCore/loader/ProgressTracker.cpp	2019-07-22 17:34:55 UTC (rev 247687)
+++ trunk/Source/WebCore/loader/ProgressTracker.cpp	2019-07-22 18:05:16 UTC (rev 247688)
@@ -65,7 +65,7 @@
 struct ProgressItem {
     WTF_MAKE_NONCOPYABLE(ProgressItem); WTF_MAKE_FAST_ALLOCATED;
 public:
-    ProgressItem(long long length)
+    explicit ProgressItem(long long length)
         : bytesReceived(0)
         , estimatedLength(length)
     {

Modified: trunk/Source/WebCore/page/DragController.cpp (247687 => 247688)


--- trunk/Source/WebCore/page/DragController.cpp	2019-07-22 17:34:55 UTC (rev 247687)
+++ trunk/Source/WebCore/page/DragController.cpp	2019-07-22 18:05:16 UTC (rev 247688)
@@ -135,12 +135,6 @@
 DragController::DragController(Page& page, DragClient& client)
     : m_page(page)
     , m_client(client)
-    , m_numberOfItemsToBeAccepted(0)
-    , m_dragHandlingMethod(DragHandlingMethod::None)
-    , m_dragDestinationAction(DragDestinationActionNone)
-    , m_dragSourceAction(DragSourceActionNone)
-    , m_didInitiateDrag(false)
-    , m_sourceDragOperation(DragOperationNone)
 {
 }
 
@@ -284,7 +278,7 @@
         return false;
 
     m_client.willPerformDragDestinationAction(DragDestinationActionLoad, dragData);
-    FrameLoadRequest frameLoadRequest { m_page.mainFrame(), { urlString }, shouldOpenExternalURLsPolicy };
+    FrameLoadRequest frameLoadRequest { m_page.mainFrame(), ResourceRequest { urlString }, shouldOpenExternalURLsPolicy };
     frameLoadRequest.setIsRequestFromClientOrUserInput();
     m_page.mainFrame().loader().load(WTFMove(frameLoadRequest));
     return true;

Modified: trunk/Source/WebCore/page/DragController.h (247687 => 247688)


--- trunk/Source/WebCore/page/DragController.h	2019-07-22 17:34:55 UTC (rev 247687)
+++ trunk/Source/WebCore/page/DragController.h	2019-07-22 18:05:16 UTC (rev 247688)
@@ -142,13 +142,13 @@
         RefPtr<Document> m_documentUnderMouse; // The document the mouse was last dragged over.
         RefPtr<Document> m_dragInitiator; // The Document (if any) that initiated the drag.
         RefPtr<HTMLInputElement> m_fileInputElementUnderMouse;
-        unsigned m_numberOfItemsToBeAccepted;
+        unsigned m_numberOfItemsToBeAccepted { 0 };
         DragHandlingMethod m_dragHandlingMethod { DragHandlingMethod::None };
 
-        DragDestinationAction m_dragDestinationAction;
-        DragSourceAction m_dragSourceAction;
-        bool m_didInitiateDrag;
-        DragOperation m_sourceDragOperation; // Set in startDrag when a drag starts from a mouse down within WebKit
+        DragDestinationAction m_dragDestinationAction { DragDestinationActionNone };
+        DragSourceAction m_dragSourceAction { DragSourceActionNone };
+        bool m_didInitiateDrag { false };
+        DragOperation m_sourceDragOperation { DragOperationNone }; // Set in startDrag when a drag starts from a mouse down within WebKit
         IntPoint m_dragOffset;
         URL m_draggingImageURL;
         bool m_isPerformingDrop { false };

Modified: trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp (247687 => 247688)


--- trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp	2019-07-22 17:34:55 UTC (rev 247687)
+++ trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp	2019-07-22 18:05:16 UTC (rev 247688)
@@ -438,7 +438,7 @@
     WTF_MAKE_NONCOPYABLE(AnimationPropertyWrapperBase);
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    AnimationPropertyWrapperBase(CSSPropertyID prop)
+    explicit AnimationPropertyWrapperBase(CSSPropertyID prop)
         : m_prop(prop)
     {
     }

Modified: trunk/Source/WebCore/page/ios/DOMTimerHoldingTank.h (247687 => 247688)


--- trunk/Source/WebCore/page/ios/DOMTimerHoldingTank.h	2019-07-22 17:34:55 UTC (rev 247687)
+++ trunk/Source/WebCore/page/ios/DOMTimerHoldingTank.h	2019-07-22 18:05:16 UTC (rev 247688)
@@ -53,7 +53,7 @@
 
 class DeferDOMTimersForScope {
 public:
-    DeferDOMTimersForScope(bool enable)
+    explicit DeferDOMTimersForScope(bool enable)
         : m_previousIsDeferring { s_isDeferring }
     {
         if (enable)

Modified: trunk/Source/WebCore/platform/CountedUserActivity.h (247687 => 247688)


--- trunk/Source/WebCore/platform/CountedUserActivity.h	2019-07-22 17:34:55 UTC (rev 247687)
+++ trunk/Source/WebCore/platform/CountedUserActivity.h	2019-07-22 18:05:16 UTC (rev 247688)
@@ -32,9 +32,8 @@
 
 class CountedUserActivity {
 public:
-    CountedUserActivity(const char* description)
+    explicit CountedUserActivity(const char* description)
         : m_activity(description)
-        , m_count(0)
     {
     }
 
@@ -52,7 +51,7 @@
 
 private:
     UserActivity m_activity;
-    size_t m_count;
+    size_t m_count { 0 };
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/platform/audio/DirectConvolver.h (247687 => 247688)


--- trunk/Source/WebCore/platform/audio/DirectConvolver.h	2019-07-22 17:34:55 UTC (rev 247687)
+++ trunk/Source/WebCore/platform/audio/DirectConvolver.h	2019-07-22 18:05:16 UTC (rev 247688)
@@ -35,7 +35,7 @@
 
 class DirectConvolver {
 public:
-    DirectConvolver(size_t inputBlockSize);
+    explicit DirectConvolver(size_t inputBlockSize);
 
     void process(AudioFloatArray* convolutionKernel, const float* sourceP, float* destP, size_t framesToProcess);
 

Modified: trunk/Source/WebCore/platform/audio/DownSampler.h (247687 => 247688)


--- trunk/Source/WebCore/platform/audio/DownSampler.h	2019-07-22 17:34:55 UTC (rev 247687)
+++ trunk/Source/WebCore/platform/audio/DownSampler.h	2019-07-22 18:05:16 UTC (rev 247688)
@@ -39,7 +39,7 @@
 class DownSampler {
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    DownSampler(size_t inputBlockSize);
+    explicit DownSampler(size_t inputBlockSize);
 
     // The destination buffer |destP| is of size sourceFramesToProcess / 2.
     void process(const float* sourceP, float* destP, size_t sourceFramesToProcess);

Modified: trunk/Source/WebCore/platform/audio/DynamicsCompressorKernel.h (247687 => 247688)


--- trunk/Source/WebCore/platform/audio/DynamicsCompressorKernel.h	2019-07-22 17:34:55 UTC (rev 247687)
+++ trunk/Source/WebCore/platform/audio/DynamicsCompressorKernel.h	2019-07-22 18:05:16 UTC (rev 247688)
@@ -37,7 +37,7 @@
 
 class DynamicsCompressorKernel {
 public:
-    DynamicsCompressorKernel(float sampleRate, unsigned numberOfChannels);
+    explicit DynamicsCompressorKernel(float sampleRate, unsigned numberOfChannels);
 
     void setNumberOfChannels(unsigned);
 

Modified: trunk/Source/WebCore/platform/audio/EqualPowerPanner.h (247687 => 247688)


--- trunk/Source/WebCore/platform/audio/EqualPowerPanner.h	2019-07-22 17:34:55 UTC (rev 247687)
+++ trunk/Source/WebCore/platform/audio/EqualPowerPanner.h	2019-07-22 18:05:16 UTC (rev 247688)
@@ -33,7 +33,7 @@
 
 class EqualPowerPanner : public Panner {
 public:
-    EqualPowerPanner(float sampleRate);
+    explicit EqualPowerPanner(float sampleRate);
 
     void pan(double azimuth, double elevation, const AudioBus* inputBus, AudioBus* outputBuf, size_t framesToProcess) override;
 

Modified: trunk/Source/WebCore/platform/audio/MultiChannelResampler.h (247687 => 247688)


--- trunk/Source/WebCore/platform/audio/MultiChannelResampler.h	2019-07-22 17:34:55 UTC (rev 247687)
+++ trunk/Source/WebCore/platform/audio/MultiChannelResampler.h	2019-07-22 18:05:16 UTC (rev 247688)
@@ -40,7 +40,7 @@
 class MultiChannelResampler {
     WTF_MAKE_FAST_ALLOCATED;
 public:   
-    MultiChannelResampler(double scaleFactor, unsigned numberOfChannels);
+    explicit MultiChannelResampler(double scaleFactor, unsigned numberOfChannels);
     
     // Process given AudioSourceProvider for streaming applications.
     void process(AudioSourceProvider*, AudioBus* destination, size_t framesToProcess);

Modified: trunk/Source/WebCore/platform/audio/ReverbAccumulationBuffer.h (247687 => 247688)


--- trunk/Source/WebCore/platform/audio/ReverbAccumulationBuffer.h	2019-07-22 17:34:55 UTC (rev 247687)
+++ trunk/Source/WebCore/platform/audio/ReverbAccumulationBuffer.h	2019-07-22 18:05:16 UTC (rev 247688)
@@ -38,7 +38,7 @@
 // just read from the buffer, so it will be ready for accumulation the next time around.
 class ReverbAccumulationBuffer {
 public:
-    ReverbAccumulationBuffer(size_t length);
+    explicit ReverbAccumulationBuffer(size_t length);
 
     // This will read from, then clear-out numberOfFrames
     void readAndClear(float* destination, size_t numberOfFrames);

Modified: trunk/Source/WebCore/platform/audio/ReverbInputBuffer.h (247687 => 247688)


--- trunk/Source/WebCore/platform/audio/ReverbInputBuffer.h	2019-07-22 17:34:55 UTC (rev 247687)
+++ trunk/Source/WebCore/platform/audio/ReverbInputBuffer.h	2019-07-22 18:05:16 UTC (rev 247688)
@@ -36,7 +36,7 @@
 // ReverbInputBuffer is used to buffer input samples for deferred processing by the background threads.
 class ReverbInputBuffer {
 public:
-    ReverbInputBuffer(size_t length);
+    explicit ReverbInputBuffer(size_t length);
 
     // The realtime audio thread keeps writing samples here.
     // The assumption is that the buffer's length is evenly divisible by numberOfFrames (for nearly all cases this will be fine).

Modified: trunk/Source/WebCore/platform/audio/SincResampler.cpp (247687 => 247688)


--- trunk/Source/WebCore/platform/audio/SincResampler.cpp	2019-07-22 17:34:55 UTC (rev 247687)
+++ trunk/Source/WebCore/platform/audio/SincResampler.cpp	2019-07-22 18:05:16 UTC (rev 247688)
@@ -146,7 +146,7 @@
 
 class BufferSourceProvider : public AudioSourceProvider {
 public:
-    BufferSourceProvider(const float* source, size_t numberOfSourceFrames)
+    explicit BufferSourceProvider(const float* source, size_t numberOfSourceFrames)
         : m_source(source)
         , m_sourceFramesAvailable(numberOfSourceFrames)
     {

Modified: trunk/Source/WebCore/platform/audio/UpSampler.h (247687 => 247688)


--- trunk/Source/WebCore/platform/audio/UpSampler.h	2019-07-22 17:34:55 UTC (rev 247687)
+++ trunk/Source/WebCore/platform/audio/UpSampler.h	2019-07-22 18:05:16 UTC (rev 247688)
@@ -39,7 +39,7 @@
 class UpSampler {
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    UpSampler(size_t inputBlockSize);
+    explicit UpSampler(size_t inputBlockSize);
 
     // The destination buffer |destP| is of size sourceFramesToProcess * 2.
     void process(const float* sourceP, float* destP, size_t sourceFramesToProcess);

Modified: trunk/Source/WebCore/platform/audio/ios/AudioFileReaderIOS.h (247687 => 247688)


--- trunk/Source/WebCore/platform/audio/ios/AudioFileReaderIOS.h	2019-07-22 17:34:55 UTC (rev 247687)
+++ trunk/Source/WebCore/platform/audio/ios/AudioFileReaderIOS.h	2019-07-22 18:05:16 UTC (rev 247688)
@@ -43,8 +43,8 @@
 
 class AudioFileReader {
 public:
-    AudioFileReader(const char* filePath);
-    AudioFileReader(const void* data, size_t dataSize);
+    explicit AudioFileReader(const char* filePath);
+    explicit AudioFileReader(const void* data, size_t dataSize);
     ~AudioFileReader();
 
     RefPtr<AudioBus> createBus(float sampleRate, bool mixToMono); // Returns nullptr on error

Modified: trunk/Source/WebCore/platform/audio/mac/AudioFileReaderMac.h (247687 => 247688)


--- trunk/Source/WebCore/platform/audio/mac/AudioFileReaderMac.h	2019-07-22 17:34:55 UTC (rev 247687)
+++ trunk/Source/WebCore/platform/audio/mac/AudioFileReaderMac.h	2019-07-22 18:05:16 UTC (rev 247688)
@@ -41,8 +41,8 @@
 
 class AudioFileReader {
 public:
-    AudioFileReader(const char* filePath);
-    AudioFileReader(const void* data, size_t dataSize);
+    explicit AudioFileReader(const char* filePath);
+    explicit AudioFileReader(const void* data, size_t dataSize);
     ~AudioFileReader();
 
     // Returns nullptr if error

Modified: trunk/Source/WebCore/platform/audio/mac/AudioSessionMac.cpp (247687 => 247688)


--- trunk/Source/WebCore/platform/audio/mac/AudioSessionMac.cpp	2019-07-22 17:34:55 UTC (rev 247687)
+++ trunk/Source/WebCore/platform/audio/mac/AudioSessionMac.cpp	2019-07-22 18:05:16 UTC (rev 247688)
@@ -55,7 +55,7 @@
 class AudioSessionPrivate {
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    AudioSessionPrivate(bool mutedState)
+    explicit AudioSessionPrivate(bool mutedState)
         : lastMutedState(mutedState) { }
     bool lastMutedState;
     AudioSession::CategoryType category { AudioSession::None };

Modified: trunk/Source/WebCore/platform/cf/KeyedDecoderCF.h (247687 => 247688)


--- trunk/Source/WebCore/platform/cf/KeyedDecoderCF.h	2019-07-22 17:34:55 UTC (rev 247687)
+++ trunk/Source/WebCore/platform/cf/KeyedDecoderCF.h	2019-07-22 18:05:16 UTC (rev 247688)
@@ -34,7 +34,7 @@
 
 class KeyedDecoderCF final : public KeyedDecoder {
 public:
-    KeyedDecoderCF(const uint8_t* data, size_t);
+    explicit KeyedDecoderCF(const uint8_t* data, size_t);
     ~KeyedDecoderCF() override;
 
 private:

Modified: trunk/Source/WebCore/platform/graphics/WidthIterator.cpp (247687 => 247688)


--- trunk/Source/WebCore/platform/graphics/WidthIterator.cpp	2019-07-22 17:34:55 UTC (rev 247687)
+++ trunk/Source/WebCore/platform/graphics/WidthIterator.cpp	2019-07-22 18:05:16 UTC (rev 247688)
@@ -65,7 +65,7 @@
 
 struct OriginalAdvancesForCharacterTreatedAsSpace {
 public:
-    OriginalAdvancesForCharacterTreatedAsSpace(bool isSpace, float advanceBefore, float advanceAt)
+    explicit OriginalAdvancesForCharacterTreatedAsSpace(bool isSpace, float advanceBefore, float advanceAt)
         : characterIsSpace(isSpace)
         , advanceBeforeCharacter(advanceBefore)
         , advanceAtCharacter(advanceAt)

Modified: trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.h (247687 => 247688)


--- trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.h	2019-07-22 17:34:55 UTC (rev 247687)
+++ trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.h	2019-07-22 18:05:16 UTC (rev 247688)
@@ -35,7 +35,7 @@
 namespace WebCore {
 
 struct SynthesisPair {
-    SynthesisPair(bool needsSyntheticBold, bool needsSyntheticOblique)
+    explicit SynthesisPair(bool needsSyntheticBold, bool needsSyntheticOblique)
         : needsSyntheticBold(needsSyntheticBold)
         , needsSyntheticOblique(needsSyntheticOblique)
     {

Modified: trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h (247687 => 247688)


--- trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h	2019-07-22 17:34:55 UTC (rev 247687)
+++ trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h	2019-07-22 18:05:16 UTC (rev 247688)
@@ -162,7 +162,7 @@
 
 class DrawingItem : public Item {
 public:
-    DrawingItem(ItemType type)
+    explicit DrawingItem(ItemType type)
         : Item(type)
     {
     }

Modified: trunk/Source/WebCore/platform/network/cf/ResourceRequest.h (247687 => 247688)


--- trunk/Source/WebCore/platform/network/cf/ResourceRequest.h	2019-07-22 17:34:55 UTC (rev 247687)
+++ trunk/Source/WebCore/platform/network/cf/ResourceRequest.h	2019-07-22 18:05:16 UTC (rev 247688)
@@ -41,7 +41,7 @@
 
 class ResourceRequest : public ResourceRequestBase {
 public:
-    ResourceRequest(const String& url) 
+    explicit ResourceRequest(const String& url) 
         : ResourceRequestBase(URL({ }, url), ResourceRequestCachePolicy::UseProtocolCachePolicy)
     {
     }

Modified: trunk/Source/WebCore/platform/text/TextCodecICU.h (247687 => 247688)


--- trunk/Source/WebCore/platform/text/TextCodecICU.h	2019-07-22 17:34:55 UTC (rev 247687)
+++ trunk/Source/WebCore/platform/text/TextCodecICU.h	2019-07-22 18:05:16 UTC (rev 247688)
@@ -35,7 +35,7 @@
 
 class TextCodecICU : public TextCodec {
 public:
-    TextCodecICU(const char* encoding, const char* canonicalConverterName);
+    explicit TextCodecICU(const char* encoding, const char* canonicalConverterName);
     virtual ~TextCodecICU();
 
     static void registerEncodingNames(EncodingNameRegistrar);

Modified: trunk/Source/WebCore/rendering/RenderTableSection.h (247687 => 247688)


--- trunk/Source/WebCore/rendering/RenderTableSection.h	2019-07-22 17:34:55 UTC (rev 247687)
+++ trunk/Source/WebCore/rendering/RenderTableSection.h	2019-07-22 18:05:16 UTC (rev 247688)
@@ -42,7 +42,7 @@
 // Helper class for paintObject.
 struct CellSpan {
 public:
-    CellSpan(unsigned start, unsigned end)
+    explicit CellSpan(unsigned start, unsigned end)
         : start(start)
         , end(end)
     {

Modified: trunk/Source/WebCore/rendering/shapes/RasterShape.cpp (247687 => 247688)


--- trunk/Source/WebCore/rendering/shapes/RasterShape.cpp	2019-07-22 17:34:55 UTC (rev 247687)
+++ trunk/Source/WebCore/rendering/shapes/RasterShape.cpp	2019-07-22 18:05:16 UTC (rev 247688)
@@ -36,7 +36,7 @@
 
 class MarginIntervalGenerator {
 public:
-    MarginIntervalGenerator(unsigned radius);
+    explicit MarginIntervalGenerator(unsigned radius);
     void set(int y, const IntShapeInterval&);
     IntShapeInterval intervalAt(int y) const;
 

Modified: trunk/Source/WebCore/rendering/shapes/RasterShape.h (247687 => 247688)


--- trunk/Source/WebCore/rendering/shapes/RasterShape.h	2019-07-22 17:34:55 UTC (rev 247687)
+++ trunk/Source/WebCore/rendering/shapes/RasterShape.h	2019-07-22 18:05:16 UTC (rev 247688)
@@ -40,7 +40,7 @@
 class RasterShapeIntervals {
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    RasterShapeIntervals(unsigned size, int offset = 0)
+    explicit RasterShapeIntervals(unsigned size, int offset = 0)
         : m_offset(offset)
     {
         m_intervals.resize(clampTo<int>(size));

Modified: trunk/Source/WebCore/testing/MockLibWebRTCPeerConnection.h (247687 => 247688)


--- trunk/Source/WebCore/testing/MockLibWebRTCPeerConnection.h	2019-07-22 17:34:55 UTC (rev 247687)
+++ trunk/Source/WebCore/testing/MockLibWebRTCPeerConnection.h	2019-07-22 18:05:16 UTC (rev 247688)
@@ -112,7 +112,7 @@
 
 class MockLibWebRTCIceCandidate : public webrtc::IceCandidateInterface {
 public:
-    MockLibWebRTCIceCandidate(const char* sdp, const char* sdpMid)
+    explicit MockLibWebRTCIceCandidate(const char* sdp, const char* sdpMid)
         : m_sdp(sdp)
         , m_sdpMid(sdpMid) { }
 

Modified: trunk/Source/WebKit/ChangeLog (247687 => 247688)


--- trunk/Source/WebKit/ChangeLog	2019-07-22 17:34:55 UTC (rev 247687)
+++ trunk/Source/WebKit/ChangeLog	2019-07-22 18:05:16 UTC (rev 247688)
@@ -1,3 +1,17 @@
+2019-07-22  Simon Fraser  <simon.fra...@apple.com>
+
+        Make some constructors explicit
+        https://bugs.webkit.org/show_bug.cgi?id=199981
+
+        Reviewed by Daniel Bates.
+
+        Make explicit public constructors of objects that take POD or String& arguments,
+        to reduce the changes of the compiler doing implicit conversions.
+
+        * Platform/Module.h:
+        * WebProcess/WebPage/WebInspector.cpp:
+        (WebKit::WebInspector::openInNewTab):
+
 2019-07-22  Daniel Bates  <daba...@apple.com>
 
         [iOS] REGRESSION (r241734): Autocorrection highlight should hide when field becomes defocused

Modified: trunk/Source/WebKit/Platform/Module.h (247687 => 247688)


--- trunk/Source/WebKit/Platform/Module.h	2019-07-22 17:34:55 UTC (rev 247687)
+++ trunk/Source/WebKit/Platform/Module.h	2019-07-22 18:05:16 UTC (rev 247688)
@@ -46,7 +46,7 @@
 class Module {
     WTF_MAKE_NONCOPYABLE(Module);
 public:
-    Module(const String& path);
+    explicit Module(const String& path);
     ~Module();
 
     bool load();

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebInspector.cpp (247687 => 247688)


--- trunk/Source/WebKit/WebProcess/WebPage/WebInspector.cpp	2019-07-22 17:34:55 UTC (rev 247687)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebInspector.cpp	2019-07-22 18:05:16 UTC (rev 247688)
@@ -167,7 +167,7 @@
         return;
 
     Frame& inspectedMainFrame = inspectedPage->mainFrame();
-    FrameLoadRequest frameLoadRequest { *inspectedMainFrame.document(), inspectedMainFrame.document()->securityOrigin(), { urlString }, "_blank"_s, LockHistory::No, LockBackForwardList::No, MaybeSendReferrer, AllowNavigationToInvalidURL::Yes, NewFrameOpenerPolicy::Allow, ShouldOpenExternalURLsPolicy::ShouldNotAllow, InitiatedByMainFrame::Unknown };
+    FrameLoadRequest frameLoadRequest { *inspectedMainFrame.document(), inspectedMainFrame.document()->securityOrigin(), ResourceRequest { urlString }, "_blank"_s, LockHistory::No, LockBackForwardList::No, MaybeSendReferrer, AllowNavigationToInvalidURL::Yes, NewFrameOpenerPolicy::Allow, ShouldOpenExternalURLsPolicy::ShouldNotAllow, InitiatedByMainFrame::Unknown };
 
     NavigationAction action { *inspectedMainFrame.document(), frameLoadRequest.resourceRequest(), frameLoadRequest.initiatedByMainFrame(), NavigationType::LinkClicked };
     Page* newPage = inspectedPage->chrome().createWindow(inspectedMainFrame, frameLoadRequest, { }, action);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to