VisibleContentRectUpdateInfo.cpp [plain text]
#include "config.h"
#include "VisibleContentRectUpdateInfo.h"
#include "WebCoreArgumentCoders.h"
#include <WebCore/LengthBox.h>
#include <wtf/text/TextStream.h>
namespace WebKit {
using namespace WebCore;
void VisibleContentRectUpdateInfo::encode(IPC::Encoder& encoder) const
{
encoder << m_exposedContentRect;
encoder << m_unobscuredContentRect;
encoder << m_contentInsets;
encoder << m_unobscuredContentRectRespectingInputViewBounds;
encoder << m_unobscuredRectInScrollViewCoordinates;
encoder << m_layoutViewportRect;
encoder << m_obscuredInsets;
encoder << m_unobscuredSafeAreaInsets;
encoder << m_scrollVelocity;
encoder << m_lastLayerTreeTransactionID;
encoder << m_scale;
encoder << m_inStableState;
encoder << m_isFirstUpdateForNewViewSize;
encoder << m_isChangingObscuredInsetsInteractively;
encoder << m_allowShrinkToFit;
encoder << m_enclosedInScrollableAncestorView;
}
bool VisibleContentRectUpdateInfo::decode(IPC::Decoder& decoder, VisibleContentRectUpdateInfo& result)
{
if (!decoder.decode(result.m_exposedContentRect))
return false;
if (!decoder.decode(result.m_unobscuredContentRect))
return false;
if (!decoder.decode(result.m_contentInsets))
return false;
if (!decoder.decode(result.m_unobscuredContentRectRespectingInputViewBounds))
return false;
if (!decoder.decode(result.m_unobscuredRectInScrollViewCoordinates))
return false;
if (!decoder.decode(result.m_layoutViewportRect))
return false;
if (!decoder.decode(result.m_obscuredInsets))
return false;
if (!decoder.decode(result.m_unobscuredSafeAreaInsets))
return false;
if (!decoder.decode(result.m_scrollVelocity))
return false;
if (!decoder.decode(result.m_lastLayerTreeTransactionID))
return false;
if (!decoder.decode(result.m_scale))
return false;
if (!decoder.decode(result.m_inStableState))
return false;
if (!decoder.decode(result.m_isFirstUpdateForNewViewSize))
return false;
if (!decoder.decode(result.m_isChangingObscuredInsetsInteractively))
return false;
if (!decoder.decode(result.m_allowShrinkToFit))
return false;
if (!decoder.decode(result.m_enclosedInScrollableAncestorView))
return false;
return true;
}
String VisibleContentRectUpdateInfo::dump() const
{
TextStream stream;
stream << *this;
return stream.release();
}
TextStream& operator<<(TextStream& ts, const VisibleContentRectUpdateInfo& info)
{
TextStream::GroupScope scope(ts);
ts << "VisibleContentRectUpdateInfo";
ts.dumpProperty("lastLayerTreeTransactionID", info.lastLayerTreeTransactionID());
ts.dumpProperty("exposedContentRect", info.exposedContentRect());
ts.dumpProperty("unobscuredContentRect", info.unobscuredContentRect());
ts.dumpProperty("contentInsets", info.contentInsets());
ts.dumpProperty("unobscuredContentRectRespectingInputViewBounds", info.unobscuredContentRectRespectingInputViewBounds());
ts.dumpProperty("unobscuredRectInScrollViewCoordinates", info.unobscuredRectInScrollViewCoordinates());
ts.dumpProperty("layoutViewportRect", info.layoutViewportRect());
ts.dumpProperty("obscuredInsets", info.obscuredInsets());
ts.dumpProperty("unobscuredSafeAreaInsets", info.unobscuredSafeAreaInsets());
ts.dumpProperty("scale", info.scale());
ts.dumpProperty("inStableState", info.inStableState());
ts.dumpProperty("isFirstUpdateForNewViewSize", info.isFirstUpdateForNewViewSize());
if (info.isChangingObscuredInsetsInteractively())
ts.dumpProperty("isChangingObscuredInsetsInteractively", info.isChangingObscuredInsetsInteractively());
if (info.enclosedInScrollableAncestorView())
ts.dumpProperty("enclosedInScrollableAncestorView", info.enclosedInScrollableAncestorView());
ts.dumpProperty("allowShrinkToFit", info.allowShrinkToFit());
ts.dumpProperty("scrollVelocity", info.scrollVelocity());
return ts;
}
}