Skip to content

Commit

Permalink
Allow to build most of embedlite sources in unified mode
Browse files Browse the repository at this point in the history
  • Loading branch information
tmeshkova committed Mar 12, 2014
1 parent 5be78bb commit ca4b528
Show file tree
Hide file tree
Showing 20 changed files with 18 additions and 48 deletions.
1 change: 0 additions & 1 deletion embedding/embedlite/EmbedLiteApp.cpp
Expand Up @@ -3,7 +3,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#define LOG_COMPONENT "EmbedLiteApp"
#include "EmbedLog.h"

#include "EmbedLiteApp.h"
Expand Down
1 change: 0 additions & 1 deletion embedding/embedlite/EmbedLiteMessagePump.cpp
Expand Up @@ -3,7 +3,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#define LOG_COMPONENT "EmbedLiteMessagePump"
#include "EmbedLog.h"

#include "EmbedLiteMessagePump.h"
Expand Down
3 changes: 1 addition & 2 deletions embedding/embedlite/EmbedLiteRenderTarget.cpp
Expand Up @@ -3,11 +3,10 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#define LOG_COMPONENT "EmbedLiteRenderTarget"
#include "EmbedLog.h"

#include "EmbedLiteRenderTarget.h"
#include "GLContext.h"
#include "EmbedLiteRenderTarget.h"
#include "GLContextProvider.h"

using namespace mozilla::gl;
Expand Down
1 change: 0 additions & 1 deletion embedding/embedlite/EmbedLiteView.cpp
Expand Up @@ -3,7 +3,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#define LOG_COMPONENT "EmbedLiteView"
#include "EmbedLog.h"

#include "EmbedLiteView.h"
Expand Down
1 change: 0 additions & 1 deletion embedding/embedlite/embedhelpers/EmbedLiteSubThread.cpp
Expand Up @@ -5,7 +5,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#define LOG_COMPONENT "EmbedLiteSubThread"
#include "EmbedLog.h"

#include "EmbedLiteSubThread.h"
Expand Down
1 change: 0 additions & 1 deletion embedding/embedlite/embedhelpers/EmbedLiteUILoop.cpp
Expand Up @@ -3,7 +3,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#define LOG_COMPONENT "EmbedLiteUILoop"
#include "EmbedLog.h"

#include "EmbedLiteUILoop.h"
Expand Down
2 changes: 1 addition & 1 deletion embedding/embedlite/embedthread/EmbedContentController.cpp
Expand Up @@ -17,7 +17,6 @@ using namespace mozilla::gfx;
using namespace mozilla::layers;

class FakeListener : public EmbedLiteViewListener {};
static FakeListener sFakeListener;

EmbedContentController::EmbedContentController(EmbedLiteViewThreadParent* aRenderFrame, MessageLoop* aUILoop)
: mUILoop(aUILoop)
Expand Down Expand Up @@ -167,6 +166,7 @@ void EmbedContentController::PostDelayedTask(Task* aTask, int aDelayMs)

EmbedLiteViewListener* const EmbedContentController::GetListener() const
{
static FakeListener sFakeListener;
return mRenderFrame && mRenderFrame->mView ?
mRenderFrame->mView->GetListener() : &sFakeListener;
}
Expand Down
Expand Up @@ -3,7 +3,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#define LOG_COMPONENT "EmbedLiteAppThreadChild"
#include "EmbedLog.h"

#include "EmbedLiteAppThreadChild.h"
Expand Down
Expand Up @@ -3,7 +3,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#define LOG_COMPONENT "EmbedLiteAppThreadParent"
#include "EmbedLog.h"

#include "EmbedLiteViewThreadParent.h"
Expand Down
Expand Up @@ -3,7 +3,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#define LOG_COMPONENT "EmbedLiteCompositorParent"
#include "EmbedLog.h"

#include "EmbedLiteCompositorParent.h"
Expand Down
3 changes: 0 additions & 3 deletions embedding/embedlite/embedthread/EmbedLitePuppetWidget.cpp
Expand Up @@ -5,7 +5,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#define LOG_COMPONENT "EmbedLitePuppetWidget"
#include "EmbedLog.h"

#include "base/basictypes.h"
Expand All @@ -25,7 +24,6 @@
#include "Layers.h"
#include "BasicLayers.h"
#include "ClientLayerManager.h"
#include "GLContext.h"
#include "GLContextProvider.h"
#include "EmbedLiteCompositorParent.h"
#include "mozilla/Preferences.h"
Expand All @@ -45,7 +43,6 @@ const size_t EmbedLitePuppetWidget::kMaxDimension = 4000;

static nsTArray<EmbedLitePuppetWidget*> gTopLevelWindows;
static bool sFailedToCreateGLContext = false;
static nsRefPtr<gl::GLContext> sGLContext;

