Title: [183065] trunk/Source
Revision
183065
Author
cdu...@apple.com
Date
2015-04-21 09:18:22 -0700 (Tue, 21 Apr 2015)

Log Message

Make Vector(const Vector<T, otherCapacity, otherOverflowBehaviour>&) constructor explicit
https://bugs.webkit.org/show_bug.cgi?id=143970

Reviewed by Darin Adler.

Make Vector(const Vector<T, otherCapacity, otherOverflowBehaviour>&)
constructor explicit as it copies the vector and it is easy to call it
by mistake.

Source/_javascript_Core:

* bytecode/UnlinkedInstructionStream.cpp:
(JSC::UnlinkedInstructionStream::UnlinkedInstructionStream):
* bytecode/UnlinkedInstructionStream.h:
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::lower):

Source/WebCore:

* Modules/indexeddb/IDBDatabaseBackend.cpp:
(WebCore::IDBDatabaseBackend::setIndexKeys):
(WebCore::IDBDatabaseBackend::setIndexesReady):
* Modules/indexeddb/IDBDatabaseBackend.h:
* Modules/indexeddb/IDBServerConnection.h:
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::minimumRegisterRequirements):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasClasses):
* cssjit/StackAllocator.h:
(WebCore::StackAllocator::push):
(WebCore::StackAllocator::pop):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::GridIterator::nextGridItem):
(WebCore::RenderGrid::GridIterator::isEmptyAreaEnough):
* rendering/style/SVGRenderStyle.cpp:
(WebCore::SVGRenderStyle::paintTypesForPaintOrder):
* rendering/style/SVGRenderStyle.h:
* rendering/svg/RenderSVGShape.cpp:
(WebCore::RenderSVGShape::fillStrokeMarkers):
* rendering/svg/SVGInlineTextBox.cpp:
(WebCore::SVGInlineTextBox::paint):
* svg/SVGToOTFFontConversion.cpp:
(WebCore::SVGToOTFFontConverter::appendLigatureGlyphs):
(WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter):

Source/WebKit2:

* WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
(WebKit::WebIDBServerConnection::setIndexKeys):
* WebProcess/Databases/IndexedDB/WebIDBServerConnection.h:

Source/WTF:

* wtf/RefCountedArray.h:
(WTF::RefCountedArray::RefCountedArray):
* wtf/Vector.h:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (183064 => 183065)


--- trunk/Source/_javascript_Core/ChangeLog	2015-04-21 16:16:21 UTC (rev 183064)
+++ trunk/Source/_javascript_Core/ChangeLog	2015-04-21 16:18:22 UTC (rev 183065)
@@ -1,3 +1,20 @@
+2015-04-21  Chris Dumez  <cdu...@apple.com>
+
+        Make Vector(const Vector<T, otherCapacity, otherOverflowBehaviour>&) constructor explicit
+        https://bugs.webkit.org/show_bug.cgi?id=143970
+
+        Reviewed by Darin Adler.
+
+        Make Vector(const Vector<T, otherCapacity, otherOverflowBehaviour>&)
+        constructor explicit as it copies the vector and it is easy to call it
+        by mistake.
+
+        * bytecode/UnlinkedInstructionStream.cpp:
+        (JSC::UnlinkedInstructionStream::UnlinkedInstructionStream):
+        * bytecode/UnlinkedInstructionStream.h:
+        * ftl/FTLLowerDFGToLLVM.cpp:
+        (JSC::FTL::LowerDFGToLLVM::lower):
+
 2015-04-20  Basile Clement  <basile_clem...@apple.com>
 
         PhantomNewObject should be marked NodeMustGenerate

Modified: trunk/Source/_javascript_Core/bytecode/UnlinkedInstructionStream.cpp (183064 => 183065)


--- trunk/Source/_javascript_Core/bytecode/UnlinkedInstructionStream.cpp	2015-04-21 16:16:21 UTC (rev 183064)
+++ trunk/Source/_javascript_Core/bytecode/UnlinkedInstructionStream.cpp	2015-04-21 16:18:22 UTC (rev 183065)
@@ -75,7 +75,7 @@
     *(ptr++) = (value >> 24) & 0xff;
 }
 
