Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Revert "Added EmbedLiteAppIface in order to abstract embedliteApp fro…
…m thread based IPC interface."

This reverts commit 72e6b4d.
  • Loading branch information
tmeshkova committed Oct 19, 2014
1 parent 201dbc7 commit 3e00c8d
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 153 deletions.
33 changes: 16 additions & 17 deletions embedding/embedlite/EmbedLiteApp.cpp
Expand Up @@ -25,7 +25,6 @@
#include "EmbedLiteMessagePump.h"

#include "EmbedLiteCompositorParent.h"
#include "EmbedLiteAppIface.h"

namespace mozilla {
namespace embedlite {
Expand Down Expand Up @@ -202,7 +201,7 @@ EmbedLiteApp::AddManifestLocation(const char* manifest)
if (!mAppParent) {
sComponentDirs.AppendElement(nsCString(manifest));
} else {
unused << mAppParent->LoadComponentManifest(manifest);
unused << mAppParent->SendLoadComponentManifest(nsDependentCString(manifest));
}
}

Expand All @@ -225,12 +224,10 @@ EmbedLiteApp::StartChildThread()

mAppParent = new EmbedLiteAppThreadParent();
mAppChild = new EmbedLiteAppThreadChild(mUILoop);
mozilla::ipc::MessageChannel* parentChannel = nullptr;
mAppParent->GetEmbedIPCChannel(&parentChannel);
MessageLoop::current()->PostTask(FROM_HERE,
NewRunnableMethod(mAppChild.get(),
&EmbedLiteAppThreadChild::Init,
parentChannel));
mAppParent->GetIPCChannel()));

return true;
}
Expand Down Expand Up @@ -275,7 +272,8 @@ EmbedLiteApp::Stop()
mDestroying = true;
} else if (!mDestroying) {
mDestroying = true;
mAppParent->PreDestroy();
mUILoop->PostTask(FROM_HERE,
NewRunnableMethod(mAppParent.get(), &EmbedLiteAppThreadParent::SendPreDestroy));
} else {
NS_ASSERTION(mUILoop, "Start was not called before stop");
mUILoop->DoQuit();
Expand All @@ -302,58 +300,58 @@ EmbedLiteApp::Stop()
void
EmbedLiteApp::SetBoolPref(const char* aName, bool aValue)
{
unused << mAppParent->SetBoolPref(aName, aValue);
unused << mAppParent->SendSetBoolPref(nsDependentCString(aName), aValue);
}

void
EmbedLiteApp::SetCharPref(const char* aName, const char* aValue)
{
unused << mAppParent->SetCharPref(aName, aValue);
unused << mAppParent->SendSetCharPref(nsDependentCString(aName), nsDependentCString(aValue));
}

void
EmbedLiteApp::SetIntPref(const char* aName, int aValue)
{
unused << mAppParent->SetIntPref(aName, aValue);
unused << mAppParent->SendSetIntPref(nsDependentCString(aName), aValue);
}

void
EmbedLiteApp::LoadGlobalStyleSheet(const char* aUri, bool aEnable)
{
LOGT();
unused << mAppParent->LoadGlobalStyleSheet(aUri, aEnable);
unused << mAppParent->SendLoadGlobalStyleSheet(nsDependentCString(aUri), aEnable);
}

void
EmbedLiteApp::SendObserve(const char* aMessageName, const char16_t* aMessage)
{
LOGT("topic:%s", aMessageName);
NS_ENSURE_TRUE(mAppParent, );
unused << mAppParent->Observe(aMessageName, (const char*)aMessage);
unused << mAppParent->SendObserve(nsDependentCString(aMessageName), aMessage ? nsDependentString((const char16_t*)aMessage) : nsString());
}

void
EmbedLiteApp::AddObserver(const char* aMessageName)
{
LOGT("topic:%s", aMessageName);
unused << mAppParent->AddObserver(aMessageName);
unused << mAppParent->SendAddObserver(nsDependentCString(aMessageName));
}

void
EmbedLiteApp::RemoveObserver(const char* aMessageName)
{
LOGT("topic:%s", aMessageName);
unused << mAppParent->RemoveObserver(aMessageName);
unused << mAppParent->SendRemoveObserver(nsDependentCString(aMessageName));
}

void EmbedLiteApp::AddObservers(nsTArray<nsCString>& observersList)
{
unused << mAppParent->AddObservers(observersList);
unused << mAppParent->SendAddObservers(observersList);
}

void EmbedLiteApp::RemoveObservers(nsTArray<nsCString>& observersList)
{
unused << mAppParent->RemoveObservers(observersList);
unused << mAppParent->SendRemoveObservers(observersList);
}

EmbedLiteView*
Expand All @@ -363,7 +361,7 @@ EmbedLiteApp::CreateView(uint32_t aParent)
mViewCreateID++;
EmbedLiteView* view = new EmbedLiteView(this, mViewCreateID, aParent);
mViews[mViewCreateID] = view;
unused << mAppParent->CreateView(mViewCreateID, aParent);
unused << mAppParent->SendCreateView(mViewCreateID, aParent);
return view;
}

Expand Down Expand Up @@ -412,7 +410,8 @@ EmbedLiteApp::ViewDestroyed(uint32_t id)
mViews.erase(it);
}
if (mDestroying && mViews.empty()) {
mAppParent->PreDestroy();
mUILoop->PostTask(FROM_HERE,
NewRunnableMethod(mAppParent.get(), &EmbedLiteAppThreadParent::SendPreDestroy));
}
}

Expand Down
3 changes: 1 addition & 2 deletions embedding/embedlite/EmbedLiteApp.h
Expand Up @@ -12,7 +12,6 @@
#include <map>

class MessageLoop;
class EmbedLiteAppIface;