NS_IMPL_ISUPPORTS_INHERITED1(EmbedLitePuppetWidget, nsBaseWidget,
nsISupportsWeakReference)
Expand Down
Expand Up @@ -3,7 +3,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#define LOG_COMPONENT "EmbedLiteViewThreadChild"
#include "EmbedLog.h"

#include "EmbedLiteViewThreadChild.h"
Expand Down
Expand Up @@ -3,7 +3,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#define LOG_COMPONENT "EmbedLiteViewThreadParent"
#include "EmbedLog.h"

#include "EmbedLiteViewThreadParent.h"
Expand All @@ -18,7 +17,7 @@
#include "mozilla/layers/APZCTreeManager.h"
#include "EmbedLiteRenderTarget.h"

#include "GLContext.h" // for GLContext
//#include "GLContext.h" // for GLContext
#include "GLScreenBuffer.h" // for GLScreenBuffer
#include "SharedSurfaceEGL.h" // for SurfaceFactory_EGLImage
#include "SharedSurfaceGL.h" // for SurfaceFactory_GLTexture, etc
Expand Down
11 changes: 7 additions & 4 deletions embedding/embedlite/moz.build
Expand Up @@ -30,20 +30,17 @@ EXPORTS.mozilla.embedlite += [

EXPORTS.ipc = ['embedhelpers/InputDataIPC.h']

SOURCES += [
UNIFIED_SOURCES += [
'embedhelpers/EmbedLiteSubThread.cpp',
'embedhelpers/EmbedLiteUILoop.cpp',
'EmbedLiteApp.cpp',
'EmbedLiteMessagePump.cpp',
'EmbedLiteRenderTarget.cpp',
'EmbedLiteView.cpp',
'embedthread/EmbedContentController.cpp',
'embedthread/EmbedLiteAppThreadChild.cpp',
'embedthread/EmbedLiteAppThreadParent.cpp',
'embedthread/EmbedLiteCompositorParent.cpp',
'embedthread/EmbedLitePuppetWidget.cpp',
'embedthread/EmbedLiteViewThreadChild.cpp',
'embedthread/EmbedLiteViewThreadParent.cpp',
'modules/EmbedLiteAppService.cpp',
'modules/EmbedLiteJSON.cpp',
'utils/DirProvider.cpp',
Expand All @@ -55,6 +52,12 @@ SOURCES += [
'utils/WindowCreator.cpp',
]

SOURCES += [
'EmbedLiteRenderTarget.cpp',
'embedthread/EmbedLiteCompositorParent.cpp',
'embedthread/EmbedLiteViewThreadParent.cpp',
]

IPDL_SOURCES += [
'PEmbedLiteApp.ipdl',
'PEmbedLiteView.ipdl'
Expand Down
1 change: 0 additions & 1 deletion embedding/embedlite/utils/DirProvider.cpp
Expand Up @@ -3,7 +3,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#define LOG_COMPONENT "DirProvider"
#include "EmbedLog.h"

#include "DirProvider.h"
Expand Down
30 changes: 8 additions & 22 deletions embedding/embedlite/utils/EmbedLog.h
Expand Up @@ -14,36 +14,22 @@

#ifdef EMBED_LITE_INTERNAL

#define FORCE_PR_LOG 1
#include "prlog.h"

extern PRLogModuleInfo* GetEmbedCommonLog(const char* aModule);

#ifdef LOG_COMPONENT
#define LOGF(FMT, ...) PR_LOG(GetEmbedCommonLog(LOG_COMPONENT), PR_LOG_DEBUG, (LOG_COMPONENT "::%s:%d " FMT , __FUNCTION__, __LINE__, ##__VA_ARGS__))
#define LOGT(FMT, ...) PR_LOG(GetEmbedCommonLog("EmbedLiteTrace"), PR_LOG_DEBUG, (LOG_COMPONENT "::%s:%d " FMT , __FUNCTION__, __LINE__, ##__VA_ARGS__))
#define LOGW(FMT, ...) PR_LOG(GetEmbedCommonLog(LOG_COMPONENT), PR_LOG_WARNING, ("W:" LOG_COMPONENT "::%s:%d " FMT , __FUNCTION__, __LINE__, ##__VA_ARGS__))
#define LOGE(FMT, ...) PR_LOG(GetEmbedCommonLog(LOG_COMPONENT), PR_LOG_ERROR, ("E:" LOG_COMPONENT "::%s:%d " FMT , __FUNCTION__, __LINE__, ##__VA_ARGS__))
#define LOGNI(FMT, ...) PR_LOG(GetEmbedCommonLog("EmbedNonImpl"), PR_LOG_ALWAYS, ("NON_IMPL:" LOG_COMPONENT "::%s:%d " FMT , __FUNCTION__, __LINE__, ##__VA_ARGS__))
#else // NON LOG_COMPONENT
#define LOGF(FMT, ...) PR_LOG(GetEmbedCommonLog("EmbedLite"), PR_LOG_DEBUG, ("EmbedLite::%s:%d " FMT , __FUNCTION__, __LINE__, ##__VA_ARGS__))
#define LOGT(FMT, ...) PR_LOG(GetEmbedCommonLog("EmbedLiteTrace"), PR_LOG_DEBUG, ("EmbedLite::%s:%d " FMT , __FUNCTION__, __LINE__, ##__VA_ARGS__))
#define LOGW(FMT, ...) PR_LOG(GetEmbedCommonLog("EmbedLite"), PR_LOG_WARNING, ("W: EmbedLite::%s:%d " FMT , __FUNCTION__, __LINE__, ##__VA_ARGS__))
#define LOGE(FMT, ...) PR_LOG(GetEmbedCommonLog("EmbedLite"), PR_LOG_ERROR, ("E: EmbedLite::%s:%d " FMT , __FUNCTION__, __LINE__, ##__VA_ARGS__))
#define LOGNI(FMT, ...) PR_LOG(GetEmbedCommonLog("EmbedNonImpl"), PR_LOG_ALWAYS, ("NON_IMPL: EmbedLite::%s:%d " FMT , __FUNCTION__, __LINE__, ##__VA_ARGS__))
#endif // LOG_COMPONENT

#define LOGC(CUSTOMNAME, FMT, ...) PR_LOG(GetEmbedCommonLog(CUSTOMNAME), PR_LOG_DEBUG, (CUSTOMNAME "::%s:%d " FMT , __FUNCTION__, __LINE__, ##__VA_ARGS__))
#define LOGF(FMT, ...) PR_LOG(GetEmbedCommonLog("EmbedLite"), PR_LOG_ALWAYS, ("FUNC::%s:%d " FMT , __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__))
#define LOGT(FMT, ...) PR_LOG(GetEmbedCommonLog("EmbedLite"), PR_LOG_DEBUG, ("TRACE::%s:%d " FMT , __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__))
#define LOGW(FMT, ...) PR_LOG(GetEmbedCommonLog("EmbedLite"), PR_LOG_WARNING, ("WARN: EmbedLite::%s:%d " FMT , __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__))
#define LOGE(FMT, ...) PR_LOG(GetEmbedCommonLog("EmbedLite"), PR_LOG_ERROR, ("ERROR: EmbedLite::%s:%d " FMT , __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__))
#define LOGNI(FMT, ...) PR_LOG(GetEmbedCommonLog("EmbedLite"), PR_LOG_ALWAYS, ("NON_IMPL: EmbedLite::%s:%d " FMT , __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__))

#define LOGC(CUSTOMNAME, FMT, ...) PR_LOG(GetEmbedCommonLog(CUSTOMNAME), PR_LOG_WARNING, (CUSTOMNAME "::%s:%d " FMT , __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__))

#else // EMBED_LITE_INTERNAL

#ifdef LOG_COMPONENT
#define LOGT(FMT, ...) fprintf(stderr, \
"EmbedLiteExt %s:%s:%d: " FMT "\n", LOG_COMPONENT, __FUNCTION__, __LINE__, ##__VA_ARGS__)
#else // LOG_COMPONENT
#define LOGT(FMT, ...) fprintf(stderr, \
"EmbedLiteExt %s:%d: " FMT "\n", __FUNCTION__, __LINE__, ##__VA_ARGS__)
#endif // LOG_COMPONENT
"EmbedLiteExt %s:%d: " FMT "\n", __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)

#endif // EMBED_LITE_INTERNAL

Expand Down
1 change: 0 additions & 1 deletion embedding/embedlite/utils/GeckoLoader.cpp
Expand Up @@ -3,7 +3,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#define LOG_COMPONENT "GeckoLoader"
#include "EmbedLog.h"

#include "GeckoLoader.h"
Expand Down
1 change: 0 additions & 1 deletion embedding/embedlite/utils/TabChildHelper.cpp
Expand Up @@ -3,7 +3,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#define LOG_COMPONENT "TabChildHelper"
#include "EmbedLog.h"

#include "TabChildHelper.h"
Expand Down
1 change: 0 additions & 1 deletion embedding/embedlite/utils/WebBrowserChrome.cpp
Expand Up @@ -3,7 +3,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#define LOG_COMPONENT "WebBrowserChrome"
#include "EmbedLog.h"

#include "WebBrowserChrome.h"
Expand Down
1 change: 0 additions & 1 deletion embedding/embedlite/utils/WindowCreator.cpp
Expand Up @@ -3,7 +3,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#define LOG_COMPONENT "WindowCreator"
#include "EmbedLog.h"

#include "nsIWebBrowserChrome.h"
Expand Down

0 comments on commit ca4b528

Please sign in to comment.