Skip to content

Commit

Permalink
Improve trace logs
Browse files Browse the repository at this point in the history
  • Loading branch information
rainemak committed Apr 5, 2019
1 parent a626db7 commit 229f23b
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 9 deletions.
8 changes: 6 additions & 2 deletions embedding/embedlite/EmbedLiteView.cpp
Expand Up @@ -19,6 +19,8 @@
#include "imgIEncoder.h"
#include "InputData.h"

#include <sys/syscall.h>

namespace mozilla {
namespace embedlite {

Expand Down Expand Up @@ -89,7 +91,8 @@ EmbedLiteView::LoadURL(const char* aUrl)
void
EmbedLiteView::SetIsActive(bool aIsActive)
{
LOGT("active: %d", aIsActive);
LOGT("active: %d thread %ld", aIsActive, syscall(SYS_gettid));

NS_ENSURE_TRUE(mViewParent, );
Unused << mViewParent->SendSetIsActive(aIsActive);
// Make sure active view content controller is always registered with
Expand All @@ -102,7 +105,8 @@ EmbedLiteView::SetIsActive(bool aIsActive)
void
EmbedLiteView::SetIsFocused(bool aIsFocused)
{
LOGT();
LOGT("focus: %d thread %ld", aIsFocused, syscall(SYS_gettid));

NS_ENSURE_TRUE(mViewParent, );
Unused << mViewParent->SendSetIsFocused(aIsFocused);
}
Expand Down
4 changes: 3 additions & 1 deletion embedding/embedlite/embedshared/EmbedLitePuppetWidget.cpp
Expand Up @@ -38,6 +38,8 @@
#include "mozilla/unused.h"
#include "mozilla/BasicEvents.h"

#include <sys/syscall.h>

using namespace mozilla::dom;
using namespace mozilla::gl;
using namespace mozilla::hal;
Expand Down Expand Up @@ -760,7 +762,7 @@ bool EmbedLitePuppetWidget::AsyncPanZoomEnabled() const
void EmbedLitePuppetWidget::UpdateZoomConstraints(const uint32_t &aPresShellId, const FrameMetrics::ViewID &aViewId, const mozilla::Maybe<ZoomConstraints> &aConstraints)
{
EmbedLiteViewChildIface* view = GetEmbedLiteChildView();
LOGT("view: %p, mWindow: %p, child view: %p", mView, mWindow, view);
LOGT("view: %p", view, mWindow);
if (view) {
view->UpdateZoomConstraints(aPresShellId,
aViewId,
Expand Down
5 changes: 5 additions & 0 deletions embedding/embedlite/embedshared/EmbedLiteViewBaseChild.cpp
Expand Up @@ -42,6 +42,8 @@
#include "nsIFrame.h" // for nsIFrame
#include "FrameLayerBuilder.h" // for FrameLayerbuilder

#include <sys/syscall.h>

using namespace mozilla::layers;
using namespace mozilla::widget;

Expand Down Expand Up @@ -352,6 +354,7 @@ bool
EmbedLiteViewBaseChild::GetInputContext(int32_t* IMEEnabled,
int32_t* IMEOpen)
{
LOGT();
return SendGetInputContext(IMEEnabled, IMEOpen);
}

Expand Down Expand Up @@ -574,6 +577,7 @@ EmbedLiteViewBaseChild::RecvSetIsActive(const bool& aIsActive)
bool
EmbedLiteViewBaseChild::RecvSetIsFocused(const bool& aIsFocused)
{
LOGT("child focus: %d thread %ld", aIsFocused, syscall(SYS_gettid));
if (!mWebBrowser || !mDOMWindow) {
return false;
}
Expand Down Expand Up @@ -809,6 +813,7 @@ bool
EmbedLiteViewBaseChild::RecvAcknowledgeScrollUpdate(const FrameMetrics::ViewID& aScrollId,
const uint32_t& aScrollGeneration)
{
LOGT("thread id: %ld", syscall(SYS_gettid));
APZCCallbackHelper::AcknowledgeScrollUpdate(aScrollId, aScrollGeneration);
return true;
}
Expand Down
7 changes: 5 additions & 2 deletions embedding/embedlite/embedshared/EmbedLiteViewBaseParent.cpp
Expand Up @@ -13,6 +13,7 @@
#include "mozilla/unused.h"
#include "EmbedContentController.h"
#include "mozilla/layers/APZCTreeManager.h"
#include <sys/syscall.h>

using namespace mozilla::layers;
using namespace mozilla::widget;
Expand Down Expand Up @@ -52,7 +53,7 @@ EmbedLiteViewBaseParent::~EmbedLiteViewBaseParent()
void
EmbedLiteViewBaseParent::ActorDestroy(ActorDestroyReason aWhy)
{
LOGT("reason:%i", aWhy);
LOGT("reason: %i layer id: %d", aWhy, mRootLayerTreeId);
mController = nullptr;
}

Expand All @@ -67,7 +68,7 @@ EmbedLiteViewBaseParent::SetCompositor(EmbedLiteCompositorParent* aCompositor)
void
EmbedLiteViewBaseParent::UpdateScrollController()
{
LOGT("view api destroyed: %d mVIew: %p compositor: %p\n", mViewAPIDestroyed, mView, mCompositor.get());
LOGT("destroyed: %d mVIew: %p compositor: %p\n", mViewAPIDestroyed, mView, mCompositor.get());
if (mViewAPIDestroyed || !mView) {
return;
}
Expand Down Expand Up @@ -99,6 +100,7 @@ EmbedLiteViewBaseParent::RecvInitialized()
bool
EmbedLiteViewBaseParent::RecvDestroyed()
{
LOGT("view destroyed: %d", mViewAPIDestroyed);
if (mViewAPIDestroyed) {
return true;
}
Expand Down Expand Up @@ -273,6 +275,7 @@ EmbedLiteViewBaseParent::RecvZoomToRect(const uint32_t& aPresShellId,
const ViewID& aViewId,
const CSSRect& aRect)
{
LOGT("thread id: %ld", syscall(SYS_gettid));
if (mController->GetManager()) {
mController->GetManager()->ZoomToRect(ScrollableLayerGuid(mRootLayerTreeId, aPresShellId, aViewId), aRect);
}
Expand Down
5 changes: 1 addition & 4 deletions embedding/embedlite/embedthread/EmbedContentController.cpp
Expand Up @@ -167,12 +167,9 @@ EmbedLiteViewListener* const EmbedContentController::GetListener() const

void EmbedContentController::DoRequestContentRepaint(const FrameMetrics& aFrameMetrics)
{
LOGT("do request %p", mRenderFrame);
LOGT("render frame %p", mRenderFrame);
if (mRenderFrame && !GetListener()->RequestContentRepaint()) {
LOGT("sending request");

DoSendScrollEvent(aFrameMetrics);

Unused << mRenderFrame->SendUpdateFrame(aFrameMetrics);
}
}
Expand Down

0 comments on commit 229f23b

Please sign in to comment.