namespace mozilla {
namespace embedlite {
Expand Down Expand Up @@ -155,7 +154,7 @@ class EmbedLiteApp
EmbedLiteUILoop* mUILoop;

RefPtr<EmbedLiteSubThread> mSubThread;
RefPtr<EmbedLiteAppIface> mAppParent;
RefPtr<EmbedLiteAppThreadParent> mAppParent;
RefPtr<EmbedLiteAppThreadChild> mAppChild;

EmbedType mEmbedType;
Expand Down
32 changes: 0 additions & 32 deletions embedding/embedlite/embedhelpers/EmbedLiteAppIface.idl

This file was deleted.

95 changes: 0 additions & 95 deletions embedding/embedlite/embedthread/EmbedLiteAppThreadParent.cpp
Expand Up @@ -19,9 +19,6 @@ namespace embedlite {

static EmbedLiteAppThreadParent* sAppThreadParent = nullptr;

/* Implementation file */
NS_IMPL_ISUPPORTS(EmbedLiteAppThreadParent, EmbedLiteAppIface)

EmbedLiteAppThreadParent::EmbedLiteAppThreadParent()
: mApp(EmbedLiteApp::GetInstance())
{
Expand Down Expand Up @@ -111,98 +108,6 @@ EmbedLiteAppThreadParent::RecvObserve(const nsCString& topic,
return true;
}

NS_IMETHODIMP
EmbedLiteAppThreadParent::LoadComponentManifest(const char* aPath)
{
unused << SendLoadComponentManifest(nsDependentCString(aPath));
return NS_OK;
}

NS_IMETHODIMP
EmbedLiteAppThreadParent::SetBoolPref(const char* aName, bool aValue)
{
unused << SendSetBoolPref(nsDependentCString(aName), aValue);
return NS_OK;
}

NS_IMETHODIMP
EmbedLiteAppThreadParent::SetCharPref(const char* aName, const char * aValue)
{
unused << SendSetCharPref(nsDependentCString(aName), nsDependentCString(aValue));
return NS_OK;
}

NS_IMETHODIMP
EmbedLiteAppThreadParent::SetIntPref(const char* aName, int32_t aValue)
{
unused << SendSetIntPref(nsDependentCString(aName), aValue);
return NS_OK;
}

NS_IMETHODIMP
EmbedLiteAppThreadParent::LoadGlobalStyleSheet(const char* aName, bool aEnable)
{
unused << SendLoadGlobalStyleSheet(nsDependentCString(aName), aEnable);
return NS_OK;
}

NS_IMETHODIMP
EmbedLiteAppThreadParent::Observe(const char* aName, const char* aMessage)
{
unused << SendObserve(nsDependentCString(aName), aMessage ? nsDependentString((const char16_t*)aMessage) : nsString());
return NS_OK;
}

NS_IMETHODIMP
EmbedLiteAppThreadParent::AddObserver(const char* aMessageName)
{
unused << SendAddObserver(nsDependentCString(aMessageName));
return NS_OK;
}

NS_IMETHODIMP
EmbedLiteAppThreadParent::RemoveObserver(const char* aMessageName)
{
unused << SendRemoveObserver(nsDependentCString(aMessageName));
return NS_OK;
}

NS_IMETHODIMP
EmbedLiteAppThreadParent::AddObservers(const nsTArray<nsCString>& observersList)
{
unused << SendAddObservers(observersList);
return NS_OK;
}

NS_IMETHODIMP
EmbedLiteAppThreadParent::RemoveObservers(const nsTArray<nsCString>& observersList)
{
unused << SendRemoveObservers(observersList);
return NS_OK;
}

NS_IMETHODIMP
EmbedLiteAppThreadParent::CreateView(uint32_t aViewId, uint32_t aParentId)
{
unused << SendCreateView(aViewId, aParentId);
return NS_OK;
}

NS_IMETHODIMP
EmbedLiteAppThreadParent::PreDestroy()
{
mApp->GetUILoop()->PostTask(FROM_HERE,
NewRunnableMethod(this, &EmbedLiteAppThreadParent::SendPreDestroy));
return NS_OK;
}

NS_IMETHODIMP
EmbedLiteAppThreadParent::GetEmbedIPCChannel(mozilla::ipc::MessageChannel* *aChannel)
{
*aChannel = GetIPCChannel();
return NS_OK;
}

} // namespace embedlite
} // namespace mozilla

8 changes: 2 additions & 6 deletions embedding/embedlite/embedthread/EmbedLiteAppThreadParent.h
Expand Up @@ -7,19 +7,15 @@
#define MOZ_APP_EMBED_THREAD_PARENT_H

#include "mozilla/embedlite/PEmbedLiteAppParent.h"
#include "EmbedLiteAppIface.h"

namespace mozilla {
namespace embedlite {

class EmbedLiteApp;
class EmbedLiteAppThreadParent : public PEmbedLiteAppParent,
public EmbedLiteAppIface
class EmbedLiteAppThreadParent : public PEmbedLiteAppParent
{
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(EmbedLiteAppThreadParent)
public:
NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_EMBEDLITEAPPIFACE

// IPDL
virtual bool
RecvInitialized();
Expand Down
1 change: 0 additions & 1 deletion embedding/embedlite/moz.build
Expand Up @@ -13,7 +13,6 @@ FAIL_ON_WARNINGS = True
FINAL_LIBRARY = 'xul'

XPIDL_SOURCES += [
'embedhelpers/EmbedLiteAppIface.idl',
'embedhelpers/EmbedLiteViewIface.idl',
'modules/nsIEmbedAppService.idl',
'modules/nsIEmbedLiteJSON.idl',
Expand Down

0 comments on commit 3e00c8d

Please sign in to comment.