-UnlinkedInstructionStream::UnlinkedInstructionStream(const Vector<UnlinkedInstruction>& instructions)
+UnlinkedInstructionStream::UnlinkedInstructionStream(const Vector<UnlinkedInstruction, 0, UnsafeVectorOverflow>& instructions)
     : m_instructionCount(instructions.size())
 {
     Vector<unsigned char> buffer;

Modified: trunk/Source/_javascript_Core/bytecode/UnlinkedInstructionStream.h (183064 => 183065)


--- trunk/Source/_javascript_Core/bytecode/UnlinkedInstructionStream.h	2015-04-21 16:16:21 UTC (rev 183064)
+++ trunk/Source/_javascript_Core/bytecode/UnlinkedInstructionStream.h	2015-04-21 16:18:22 UTC (rev 183065)
@@ -35,7 +35,7 @@
 class UnlinkedInstructionStream {
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    explicit UnlinkedInstructionStream(const Vector<UnlinkedInstruction>&);
+    explicit UnlinkedInstructionStream(const Vector<UnlinkedInstruction, 0, UnsafeVectorOverflow>&);
 
     unsigned count() const { return m_instructionCount; }
 

Modified: trunk/Source/_javascript_Core/ftl/FTLLowerDFGToLLVM.cpp (183064 => 183065)


--- trunk/Source/_javascript_Core/ftl/FTLLowerDFGToLLVM.cpp	2015-04-21 16:16:21 UTC (rev 183064)
+++ trunk/Source/_javascript_Core/ftl/FTLLowerDFGToLLVM.cpp	2015-04-21 16:18:22 UTC (rev 183065)
@@ -152,7 +152,7 @@
         m_out.appendTo(m_prologue, stackOverflow);
         createPhiVariables();
 
-        Vector<BasicBlock*> preOrder = m_graph.blocksInPreOrder();
+        auto preOrder = m_graph.blocksInPreOrder();
 
         int maxNumberOfArguments = -1;
         for (BasicBlock* block : preOrder) {

Modified: trunk/Source/WTF/ChangeLog (183064 => 183065)


--- trunk/Source/WTF/ChangeLog	2015-04-21 16:16:21 UTC (rev 183064)
+++ trunk/Source/WTF/ChangeLog	2015-04-21 16:18:22 UTC (rev 183065)
@@ -1,3 +1,18 @@
+2015-04-21  Chris Dumez  <cdu...@apple.com>
+
+        Make Vector(const Vector<T, otherCapacity, otherOverflowBehaviour>&) constructor explicit
+        https://bugs.webkit.org/show_bug.cgi?id=143970
+
+        Reviewed by Darin Adler.
+
+        Make Vector(const Vector<T, otherCapacity, otherOverflowBehaviour>&)
+        constructor explicit as it copies the vector and it is easy to call it
+        by mistake.
+
+        * wtf/RefCountedArray.h:
+        (WTF::RefCountedArray::RefCountedArray):
+        * wtf/Vector.h:
+
 2015-04-21  Darin Adler  <da...@apple.com>
 
         Remove some stray uses of OwnPtr and PassOwnPtr in WTF (outside of the template definitions and traits)

Modified: trunk/Source/WTF/wtf/RefCountedArray.h (183064 => 183065)


--- trunk/Source/WTF/wtf/RefCountedArray.h	2015-04-21 16:16:21 UTC (rev 183064)
+++ trunk/Source/WTF/wtf/RefCountedArray.h	2015-04-21 16:18:22 UTC (rev 183065)
@@ -72,7 +72,8 @@
         VectorTypeOperations<T>::initialize(begin(), end());
     }
 
-    explicit RefCountedArray(const Vector<T>& other)
+    template<size_t inlineCapacity, typename OverflowHandler>
+    explicit RefCountedArray(const Vector<T, inlineCapacity, OverflowHandler>& other)
     {
         if (other.isEmpty()) {
             m_data = 0;

Modified: trunk/Source/WTF/wtf/Vector.h (183064 => 183065)


--- trunk/Source/WTF/wtf/Vector.h	2015-04-21 16:16:21 UTC (rev 183064)
+++ trunk/Source/WTF/wtf/Vector.h	2015-04-21 16:18:22 UTC (rev 183065)
@@ -639,7 +639,7 @@
 
     Vector(const Vector&);
     template<size_t otherCapacity, typename otherOverflowBehaviour>
-    Vector(const Vector<T, otherCapacity, otherOverflowBehaviour>&);
+    explicit Vector(const Vector<T, otherCapacity, otherOverflowBehaviour>&);
 
     Vector& operator=(const Vector&);
     template<size_t otherCapacity, typename otherOverflowBehaviour>

Modified: trunk/Source/WebCore/ChangeLog (183064 => 183065)


--- trunk/Source/WebCore/ChangeLog	2015-04-21 16:16:21 UTC (rev 183064)
+++ trunk/Source/WebCore/ChangeLog	2015-04-21 16:18:22 UTC (rev 183065)
@@ -1,5 +1,41 @@
 2015-04-21  Chris Dumez  <cdu...@apple.com>
 
+        Make Vector(const Vector<T, otherCapacity, otherOverflowBehaviour>&) constructor explicit
+        https://bugs.webkit.org/show_bug.cgi?id=143970
+
+        Reviewed by Darin Adler.
+
+        Make Vector(const Vector<T, otherCapacity, otherOverflowBehaviour>&)
+        constructor explicit as it copies the vector and it is easy to call it
+        by mistake.
+
+        * Modules/indexeddb/IDBDatabaseBackend.cpp:
+        (WebCore::IDBDatabaseBackend::setIndexKeys):
+        (WebCore::IDBDatabaseBackend::setIndexesReady):
+        * Modules/indexeddb/IDBDatabaseBackend.h:
+        * Modules/indexeddb/IDBServerConnection.h:
+        * cssjit/SelectorCompiler.cpp:
+        (WebCore::SelectorCompiler::minimumRegisterRequirements):
+        (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasClasses):
+        * cssjit/StackAllocator.h:
+        (WebCore::StackAllocator::push):
+        (WebCore::StackAllocator::pop):
+        * rendering/RenderGrid.cpp:
+        (WebCore::RenderGrid::GridIterator::nextGridItem):
+        (WebCore::RenderGrid::GridIterator::isEmptyAreaEnough):
+        * rendering/style/SVGRenderStyle.cpp:
+        (WebCore::SVGRenderStyle::paintTypesForPaintOrder):
+        * rendering/style/SVGRenderStyle.h:
+        * rendering/svg/RenderSVGShape.cpp:
+        (WebCore::RenderSVGShape::fillStrokeMarkers):
+        * rendering/svg/SVGInlineTextBox.cpp:
+        (WebCore::SVGInlineTextBox::paint):
+        * svg/SVGToOTFFontConversion.cpp:
+        (WebCore::SVGToOTFFontConverter::appendLigatureGlyphs):
+        (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter):
+
+2015-04-21  Chris Dumez  <cdu...@apple.com>
+
         Use ASSERT_WITH_SECURITY_IMPLICATION() for NoEventDispatchAssertion
         https://bugs.webkit.org/show_bug.cgi?id=143971
 

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBDatabaseBackend.cpp (183064 => 183065)


--- trunk/Source/WebCore/Modules/indexeddb/IDBDatabaseBackend.cpp	2015-04-21 16:16:21 UTC (rev 183064)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBDatabaseBackend.cpp	2015-04-21 16:18:22 UTC (rev 183065)
@@ -244,7 +244,7 @@
     transaction->schedulePutOperation(objectStoreMetadata, value, key, putMode, callbacks, indexIds, indexKeys);
 }
 
-void IDBDatabaseBackend::setIndexKeys(int64_t transactionID, int64_t objectStoreID, PassRefPtr<IDBKey> prpPrimaryKey, const Vector<int64_t>& indexIDs, const Vector<IndexKeys>& indexKeys)
+void IDBDatabaseBackend::setIndexKeys(int64_t transactionID, int64_t objectStoreID, PassRefPtr<IDBKey> prpPrimaryKey, const Vector<int64_t, 1>& indexIDs, const Vector<IndexKeys, 1>& indexKeys)
 {
     LOG(StorageAPI, "IDBDatabaseBackend::setIndexKeys");
     ASSERT(prpPrimaryKey);
@@ -262,7 +262,7 @@
     });
 }
 
-void IDBDatabaseBackend::setIndexesReady(int64_t transactionId, int64_t, const Vector<int64_t>& indexIds)
+void IDBDatabaseBackend::setIndexesReady(int64_t transactionId, int64_t, const Vector<int64_t, 1>& indexIds)
 {
     LOG(StorageAPI, "IDBDatabaseBackend::setIndexesReady");
 

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBDatabaseBackend.h (183064 => 183065)


--- trunk/Source/WebCore/Modules/indexeddb/IDBDatabaseBackend.h	2015-04-21 16:16:21 UTC (rev 183064)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBDatabaseBackend.h	2015-04-21 16:18:22 UTC (rev 183065)
@@ -108,8 +108,8 @@
 
     void get(int64_t transactionId, int64_t objectStoreId, int64_t indexId, PassRefPtr<IDBKeyRange>, bool keyOnly, PassRefPtr<IDBCallbacks>);
     void put(int64_t transactionId, int64_t objectStoreId, PassRefPtr<SharedBuffer> value, PassRefPtr<IDBKey>, PutMode, PassRefPtr<IDBCallbacks>, const Vector<int64_t>& indexIds, const Vector<IndexKeys>&);
-    void setIndexKeys(int64_t transactionId, int64_t objectStoreId, PassRefPtr<IDBKey> prpPrimaryKey, const Vector<int64_t>& indexIds, const Vector<IndexKeys>&);
-    void setIndexesReady(int64_t transactionId, int64_t objectStoreId, const Vector<int64_t>& indexIds);
+    void setIndexKeys(int64_t transactionId, int64_t objectStoreId, PassRefPtr<IDBKey> prpPrimaryKey, const Vector<int64_t, 1>& indexIds, const Vector<IndexKeys, 1>&);
+    void setIndexesReady(int64_t transactionId, int64_t objectStoreId, const Vector<int64_t, 1>& indexIds);
     void openCursor(int64_t transactionId, int64_t objectStoreId, int64_t indexId, PassRefPtr<IDBKeyRange>, IndexedDB::CursorDirection, bool keyOnly, TaskType, PassRefPtr<IDBCallbacks>);
     void count(int64_t transactionId, int64_t objectStoreId, int64_t indexId, PassRefPtr<IDBKeyRange>, PassRefPtr<IDBCallbacks>);
     void deleteRange(int64_t transactionId, int64_t objectStoreId, PassRefPtr<IDBKeyRange>, PassRefPtr<IDBCallbacks>);

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBServerConnection.h (183064 => 183065)


--- trunk/Source/WebCore/Modules/indexeddb/IDBServerConnection.h	2015-04-21 16:16:21 UTC (rev 183064)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBServerConnection.h	2015-04-21 16:18:22 UTC (rev 183065)
@@ -74,7 +74,7 @@
     virtual void rollbackTransaction(int64_t transactionID, std::function<void()> completionCallback) = 0;
     virtual bool rollbackTransactionSync(int64_t transactionID) = 0;
 
-    virtual void setIndexKeys(int64_t transactionID, int64_t databaseID, int64_t objectStoreID, const IDBObjectStoreMetadata&, IDBKey& primaryKey, const Vector<int64_t>& indexIDs, const Vector<Vector<RefPtr<IDBKey>>>& indexKeys, std::function<void(PassRefPtr<IDBDatabaseError>)> completionCallback) = 0;
+    virtual void setIndexKeys(int64_t transactionID, int64_t databaseID, int64_t objectStoreID, const IDBObjectStoreMetadata&, IDBKey& primaryKey, const Vector<int64_t, 1>& indexIDs, const Vector<Vector<RefPtr<IDBKey>>, 1>& indexKeys, std::function<void(PassRefPtr<IDBDatabaseError>)> completionCallback) = 0;
 
     virtual void createObjectStore(IDBTransactionBackend&, const CreateObjectStoreOperation&, std::function<void(PassRefPtr<IDBDatabaseError>)> completionCallback) = 0;
     virtual void createIndex(IDBTransactionBackend&, const CreateIndexOperation&, std::function<void(PassRefPtr<IDBDatabaseError>)> completionCallback) = 0;

Modified: trunk/Source/WebCore/cssjit/SelectorCompiler.cpp (183064 => 183065)


--- trunk/Source/WebCore/cssjit/SelectorCompiler.cpp	2015-04-21 16:16:21 UTC (rev 183064)
+++ trunk/Source/WebCore/cssjit/SelectorCompiler.cpp	2015-04-21 16:18:22 UTC (rev 183065)
@@ -308,7 +308,7 @@
     void generateElementAttributeFunctionCallValueMatching(Assembler::JumpList& failureCases, Assembler::RegisterID currentAttributeAddress, const AtomicString& expectedValue, AttributeCaseSensitivity valueCaseSensitivity, JSC::FunctionPtr caseSensitiveTest, JSC::FunctionPtr caseInsensitiveTest);
     void generateElementHasTagName(Assembler::JumpList& failureCases, const CSSSelector& tagMatchingSelector);
     void generateElementHasId(Assembler::JumpList& failureCases, const LocalRegister& elementDataAddress, const AtomicString& idToMatch);
-    void generateElementHasClasses(Assembler::JumpList& failureCases, const LocalRegister& elementDataAddress, const Vector<const AtomicStringImpl*>& classNames);
+    void generateElementHasClasses(Assembler::JumpList& failureCases, const LocalRegister& elementDataAddress, const Vector<const AtomicStringImpl*, 8>& classNames);
     void generateElementIsLink(Assembler::JumpList& failureCases);
     void generateElementIsNthChild(Assembler::JumpList& failureCases, const SelectorFragment&);
     void generateElementIsNthChildOf(Assembler::JumpList& failureCases, const SelectorFragment&);
@@ -1092,7 +1092,7 @@
 static unsigned minimumRegisterRequirements(const SelectorFragment& selectorFragment)
 {
     unsigned minimum = minimumRequiredRegisterCount;
-    const Vector<AttributeMatchingInfo>& attributes = selectorFragment.attributes;
+    const auto& attributes = selectorFragment.attributes;
 
     // Attributes cause some register pressure.
     unsigned attributeCount = attributes.size();
@@ -3530,7 +3530,7 @@
     failureCases.append(m_assembler.branchPtr(Assembler::NotEqual, Assembler::Address(elementDataAddress, ElementData::idForStyleResolutionMemoryOffset()), idToMatchRegister));
 }
 
-void SelectorCodeGenerator::generateElementHasClasses(Assembler::JumpList& failureCases, const LocalRegister& elementDataAddress, const Vector<const AtomicStringImpl*>& classNames)
+void SelectorCodeGenerator::generateElementHasClasses(Assembler::JumpList& failureCases, const LocalRegister& elementDataAddress, const Vector<const AtomicStringImpl*, 8>& classNames)
 {
     // Load m_classNames.
     LocalRegister spaceSplitStringData(m_registerAllocator);

Modified: trunk/Source/WebCore/cssjit/StackAllocator.h (183064 => 183065)


--- trunk/Source/WebCore/cssjit/StackAllocator.h	2015-04-21 16:16:21 UTC (rev 183064)
+++ trunk/Source/WebCore/cssjit/StackAllocator.h	2015-04-21 16:18:22 UTC (rev 183065)
@@ -100,7 +100,8 @@
         return stackReferences;
     }
 
-    StackReferenceVector push(const Vector<JSC::MacroAssembler::RegisterID>& registerIDs)
+    template<size_t inlineCapacity, typename OverflowHandler>
+    StackReferenceVector push(const Vector<JSC::MacroAssembler::RegisterID, inlineCapacity, OverflowHandler>& registerIDs)
     {
         RELEASE_ASSERT(!m_hasFunctionCallPadding);
 
@@ -134,7 +135,8 @@
         return StackReference(m_offsetFromTop);
     }
 
-    void pop(const StackReferenceVector& stackReferences, const Vector<JSC::MacroAssembler::RegisterID>& registerIDs)
+    template<size_t inlineCapacity, typename OverflowHandler>
+    void pop(const StackReferenceVector& stackReferences, const Vector<JSC::MacroAssembler::RegisterID, inlineCapacity, OverflowHandler>& registerIDs)
     {
         RELEASE_ASSERT(!m_hasFunctionCallPadding);
 

Modified: trunk/Source/WebCore/rendering/RenderGrid.cpp (183064 => 183065)


--- trunk/Source/WebCore/rendering/RenderGrid.cpp	2015-04-21 16:16:21 UTC (rev 183064)
+++ trunk/Source/WebCore/rendering/RenderGrid.cpp	2015-04-21 16:18:22 UTC (rev 183065)
@@ -153,7 +153,7 @@
         unsigned& varyingTrackIndex = (m_direction == ForColumns) ? m_rowIndex : m_columnIndex;
         const unsigned endOfVaryingTrackIndex = (m_direction == ForColumns) ? m_grid.size() : m_grid[0].size();
         for (; varyingTrackIndex < endOfVaryingTrackIndex; ++varyingTrackIndex) {
-            const Vector<RenderBox*>& children = m_grid[m_rowIndex][m_columnIndex];
+            const auto& children = m_grid[m_rowIndex][m_columnIndex];
             if (m_childIndex < children.size())
                 return children[m_childIndex++];
 
@@ -171,7 +171,7 @@
         // This adds a O(N^2) behavior that shouldn't be a big deal as we expect spanning areas to be small.
         for (unsigned row = m_rowIndex; row < maxRows; ++row) {
             for (unsigned column = m_columnIndex; column < maxColumns; ++column) {
-                const Vector<RenderBox*>& children = m_grid[row][column];
+                auto& children = m_grid[row][column];
                 if (!children.isEmpty())
                     return false;
             }

Modified: trunk/Source/WebCore/rendering/style/SVGRenderStyle.cpp (183064 => 183065)


--- trunk/Source/WebCore/rendering/style/SVGRenderStyle.cpp	2015-04-21 16:16:21 UTC (rev 183064)
+++ trunk/Source/WebCore/rendering/style/SVGRenderStyle.cpp	2015-04-21 16:18:22 UTC (rev 183065)
@@ -148,7 +148,7 @@
     resources = other->resources;
 }
 
-Vector<PaintType> SVGRenderStyle::paintTypesForPaintOrder() const
+Vector<PaintType, 3> SVGRenderStyle::paintTypesForPaintOrder() const
 {
     Vector<PaintType, 3> paintOrder;
     switch (this->paintOrder()) {

Modified: trunk/Source/WebCore/rendering/style/SVGRenderStyle.h (183064 => 183065)


--- trunk/Source/WebCore/rendering/style/SVGRenderStyle.h	2015-04-21 16:16:21 UTC (rev 183064)
+++ trunk/Source/WebCore/rendering/style/SVGRenderStyle.h	2015-04-21 16:18:22 UTC (rev 183065)
@@ -379,7 +379,7 @@
     String markerEndResource() const { return inheritedResources->markerEnd; }
     EMaskType maskType() const { return (EMaskType) svg_noninherited_flags.f.maskType; }
     PaintOrder paintOrder() const { return (PaintOrder) svg_inherited_flags.paintOrder; }
-    Vector<PaintType> paintTypesForPaintOrder() const;
+    Vector<PaintType, 3> paintTypesForPaintOrder() const;
 
     const SVGPaint::SVGPaintType& visitedLinkFillPaintType() const { return fill->visitedLinkPaintType; }
     const Color& visitedLinkFillPaintColor() const { return fill->visitedLinkPaintColor; }

Modified: trunk/Source/WebCore/rendering/svg/RenderSVGShape.cpp (183064 => 183065)


--- trunk/Source/WebCore/rendering/svg/RenderSVGShape.cpp	2015-04-21 16:16:21 UTC (rev 183064)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGShape.cpp	2015-04-21 16:18:22 UTC (rev 183065)
@@ -271,7 +271,7 @@
 
 void RenderSVGShape::fillStrokeMarkers(PaintInfo& childPaintInfo)
 {
-    Vector<PaintType> paintOrder = style().svgStyle().paintTypesForPaintOrder();
+    auto paintOrder = style().svgStyle().paintTypesForPaintOrder();
     for (unsigned i = 0; i < paintOrder.size(); ++i) {
         switch (paintOrder.at(i)) {
         case PaintTypeFill:

Modified: trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp (183064 => 183065)


--- trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp	2015-04-21 16:16:21 UTC (rev 183064)
+++ trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp	2015-04-21 16:18:22 UTC (rev 183065)
@@ -300,7 +300,7 @@
         if (decorations & TextDecorationOverline)
             paintDecoration(paintInfo.context, TextDecorationOverline, fragment);
 
-        Vector<PaintType> paintOrder = style.svgStyle().paintTypesForPaintOrder();
+        auto paintOrder = style.svgStyle().paintTypesForPaintOrder();
         for (unsigned i = 0; i < paintOrder.size(); ++i) {
             switch (paintOrder.at(i)) {
             case PaintTypeFill:

Modified: trunk/Source/WebCore/svg/SVGToOTFFontConversion.cpp (183064 => 183065)


--- trunk/Source/WebCore/svg/SVGToOTFFontConversion.cpp	2015-04-21 16:16:21 UTC (rev 183064)
+++ trunk/Source/WebCore/svg/SVGToOTFFontConversion.cpp	2015-04-21 16:18:22 UTC (rev 183065)
@@ -1300,7 +1300,7 @@
     for (auto codepoint : ligatureCodepoints) {
         auto codepoints = codepointToString(codepoint);
         if (!codepoints.isNull())
-            m_glyphs.append(GlyphData(Vector<char, 17>(m_emptyGlyphCharString), nullptr, m_unitsPerEm, m_unitsPerEm, FloatRect(), codepoints));
+            m_glyphs.append(GlyphData(Vector<char>(m_emptyGlyphCharString), nullptr, m_unitsPerEm, m_unitsPerEm, FloatRect(), codepoints));
     }
 }
 
@@ -1390,7 +1390,7 @@
     if (m_missingGlyphElement)
         processGlyphElement(*m_missingGlyphElement, nullptr, defaultHorizontalAdvance, defaultVerticalAdvance, String(), initialGlyph);
     else
-        m_glyphs.append(GlyphData(Vector<char, 17>(m_emptyGlyphCharString), nullptr, m_unitsPerEm, m_unitsPerEm, FloatRect(), String()));
+        m_glyphs.append(GlyphData(Vector<char>(m_emptyGlyphCharString), nullptr, m_unitsPerEm, m_unitsPerEm, FloatRect(), String()));
 
     for (auto& glyphElement : childrenOfType<SVGGlyphElement>(m_fontElement)) {
         auto& unicodeAttribute = glyphElement.fastGetAttribute(SVGNames::unicodeAttr);

Modified: trunk/Source/WebKit2/ChangeLog (183064 => 183065)


--- trunk/Source/WebKit2/ChangeLog	2015-04-21 16:16:21 UTC (rev 183064)
+++ trunk/Source/WebKit2/ChangeLog	2015-04-21 16:18:22 UTC (rev 183065)
@@ -1,3 +1,18 @@
+2015-04-21  Chris Dumez  <cdu...@apple.com>
+
+        Make Vector(const Vector<T, otherCapacity, otherOverflowBehaviour>&) constructor explicit
+        https://bugs.webkit.org/show_bug.cgi?id=143970
+
+        Reviewed by Darin Adler.
+
+        Make Vector(const Vector<T, otherCapacity, otherOverflowBehaviour>&)
+        constructor explicit as it copies the vector and it is easy to call it
+        by mistake.
+
+        * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
+        (WebKit::WebIDBServerConnection::setIndexKeys):
+        * WebProcess/Databases/IndexedDB/WebIDBServerConnection.h:
+
 2015-04-20  Dan Bernstein  <m...@apple.com>
 
         Expose more bundle form client functions as WKWebProcessPlugInFormDelegatePrivate methods

Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNotificationProvider.cpp (183064 => 183065)


--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNotificationProvider.cpp	2015-04-21 16:16:21 UTC (rev 183064)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNotificationProvider.cpp	2015-04-21 16:18:22 UTC (rev 183065)
@@ -89,8 +89,8 @@
 void WebKitNotificationProvider::notificationCloseCallback(WebKitNotification* notification, WebKitNotificationProvider* provider)
 {
     uint64_t notificationID = webkit_notification_get_id(notification);
-    Vector<RefPtr<API::Object>, 1> arrayIDs;
-    arrayIDs.uncheckedAppend(API::UInt64::create(notificationID));
+    Vector<RefPtr<API::Object>> arrayIDs;
+    arrayIDs.append(API::UInt64::create(notificationID));
     provider->m_notificationManager->providerDidCloseNotifications(API::Array::create(WTF::move(arrayIDs)).get());
     provider->m_notifications.remove(notificationID);
 }

Modified: trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp (183064 => 183065)


--- trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp	2015-04-21 16:16:21 UTC (rev 183064)
+++ trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp	2015-04-21 16:18:22 UTC (rev 183065)
@@ -305,7 +305,7 @@
     return success;
 }
 
-void WebIDBServerConnection::setIndexKeys(int64_t transactionID, int64_t databaseID, int64_t objectStoreID, const IDBObjectStoreMetadata&, IDBKey& primaryKey, const Vector<int64_t>& indexIDs, const Vector<Vector<RefPtr<IDBKey>>>& indexKeys, std::function<void (PassRefPtr<IDBDatabaseError>)> completionCallback)
+void WebIDBServerConnection::setIndexKeys(int64_t transactionID, int64_t databaseID, int64_t objectStoreID, const IDBObjectStoreMetadata&, IDBKey& primaryKey, const Vector<int64_t, 1>& indexIDs, const Vector<Vector<RefPtr<WebCore::IDBKey>>, 1>& indexKeys, std::function<void (PassRefPtr<IDBDatabaseError>)> completionCallback)
 {
 }
 

Modified: trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.h (183064 => 183065)


--- trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.h	2015-04-21 16:16:21 UTC (rev 183064)
+++ trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.h	2015-04-21 16:18:22 UTC (rev 183065)
@@ -68,7 +68,7 @@
     virtual void rollbackTransaction(int64_t transactionID, std::function<void ()> completionCallback) override;
     virtual bool rollbackTransactionSync(int64_t transactionID) override;
 
-    virtual void setIndexKeys(int64_t transactionID, int64_t databaseID, int64_t objectStoreID, const WebCore::IDBObjectStoreMetadata&, WebCore::IDBKey& primaryKey, const Vector<int64_t>& indexIDs, const Vector<Vector<RefPtr<WebCore::IDBKey>>>& indexKeys, std::function<void (PassRefPtr<WebCore::IDBDatabaseError>)> completionCallback) override;
+    virtual void setIndexKeys(int64_t transactionID, int64_t databaseID, int64_t objectStoreID, const WebCore::IDBObjectStoreMetadata&, WebCore::IDBKey& primaryKey, const Vector<int64_t, 1>& indexIDs, const Vector<Vector<RefPtr<WebCore::IDBKey>>, 1>& indexKeys, std::function<void (PassRefPtr<WebCore::IDBDatabaseError>)> completionCallback) override;
 
     virtual void createObjectStore(WebCore::IDBTransactionBackend&, const WebCore::CreateObjectStoreOperation&, std::function<void (PassRefPtr<WebCore::IDBDatabaseError>)> completionCallback) override;
     virtual void createIndex(WebCore::IDBTransactionBackend&, const WebCore::CreateIndexOperation&, std::function<void (PassRefPtr<WebCore::IDBDatabaseError>)> completionCallback) override;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to