Changeset 247688 in webkit


Ignore:
Timestamp:
Jul 22, 2019 11:05:16 AM (5 years ago)
Author:
Simon Fraser
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):

Location:
trunk/Source
Files:
47 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r247681 r247688  
     12019-07-22  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Make some constructors explicit
     4        https://bugs.webkit.org/show_bug.cgi?id=199981
     5
     6        Reviewed by Daniel Bates.
     7
     8        Make explicit public constructors of objects that take POD or String& arguments,
     9        to reduce the changes of the compiler doing implicit conversions.
     10
     11        * Modules/indexeddb/server/IndexValueEntry.h:
     12        * Modules/indexeddb/server/IndexValueStore.h:
     13        * Modules/indexeddb/shared/IDBDatabaseInfo.h:
     14        * Modules/webdatabase/ChangeVersionData.h:
     15        (WebCore::ChangeVersionData::ChangeVersionData):
     16        * Modules/webdatabase/OriginLock.h:
     17        * Modules/websockets/WebSocketExtensionParser.h:
     18        (WebCore::WebSocketExtensionParser::WebSocketExtensionParser):
     19        * bindings/js/ScriptCachedFrameData.h:
     20        * contentextensions/URLFilterParser.cpp:
     21        (WebCore::ContentExtensions::PatternParser::PatternParser):
     22        * css/parser/CSSTokenizer.h:
     23        * css/parser/SizesAttributeParser.h:
     24        * dom/SpaceSplitString.cpp:
     25        (WebCore::TokenIsEqualToCStringTokenProcessor::TokenIsEqualToCStringTokenProcessor):
     26        * html/FormController.cpp:
     27        (WebCore::SavedFormState::appendControlState):
     28        (WebCore::SavedFormState::takeControlState):
     29        * loader/ProgressTracker.cpp:
     30        (WebCore::ProgressItem::ProgressItem):
     31        * page/DragController.cpp:
     32        (WebCore::DragController::DragController):
     33        (WebCore::DragController::performDragOperation):
     34        * page/DragController.h:
     35        * page/animation/CSSPropertyAnimation.cpp:
     36        (WebCore::AnimationPropertyWrapperBase::AnimationPropertyWrapperBase):
     37        * page/ios/DOMTimerHoldingTank.h:
     38        (WebCore::DeferDOMTimersForScope::DeferDOMTimersForScope):
     39        * platform/CountedUserActivity.h:
     40        (WebCore::CountedUserActivity::CountedUserActivity):
     41        * platform/audio/DirectConvolver.h:
     42        * platform/audio/DownSampler.h:
     43        * platform/audio/DynamicsCompressorKernel.h:
     44        * platform/audio/EqualPowerPanner.h:
     45        * platform/audio/MultiChannelResampler.h:
     46        * platform/audio/ReverbAccumulationBuffer.h:
     47        * platform/audio/ReverbInputBuffer.h:
     48        * platform/audio/SincResampler.cpp:
     49        * platform/audio/UpSampler.h:
     50        * platform/audio/ios/AudioFileReaderIOS.h:
     51        * platform/audio/mac/AudioFileReaderMac.h:
     52        * platform/audio/mac/AudioSessionMac.cpp:
     53        (WebCore::AudioSessionPrivate::AudioSessionPrivate):
     54        * platform/cf/KeyedDecoderCF.h:
     55        * platform/graphics/WidthIterator.cpp:
     56        (WebCore::OriginalAdvancesForCharacterTreatedAsSpace::OriginalAdvancesForCharacterTreatedAsSpace):
     57        * platform/graphics/cocoa/FontCacheCoreText.h:
     58        (WebCore::SynthesisPair::SynthesisPair):
     59        * platform/graphics/displaylists/DisplayListItems.h:
     60        (WebCore::DisplayList::DrawingItem::DrawingItem):
     61        * platform/network/cf/ResourceRequest.h:
     62        (WebCore::ResourceRequest::ResourceRequest):
     63        * platform/text/TextCodecICU.h:
     64        * rendering/RenderTableSection.h:
     65        (WebCore::CellSpan::CellSpan):
     66        * rendering/shapes/RasterShape.cpp:
     67        * rendering/shapes/RasterShape.h:
     68        (WebCore::RasterShapeIntervals::RasterShapeIntervals):
     69        * testing/MockLibWebRTCPeerConnection.h:
     70        (WebCore::MockLibWebRTCIceCandidate::MockLibWebRTCIceCandidate):
     71
    1722019-07-22  Rob Buis  <rbuis@igalia.com>
    273
  • trunk/Source/WebCore/Modules/indexeddb/server/IndexValueEntry.h

    r241183 r247688  
    4141    WTF_MAKE_FAST_ALLOCATED;
    4242public:
    43     IndexValueEntry(bool unique);
     43    explicit IndexValueEntry(bool unique);
    4444    ~IndexValueEntry();
    4545
  • trunk/Source/WebCore/Modules/indexeddb/server/IndexValueStore.h

    r241183 r247688  
    4848    WTF_MAKE_FAST_ALLOCATED;
    4949public:
    50     IndexValueStore(bool unique);
     50    explicit IndexValueStore(bool unique);
    5151
    5252    const IDBKeyData* lowestValueForKey(const IDBKeyData&) const;
  • trunk/Source/WebCore/Modules/indexeddb/shared/IDBDatabaseInfo.h

    r241183 r247688  
    3636    WTF_MAKE_FAST_ALLOCATED;
    3737public:
    38     IDBDatabaseInfo(const String& name, uint64_t version);
     38    explicit IDBDatabaseInfo(const String& name, uint64_t version);
    3939
    4040    enum IsolatedCopyTag { IsolatedCopy };
  • trunk/Source/WebCore/Modules/webdatabase/ChangeVersionData.h

    r208646 r247688  
    3232class ChangeVersionData {
    3333public:
    34     ChangeVersionData(String oldVersion, String newVersion)
     34    explicit ChangeVersionData(String oldVersion, String newVersion)
    3535        : m_oldVersion(oldVersion), m_newVersion(newVersion) { }
    3636
  • trunk/Source/WebCore/Modules/webdatabase/OriginLock.h

    r240437 r247688  
    3636    WTF_MAKE_NONCOPYABLE(OriginLock); WTF_MAKE_FAST_ALLOCATED;
    3737public:
    38     OriginLock(String originPath);
     38    explicit OriginLock(String originPath);
    3939    WEBCORE_EXPORT ~OriginLock();
    4040
  • trunk/Source/WebCore/Modules/websockets/WebSocketExtensionParser.h

    r220250 r247688  
    3939class WebSocketExtensionParser {
    4040public:
    41     WebSocketExtensionParser(const char* start, const char* end)
     41    explicit WebSocketExtensionParser(const char* start, const char* end)
    4242        : m_current(start)
    4343        , m_end(end)
  • trunk/Source/WebCore/PAL/ChangeLog

    r247674 r247688  
     12019-07-22  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Make some constructors explicit
     4        https://bugs.webkit.org/show_bug.cgi?id=199981
     5
     6        Reviewed by Daniel Bates.
     7
     8        Make explicit public constructors of objects that take POD or String& arguments,
     9        to reduce the changes of the compiler doing implicit conversions.
     10
     11        * pal/system/cocoa/SleepDisablerCocoa.cpp:
     12        (PAL::SleepDisablerCocoa::SleepDisablerCocoa):
     13        * pal/system/cocoa/SleepDisablerCocoa.h:
     14
    1152019-07-21  Myles C. Maxfield  <mmaxfield@apple.com>
    216
  • trunk/Source/WebCore/PAL/pal/system/cocoa/SleepDisablerCocoa.cpp

    r220759 r247688  
    4141SleepDisablerCocoa::SleepDisablerCocoa(const char* reason, Type type)
    4242    : SleepDisabler(reason, type)
    43     , m_sleepAssertion(0)
    4443{
    4544    RetainPtr<CFStringRef> reasonCF = adoptCF(CFStringCreateWithCString(kCFAllocatorDefault, reason, kCFStringEncodingUTF8));
  • trunk/Source/WebCore/PAL/pal/system/cocoa/SleepDisablerCocoa.h

    r220759 r247688  
    3434class SleepDisablerCocoa : public SleepDisabler {
    3535public:
    36     SleepDisablerCocoa(const char*, Type);
     36    explicit SleepDisablerCocoa(const char*, Type);
    3737    virtual ~SleepDisablerCocoa();
    3838
    3939private:
    40     uint32_t m_sleepAssertion;
     40    uint32_t m_sleepAssertion { 0 };
    4141};
    4242
  • trunk/Source/WebCore/bindings/js/ScriptCachedFrameData.h

    r228218 r247688  
    4444    WTF_MAKE_NONCOPYABLE(ScriptCachedFrameData); WTF_MAKE_FAST_ALLOCATED;
    4545public:
    46     ScriptCachedFrameData(Frame&);
     46    explicit ScriptCachedFrameData(Frame&);
    4747    ~ScriptCachedFrameData();
    4848
  • trunk/Source/WebCore/contentextensions/URLFilterParser.cpp

    r241316 r247688  
    4141class PatternParser {
    4242public:
    43     PatternParser(bool patternIsCaseSensitive)
     43    explicit PatternParser(bool patternIsCaseSensitive)
    4444        : m_patternIsCaseSensitive(patternIsCaseSensitive)
    4545        , m_parseStatus(URLFilterParser::Ok)
  • trunk/Source/WebCore/css/parser/CSSTokenizer.h

    r209826 r247688  
    4646    WTF_MAKE_FAST_ALLOCATED;
    4747public:
    48     CSSTokenizer(const String&);
     48    explicit CSSTokenizer(const String&);
    4949    CSSTokenizer(const String&, CSSParserObserverWrapper&); // For the inspector
    5050
  • trunk/Source/WebCore/css/parser/SizesAttributeParser.h

    r218588 r247688  
    4242class SizesAttributeParser {
    4343public:
    44     SizesAttributeParser(const String&, const Document&);
     44    explicit SizesAttributeParser(const String&, const Document&);
    4545
    4646    float length();
  • trunk/Source/WebCore/dom/SpaceSplitString.cpp

    r246490 r247688  
    104104class TokenIsEqualToCStringTokenProcessor {
    105105public:
    106     TokenIsEqualToCStringTokenProcessor(const char* referenceString, unsigned referenceStringLength)
     106    explicit TokenIsEqualToCStringTokenProcessor(const char* referenceString, unsigned referenceStringLength)
    107107        : m_referenceString(referenceString)
    108108        , m_referenceStringLength(referenceStringLength)
  • trunk/Source/WebCore/html/FormController.cpp

    r246636 r247688  
    8080class FormElementKey {
    8181public:
    82     FormElementKey(AtomStringImpl* = 0, AtomStringImpl* = 0);
     82    explicit FormElementKey(AtomStringImpl* = nullptr, AtomStringImpl* = nullptr);
    8383    ~FormElementKey();
    8484    FormElementKey(const FormElementKey&);
     
    230230void SavedFormState::appendControlState(const AtomString& name, const AtomString& type, const FormControlState& state)
    231231{
    232     m_stateForNewFormElements.add({ name.impl(), type.impl() }, Deque<FormControlState> { }).iterator->value.append(state);
     232    m_stateForNewFormElements.add(FormElementKey { name.impl(), type.impl() }, Deque<FormControlState> { }).iterator->value.append(state);
    233233    ++m_controlStateCount;
    234234}
     
    236236FormControlState SavedFormState::takeControlState(const AtomString& name, const AtomString& type)
    237237{
    238     auto iterator = m_stateForNewFormElements.find({ name.impl(), type.impl() });
     238    auto iterator = m_stateForNewFormElements.find(FormElementKey { name.impl(), type.impl() });
    239239    if (iterator == m_stateForNewFormElements.end())
    240240        return { };
  • trunk/Source/WebCore/loader/ProgressTracker.cpp

    r239457 r247688  
    6666    WTF_MAKE_NONCOPYABLE(ProgressItem); WTF_MAKE_FAST_ALLOCATED;
    6767public:
    68     ProgressItem(long long length)
     68    explicit ProgressItem(long long length)
    6969        : bytesReceived(0)
    7070        , estimatedLength(length)
  • trunk/Source/WebCore/page/DragController.cpp

    r247416 r247688  
    136136    : m_page(page)
    137137    , m_client(client)
    138     , m_numberOfItemsToBeAccepted(0)
    139     , m_dragHandlingMethod(DragHandlingMethod::None)
    140     , m_dragDestinationAction(DragDestinationActionNone)
    141     , m_dragSourceAction(DragSourceActionNone)
    142     , m_didInitiateDrag(false)
    143     , m_sourceDragOperation(DragOperationNone)
    144138{
    145139}
     
    285279
    286280    m_client.willPerformDragDestinationAction(DragDestinationActionLoad, dragData);
    287     FrameLoadRequest frameLoadRequest { m_page.mainFrame(), { urlString }, shouldOpenExternalURLsPolicy };
     281    FrameLoadRequest frameLoadRequest { m_page.mainFrame(), ResourceRequest { urlString }, shouldOpenExternalURLsPolicy };
    288282    frameLoadRequest.setIsRequestFromClientOrUserInput();
    289283    m_page.mainFrame().loader().load(WTFMove(frameLoadRequest));
  • trunk/Source/WebCore/page/DragController.h

    r239039 r247688  
    143143        RefPtr<Document> m_dragInitiator; // The Document (if any) that initiated the drag.
    144144        RefPtr<HTMLInputElement> m_fileInputElementUnderMouse;
    145         unsigned m_numberOfItemsToBeAccepted;
     145        unsigned m_numberOfItemsToBeAccepted { 0 };
    146146        DragHandlingMethod m_dragHandlingMethod { DragHandlingMethod::None };
    147147
    148         DragDestinationAction m_dragDestinationAction;
    149         DragSourceAction m_dragSourceAction;
    150         bool m_didInitiateDrag;
    151         DragOperation m_sourceDragOperation; // Set in startDrag when a drag starts from a mouse down within WebKit
     148        DragDestinationAction m_dragDestinationAction { DragDestinationActionNone };
     149        DragSourceAction m_dragSourceAction { DragSourceActionNone };
     150        bool m_didInitiateDrag { false };
     151        DragOperation m_sourceDragOperation { DragOperationNone }; // Set in startDrag when a drag starts from a mouse down within WebKit
    152152        IntPoint m_dragOffset;
    153153        URL m_draggingImageURL;
  • trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp

    r239535 r247688  
    439439    WTF_MAKE_FAST_ALLOCATED;
    440440public:
    441     AnimationPropertyWrapperBase(CSSPropertyID prop)
     441    explicit AnimationPropertyWrapperBase(CSSPropertyID prop)
    442442        : m_prop(prop)
    443443    {
  • trunk/Source/WebCore/page/ios/DOMTimerHoldingTank.h

    r247530 r247688  
    5454class DeferDOMTimersForScope {
    5555public:
    56     DeferDOMTimersForScope(bool enable)
     56    explicit DeferDOMTimersForScope(bool enable)
    5757        : m_previousIsDeferring { s_isDeferring }
    5858    {
  • trunk/Source/WebCore/platform/CountedUserActivity.h

    r164916 r247688  
    3333class CountedUserActivity {
    3434public:
    35     CountedUserActivity(const char* description)
     35    explicit CountedUserActivity(const char* description)
    3636        : m_activity(description)
    37         , m_count(0)
    3837    {
    3938    }
     
    5352private:
    5453    UserActivity m_activity;
    55     size_t m_count;
     54    size_t m_count { 0 };
    5655};
    5756
  • trunk/Source/WebCore/platform/audio/DirectConvolver.h

    r172431 r247688  
    3636class DirectConvolver {
    3737public:
    38     DirectConvolver(size_t inputBlockSize);
     38    explicit DirectConvolver(size_t inputBlockSize);
    3939
    4040    void process(AudioFloatArray* convolutionKernel, const float* sourceP, float* destP, size_t framesToProcess);
  • trunk/Source/WebCore/platform/audio/DownSampler.h

    r241183 r247688  
    4040    WTF_MAKE_FAST_ALLOCATED;
    4141public:
    42     DownSampler(size_t inputBlockSize);
     42    explicit DownSampler(size_t inputBlockSize);
    4343
    4444    // The destination buffer |destP| is of size sourceFramesToProcess / 2.
  • trunk/Source/WebCore/platform/audio/DynamicsCompressorKernel.h

    r218799 r247688  
    3838class DynamicsCompressorKernel {
    3939public:
    40     DynamicsCompressorKernel(float sampleRate, unsigned numberOfChannels);
     40    explicit DynamicsCompressorKernel(float sampleRate, unsigned numberOfChannels);
    4141
    4242    void setNumberOfChannels(unsigned);
  • trunk/Source/WebCore/platform/audio/EqualPowerPanner.h

    r197563 r247688  
    3434class EqualPowerPanner : public Panner {
    3535public:
    36     EqualPowerPanner(float sampleRate);
     36    explicit EqualPowerPanner(float sampleRate);
    3737
    3838    void pan(double azimuth, double elevation, const AudioBus* inputBus, AudioBus* outputBuf, size_t framesToProcess) override;
  • trunk/Source/WebCore/platform/audio/MultiChannelResampler.h

    r241183 r247688  
    4141    WTF_MAKE_FAST_ALLOCATED;
    4242public:   
    43     MultiChannelResampler(double scaleFactor, unsigned numberOfChannels);
     43    explicit MultiChannelResampler(double scaleFactor, unsigned numberOfChannels);
    4444   
    4545    // Process given AudioSourceProvider for streaming applications.
  • trunk/Source/WebCore/platform/audio/ReverbAccumulationBuffer.h

    r165676 r247688  
    3939class ReverbAccumulationBuffer {
    4040public:
    41     ReverbAccumulationBuffer(size_t length);
     41    explicit ReverbAccumulationBuffer(size_t length);
    4242
    4343    // This will read from, then clear-out numberOfFrames
  • trunk/Source/WebCore/platform/audio/ReverbInputBuffer.h

    r165676 r247688  
    3737class ReverbInputBuffer {
    3838public:
    39     ReverbInputBuffer(size_t length);
     39    explicit ReverbInputBuffer(size_t length);
    4040
    4141    // The realtime audio thread keeps writing samples here.
  • trunk/Source/WebCore/platform/audio/SincResampler.cpp

    r239535 r247688  
    147147class BufferSourceProvider : public AudioSourceProvider {
    148148public:
    149     BufferSourceProvider(const float* source, size_t numberOfSourceFrames)
     149    explicit BufferSourceProvider(const float* source, size_t numberOfSourceFrames)
    150150        : m_source(source)
    151151        , m_sourceFramesAvailable(numberOfSourceFrames)
  • trunk/Source/WebCore/platform/audio/UpSampler.h

    r241183 r247688  
    4040    WTF_MAKE_FAST_ALLOCATED;
    4141public:
    42     UpSampler(size_t inputBlockSize);
     42    explicit UpSampler(size_t inputBlockSize);
    4343
    4444    // The destination buffer |destP| is of size sourceFramesToProcess * 2.
  • trunk/Source/WebCore/platform/audio/ios/AudioFileReaderIOS.h

    r237266 r247688  
    4444class AudioFileReader {
    4545public:
    46     AudioFileReader(const char* filePath);
    47     AudioFileReader(const void* data, size_t dataSize);
     46    explicit AudioFileReader(const char* filePath);
     47    explicit AudioFileReader(const void* data, size_t dataSize);
    4848    ~AudioFileReader();
    4949
  • trunk/Source/WebCore/platform/audio/mac/AudioFileReaderMac.h

    r216679 r247688  
    4242class AudioFileReader {
    4343public:
    44     AudioFileReader(const char* filePath);
    45     AudioFileReader(const void* data, size_t dataSize);
     44    explicit AudioFileReader(const char* filePath);
     45    explicit AudioFileReader(const void* data, size_t dataSize);
    4646    ~AudioFileReader();
    4747
  • trunk/Source/WebCore/platform/audio/mac/AudioSessionMac.cpp

    r244223 r247688  
    5656    WTF_MAKE_FAST_ALLOCATED;
    5757public:
    58     AudioSessionPrivate(bool mutedState)
     58    explicit AudioSessionPrivate(bool mutedState)
    5959        : lastMutedState(mutedState) { }
    6060    bool lastMutedState;
  • trunk/Source/WebCore/platform/cf/KeyedDecoderCF.h

    r235673 r247688  
    3535class KeyedDecoderCF final : public KeyedDecoder {
    3636public:
    37     KeyedDecoderCF(const uint8_t* data, size_t);
     37    explicit KeyedDecoderCF(const uint8_t* data, size_t);
    3838    ~KeyedDecoderCF() override;
    3939
  • trunk/Source/WebCore/platform/graphics/WidthIterator.cpp

    r247102 r247688  
    6666struct OriginalAdvancesForCharacterTreatedAsSpace {
    6767public:
    68     OriginalAdvancesForCharacterTreatedAsSpace(bool isSpace, float advanceBefore, float advanceAt)
     68    explicit OriginalAdvancesForCharacterTreatedAsSpace(bool isSpace, float advanceBefore, float advanceAt)
    6969        : characterIsSpace(isSpace)
    7070        , advanceBeforeCharacter(advanceBefore)
  • trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.h

    r247377 r247688  
    3636
    3737struct SynthesisPair {
    38     SynthesisPair(bool needsSyntheticBold, bool needsSyntheticOblique)
     38    explicit SynthesisPair(bool needsSyntheticBold, bool needsSyntheticOblique)
    3939        : needsSyntheticBold(needsSyntheticBold)
    4040        , needsSyntheticOblique(needsSyntheticOblique)
  • trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h

    r239427 r247688  
    163163class DrawingItem : public Item {
    164164public:
    165     DrawingItem(ItemType type)
     165    explicit DrawingItem(ItemType type)
    166166        : Item(type)
    167167    {
  • trunk/Source/WebCore/platform/network/cf/ResourceRequest.h

    r237266 r247688  
    4242class ResourceRequest : public ResourceRequestBase {
    4343public:
    44     ResourceRequest(const String& url)
     44    explicit ResourceRequest(const String& url)
    4545        : ResourceRequestBase(URL({ }, url), ResourceRequestCachePolicy::UseProtocolCachePolicy)
    4646    {
  • trunk/Source/WebCore/platform/text/TextCodecICU.h

    r241183 r247688  
    3636class TextCodecICU : public TextCodec {
    3737public:
    38     TextCodecICU(const char* encoding, const char* canonicalConverterName);
     38    explicit TextCodecICU(const char* encoding, const char* canonicalConverterName);
    3939    virtual ~TextCodecICU();
    4040
  • trunk/Source/WebCore/rendering/RenderTableSection.h

    r239427 r247688  
    4343struct CellSpan {
    4444public:
    45     CellSpan(unsigned start, unsigned end)
     45    explicit CellSpan(unsigned start, unsigned end)
    4646        : start(start)
    4747        , end(end)
  • trunk/Source/WebCore/rendering/shapes/RasterShape.cpp

    r172357 r247688  
    3737class MarginIntervalGenerator {
    3838public:
    39     MarginIntervalGenerator(unsigned radius);
     39    explicit MarginIntervalGenerator(unsigned radius);
    4040    void set(int y, const IntShapeInterval&);
    4141    IntShapeInterval intervalAt(int y) const;
  • trunk/Source/WebCore/rendering/shapes/RasterShape.h

    r208668 r247688  
    4141    WTF_MAKE_FAST_ALLOCATED;
    4242public:
    43     RasterShapeIntervals(unsigned size, int offset = 0)
     43    explicit RasterShapeIntervals(unsigned size, int offset = 0)
    4444        : m_offset(offset)
    4545    {
  • trunk/Source/WebCore/testing/MockLibWebRTCPeerConnection.h

    r239030 r247688  
    113113class MockLibWebRTCIceCandidate : public webrtc::IceCandidateInterface {
    114114public:
    115     MockLibWebRTCIceCandidate(const char* sdp, const char* sdpMid)
     115    explicit MockLibWebRTCIceCandidate(const char* sdp, const char* sdpMid)
    116116        : m_sdp(sdp)
    117117        , m_sdpMid(sdpMid) { }
  • trunk/Source/WebKit/ChangeLog

    r247687 r247688  
     12019-07-22  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Make some constructors explicit
     4        https://bugs.webkit.org/show_bug.cgi?id=199981
     5
     6        Reviewed by Daniel Bates.
     7
     8        Make explicit public constructors of objects that take POD or String& arguments,
     9        to reduce the changes of the compiler doing implicit conversions.
     10
     11        * Platform/Module.h:
     12        * WebProcess/WebPage/WebInspector.cpp:
     13        (WebKit::WebInspector::openInNewTab):
     14
    1152019-07-22  Daniel Bates  <dabates@apple.com>
    216
  • trunk/Source/WebKit/Platform/Module.h

    r242325 r247688  
    4747    WTF_MAKE_NONCOPYABLE(Module);
    4848public:
    49     Module(const String& path);
     49    explicit Module(const String& path);
    5050    ~Module();
    5151
  • trunk/Source/WebKit/WebProcess/WebPage/WebInspector.cpp

    r247662 r247688  
    168168
    169169    Frame& inspectedMainFrame = inspectedPage->mainFrame();
    170     FrameLoadRequest frameLoadRequest { *inspectedMainFrame.document(), inspectedMainFrame.document()->securityOrigin(), { urlString }, "_blank"_s, LockHistory::No, LockBackForwardList::No, MaybeSendReferrer, AllowNavigationToInvalidURL::Yes, NewFrameOpenerPolicy::Allow, ShouldOpenExternalURLsPolicy::ShouldNotAllow, InitiatedByMainFrame::Unknown };
     170    FrameLoadRequest frameLoadRequest { *inspectedMainFrame.document(), inspectedMainFrame.document()->securityOrigin(), ResourceRequest { urlString }, "_blank"_s, LockHistory::No, LockBackForwardList::No, MaybeSendReferrer, AllowNavigationToInvalidURL::Yes, NewFrameOpenerPolicy::Allow, ShouldOpenExternalURLsPolicy::ShouldNotAllow, InitiatedByMainFrame::Unknown };
    171171
    172172    NavigationAction action { *inspectedMainFrame.document(), frameLoadRequest.resourceRequest(), frameLoadRequest.initiatedByMainFrame(), NavigationType::LinkClicked };
Note: See TracChangeset for help on using the changeset viewer.