Skip to content

Commit

Permalink
Improve embedlite trace logs
Browse files Browse the repository at this point in the history
This commit also separates tracing logs into "EmbedLiteTrace" log
module.
  • Loading branch information
rainemak committed Dec 19, 2016
1 parent d23e956 commit 041bc56
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 5 deletions.
3 changes: 2 additions & 1 deletion embedding/embedlite/EmbedLiteView.cpp
Expand Up @@ -89,7 +89,7 @@ EmbedLiteView::LoadURL(const char* aUrl)
void
EmbedLiteView::SetIsActive(bool aIsActive)
{
LOGT();
LOGT("active: %d", aIsActive);
NS_ENSURE_TRUE(mViewParent, );
unused << mViewParent->SendSetIsActive(aIsActive);
// Make sure active view content controller is always registered with
Expand Down Expand Up @@ -235,6 +235,7 @@ EmbedLiteView::SetDPI(const float& dpi)
void
EmbedLiteView::ReceiveInputEvent(const InputData& aEvent)
{
LOGT();
NS_ENSURE_TRUE(mViewImpl,);
mViewImpl->ReceiveInputEvent(aEvent);
}
Expand Down
2 changes: 1 addition & 1 deletion embedding/embedlite/embedshared/EmbedLitePuppetWidget.cpp
Expand Up @@ -403,7 +403,7 @@ EmbedLitePuppetWidget::GetNativeData(uint32_t aDataType)
LOGT("t:%p, DataType: %i", this, aDataType);
switch (aDataType) {
case NS_NATIVE_SHAREABLE_WINDOW: {
LOGW("aDataType:%i\n", __LINE__, aDataType);
LOGW("aDataType:%i\n", aDataType);
return (void*)nullptr;
}
case NS_NATIVE_OPENGL_CONTEXT: {
Expand Down
3 changes: 2 additions & 1 deletion embedding/embedlite/embedshared/EmbedLiteViewBaseChild.cpp
Expand Up @@ -1028,6 +1028,7 @@ bool EmbedLiteViewBaseChild::ContentReceivedInputBlock(const ScrollableLayerGuid
bool
EmbedLiteViewBaseChild::RecvInputDataTouchEvent(const ScrollableLayerGuid& aGuid, const mozilla::MultiTouchInput& aData, const uint64_t& aInputBlockId)
{
LOGT();
WidgetTouchEvent localEvent;
if (!mHelper->ConvertMutiTouchInputToEvent(aData, localEvent)) {
return true;
Expand Down Expand Up @@ -1221,7 +1222,7 @@ EmbedLiteViewBaseChild::DispatchSynthesizedMouseEvent(const WidgetTouchEvent& aE

void EmbedLiteViewBaseChild::WidgetBoundsChanged(const nsIntRect& aSize)
{
LOGT("sz[%g,%g]", aSize.width, aSize.height);
LOGT("sz[%d,%d]", aSize.width, aSize.height);
mViewResized = true;

MOZ_ASSERT(mHelper && mWebBrowser);
Expand Down
5 changes: 4 additions & 1 deletion embedding/embedlite/embedshared/EmbedLiteViewBaseParent.cpp
Expand Up @@ -59,14 +59,15 @@ EmbedLiteViewBaseParent::ActorDestroy(ActorDestroyReason aWhy)
void
EmbedLiteViewBaseParent::SetCompositor(EmbedLiteCompositorParent* aCompositor)
{
LOGT();
mCompositor = aCompositor;
LOGT("compositor: %p", mCompositor.get());
UpdateScrollController();
}

void
EmbedLiteViewBaseParent::UpdateScrollController()
{
LOGT("view api destroyed: %d mVIew: %p compositor: %p\n", mViewAPIDestroyed, mView, mCompositor.get());
if (mViewAPIDestroyed || !mView) {
return;
}
Expand Down Expand Up @@ -284,6 +285,7 @@ EmbedLiteViewBaseParent::RecvZoomToRect(const uint32_t& aPresShellId,
bool
EmbedLiteViewBaseParent::RecvContentReceivedInputBlock(const ScrollableLayerGuid& aGuid, const uint64_t& aInputBlockId, const bool& aPreventDefault)
{
LOGT();
if (mController->GetManager()) {
mController->GetManager()->ContentReceivedInputBlock(aInputBlockId, aPreventDefault);
}
Expand Down Expand Up @@ -380,6 +382,7 @@ EmbedLiteViewBaseParent::CompositorCreated()
NS_IMETHODIMP
EmbedLiteViewBaseParent::ReceiveInputEvent(const mozilla::InputData& aEvent)
{
LOGT("APZCTreeManager: %p\n", mController->GetManager());
if (mController->GetManager()) {
ScrollableLayerGuid guid;
uint64_t outInputBlockId;
Expand Down
4 changes: 4 additions & 0 deletions embedding/embedlite/embedthread/EmbedContentController.cpp
Expand Up @@ -28,6 +28,7 @@ EmbedContentController::EmbedContentController(EmbedLiteViewBaseParent* aRenderF
void EmbedContentController::SetManagerByRootLayerTreeId(uint64_t aRootLayerTreeId)
{
mAPZC = CompositorParent::GetAPZCTreeManager(aRootLayerTreeId);
LOGT("APZCTreeManager: %p\n", mAPZC.get());
}

void EmbedContentController::RequestContentRepaint(const FrameMetrics& aFrameMetrics)
Expand Down Expand Up @@ -194,6 +195,9 @@ EmbedContentController::ReceiveInputEvent(InputData& aEvent,
mozilla::layers::ScrollableLayerGuid* aOutTargetGuid,
uint64_t* aOutInputBlockId)
{

LOGT(" has mAPZC: %p\n", mAPZC.get());

if (!mAPZC) {
return nsEventStatus_eIgnore;
}
Expand Down
2 changes: 1 addition & 1 deletion embedding/embedlite/utils/EmbedLog.h
Expand Up @@ -16,7 +16,7 @@
extern mozilla::LogModule* GetEmbedCommonLog(const char* aModule);

#define LOGF(FMT, ...) MOZ_LOG(GetEmbedCommonLog("EmbedLite"), mozilla::LogLevel::Error, ("FUNC::%s:%d " FMT , __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__))
#define LOGT(FMT, ...) MOZ_LOG(GetEmbedCommonLog("EmbedLite"), mozilla::LogLevel::Debug, ("TRACE::%s:%d " FMT , __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__))
#define LOGT(FMT, ...) MOZ_LOG(GetEmbedCommonLog("EmbedLiteTrace"), mozilla::LogLevel::Debug, ("TRACE::%s:%d " FMT , __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__))
#define LOGW(FMT, ...) MOZ_LOG(GetEmbedCommonLog("EmbedLite"), mozilla::LogLevel::Info, ("WARN: EmbedLite::%s:%d " FMT , __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__))
#define LOGE(FMT, ...) MOZ_LOG(GetEmbedCommonLog("EmbedLite"), mozilla::LogLevel::Warning, ("ERROR: EmbedLite::%s:%d " FMT , __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__))
#define LOGNI(FMT, ...) MOZ_LOG(GetEmbedCommonLog("EmbedLite"), mozilla::LogLevel::Error, ("NON_IMPL: EmbedLite::%s:%d " FMT , __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__))
Expand Down

0 comments on commit 041bc56

Please sign in to comment.