Skip to content

Commit

Permalink
Fixed double EmbedLiteApp initialization in process backend
Browse files Browse the repository at this point in the history
Fixed start and shutdown with full cleanup in process backend
  • Loading branch information
tmeshkova committed Jan 4, 2015
1 parent 4d1cd19 commit a890591
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
5 changes: 2 additions & 3 deletions embedding/embedlite/EmbedLiteView.cpp
Expand Up @@ -39,9 +39,8 @@ EmbedLiteView::EmbedLiteView(EmbedLiteApp* aApp, PEmbedLiteViewParent* aViewImpl
EmbedLiteView::~EmbedLiteView()
{
LOGT("impl:%p", mViewImpl);
if (mViewImpl && mApp->GetType() == EmbedLiteApp::EMBED_THREAD) {
EmbedLiteViewThreadParent* impl = static_cast<EmbedLiteViewThreadParent*>(mViewImpl);
unused << impl->SendDestroy();
if (mViewImpl) {
unused << mViewParent->SendDestroy();
} else {
LOGNI();
}
Expand Down
2 changes: 0 additions & 2 deletions embedding/embedlite/embedprocess/EmbedLiteAppProcessChild.cpp
Expand Up @@ -112,8 +112,6 @@ EmbedLiteAppProcessChild::InitXPCOM()
mozilla::DebugOnly<nsresult> rv = InitAppService();
MOZ_ASSERT(NS_SUCCEEDED(rv));

SendInitialized();

nsCOMPtr<nsIObserverService> observerService =
do_GetService(NS_OBSERVERSERVICE_CONTRACTID);

Expand Down
2 changes: 2 additions & 0 deletions embedding/embedlite/embedshared/EmbedLiteAppBaseChild.cpp
Expand Up @@ -33,6 +33,8 @@ using namespace mozilla::layers;
namespace mozilla {
namespace embedlite {

NS_GENERIC_FACTORY_CONSTRUCTOR(EmbedLiteJSON)

static EmbedLiteAppBaseChild* sAppBaseChild = nullptr;

EmbedLiteAppBaseChild*
Expand Down
2 changes: 1 addition & 1 deletion embedding/embedlite/modules/EmbedLiteAppService.cpp
Expand Up @@ -112,10 +112,10 @@ void EmbedLiteAppService::UnregisterView(uint32_t aId)
std::map<uint64_t, uint32_t>::iterator it;
for (it = mIDMap.begin(); it != mIDMap.end(); ++it) {
if (aId == it->second) {
mIDMap.erase(it);
break;
}
}
mIDMap.erase(it);
}

NS_IMETHODIMP
Expand Down
2 changes: 0 additions & 2 deletions embedding/embedlite/modules/EmbedLiteJSON.h
Expand Up @@ -23,8 +23,6 @@ class EmbedLiteJSON : public nsIEmbedLiteJSON
virtual ~EmbedLiteJSON();
};

NS_GENERIC_FACTORY_CONSTRUCTOR(EmbedLiteJSON)

#define NS_EMBED_LITE_JSON_CONTRACTID "@mozilla.org/embedlite-json;1"
#define NS_EMBED_LITE_JSON_SERVICE_CLASSNAME "EmbedLite JSON Component"
#define NS_EMBED_LITE_JSON_SERVICE_CID NS_IEMBEDLITEJSON_IID
Expand Down
3 changes: 3 additions & 0 deletions embedding/embedlite/tests/embedLiteViewInitTest.cpp
Expand Up @@ -127,6 +127,9 @@ void MyListener::CreateView(void* aData)

void MyListener::Initialized()
{
static bool sAppInititalized = false;
MOZ_ASSERT(!sAppInititalized, "EmbedliteApp sent Initialized notification twice\n");
sAppInititalized = true;
printf("Embedding initialized, let's make view");

int defaultViewCount = 2;
Expand Down

0 comments on commit a890591

Please sign in to comment.