diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2012-10-18 10:55:06 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2012-10-18 10:55:06 +0200 |
commit | ee4c86d1990a9e26277a6948e7027ad8d525ebfa (patch) | |
tree | 1e2d3408cd097606571f40ab63353c27bcb7dd5c /Source/WebKit2/WebProcess | |
parent | d882bec96d0d30aeeda2141bfadfca7f038ee862 (diff) | |
download | qtwebkit-ee4c86d1990a9e26277a6948e7027ad8d525ebfa.tar.gz |
Imported WebKit commit 795dcd25a9649fccaf1c9b685f6e2ffedaf7e620 (http://svn.webkit.org/repository/webkit/trunk@131718)
New snapshot that includes the return of -fkeep-memory at link time
to reduce memory pressure as well as modularized documentation
Diffstat (limited to 'Source/WebKit2/WebProcess')
12 files changed, 51 insertions, 28 deletions
diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMNode.h b/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMNode.h index c0e03937c..40a8f9c90 100644 --- a/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMNode.h +++ b/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMNode.h @@ -35,6 +35,7 @@ WK_EXPORT - (void)insertNode:(WKDOMNode *)node before:(WKDOMNode *)refNode; - (void)appendChild:(WKDOMNode *)node; +- (void)removeChild:(WKDOMNode *)node; @property(readonly) WKDOMDocument *document; @property(readonly) WKDOMNode *parentNode; diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMNode.mm b/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMNode.mm index 4308ff3ab..a3296bfc0 100644 --- a/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMNode.mm +++ b/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMNode.mm @@ -65,6 +65,13 @@ _impl->appendChild(WebKit::toWebCoreNode(node), ec); } +- (void)removeChild:(WKDOMNode *)node +{ + // FIXME: Do something about the exception. + WebCore::ExceptionCode ec; + _impl->removeChild(WebKit::toWebCoreNode(node), ec); +} + - (WKDOMDocument *)document { return WebKit::toWKDOMDocument(_impl->document()); diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMText.h b/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMText.h index eb8552e3f..7a97b5e2f 100644 --- a/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMText.h +++ b/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMText.h @@ -30,7 +30,7 @@ WK_EXPORT @interface WKDOMText : WKDOMNode -@property(readonly) NSString *data; +@property(nonatomic, copy) NSString *data; @end diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMText.mm b/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMText.mm index 4f4f627ab..9bcd7b4c4 100644 --- a/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMText.mm +++ b/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMText.mm @@ -38,6 +38,13 @@ return WebCore::toText(_impl.get())->data(); } +- (void)setData:(NSString *)data +{ + // FIXME: Do something about the exception. + WebCore::ExceptionCode ec; + WebCore::toText(_impl.get())->setData(data, ec); +} + @end #endif // defined(__LP64__) && defined(__clang__) diff --git a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp index 9798f3f05..79c8eec5c 100644 --- a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp +++ b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp @@ -621,7 +621,7 @@ void CoordinatedGraphicsLayer::tiledBackingStorePaint(GraphicsContext* context, paintGraphicsLayerContents(*context, rect); } -void CoordinatedGraphicsLayer::tiledBackingStorePaintEnd(const Vector<IntRect>& updatedRects) +void CoordinatedGraphicsLayer::tiledBackingStorePaintEnd(const Vector<IntRect>& /* updatedRects */) { } diff --git a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedTile.cpp b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedTile.cpp index 4a6244e2d..668ca5d9e 100644 --- a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedTile.cpp +++ b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedTile.cpp @@ -106,7 +106,7 @@ bool CoordinatedTile::isReadyToPaint() const return !!m_ID; } -void CoordinatedTile::paint(GraphicsContext* context, const IntRect& rect) +void CoordinatedTile::paint(GraphicsContext*, const IntRect&) { ASSERT_NOT_REACHED(); } diff --git a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp index 416cf00e0..a19715e7e 100644 --- a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp +++ b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp @@ -171,7 +171,7 @@ void LayerTreeCoordinator::setNonCompositedContentsNeedDisplay(const WebCore::In scheduleLayerFlush(); } -void LayerTreeCoordinator::scrollNonCompositedContents(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollOffset) +void LayerTreeCoordinator::scrollNonCompositedContents(const WebCore::IntRect& scrollRect, const WebCore::IntSize& /* scrollOffset */) { setNonCompositedContentsNeedDisplay(scrollRect); } @@ -512,7 +512,7 @@ void LayerTreeCoordinator::releaseImageBackingStore(int64_t key) } -void LayerTreeCoordinator::notifyAnimationStarted(const WebCore::GraphicsLayer*, double time) +void LayerTreeCoordinator::notifyAnimationStarted(const WebCore::GraphicsLayer*, double /* time */) { } diff --git a/Source/WebKit2/WebProcess/WebPage/DecoderAdapter.cpp b/Source/WebKit2/WebProcess/WebPage/DecoderAdapter.cpp index 763305cbe..63417720c 100644 --- a/Source/WebKit2/WebProcess/WebPage/DecoderAdapter.cpp +++ b/Source/WebKit2/WebProcess/WebPage/DecoderAdapter.cpp @@ -33,14 +33,19 @@ namespace WebKit { DecoderAdapter::DecoderAdapter(const uint8_t* buffer, size_t bufferSize) - : m_decoder(buffer, bufferSize) + : m_decoder(CoreIPC::ArgumentDecoder::create(buffer, bufferSize)) { + // Keep format compatibility by decoding an unused uint64_t value + // that used to be encoded by the argument encoder. + uint64_t value; + m_decoder->decode(value); + ASSERT(!value); } bool DecoderAdapter::decodeBytes(Vector<uint8_t>& bytes) { CoreIPC::DataReference dataReference; - if (!m_decoder.decodeVariableLengthByteArray(dataReference)) + if (!m_decoder->decodeVariableLengthByteArray(dataReference)) return false; bytes = dataReference.vector(); @@ -49,42 +54,42 @@ bool DecoderAdapter::decodeBytes(Vector<uint8_t>& bytes) bool DecoderAdapter::decodeBool(bool& value) { - return m_decoder.decodeBool(value); + return m_decoder->decodeBool(value); } bool DecoderAdapter::decodeUInt16(uint16_t& value) { - return m_decoder.decodeUInt16(value); + return m_decoder->decodeUInt16(value); } bool DecoderAdapter::decodeUInt32(uint32_t& value) { - return m_decoder.decodeUInt32(value); + return m_decoder->decodeUInt32(value); } bool DecoderAdapter::decodeUInt64(uint64_t& value) { - return m_decoder.decodeUInt64(value); + return m_decoder->decodeUInt64(value); } bool DecoderAdapter::decodeInt32(int32_t& value) { - return m_decoder.decodeInt32(value); + return m_decoder->decodeInt32(value); } bool DecoderAdapter::decodeInt64(int64_t& value) { - return m_decoder.decodeInt64(value); + return m_decoder->decodeInt64(value); } bool DecoderAdapter::decodeFloat(float& value) { - return m_decoder.decodeFloat(value); + return m_decoder->decodeFloat(value); } bool DecoderAdapter::decodeDouble(double& value) { - return m_decoder.decodeDouble(value); + return m_decoder->decodeDouble(value); } bool DecoderAdapter::decodeString(String& value) @@ -96,7 +101,7 @@ bool DecoderAdapter::decodeString(String& value) // without breaking encoding/decoding of the history tree. uint32_t length; - if (!m_decoder.decode(length)) + if (!m_decoder->decode(length)) return false; if (length == std::numeric_limits<uint32_t>::max()) { @@ -106,22 +111,22 @@ bool DecoderAdapter::decodeString(String& value) } uint64_t lengthInBytes; - if (!m_decoder.decode(lengthInBytes)) + if (!m_decoder->decode(lengthInBytes)) return false; if (lengthInBytes % sizeof(UChar) || lengthInBytes / sizeof(UChar) != length) { - m_decoder.markInvalid(); + m_decoder->markInvalid(); return false; } - if (!m_decoder.bufferIsLargeEnoughToContain<UChar>(length)) { - m_decoder.markInvalid(); + if (!m_decoder->bufferIsLargeEnoughToContain<UChar>(length)) { + m_decoder->markInvalid(); return false; } UChar* buffer; String string = String::createUninitialized(length, buffer); - if (!m_decoder.decodeFixedLengthData(reinterpret_cast<uint8_t*>(buffer), length * sizeof(UChar), __alignof(UChar))) + if (!m_decoder->decodeFixedLengthData(reinterpret_cast<uint8_t*>(buffer), length * sizeof(UChar), __alignof(UChar))) return false; value = string; diff --git a/Source/WebKit2/WebProcess/WebPage/DecoderAdapter.h b/Source/WebKit2/WebProcess/WebPage/DecoderAdapter.h index d6b4eb766..671e1896f 100644 --- a/Source/WebKit2/WebProcess/WebPage/DecoderAdapter.h +++ b/Source/WebKit2/WebProcess/WebPage/DecoderAdapter.h @@ -48,7 +48,7 @@ private: virtual bool decodeDouble(double&); virtual bool decodeString(String&); - CoreIPC::ArgumentDecoder m_decoder; + OwnPtr<CoreIPC::ArgumentDecoder> m_decoder; }; } // namespace WebKit diff --git a/Source/WebKit2/WebProcess/WebPage/EncoderAdapter.cpp b/Source/WebKit2/WebProcess/WebPage/EncoderAdapter.cpp index bda7d9b72..54f9372d1 100644 --- a/Source/WebKit2/WebProcess/WebPage/EncoderAdapter.cpp +++ b/Source/WebKit2/WebProcess/WebPage/EncoderAdapter.cpp @@ -33,8 +33,11 @@ namespace WebKit { EncoderAdapter::EncoderAdapter() - : m_encoder(CoreIPC::ArgumentEncoder::create(0)) + : m_encoder(CoreIPC::ArgumentEncoder::create()) { + // Keep format compatibility by decoding an unused uint64_t value + // that used to be encoded by the argument encoder. + m_encoder->encode(static_cast<uint64_t>(0)); } CoreIPC::DataReference EncoderAdapter::dataReference() const diff --git a/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h b/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h index 0e686b66f..95dc8e9ca 100644 --- a/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h +++ b/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h @@ -90,8 +90,8 @@ public: virtual WebCore::GraphicsLayerFactory* graphicsLayerFactory() { return 0; } #if USE(COORDINATED_GRAPHICS) - virtual void setVisibleContentsRect(const WebCore::IntRect&, float scale, const WebCore::FloatPoint&) { } - virtual void setVisibleContentsRectForLayer(int layerID, const WebCore::IntRect&) { } + virtual void setVisibleContentsRect(const WebCore::IntRect&, float /* scale */, const WebCore::FloatPoint&) { } + virtual void setVisibleContentsRectForLayer(int /* layerID */, const WebCore::IntRect&) { } virtual void renderNextFrame() { } virtual void purgeBackingStores() { } virtual void didReceiveLayerTreeCoordinatorMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*) = 0; diff --git a/Source/WebKit2/WebProcess/WebProcess.cpp b/Source/WebKit2/WebProcess/WebProcess.cpp index 6f67ed022..43ed16b1a 100644 --- a/Source/WebKit2/WebProcess/WebProcess.cpp +++ b/Source/WebKit2/WebProcess/WebProcess.cpp @@ -1011,14 +1011,14 @@ void WebProcess::postInjectedBundleMessage(const CoreIPC::DataReference& message if (!injectedBundle) return; - CoreIPC::ArgumentDecoder messageDecoder(messageData.data(), messageData.size()); + OwnPtr<CoreIPC::ArgumentDecoder> decoder = CoreIPC::ArgumentDecoder::create(messageData.data(), messageData.size()); String messageName; - if (!messageDecoder.decode(messageName)) + if (!decoder->decode(messageName)) return; RefPtr<APIObject> messageBody; - if (!messageDecoder.decode(InjectedBundleUserMessageDecoder(messageBody))) + if (!decoder->decode(InjectedBundleUserMessageDecoder(messageBody))) return; injectedBundle->didReceiveMessage(messageName, messageBody.get()); |