зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1235576 - Fix the indentation in dom/ipc, r=smaug
This commit is contained in:
Родитель
084b138ad2
Коммит
9b34c64d31
|
@ -14,13 +14,14 @@ class CPOWManager;
|
|||
} /* namespace jsipc */
|
||||
|
||||
namespace dom {
|
||||
|
||||
class CPOWManagerGetter
|
||||
{
|
||||
public:
|
||||
virtual mozilla::jsipc::CPOWManager* GetCPOWManager() = 0;
|
||||
};
|
||||
} /* namespace dom */
|
||||
|
||||
} /* namespace dom */
|
||||
} /* namespace mozilla */
|
||||
|
||||
#endif /* mozilla_dom_CPOWManagerGetter_h */
|
||||
|
|
|
@ -27,7 +27,7 @@ public:
|
|||
|
||||
virtual void ActorDestroy(ActorDestroyReason aWhy) override;
|
||||
void DeferredDestroy();
|
||||
virtual bool IsContentBridgeParent() override { return true; }
|
||||
virtual bool IsContentBridgeParent() const override { return true; }
|
||||
void NotifyTabDestroyed();
|
||||
|
||||
static ContentBridgeParent*
|
||||
|
@ -48,15 +48,15 @@ public:
|
|||
|
||||
jsipc::CPOWManager* GetCPOWManager() override;
|
||||
|
||||
virtual ContentParentId ChildID() override
|
||||
virtual ContentParentId ChildID() const override
|
||||
{
|
||||
return mChildID;
|
||||
}
|
||||
virtual bool IsForApp() override
|
||||
virtual bool IsForApp() const override
|
||||
{
|
||||
return mIsForApp;
|
||||
}
|
||||
virtual bool IsForBrowser() override
|
||||
virtual bool IsForBrowser() const override
|
||||
{
|
||||
return mIsForBrowser;
|
||||
}
|
||||
|
@ -68,27 +68,32 @@ protected:
|
|||
{
|
||||
mChildID = aId;
|
||||
}
|
||||
|
||||
void SetIsForApp(bool aIsForApp)
|
||||
{
|
||||
mIsForApp = aIsForApp;
|
||||
}
|
||||
|
||||
void SetIsForBrowser(bool aIsForBrowser)
|
||||
{
|
||||
mIsForBrowser = aIsForBrowser;
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual bool RecvSyncMessage(const nsString& aMsg,
|
||||
const ClonedMessageData& aData,
|
||||
InfallibleTArray<jsipc::CpowEntry>&& aCpows,
|
||||
const IPC::Principal& aPrincipal,
|
||||
nsTArray<StructuredCloneData>* aRetvals) override;
|
||||
virtual bool
|
||||
RecvSyncMessage(const nsString& aMsg,
|
||||
const ClonedMessageData& aData,
|
||||
InfallibleTArray<jsipc::CpowEntry>&& aCpows,
|
||||
const IPC::Principal& aPrincipal,
|
||||
nsTArray<StructuredCloneData>* aRetvals) override;
|
||||
|
||||
virtual bool RecvAsyncMessage(const nsString& aMsg,
|
||||
const ClonedMessageData& aData,
|
||||
InfallibleTArray<jsipc::CpowEntry>&& aCpows,
|
||||
const IPC::Principal& aPrincipal) override;
|
||||
|
||||
virtual jsipc::PJavaScriptParent* AllocPJavaScriptParent() override;
|
||||
|
||||
virtual bool
|
||||
DeallocPJavaScriptParent(jsipc::PJavaScriptParent*) override;
|
||||
|
||||
|
@ -99,6 +104,7 @@ protected:
|
|||
const ContentParentId& aCpID,
|
||||
const bool& aIsForApp,
|
||||
const bool& aIsForBrowser) override;
|
||||
|
||||
virtual bool DeallocPBrowserParent(PBrowserParent*) override;
|
||||
|
||||
virtual PBlobParent*
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -20,26 +20,26 @@ namespace dom {
|
|||
*/
|
||||
class ContentProcess : public mozilla::ipc::ProcessChild
|
||||
{
|
||||
typedef mozilla::ipc::ProcessChild ProcessChild;
|
||||
typedef mozilla::ipc::ProcessChild ProcessChild;
|
||||
|
||||
public:
|
||||
explicit ContentProcess(ProcessId aParentPid)
|
||||
: ProcessChild(aParentPid)
|
||||
{ }
|
||||
explicit ContentProcess(ProcessId aParentPid)
|
||||
: ProcessChild(aParentPid)
|
||||
{ }
|
||||
|
||||
~ContentProcess()
|
||||
{ }
|
||||
~ContentProcess()
|
||||
{ }
|
||||
|
||||
virtual bool Init() override;
|
||||
virtual void CleanUp() override;
|
||||
virtual bool Init() override;
|
||||
virtual void CleanUp() override;
|
||||
|
||||
void SetAppDir(const nsACString& aPath);
|
||||
void SetAppDir(const nsACString& aPath);
|
||||
|
||||
private:
|
||||
ContentChild mContent;
|
||||
mozilla::ipc::ScopedXREEmbed mXREEmbed;
|
||||
ContentChild mContent;
|
||||
mozilla::ipc::ScopedXREEmbed mXREEmbed;
|
||||
|
||||
DISALLOW_EVIL_CONSTRUCTORS(ContentProcess);
|
||||
DISALLOW_EVIL_CONSTRUCTORS(ContentProcess);
|
||||
};
|
||||
|
||||
} // namespace dom
|
||||
|
|
|
@ -74,8 +74,9 @@ public:
|
|||
/**
|
||||
* Allocate a tab id for the given content process's id.
|
||||
* Used when a content process wants to create a new tab. aOpenerTabId and
|
||||
* aContext are saved in RemoteFrameInfo, which is a part of ContentProcessInfo.
|
||||
* We can use the tab id and process id to locate the TabContext for future use.
|
||||
* aContext are saved in RemoteFrameInfo, which is a part of
|
||||
* ContentProcessInfo. We can use the tab id and process id to locate the
|
||||
* TabContext for future use.
|
||||
*/
|
||||
TabId AllocateTabId(const TabId& aOpenerTabId,
|
||||
const IPCTabContext& aContext,
|
||||
|
@ -162,4 +163,4 @@ private:
|
|||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
#endif
|
||||
#endif // mozilla_dom_ContentProcessManager_h
|
||||
|
|
|
@ -11,18 +11,19 @@
|
|||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
class CrashReporterChild :
|
||||
public PCrashReporterChild
|
||||
{
|
||||
public:
|
||||
CrashReporterChild() {
|
||||
MOZ_COUNT_CTOR(CrashReporterChild);
|
||||
}
|
||||
~CrashReporterChild() {
|
||||
MOZ_COUNT_DTOR(CrashReporterChild);
|
||||
}
|
||||
|
||||
static PCrashReporterChild* GetCrashReporter();
|
||||
class CrashReporterChild :
|
||||
public PCrashReporterChild
|
||||
{
|
||||
public:
|
||||
CrashReporterChild() {
|
||||
MOZ_COUNT_CTOR(CrashReporterChild);
|
||||
}
|
||||
~CrashReporterChild() {
|
||||
MOZ_COUNT_DTOR(CrashReporterChild);
|
||||
}
|
||||
|
||||
static PCrashReporterChild* GetCrashReporter();
|
||||
};
|
||||
|
||||
} // namespace dom
|
||||
|
|
|
@ -26,7 +26,7 @@ CrashReporterParent::AnnotateCrashReport(const nsCString& key,
|
|||
const nsCString& data)
|
||||
{
|
||||
#ifdef MOZ_CRASHREPORTER
|
||||
mNotes.Put(key, data);
|
||||
mNotes.Put(key, data);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -39,8 +39,8 @@ CrashReporterParent::ActorDestroy(ActorDestroyReason aWhy)
|
|||
bool
|
||||
CrashReporterParent::RecvAppendAppNotes(const nsCString& data)
|
||||
{
|
||||
mAppNotes.Append(data);
|
||||
return true;
|
||||
mAppNotes.Append(data);
|
||||
return true;
|
||||
}
|
||||
|
||||
mozilla::ipc::IProtocol*
|
||||
|
@ -48,186 +48,188 @@ CrashReporterParent::CloneProtocol(Channel* aChannel,
|
|||
mozilla::ipc::ProtocolCloneContext* aCtx)
|
||||
{
|
||||
#ifdef MOZ_CRASHREPORTER
|
||||
ContentParent* contentParent = aCtx->GetContentParent();
|
||||
CrashReporter::ThreadId childThreadId = contentParent->Pid();
|
||||
GeckoProcessType childProcessType =
|
||||
contentParent->Process()->GetProcessType();
|
||||
ContentParent* contentParent = aCtx->GetContentParent();
|
||||
CrashReporter::ThreadId childThreadId = contentParent->Pid();
|
||||
GeckoProcessType childProcessType =
|
||||
contentParent->Process()->GetProcessType();
|
||||
|
||||
nsAutoPtr<PCrashReporterParent> actor(
|
||||
contentParent->AllocPCrashReporterParent(childThreadId,
|
||||
childProcessType)
|
||||
);
|
||||
if (!actor ||
|
||||
!contentParent->RecvPCrashReporterConstructor(actor,
|
||||
childThreadId,
|
||||
childThreadId)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return actor.forget();
|
||||
#else
|
||||
MOZ_CRASH("Not Implemented");
|
||||
nsAutoPtr<PCrashReporterParent> actor(
|
||||
contentParent->AllocPCrashReporterParent(childThreadId,
|
||||
childProcessType)
|
||||
);
|
||||
if (!actor ||
|
||||
!contentParent->RecvPCrashReporterConstructor(actor,
|
||||
childThreadId,
|
||||
childThreadId)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return actor.forget();
|
||||
#else
|
||||
MOZ_CRASH("Not Implemented");
|
||||
return nullptr;
|
||||
#endif
|
||||
}
|
||||
|
||||
CrashReporterParent::CrashReporterParent()
|
||||
:
|
||||
:
|
||||
#ifdef MOZ_CRASHREPORTER
|
||||
mNotes(4),
|
||||
mNotes(4),
|
||||
#endif
|
||||
mStartTime(::time(nullptr))
|
||||
, mInitialized(false)
|
||||
mStartTime(::time(nullptr))
|
||||
, mInitialized(false)
|
||||
{
|
||||
MOZ_COUNT_CTOR(CrashReporterParent);
|
||||
MOZ_COUNT_CTOR(CrashReporterParent);
|
||||
}
|
||||
|
||||
CrashReporterParent::~CrashReporterParent()
|
||||
{
|
||||
MOZ_COUNT_DTOR(CrashReporterParent);
|
||||
MOZ_COUNT_DTOR(CrashReporterParent);
|
||||
}
|
||||
|
||||
void
|
||||
CrashReporterParent::SetChildData(const NativeThreadId& tid,
|
||||
const uint32_t& processType)
|
||||
{
|
||||
mInitialized = true;
|
||||
mMainThread = tid;
|
||||
mProcessType = processType;
|
||||
mInitialized = true;
|
||||
mMainThread = tid;
|
||||
mProcessType = processType;
|
||||
}
|
||||
|
||||
#ifdef MOZ_CRASHREPORTER
|
||||
bool
|
||||
CrashReporterParent::GenerateCrashReportForMinidump(nsIFile* minidump,
|
||||
const AnnotationTable* processNotes)
|
||||
const AnnotationTable* processNotes)
|
||||
{
|
||||
if (!CrashReporter::GetIDFromMinidump(minidump, mChildDumpID))
|
||||
return false;
|
||||
bool result = GenerateChildData(processNotes);
|
||||
FinalizeChildData();
|
||||
return result;
|
||||
if (!CrashReporter::GetIDFromMinidump(minidump, mChildDumpID)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool result = GenerateChildData(processNotes);
|
||||
FinalizeChildData();
|
||||
return result;
|
||||
}
|
||||
|
||||
bool
|
||||
CrashReporterParent::GenerateChildData(const AnnotationTable* processNotes)
|
||||
{
|
||||
MOZ_ASSERT(mInitialized);
|
||||
MOZ_ASSERT(mInitialized);
|
||||
|
||||
if (mChildDumpID.IsEmpty()) {
|
||||
NS_WARNING("problem with GenerateChildData: no child dump id yet!");
|
||||
return false;
|
||||
}
|
||||
if (mChildDumpID.IsEmpty()) {
|
||||
NS_WARNING("problem with GenerateChildData: no child dump id yet!");
|
||||
return false;
|
||||
}
|
||||
|
||||
nsAutoCString type;
|
||||
switch (mProcessType) {
|
||||
case GeckoProcessType_Content:
|
||||
type = NS_LITERAL_CSTRING("content");
|
||||
break;
|
||||
case GeckoProcessType_Plugin:
|
||||
case GeckoProcessType_GMPlugin:
|
||||
type = NS_LITERAL_CSTRING("plugin");
|
||||
break;
|
||||
default:
|
||||
NS_ERROR("unknown process type");
|
||||
break;
|
||||
}
|
||||
mNotes.Put(NS_LITERAL_CSTRING("ProcessType"), type);
|
||||
nsAutoCString type;
|
||||
switch (mProcessType) {
|
||||
case GeckoProcessType_Content:
|
||||
type = NS_LITERAL_CSTRING("content");
|
||||
break;
|
||||
case GeckoProcessType_Plugin:
|
||||
case GeckoProcessType_GMPlugin:
|
||||
type = NS_LITERAL_CSTRING("plugin");
|
||||
break;
|
||||
default:
|
||||
NS_ERROR("unknown process type");
|
||||
break;
|
||||
}
|
||||
mNotes.Put(NS_LITERAL_CSTRING("ProcessType"), type);
|
||||
|
||||
char startTime[32];
|
||||
snprintf_literal(startTime, "%lld", static_cast<long long>(mStartTime));
|
||||
mNotes.Put(NS_LITERAL_CSTRING("StartupTime"), nsDependentCString(startTime));
|
||||
char startTime[32];
|
||||
snprintf_literal(startTime, "%lld", static_cast<long long>(mStartTime));
|
||||
mNotes.Put(NS_LITERAL_CSTRING("StartupTime"), nsDependentCString(startTime));
|
||||
|
||||
if (!mAppNotes.IsEmpty()) {
|
||||
mNotes.Put(NS_LITERAL_CSTRING("Notes"), mAppNotes);
|
||||
}
|
||||
if (!mAppNotes.IsEmpty()) {
|
||||
mNotes.Put(NS_LITERAL_CSTRING("Notes"), mAppNotes);
|
||||
}
|
||||
|
||||
// Append these notes to the end of the extra file based on the current
|
||||
// dump id we obtained from CreatePairedMinidumps.
|
||||
bool ret = CrashReporter::AppendExtraData(mChildDumpID, mNotes);
|
||||
if (ret && processNotes) {
|
||||
ret = CrashReporter::AppendExtraData(mChildDumpID, *processNotes);
|
||||
}
|
||||
// Append these notes to the end of the extra file based on the current
|
||||
// dump id we obtained from CreatePairedMinidumps.
|
||||
bool ret = CrashReporter::AppendExtraData(mChildDumpID, mNotes);
|
||||
if (ret && processNotes) {
|
||||
ret = CrashReporter::AppendExtraData(mChildDumpID, *processNotes);
|
||||
}
|
||||
|
||||
if (!ret) {
|
||||
NS_WARNING("problem appending child data to .extra");
|
||||
}
|
||||
return ret;
|
||||
if (!ret) {
|
||||
NS_WARNING("problem appending child data to .extra");
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
void
|
||||
CrashReporterParent::FinalizeChildData()
|
||||
{
|
||||
MOZ_ASSERT(mInitialized);
|
||||
MOZ_ASSERT(mInitialized);
|
||||
|
||||
if (NS_IsMainThread()) {
|
||||
// Inline, this is the main thread. Get this done.
|
||||
NotifyCrashService();
|
||||
return;
|
||||
if (NS_IsMainThread()) {
|
||||
// Inline, this is the main thread. Get this done.
|
||||
NotifyCrashService();
|
||||
return;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIThread> mainThread = do_GetMainThread();
|
||||
class NotifyOnMainThread : public nsRunnable
|
||||
{
|
||||
public:
|
||||
explicit NotifyOnMainThread(CrashReporterParent* aCR)
|
||||
: mCR(aCR)
|
||||
{ }
|
||||
|
||||
NS_IMETHOD Run() {
|
||||
mCR->NotifyCrashService();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIThread> mainThread = do_GetMainThread();
|
||||
class NotifyOnMainThread : public nsRunnable
|
||||
{
|
||||
public:
|
||||
explicit NotifyOnMainThread(CrashReporterParent* aCR)
|
||||
: mCR(aCR)
|
||||
{ }
|
||||
|
||||
NS_IMETHOD Run() {
|
||||
mCR->NotifyCrashService();
|
||||
return NS_OK;
|
||||
}
|
||||
private:
|
||||
CrashReporterParent* mCR;
|
||||
};
|
||||
SyncRunnable::DispatchToThread(mainThread, new NotifyOnMainThread(this));
|
||||
private:
|
||||
CrashReporterParent* mCR;
|
||||
};
|
||||
SyncRunnable::DispatchToThread(mainThread, new NotifyOnMainThread(this));
|
||||
}
|
||||
|
||||
void
|
||||
CrashReporterParent::NotifyCrashService()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
MOZ_ASSERT(!mChildDumpID.IsEmpty());
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
MOZ_ASSERT(!mChildDumpID.IsEmpty());
|
||||
|
||||
nsCOMPtr<nsICrashService> crashService =
|
||||
do_GetService("@mozilla.org/crashservice;1");
|
||||
if (!crashService) {
|
||||
return;
|
||||
nsCOMPtr<nsICrashService> crashService =
|
||||
do_GetService("@mozilla.org/crashservice;1");
|
||||
if (!crashService) {
|
||||
return;
|
||||
}
|
||||
|
||||
int32_t processType;
|
||||
int32_t crashType = nsICrashService::CRASH_TYPE_CRASH;
|
||||
|
||||
nsCString telemetryKey;
|
||||
|
||||
switch (mProcessType) {
|
||||
case GeckoProcessType_Content:
|
||||
processType = nsICrashService::PROCESS_TYPE_CONTENT;
|
||||
telemetryKey.AssignLiteral("content");
|
||||
break;
|
||||
case GeckoProcessType_Plugin: {
|
||||
processType = nsICrashService::PROCESS_TYPE_PLUGIN;
|
||||
telemetryKey.AssignLiteral("plugin");
|
||||
nsAutoCString val;
|
||||
if (mNotes.Get(NS_LITERAL_CSTRING("PluginHang"), &val) &&
|
||||
val.Equals(NS_LITERAL_CSTRING("1"))) {
|
||||
crashType = nsICrashService::CRASH_TYPE_HANG;
|
||||
telemetryKey.AssignLiteral("pluginhang");
|
||||
}
|
||||
break;
|
||||
}
|
||||
case GeckoProcessType_GMPlugin:
|
||||
processType = nsICrashService::PROCESS_TYPE_GMPLUGIN;
|
||||
telemetryKey.AssignLiteral("gmplugin");
|
||||
break;
|
||||
default:
|
||||
NS_ERROR("unknown process type");
|
||||
return;
|
||||
}
|
||||
|
||||
int32_t processType;
|
||||
int32_t crashType = nsICrashService::CRASH_TYPE_CRASH;
|
||||
|
||||
nsCString telemetryKey;
|
||||
|
||||
switch (mProcessType) {
|
||||
case GeckoProcessType_Content:
|
||||
processType = nsICrashService::PROCESS_TYPE_CONTENT;
|
||||
telemetryKey.AssignLiteral("content");
|
||||
break;
|
||||
case GeckoProcessType_Plugin: {
|
||||
processType = nsICrashService::PROCESS_TYPE_PLUGIN;
|
||||
telemetryKey.AssignLiteral("plugin");
|
||||
nsAutoCString val;
|
||||
if (mNotes.Get(NS_LITERAL_CSTRING("PluginHang"), &val) &&
|
||||
val.Equals(NS_LITERAL_CSTRING("1"))) {
|
||||
crashType = nsICrashService::CRASH_TYPE_HANG;
|
||||
telemetryKey.AssignLiteral("pluginhang");
|
||||
}
|
||||
break;
|
||||
}
|
||||
case GeckoProcessType_GMPlugin:
|
||||
processType = nsICrashService::PROCESS_TYPE_GMPLUGIN;
|
||||
telemetryKey.AssignLiteral("gmplugin");
|
||||
break;
|
||||
default:
|
||||
NS_ERROR("unknown process type");
|
||||
return;
|
||||
}
|
||||
|
||||
crashService->AddCrash(processType, crashType, mChildDumpID);
|
||||
Telemetry::Accumulate(Telemetry::SUBPROCESS_CRASHES_WITH_DUMP, telemetryKey, 1);
|
||||
mNotes.Clear();
|
||||
crashService->AddCrash(processType, crashType, mChildDumpID);
|
||||
Telemetry::Accumulate(Telemetry::SUBPROCESS_CRASHES_WITH_DUMP, telemetryKey, 1);
|
||||
mNotes.Clear();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -18,8 +18,7 @@
|
|||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
class CrashReporterParent :
|
||||
public PCrashReporterParent
|
||||
class CrashReporterParent : public PCrashReporterParent
|
||||
{
|
||||
#ifdef MOZ_CRASHREPORTER
|
||||
typedef CrashReporter::AnnotationTable AnnotationTable;
|
||||
|
@ -137,7 +136,7 @@ public:
|
|||
* Returns the ID of the child minidump.
|
||||
* GeneratePairedMinidump or GenerateCrashReport must be called first.
|
||||
*/
|
||||
const nsString& ChildDumpID() {
|
||||
const nsString& ChildDumpID() const {
|
||||
return mChildDumpID;
|
||||
}
|
||||
|
||||
|
@ -147,18 +146,20 @@ public:
|
|||
* the notes will get dropped.
|
||||
*/
|
||||
void
|
||||
AnnotateCrashReport(const nsCString& key, const nsCString& data);
|
||||
AnnotateCrashReport(const nsCString& aKey, const nsCString& aData);
|
||||
|
||||
protected:
|
||||
virtual void ActorDestroy(ActorDestroyReason aWhy) override;
|
||||
|
||||
virtual bool
|
||||
RecvAnnotateCrashReport(const nsCString& key, const nsCString& data) override {
|
||||
AnnotateCrashReport(key, data);
|
||||
virtual bool RecvAnnotateCrashReport(const nsCString& aKey,
|
||||
const nsCString& aData) override
|
||||
{
|
||||
AnnotateCrashReport(aKey, aData);
|
||||
return true;
|
||||
}
|
||||
virtual bool
|
||||
RecvAppendAppNotes(const nsCString& data) override;
|
||||
|
||||
virtual bool RecvAppendAppNotes(const nsCString& aData) override;
|
||||
|
||||
virtual mozilla::ipc::IProtocol*
|
||||
CloneProtocol(Channel* aChannel,
|
||||
mozilla::ipc::ProtocolCloneContext *aCtx) override;
|
||||
|
@ -217,7 +218,8 @@ CrashReporterParent::GenerateMinidumpAndPair(Toplevel* aTopLevel,
|
|||
#ifdef XP_MACOSX
|
||||
childHandle = aTopLevel->Process()->GetChildTask();
|
||||
#else
|
||||
if (!base::OpenPrivilegedProcessHandle(aTopLevel->OtherPid(), &childHandle.rwget())) {
|
||||
if (!base::OpenPrivilegedProcessHandle(aTopLevel->OtherPid(),
|
||||
&childHandle.rwget())) {
|
||||
NS_WARNING("Failed to open child process handle.");
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -68,7 +68,8 @@ class FilePickerParent : public PFilePickerParent
|
|||
nsCOMPtr<nsIEventTarget> mEventTarget;
|
||||
|
||||
public:
|
||||
FileSizeAndDateRunnable(FilePickerParent *aFPParent, nsTArray<RefPtr<BlobImpl>>& aBlobs);
|
||||
FileSizeAndDateRunnable(FilePickerParent *aFPParent,
|
||||
nsTArray<RefPtr<BlobImpl>>& aBlobs);
|
||||
bool Dispatch();
|
||||
NS_IMETHOD Run();
|
||||
void Destroy();
|
||||
|
@ -86,4 +87,4 @@ class FilePickerParent : public PFilePickerParent
|
|||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
#endif
|
||||
#endif // mozilla_dom_FilePickerParent_h
|
||||
|
|
|
@ -22,7 +22,6 @@ class TabParent;
|
|||
template<typename T>
|
||||
class IdType
|
||||
{
|
||||
|
||||
friend struct IPC::ParamTraits<IdType<T>>;
|
||||
|
||||
public:
|
||||
|
@ -71,4 +70,4 @@ struct ParamTraits<mozilla::dom::IdType<T>>
|
|||
|
||||
} // namespace IPC
|
||||
|
||||
#endif
|
||||
#endif // mozilla_dom_IdType_h
|
||||
|
|
|
@ -30,5 +30,4 @@ private:
|
|||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
#endif
|
||||
|
||||
#endif // mozilla_dom_NuwaChild_h
|
||||
|
|
|
@ -70,4 +70,4 @@ private:
|
|||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
#endif
|
||||
#endif // mozilla_dom_NuwaParent_h
|
||||
|
|
|
@ -13,12 +13,19 @@
|
|||
|
||||
namespace IPC {
|
||||
|
||||
class Principal {
|
||||
class Principal
|
||||
{
|
||||
friend struct ParamTraits<Principal>;
|
||||
|
||||
public:
|
||||
Principal() : mPrincipal(nullptr) {}
|
||||
explicit Principal(nsIPrincipal* aPrincipal) : mPrincipal(aPrincipal) {}
|
||||
Principal()
|
||||
: mPrincipal(nullptr)
|
||||
{}
|
||||
|
||||
explicit Principal(nsIPrincipal* aPrincipal)
|
||||
: mPrincipal(aPrincipal)
|
||||
{}
|
||||
|
||||
operator nsIPrincipal*() const { return mPrincipal.get(); }
|
||||
|
||||
private:
|
||||
|
|
|
@ -1210,7 +1210,7 @@ TabChild::SetProcessNameToAppName()
|
|||
}
|
||||
|
||||
bool
|
||||
TabChild::IsRootContentDocument()
|
||||
TabChild::IsRootContentDocument() const
|
||||
{
|
||||
// A TabChild is a "root content document" if it's
|
||||
//
|
||||
|
|
|
@ -162,56 +162,56 @@ protected:
|
|||
TabChild* mTabChild;
|
||||
};
|
||||
|
||||
// This is base clase which helps to share Viewport and touch related functionality
|
||||
// between b2g/android FF/embedlite clients implementation.
|
||||
// It make sense to place in this class all helper functions, and functionality which could be shared between
|
||||
// Cross-process/Cross-thread implmentations.
|
||||
// This is base clase which helps to share Viewport and touch related
|
||||
// functionality between b2g/android FF/embedlite clients implementation.
|
||||
// It make sense to place in this class all helper functions, and functionality
|
||||
// which could be shared between Cross-process/Cross-thread implmentations.
|
||||
class TabChildBase : public nsISupports,
|
||||
public nsMessageManagerScriptExecutor,
|
||||
public ipc::MessageManagerCallback
|
||||
{
|
||||
protected:
|
||||
typedef mozilla::widget::PuppetWidget PuppetWidget;
|
||||
typedef mozilla::widget::PuppetWidget PuppetWidget;
|
||||
|
||||
public:
|
||||
TabChildBase();
|
||||
TabChildBase();
|
||||
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TabChildBase)
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TabChildBase)
|
||||
|
||||
virtual nsIWebNavigation* WebNavigation() const = 0;
|
||||
virtual PuppetWidget* WebWidget() = 0;
|
||||
nsIPrincipal* GetPrincipal() { return mPrincipal; }
|
||||
virtual bool DoUpdateZoomConstraints(const uint32_t& aPresShellId,
|
||||
const mozilla::layers::FrameMetrics::ViewID& aViewId,
|
||||
const Maybe<mozilla::layers::ZoomConstraints>& aConstraints) = 0;
|
||||
virtual nsIWebNavigation* WebNavigation() const = 0;
|
||||
virtual PuppetWidget* WebWidget() = 0;
|
||||
nsIPrincipal* GetPrincipal() { return mPrincipal; }
|
||||
virtual bool DoUpdateZoomConstraints(const uint32_t& aPresShellId,
|
||||
const mozilla::layers::FrameMetrics::ViewID& aViewId,
|
||||
const Maybe<mozilla::layers::ZoomConstraints>& aConstraints) = 0;
|
||||
|
||||
virtual ScreenIntSize GetInnerSize() = 0;
|
||||
virtual ScreenIntSize GetInnerSize() = 0;
|
||||
|
||||
// Get the Document for the top-level window in this tab.
|
||||
already_AddRefed<nsIDocument> GetDocument() const;
|
||||
// Get the Document for the top-level window in this tab.
|
||||
already_AddRefed<nsIDocument> GetDocument() const;
|
||||
|
||||
protected:
|
||||
virtual ~TabChildBase();
|
||||
virtual ~TabChildBase();
|
||||
|
||||
// Get the pres-shell of the document for the top-level window in this tab.
|
||||
already_AddRefed<nsIPresShell> GetPresShell() const;
|
||||
// Get the pres-shell of the document for the top-level window in this tab.
|
||||
already_AddRefed<nsIPresShell> GetPresShell() const;
|
||||
|
||||
// Wraps up a JSON object as a structured clone and sends it to the browser
|
||||
// chrome script.
|
||||
//
|
||||
// XXX/bug 780335: Do the work the browser chrome script does in C++ instead
|
||||
// so we don't need things like this.
|
||||
void DispatchMessageManagerMessage(const nsAString& aMessageName,
|
||||
const nsAString& aJSONData);
|
||||
// Wraps up a JSON object as a structured clone and sends it to the browser
|
||||
// chrome script.
|
||||
//
|
||||
// XXX/bug 780335: Do the work the browser chrome script does in C++ instead
|
||||
// so we don't need things like this.
|
||||
void DispatchMessageManagerMessage(const nsAString& aMessageName,
|
||||
const nsAString& aJSONData);
|
||||
|
||||
void ProcessUpdateFrame(const mozilla::layers::FrameMetrics& aFrameMetrics);
|
||||
void ProcessUpdateFrame(const mozilla::layers::FrameMetrics& aFrameMetrics);
|
||||
|
||||
bool UpdateFrameHandler(const mozilla::layers::FrameMetrics& aFrameMetrics);
|
||||
bool UpdateFrameHandler(const mozilla::layers::FrameMetrics& aFrameMetrics);
|
||||
|
||||
protected:
|
||||
RefPtr<TabChildGlobal> mTabChildGlobal;
|
||||
nsCOMPtr<nsIWebBrowserChrome3> mWebBrowserChrome;
|
||||
RefPtr<TabChildGlobal> mTabChildGlobal;
|
||||
nsCOMPtr<nsIWebBrowserChrome3> mWebBrowserChrome;
|
||||
};
|
||||
|
||||
class TabChild final : public TabChildBase,
|
||||
|
@ -227,415 +227,499 @@ class TabChild final : public TabChildBase,
|
|||
public TabContext,
|
||||
public nsITooltipListener
|
||||
{
|
||||
typedef mozilla::dom::ClonedMessageData ClonedMessageData;
|
||||
typedef mozilla::layout::RenderFrameChild RenderFrameChild;
|
||||
typedef mozilla::layers::APZEventState APZEventState;
|
||||
typedef mozilla::layers::SetAllowedTouchBehaviorCallback SetAllowedTouchBehaviorCallback;
|
||||
typedef mozilla::dom::ClonedMessageData ClonedMessageData;
|
||||
typedef mozilla::layout::RenderFrameChild RenderFrameChild;
|
||||
typedef mozilla::layers::APZEventState APZEventState;
|
||||
typedef mozilla::layers::SetAllowedTouchBehaviorCallback SetAllowedTouchBehaviorCallback;
|
||||
|
||||
public:
|
||||
/**
|
||||
* Find TabChild of aTabId in the same content process of the
|
||||
* caller.
|
||||
*/
|
||||
static already_AddRefed<TabChild> FindTabChild(const TabId& aTabId);
|
||||
/**
|
||||
* Find TabChild of aTabId in the same content process of the
|
||||
* caller.
|
||||
*/
|
||||
static already_AddRefed<TabChild> FindTabChild(const TabId& aTabId);
|
||||
|
||||
public:
|
||||
/**
|
||||
* Create a new TabChild object.
|
||||
*/
|
||||
TabChild(nsIContentChild* aManager,
|
||||
const TabId& aTabId,
|
||||
const TabContext& aContext,
|
||||
uint32_t aChromeFlags);
|
||||
/**
|
||||
* Create a new TabChild object.
|
||||
*/
|
||||
TabChild(nsIContentChild* aManager,
|
||||
const TabId& aTabId,
|
||||
const TabContext& aContext,
|
||||
uint32_t aChromeFlags);
|
||||
|
||||
nsresult Init();
|
||||
nsresult Init();
|
||||
|
||||
/**
|
||||
* This is expected to be called off the critical path to content
|
||||
* startup. This is an opportunity to load things that are slow
|
||||
* on the critical path.
|
||||
*/
|
||||
static void PreloadSlowThings();
|
||||
/**
|
||||
* This is expected to be called off the critical path to content
|
||||
* startup. This is an opportunity to load things that are slow
|
||||
* on the critical path.
|
||||
*/
|
||||
static void PreloadSlowThings();
|
||||
|
||||
/** Return a TabChild with the given attributes. */
|
||||
static already_AddRefed<TabChild>
|
||||
Create(nsIContentChild* aManager, const TabId& aTabId, const TabContext& aContext, uint32_t aChromeFlags);
|
||||
/** Return a TabChild with the given attributes. */
|
||||
static already_AddRefed<TabChild>
|
||||
Create(nsIContentChild* aManager, const TabId& aTabId,
|
||||
const TabContext& aContext, uint32_t aChromeFlags);
|
||||
|
||||
bool IsRootContentDocument();
|
||||
// Let managees query if it is safe to send messages.
|
||||
bool IsDestroyed() { return mDestroyed; }
|
||||
const TabId GetTabId() const {
|
||||
MOZ_ASSERT(mUniqueId != 0);
|
||||
return mUniqueId;
|
||||
}
|
||||
bool IsRootContentDocument() const;
|
||||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
NS_DECL_NSIWEBBROWSERCHROME
|
||||
NS_DECL_NSIWEBBROWSERCHROME2
|
||||
NS_DECL_NSIEMBEDDINGSITEWINDOW
|
||||
NS_DECL_NSIWEBBROWSERCHROMEFOCUS
|
||||
NS_DECL_NSIINTERFACEREQUESTOR
|
||||
NS_DECL_NSIWINDOWPROVIDER
|
||||
NS_DECL_NSITABCHILD
|
||||
NS_DECL_NSIOBSERVER
|
||||
NS_DECL_NSITOOLTIPLISTENER
|
||||
// Let managees query if it is safe to send messages.
|
||||
bool IsDestroyed() const{ return mDestroyed; }
|
||||
|
||||
/**
|
||||
* MessageManagerCallback methods that we override.
|
||||
*/
|
||||
virtual bool DoSendBlockingMessage(JSContext* aCx,
|
||||
const nsAString& aMessage,
|
||||
StructuredCloneData& aData,
|
||||
JS::Handle<JSObject *> aCpows,
|
||||
nsIPrincipal* aPrincipal,
|
||||
nsTArray<StructuredCloneData>* aRetVal,
|
||||
bool aIsSync) override;
|
||||
virtual nsresult DoSendAsyncMessage(JSContext* aCx,
|
||||
const nsAString& aMessage,
|
||||
StructuredCloneData& aData,
|
||||
JS::Handle<JSObject *> aCpows,
|
||||
nsIPrincipal* aPrincipal) override;
|
||||
virtual bool DoUpdateZoomConstraints(const uint32_t& aPresShellId,
|
||||
const ViewID& aViewId,
|
||||
const Maybe<ZoomConstraints>& aConstraints) override;
|
||||
virtual bool RecvLoadURL(const nsCString& aURI,
|
||||
const BrowserConfiguration& aConfiguration,
|
||||
const ShowInfo& aInfo) override;
|
||||
virtual bool RecvOpenURI(const URIParams& aURI,
|
||||
const uint32_t& aFlags) override;
|
||||
virtual bool RecvCacheFileDescriptor(const nsString& aPath,
|
||||
const FileDescriptor& aFileDescriptor)
|
||||
override;
|
||||
virtual bool RecvShow(const ScreenIntSize& aSize,
|
||||
const ShowInfo& aInfo,
|
||||
const TextureFactoryIdentifier& aTextureFactoryIdentifier,
|
||||
const uint64_t& aLayersId,
|
||||
PRenderFrameChild* aRenderFrame,
|
||||
const bool& aParentIsActive) override;
|
||||
virtual bool RecvUpdateDimensions(const CSSRect& rect,
|
||||
const CSSSize& size,
|
||||
const nsSizeMode& sizeMode,
|
||||
const ScreenOrientationInternal& orientation,
|
||||
const LayoutDeviceIntPoint& chromeDisp) override;
|
||||
virtual bool RecvUpdateFrame(const layers::FrameMetrics& aFrameMetrics) override;
|
||||
virtual bool RecvRequestFlingSnap(const ViewID& aScrollId,
|
||||
const CSSPoint& aDestination) override;
|
||||
virtual bool RecvAcknowledgeScrollUpdate(const ViewID& aScrollId,
|
||||
const uint32_t& aScrollGeneration) override;
|
||||
virtual bool RecvHandleDoubleTap(const CSSPoint& aPoint,
|
||||
const Modifiers& aModifiers,
|
||||
const mozilla::layers::ScrollableLayerGuid& aGuid) override;
|
||||
virtual bool RecvHandleSingleTap(const CSSPoint& aPoint,
|
||||
const Modifiers& aModifiers,
|
||||
const mozilla::layers::ScrollableLayerGuid& aGuid) override;
|
||||
virtual bool RecvHandleLongTap(const CSSPoint& aPoint,
|
||||
const Modifiers& aModifiers,
|
||||
const mozilla::layers::ScrollableLayerGuid& aGuid,
|
||||
const uint64_t& aInputBlockId) override;
|
||||
virtual bool RecvNotifyAPZStateChange(const ViewID& aViewId,
|
||||
const APZStateChange& aChange,
|
||||
const int& aArg) override;
|
||||
virtual bool RecvNotifyFlushComplete() override;
|
||||
virtual bool RecvActivate() override;
|
||||
virtual bool RecvDeactivate() override;
|
||||
virtual bool RecvMouseEvent(const nsString& aType,
|
||||
const float& aX,
|
||||
const float& aY,
|
||||
const int32_t& aButton,
|
||||
const int32_t& aClickCount,
|
||||
const int32_t& aModifiers,
|
||||
const bool& aIgnoreRootScrollFrame) override;
|
||||
virtual bool RecvRealMouseMoveEvent(const mozilla::WidgetMouseEvent& event,
|
||||
const ScrollableLayerGuid& aGuid,
|
||||
const uint64_t& aInputBlockId) override;
|
||||
virtual bool RecvSynthMouseMoveEvent(const mozilla::WidgetMouseEvent& event,
|
||||
const ScrollableLayerGuid& aGuid,
|
||||
const uint64_t& aInputBlockId) override;
|
||||
virtual bool RecvRealMouseButtonEvent(const mozilla::WidgetMouseEvent& event,
|
||||
const ScrollableLayerGuid& aGuid,
|
||||
const uint64_t& aInputBlockId) override;
|
||||
virtual bool RecvRealDragEvent(const WidgetDragEvent& aEvent,
|
||||
const uint32_t& aDragAction,
|
||||
const uint32_t& aDropEffect) override;
|
||||
virtual bool RecvRealKeyEvent(const mozilla::WidgetKeyboardEvent& event,
|
||||
const MaybeNativeKeyBinding& aBindings) override;
|
||||
virtual bool RecvMouseWheelEvent(const mozilla::WidgetWheelEvent& event,
|
||||
const ScrollableLayerGuid& aGuid,
|
||||
const uint64_t& aInputBlockId) override;
|
||||
virtual bool RecvRealTouchEvent(const WidgetTouchEvent& aEvent,
|
||||
const ScrollableLayerGuid& aGuid,
|
||||
const uint64_t& aInputBlockId,
|
||||
const nsEventStatus& aApzResponse) override;
|
||||
virtual bool RecvRealTouchMoveEvent(const WidgetTouchEvent& aEvent,
|
||||
const ScrollableLayerGuid& aGuid,
|
||||
const uint64_t& aInputBlockId,
|
||||
const nsEventStatus& aApzResponse) override;
|
||||
virtual bool RecvKeyEvent(const nsString& aType,
|
||||
const int32_t& aKeyCode,
|
||||
const int32_t& aCharCode,
|
||||
const int32_t& aModifiers,
|
||||
const bool& aPreventDefault) override;
|
||||
virtual bool RecvMouseScrollTestEvent(const FrameMetrics::ViewID& aScrollId,
|
||||
const nsString& aEvent) override;
|
||||
virtual bool RecvNativeSynthesisResponse(const uint64_t& aObserverId,
|
||||
const nsCString& aResponse) override;
|
||||
virtual bool RecvPluginEvent(const WidgetPluginEvent& aEvent) override;
|
||||
virtual bool RecvCompositionEvent(const mozilla::WidgetCompositionEvent& event) override;
|
||||
virtual bool RecvSelectionEvent(const mozilla::WidgetSelectionEvent& event) override;
|
||||
virtual bool RecvActivateFrameEvent(const nsString& aType, const bool& capture) override;
|
||||
virtual bool RecvLoadRemoteScript(const nsString& aURL,
|
||||
const bool& aRunInGlobalScope) override;
|
||||
virtual bool RecvAsyncMessage(const nsString& aMessage,
|
||||
const ClonedMessageData& aData,
|
||||
InfallibleTArray<CpowEntry>&& aCpows,
|
||||
const IPC::Principal& aPrincipal) override;
|
||||
const TabId GetTabId() const
|
||||
{
|
||||
MOZ_ASSERT(mUniqueId != 0);
|
||||
return mUniqueId;
|
||||
}
|
||||
|
||||
virtual bool RecvAppOfflineStatus(const uint32_t& aId, const bool& aOffline) override;
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
NS_DECL_NSIWEBBROWSERCHROME
|
||||
NS_DECL_NSIWEBBROWSERCHROME2
|
||||
NS_DECL_NSIEMBEDDINGSITEWINDOW
|
||||
NS_DECL_NSIWEBBROWSERCHROMEFOCUS
|
||||
NS_DECL_NSIINTERFACEREQUESTOR
|
||||
NS_DECL_NSIWINDOWPROVIDER
|
||||
NS_DECL_NSITABCHILD
|
||||
NS_DECL_NSIOBSERVER
|
||||
NS_DECL_NSITOOLTIPLISTENER
|
||||
|
||||
virtual bool RecvSwappedWithOtherRemoteLoader() override;
|
||||
/**
|
||||
* MessageManagerCallback methods that we override.
|
||||
*/
|
||||
virtual bool DoSendBlockingMessage(JSContext* aCx,
|
||||
const nsAString& aMessage,
|
||||
StructuredCloneData& aData,
|
||||
JS::Handle<JSObject *> aCpows,
|
||||
nsIPrincipal* aPrincipal,
|
||||
nsTArray<StructuredCloneData>* aRetVal,
|
||||
bool aIsSync) override;
|
||||
|
||||
virtual PDocAccessibleChild* AllocPDocAccessibleChild(PDocAccessibleChild*,
|
||||
const uint64_t&)
|
||||
override;
|
||||
virtual bool DeallocPDocAccessibleChild(PDocAccessibleChild*) override;
|
||||
virtual PDocumentRendererChild*
|
||||
AllocPDocumentRendererChild(const nsRect& documentRect, const gfx::Matrix& transform,
|
||||
const nsString& bgcolor,
|
||||
const uint32_t& renderFlags, const bool& flushLayout,
|
||||
const nsIntSize& renderSize) override;
|
||||
virtual bool DeallocPDocumentRendererChild(PDocumentRendererChild* actor) override;
|
||||
virtual bool RecvPDocumentRendererConstructor(PDocumentRendererChild* actor,
|
||||
const nsRect& documentRect,
|
||||
const gfx::Matrix& transform,
|
||||
const nsString& bgcolor,
|
||||
const uint32_t& renderFlags,
|
||||
const bool& flushLayout,
|
||||
const nsIntSize& renderSize) override;
|
||||
virtual nsresult DoSendAsyncMessage(JSContext* aCx,
|
||||
const nsAString& aMessage,
|
||||
StructuredCloneData& aData,
|
||||
JS::Handle<JSObject *> aCpows,
|
||||
nsIPrincipal* aPrincipal) override;
|
||||
|
||||
virtual PColorPickerChild*
|
||||
AllocPColorPickerChild(const nsString& title, const nsString& initialColor) override;
|
||||
virtual bool DeallocPColorPickerChild(PColorPickerChild* actor) override;
|
||||
virtual bool
|
||||
DoUpdateZoomConstraints(const uint32_t& aPresShellId,
|
||||
const ViewID& aViewId,
|
||||
const Maybe<ZoomConstraints>& aConstraints) override;
|
||||
|
||||
virtual PFilePickerChild*
|
||||
AllocPFilePickerChild(const nsString& aTitle, const int16_t& aMode) override;
|
||||
virtual bool
|
||||
DeallocPFilePickerChild(PFilePickerChild* actor) override;
|
||||
virtual bool RecvLoadURL(const nsCString& aURI,
|
||||
const BrowserConfiguration& aConfiguration,
|
||||
const ShowInfo& aInfo) override;
|
||||
|
||||
virtual PIndexedDBPermissionRequestChild*
|
||||
AllocPIndexedDBPermissionRequestChild(const Principal& aPrincipal)
|
||||
override;
|
||||
virtual bool RecvOpenURI(const URIParams& aURI,
|
||||
const uint32_t& aFlags) override;
|
||||
|
||||
virtual bool
|
||||
DeallocPIndexedDBPermissionRequestChild(
|
||||
PIndexedDBPermissionRequestChild* aActor)
|
||||
virtual bool RecvCacheFileDescriptor(const nsString& aPath,
|
||||
const FileDescriptor& aFileDescriptor)
|
||||
override;
|
||||
|
||||
virtual nsIWebNavigation* WebNavigation() const override { return mWebNav; }
|
||||
virtual PuppetWidget* WebWidget() override { return mPuppetWidget; }
|
||||
virtual bool
|
||||
RecvShow(const ScreenIntSize& aSize,
|
||||
const ShowInfo& aInfo,
|
||||
const TextureFactoryIdentifier& aTextureFactoryIdentifier,
|
||||
const uint64_t& aLayersId,
|
||||
PRenderFrameChild* aRenderFrame,
|
||||
const bool& aParentIsActive) override;
|
||||
|
||||
/** Return the DPI of the widget this TabChild draws to. */
|
||||
void GetDPI(float* aDPI);
|
||||
void GetDefaultScale(double *aScale);
|
||||
virtual bool
|
||||
RecvUpdateDimensions(const CSSRect& aRect,
|
||||
const CSSSize& aSize,
|
||||
const nsSizeMode& aSizeMode,
|
||||
const ScreenOrientationInternal& aOrientation,
|
||||
const LayoutDeviceIntPoint& aChromeDisp) override;
|
||||
|
||||
void GetMaxTouchPoints(uint32_t* aTouchPoints);
|
||||
virtual bool
|
||||
RecvUpdateFrame(const layers::FrameMetrics& aFrameMetrics) override;
|
||||
|
||||
ScreenOrientationInternal GetOrientation() const { return mOrientation; }
|
||||
virtual bool
|
||||
RecvRequestFlingSnap(const ViewID& aScrollId,
|
||||
const CSSPoint& aDestination) override;
|
||||
|
||||
void SetBackgroundColor(const nscolor& aColor);
|
||||
virtual bool
|
||||
RecvAcknowledgeScrollUpdate(const ViewID& aScrollId,
|
||||
const uint32_t& aScrollGeneration) override;
|
||||
|
||||
void NotifyPainted();
|
||||
virtual bool
|
||||
RecvHandleDoubleTap(const CSSPoint& aPoint,
|
||||
const Modifiers& aModifiers,
|
||||
const mozilla::layers::ScrollableLayerGuid& aGuid) override;
|
||||
|
||||
void RequestNativeKeyBindings(mozilla::widget::AutoCacheNativeKeyCommands* aAutoCache,
|
||||
WidgetKeyboardEvent* aEvent);
|
||||
virtual bool
|
||||
RecvHandleSingleTap(const CSSPoint& aPoint,
|
||||
const Modifiers& aModifiers,
|
||||
const mozilla::layers::ScrollableLayerGuid& aGuid) override;
|
||||
|
||||
/**
|
||||
* Signal to this TabChild that it should be made visible:
|
||||
* activated widget, retained layer tree, etc. (Respectively,
|
||||
* made not visible.)
|
||||
*/
|
||||
void MakeVisible();
|
||||
void MakeHidden();
|
||||
virtual bool
|
||||
RecvHandleLongTap(const CSSPoint& aPoint,
|
||||
const Modifiers& aModifiers,
|
||||
const mozilla::layers::ScrollableLayerGuid& aGuid,
|
||||
const uint64_t& aInputBlockId) override;
|
||||
|
||||
// Returns true if the file descriptor was found in the cache, false
|
||||
// otherwise.
|
||||
bool GetCachedFileDescriptor(const nsAString& aPath,
|
||||
nsICachedFileDescriptorListener* aCallback);
|
||||
virtual bool RecvNotifyAPZStateChange(const ViewID& aViewId,
|
||||
const APZStateChange& aChange,
|
||||
const int& aArg) override;
|
||||
|
||||
void CancelCachedFileDescriptorCallback(
|
||||
const nsAString& aPath,
|
||||
nsICachedFileDescriptorListener* aCallback);
|
||||
virtual bool RecvNotifyFlushComplete() override;
|
||||
|
||||
nsIContentChild* Manager() { return mManager; }
|
||||
virtual bool RecvActivate() override;
|
||||
|
||||
bool GetUpdateHitRegion() { return mUpdateHitRegion; }
|
||||
virtual bool RecvDeactivate() override;
|
||||
|
||||
void UpdateHitRegion(const nsRegion& aRegion);
|
||||
virtual bool RecvMouseEvent(const nsString& aType,
|
||||
const float& aX,
|
||||
const float& aY,
|
||||
const int32_t& aButton,
|
||||
const int32_t& aClickCount,
|
||||
const int32_t& aModifiers,
|
||||
const bool& aIgnoreRootScrollFrame) override;
|
||||
|
||||
static inline TabChild*
|
||||
GetFrom(nsIDocShell* aDocShell)
|
||||
{
|
||||
nsCOMPtr<nsITabChild> tc = do_GetInterface(aDocShell);
|
||||
return static_cast<TabChild*>(tc.get());
|
||||
}
|
||||
virtual bool RecvRealMouseMoveEvent(const mozilla::WidgetMouseEvent& aEvent,
|
||||
const ScrollableLayerGuid& aGuid,
|
||||
const uint64_t& aInputBlockId) override;
|
||||
|
||||
static TabChild* GetFrom(nsIPresShell* aPresShell);
|
||||
static TabChild* GetFrom(uint64_t aLayersId);
|
||||
virtual bool RecvSynthMouseMoveEvent(const mozilla::WidgetMouseEvent& aEvent,
|
||||
const ScrollableLayerGuid& aGuid,
|
||||
const uint64_t& aInputBlockId) override;
|
||||
|
||||
void DidComposite(uint64_t aTransactionId,
|
||||
const TimeStamp& aCompositeStart,
|
||||
const TimeStamp& aCompositeEnd);
|
||||
void DidRequestComposite(const TimeStamp& aCompositeReqStart,
|
||||
const TimeStamp& aCompositeReqEnd);
|
||||
virtual bool RecvRealMouseButtonEvent(const mozilla::WidgetMouseEvent& aEvent,
|
||||
const ScrollableLayerGuid& aGuid,
|
||||
const uint64_t& aInputBlockId) override;
|
||||
|
||||
void ClearCachedResources();
|
||||
virtual bool RecvRealDragEvent(const WidgetDragEvent& aEvent,
|
||||
const uint32_t& aDragAction,
|
||||
const uint32_t& aDropEffect) override;
|
||||
|
||||
static inline TabChild*
|
||||
GetFrom(nsIDOMWindow* aWindow)
|
||||
{
|
||||
nsCOMPtr<nsIWebNavigation> webNav = do_GetInterface(aWindow);
|
||||
nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(webNav);
|
||||
return GetFrom(docShell);
|
||||
}
|
||||
virtual bool
|
||||
RecvRealKeyEvent(const mozilla::WidgetKeyboardEvent& aEvent,
|
||||
const MaybeNativeKeyBinding& aBindings) override;
|
||||
|
||||
virtual bool RecvUIResolutionChanged(const float& aDpi, const double& aScale) override;
|
||||
virtual bool RecvMouseWheelEvent(const mozilla::WidgetWheelEvent& aEvent,
|
||||
const ScrollableLayerGuid& aGuid,
|
||||
const uint64_t& aInputBlockId) override;
|
||||
|
||||
virtual bool RecvThemeChanged(nsTArray<LookAndFeelInt>&& aLookAndFeelIntCache) override;
|
||||
virtual bool RecvRealTouchEvent(const WidgetTouchEvent& aEvent,
|
||||
const ScrollableLayerGuid& aGuid,
|
||||
const uint64_t& aInputBlockId,
|
||||
const nsEventStatus& aApzResponse) override;
|
||||
|
||||
virtual bool RecvHandleAccessKey(nsTArray<uint32_t>&& aCharCodes,
|
||||
const bool& aIsTrusted,
|
||||
const int32_t& aModifierMask) override;
|
||||
virtual bool
|
||||
RecvRealTouchMoveEvent(const WidgetTouchEvent& aEvent,
|
||||
const ScrollableLayerGuid& aGuid,
|
||||
const uint64_t& aInputBlockId,
|
||||
const nsEventStatus& aApzResponse) override;
|
||||
|
||||
virtual bool RecvAudioChannelChangeNotification(const uint32_t& aAudioChannel,
|
||||
const float& aVolume,
|
||||
const bool& aMuted) override;
|
||||
virtual bool RecvKeyEvent(const nsString& aType,
|
||||
const int32_t& aKeyCode,
|
||||
const int32_t& aCharCode,
|
||||
const int32_t& aModifiers,
|
||||
const bool& aPreventDefault) override;
|
||||
|
||||
/**
|
||||
* Native widget remoting protocol for use with windowed plugins with e10s.
|
||||
*/
|
||||
PPluginWidgetChild* AllocPPluginWidgetChild() override;
|
||||
bool DeallocPPluginWidgetChild(PPluginWidgetChild* aActor) override;
|
||||
nsresult CreatePluginWidget(nsIWidget* aParent, nsIWidget** aOut);
|
||||
virtual bool RecvMouseScrollTestEvent(const FrameMetrics::ViewID& aScrollId,
|
||||
const nsString& aEvent) override;
|
||||
|
||||
LayoutDeviceIntPoint GetChromeDisplacement() { return mChromeDisp; };
|
||||
virtual bool RecvNativeSynthesisResponse(const uint64_t& aObserverId,
|
||||
const nsCString& aResponse) override;
|
||||
|
||||
bool IPCOpen() { return mIPCOpen; }
|
||||
virtual bool RecvPluginEvent(const WidgetPluginEvent& aEvent) override;
|
||||
|
||||
bool ParentIsActive()
|
||||
{
|
||||
return mParentIsActive;
|
||||
}
|
||||
bool AsyncPanZoomEnabled() { return mAsyncPanZoomEnabled; }
|
||||
virtual bool
|
||||
RecvCompositionEvent(const mozilla::WidgetCompositionEvent& aEvent) override;
|
||||
|
||||
virtual ScreenIntSize GetInnerSize() override;
|
||||
virtual bool
|
||||
RecvSelectionEvent(const mozilla::WidgetSelectionEvent& aEvent) override;
|
||||
|
||||
// Call RecvShow(nsIntSize(0, 0)) and block future calls to RecvShow().
|
||||
void DoFakeShow(const TextureFactoryIdentifier& aTextureFactoryIdentifier,
|
||||
const uint64_t& aLayersId,
|
||||
PRenderFrameChild* aRenderFrame,
|
||||
const ShowInfo& aShowInfo);
|
||||
virtual bool
|
||||
RecvActivateFrameEvent(const nsString& aType, const bool& aCapture) override;
|
||||
|
||||
virtual bool RecvLoadRemoteScript(const nsString& aURL,
|
||||
const bool& aRunInGlobalScope) override;
|
||||
|
||||
virtual bool RecvAsyncMessage(const nsString& aMessage,
|
||||
const ClonedMessageData& aData,
|
||||
InfallibleTArray<CpowEntry>&& aCpows,
|
||||
const IPC::Principal& aPrincipal) override;
|
||||
|
||||
virtual bool RecvAppOfflineStatus(const uint32_t& aId,
|
||||
const bool& aOffline) override;
|
||||
|
||||
virtual bool RecvSwappedWithOtherRemoteLoader() override;
|
||||
|
||||
virtual PDocAccessibleChild*
|
||||
AllocPDocAccessibleChild(PDocAccessibleChild*, const uint64_t&) override;
|
||||
|
||||
virtual bool DeallocPDocAccessibleChild(PDocAccessibleChild*) override;
|
||||
|
||||
virtual PDocumentRendererChild*
|
||||
AllocPDocumentRendererChild(const nsRect& aDocumentRect,
|
||||
const gfx::Matrix& aTransform,
|
||||
const nsString& aBggcolor,
|
||||
const uint32_t& aRenderFlags,
|
||||
const bool& aFlushLayout,
|
||||
const nsIntSize& arenderSize) override;
|
||||
|
||||
virtual bool
|
||||
DeallocPDocumentRendererChild(PDocumentRendererChild* aCctor) override;
|
||||
|
||||
virtual bool
|
||||
RecvPDocumentRendererConstructor(PDocumentRendererChild* aActor,
|
||||
const nsRect& aDocumentRect,
|
||||
const gfx::Matrix& aTransform,
|
||||
const nsString& aBgcolor,
|
||||
const uint32_t& aRenderFlags,
|
||||
const bool& aFlushLayout,
|
||||
const nsIntSize& aRenderSize) override;
|
||||
|
||||
virtual PColorPickerChild*
|
||||
AllocPColorPickerChild(const nsString& aTitle,
|
||||
const nsString& aInitialColor) override;
|
||||
|
||||
virtual bool DeallocPColorPickerChild(PColorPickerChild* aActor) override;
|
||||
|
||||
virtual PFilePickerChild*
|
||||
AllocPFilePickerChild(const nsString& aTitle, const int16_t& aMode) override;
|
||||
|
||||
virtual bool
|
||||
DeallocPFilePickerChild(PFilePickerChild* aActor) override;
|
||||
|
||||
virtual PIndexedDBPermissionRequestChild*
|
||||
AllocPIndexedDBPermissionRequestChild(const Principal& aPrincipal) override;
|
||||
|
||||
virtual bool
|
||||
DeallocPIndexedDBPermissionRequestChild(PIndexedDBPermissionRequestChild* aActor) override;
|
||||
|
||||
virtual nsIWebNavigation* WebNavigation() const override
|
||||
{
|
||||
return mWebNav;
|
||||
}
|
||||
|
||||
virtual PuppetWidget* WebWidget() override { return mPuppetWidget; }
|
||||
|
||||
/** Return the DPI of the widget this TabChild draws to. */
|
||||
void GetDPI(float* aDPI);
|
||||
|
||||
void GetDefaultScale(double *aScale);
|
||||
|
||||
void GetMaxTouchPoints(uint32_t* aTouchPoints);
|
||||
|
||||
ScreenOrientationInternal GetOrientation() const { return mOrientation; }
|
||||
|
||||
void SetBackgroundColor(const nscolor& aColor);
|
||||
|
||||
void NotifyPainted();
|
||||
|
||||
void RequestNativeKeyBindings(mozilla::widget::AutoCacheNativeKeyCommands* aAutoCache,
|
||||
WidgetKeyboardEvent* aEvent);
|
||||
|
||||
/**
|
||||
* Signal to this TabChild that it should be made visible:
|
||||
* activated widget, retained layer tree, etc. (Respectively,
|
||||
* made not visible.)
|
||||
*/
|
||||
void MakeVisible();
|
||||
void MakeHidden();
|
||||
|
||||
// Returns true if the file descriptor was found in the cache, false
|
||||
// otherwise.
|
||||
bool GetCachedFileDescriptor(const nsAString& aPath,
|
||||
nsICachedFileDescriptorListener* aCallback);
|
||||
|
||||
void CancelCachedFileDescriptorCallback(
|
||||
const nsAString& aPath,
|
||||
nsICachedFileDescriptorListener* aCallback);
|
||||
|
||||
nsIContentChild* Manager() const { return mManager; }
|
||||
|
||||
bool GetUpdateHitRegion() const { return mUpdateHitRegion; }
|
||||
|
||||
void UpdateHitRegion(const nsRegion& aRegion);
|
||||
|
||||
static inline TabChild*
|
||||
GetFrom(nsIDocShell* aDocShell)
|
||||
{
|
||||
nsCOMPtr<nsITabChild> tc = do_GetInterface(aDocShell);
|
||||
return static_cast<TabChild*>(tc.get());
|
||||
}
|
||||
|
||||
static TabChild* GetFrom(nsIPresShell* aPresShell);
|
||||
static TabChild* GetFrom(uint64_t aLayersId);
|
||||
|
||||
void DidComposite(uint64_t aTransactionId,
|
||||
const TimeStamp& aCompositeStart,
|
||||
const TimeStamp& aCompositeEnd);
|
||||
|
||||
void DidRequestComposite(const TimeStamp& aCompositeReqStart,
|
||||
const TimeStamp& aCompositeReqEnd);
|
||||
|
||||
void ClearCachedResources();
|
||||
|
||||
static inline TabChild* GetFrom(nsIDOMWindow* aWindow)
|
||||
{
|
||||
nsCOMPtr<nsIWebNavigation> webNav = do_GetInterface(aWindow);
|
||||
nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(webNav);
|
||||
return GetFrom(docShell);
|
||||
}
|
||||
|
||||
virtual bool RecvUIResolutionChanged(const float& aDpi,
|
||||
const double& aScale) override;
|
||||
|
||||
virtual bool
|
||||
RecvThemeChanged(nsTArray<LookAndFeelInt>&& aLookAndFeelIntCache) override;
|
||||
|
||||
virtual bool RecvHandleAccessKey(nsTArray<uint32_t>&& aCharCodes,
|
||||
const bool& aIsTrusted,
|
||||
const int32_t& aModifierMask) override;
|
||||
|
||||
virtual bool RecvAudioChannelChangeNotification(const uint32_t& aAudioChannel,
|
||||
const float& aVolume,
|
||||
const bool& aMuted) override;
|
||||
|
||||
/**
|
||||
* Native widget remoting protocol for use with windowed plugins with e10s.
|
||||
*/
|
||||
PPluginWidgetChild* AllocPPluginWidgetChild() override;
|
||||
|
||||
bool DeallocPPluginWidgetChild(PPluginWidgetChild* aActor) override;
|
||||
|
||||
nsresult CreatePluginWidget(nsIWidget* aParent, nsIWidget** aOut);
|
||||
|
||||
LayoutDeviceIntPoint GetChromeDisplacement() const { return mChromeDisp; };
|
||||
|
||||
bool IPCOpen() const { return mIPCOpen; }
|
||||
|
||||
bool ParentIsActive() const
|
||||
{
|
||||
return mParentIsActive;
|
||||
}
|
||||
|
||||
bool AsyncPanZoomEnabled() const { return mAsyncPanZoomEnabled; }
|
||||
|
||||
virtual ScreenIntSize GetInnerSize() override;
|
||||
|
||||
// Call RecvShow(nsIntSize(0, 0)) and block future calls to RecvShow().
|
||||
void DoFakeShow(const TextureFactoryIdentifier& aTextureFactoryIdentifier,
|
||||
const uint64_t& aLayersId,
|
||||
PRenderFrameChild* aRenderFrame,
|
||||
const ShowInfo& aShowInfo);
|
||||
|
||||
protected:
|
||||
virtual ~TabChild();
|
||||
virtual ~TabChild();
|
||||
|
||||
virtual PRenderFrameChild* AllocPRenderFrameChild() override;
|
||||
virtual bool DeallocPRenderFrameChild(PRenderFrameChild* aFrame) override;
|
||||
virtual bool RecvDestroy() override;
|
||||
virtual bool RecvSetUpdateHitRegion(const bool& aEnabled) override;
|
||||
virtual bool RecvSetDocShellIsActive(const bool& aIsActive, const bool& aIsHidden) override;
|
||||
virtual bool RecvNavigateByKey(const bool& aForward, const bool& aForDocumentNavigation) override;
|
||||
virtual PRenderFrameChild* AllocPRenderFrameChild() override;
|
||||
|
||||
virtual bool RecvRequestNotifyAfterRemotePaint() override;
|
||||
virtual bool DeallocPRenderFrameChild(PRenderFrameChild* aFrame) override;
|
||||
|
||||
virtual bool RecvSuppressDisplayport(const bool& aEnabled) override;
|
||||
virtual bool RecvDestroy() override;
|
||||
|
||||
virtual bool RecvParentActivated(const bool& aActivated) override;
|
||||
virtual bool RecvSetUpdateHitRegion(const bool& aEnabled) override;
|
||||
|
||||
virtual bool RecvStopIMEStateManagement() override;
|
||||
virtual bool RecvMenuKeyboardListenerInstalled(
|
||||
const bool& aInstalled) override;
|
||||
virtual bool RecvSetDocShellIsActive(const bool& aIsActive,
|
||||
const bool& aIsHidden) override;
|
||||
|
||||
virtual bool RecvNavigateByKey(const bool& aForward,
|
||||
const bool& aForDocumentNavigation) override;
|
||||
|
||||
virtual bool RecvRequestNotifyAfterRemotePaint() override;
|
||||
|
||||
virtual bool RecvSuppressDisplayport(const bool& aEnabled) override;
|
||||
|
||||
virtual bool RecvParentActivated(const bool& aActivated) override;
|
||||
|
||||
virtual bool RecvStopIMEStateManagement() override;
|
||||
|
||||
virtual bool RecvMenuKeyboardListenerInstalled(
|
||||
const bool& aInstalled) override;
|
||||
|
||||
#ifdef MOZ_WIDGET_GONK
|
||||
void MaybeRequestPreinitCamera();
|
||||
void MaybeRequestPreinitCamera();
|
||||
#endif
|
||||
|
||||
private:
|
||||
// Notify others that our TabContext has been updated. (At the moment, this
|
||||
// sets the appropriate app-id and is-browser flags on our docshell.)
|
||||
//
|
||||
// You should call this after calling TabContext::SetTabContext(). We also
|
||||
// call this during Init().
|
||||
void NotifyTabContextUpdated();
|
||||
// Notify others that our TabContext has been updated. (At the moment, this
|
||||
// sets the appropriate app-id and is-browser flags on our docshell.)
|
||||
//
|
||||
// You should call this after calling TabContext::SetTabContext(). We also
|
||||
// call this during Init().
|
||||
void NotifyTabContextUpdated();
|
||||
|
||||
void ActorDestroy(ActorDestroyReason why) override;
|
||||
void ActorDestroy(ActorDestroyReason why) override;
|
||||
|
||||
enum FrameScriptLoading { DONT_LOAD_SCRIPTS, DEFAULT_LOAD_SCRIPTS };
|
||||
bool InitTabChildGlobal(FrameScriptLoading aScriptLoading = DEFAULT_LOAD_SCRIPTS);
|
||||
bool InitRenderingState(const TextureFactoryIdentifier& aTextureFactoryIdentifier,
|
||||
const uint64_t& aLayersId,
|
||||
PRenderFrameChild* aRenderFrame);
|
||||
void DestroyWindow();
|
||||
void SetProcessNameToAppName();
|
||||
enum FrameScriptLoading { DONT_LOAD_SCRIPTS, DEFAULT_LOAD_SCRIPTS };
|
||||
|
||||
void ApplyShowInfo(const ShowInfo& aInfo);
|
||||
bool InitTabChildGlobal(FrameScriptLoading aScriptLoading = DEFAULT_LOAD_SCRIPTS);
|
||||
|
||||
bool HasValidInnerSize();
|
||||
bool InitRenderingState(const TextureFactoryIdentifier& aTextureFactoryIdentifier,
|
||||
const uint64_t& aLayersId,
|
||||
PRenderFrameChild* aRenderFrame);
|
||||
|
||||
void SetTabId(const TabId& aTabId);
|
||||
void DestroyWindow();
|
||||
|
||||
ScreenIntRect GetOuterRect();
|
||||
void SetProcessNameToAppName();
|
||||
|
||||
void SetUnscaledInnerSize(const CSSSize& aSize) {
|
||||
mUnscaledInnerSize = aSize;
|
||||
}
|
||||
void ApplyShowInfo(const ShowInfo& aInfo);
|
||||
|
||||
class CachedFileDescriptorInfo;
|
||||
class CachedFileDescriptorCallbackRunnable;
|
||||
class DelayedDeleteRunnable;
|
||||
bool HasValidInnerSize();
|
||||
|
||||
TextureFactoryIdentifier mTextureFactoryIdentifier;
|
||||
nsCOMPtr<nsIWebNavigation> mWebNav;
|
||||
RefPtr<PuppetWidget> mPuppetWidget;
|
||||
nsCOMPtr<nsIURI> mLastURI;
|
||||
RenderFrameChild* mRemoteFrame;
|
||||
RefPtr<nsIContentChild> mManager;
|
||||
uint32_t mChromeFlags;
|
||||
int32_t mActiveSuppressDisplayport;
|
||||
uint64_t mLayersId;
|
||||
CSSRect mUnscaledOuterRect;
|
||||
// Whether we have already received a FileDescriptor for the app package.
|
||||
bool mAppPackageFileDescriptorRecved;
|
||||
// At present only 1 of these is really expected.
|
||||
nsAutoTArray<nsAutoPtr<CachedFileDescriptorInfo>, 1>
|
||||
mCachedFileDescriptorInfos;
|
||||
nscolor mLastBackgroundColor;
|
||||
bool mDidFakeShow;
|
||||
bool mNotified;
|
||||
bool mTriedBrowserInit;
|
||||
ScreenOrientationInternal mOrientation;
|
||||
bool mUpdateHitRegion;
|
||||
void SetTabId(const TabId& aTabId);
|
||||
|
||||
bool mIgnoreKeyPressEvent;
|
||||
RefPtr<APZEventState> mAPZEventState;
|
||||
SetAllowedTouchBehaviorCallback mSetAllowedTouchBehaviorCallback;
|
||||
bool mHasValidInnerSize;
|
||||
bool mDestroyed;
|
||||
// Position of tab, relative to parent widget (typically the window)
|
||||
LayoutDeviceIntPoint mChromeDisp;
|
||||
TabId mUniqueId;
|
||||
ScreenIntRect GetOuterRect();
|
||||
|
||||
friend class ContentChild;
|
||||
float mDPI;
|
||||
double mDefaultScale;
|
||||
void SetUnscaledInnerSize(const CSSSize& aSize)
|
||||
{
|
||||
mUnscaledInnerSize = aSize;
|
||||
}
|
||||
|
||||
bool mIPCOpen;
|
||||
bool mParentIsActive;
|
||||
bool mAsyncPanZoomEnabled;
|
||||
CSSSize mUnscaledInnerSize;
|
||||
bool mDidSetRealShowInfo;
|
||||
class CachedFileDescriptorInfo;
|
||||
class CachedFileDescriptorCallbackRunnable;
|
||||
class DelayedDeleteRunnable;
|
||||
|
||||
nsAutoTArray<bool, NUMBER_OF_AUDIO_CHANNELS> mAudioChannelsActive;
|
||||
TextureFactoryIdentifier mTextureFactoryIdentifier;
|
||||
nsCOMPtr<nsIWebNavigation> mWebNav;
|
||||
RefPtr<PuppetWidget> mPuppetWidget;
|
||||
nsCOMPtr<nsIURI> mLastURI;
|
||||
RenderFrameChild* mRemoteFrame;
|
||||
RefPtr<nsIContentChild> mManager;
|
||||
uint32_t mChromeFlags;
|
||||
int32_t mActiveSuppressDisplayport;
|
||||
uint64_t mLayersId;
|
||||
CSSRect mUnscaledOuterRect;
|
||||
// Whether we have already received a FileDescriptor for the app package.
|
||||
bool mAppPackageFileDescriptorRecved;
|
||||
// At present only 1 of these is really expected.
|
||||
nsAutoTArray<nsAutoPtr<CachedFileDescriptorInfo>, 1>
|
||||
mCachedFileDescriptorInfos;
|
||||
nscolor mLastBackgroundColor;
|
||||
bool mDidFakeShow;
|
||||
bool mNotified;
|
||||
bool mTriedBrowserInit;
|
||||
ScreenOrientationInternal mOrientation;
|
||||
bool mUpdateHitRegion;
|
||||
|
||||
DISALLOW_EVIL_CONSTRUCTORS(TabChild);
|
||||
bool mIgnoreKeyPressEvent;
|
||||
RefPtr<APZEventState> mAPZEventState;
|
||||
SetAllowedTouchBehaviorCallback mSetAllowedTouchBehaviorCallback;
|
||||
bool mHasValidInnerSize;
|
||||
bool mDestroyed;
|
||||
// Position of tab, relative to parent widget (typically the window)
|
||||
LayoutDeviceIntPoint mChromeDisp;
|
||||
TabId mUniqueId;
|
||||
|
||||
friend class ContentChild;
|
||||
float mDPI;
|
||||
double mDefaultScale;
|
||||
|
||||
bool mIPCOpen;
|
||||
bool mParentIsActive;
|
||||
bool mAsyncPanZoomEnabled;
|
||||
CSSSize mUnscaledInnerSize;
|
||||
bool mDidSetRealShowInfo;
|
||||
|
||||
nsAutoTArray<bool, NUMBER_OF_AUDIO_CHANNELS> mAudioChannelsActive;
|
||||
|
||||
DISALLOW_EVIL_CONSTRUCTORS(TabChild);
|
||||
};
|
||||
|
||||
} // namespace dom
|
||||
|
|
|
@ -104,8 +104,8 @@ public:
|
|||
bool HasOwnOrContainingApp() const;
|
||||
|
||||
/**
|
||||
* OriginAttributesRef() returns the DocShellOriginAttributes of this frame to the
|
||||
* caller. This is used to store any attribute associated with the frame's
|
||||
* OriginAttributesRef() returns the DocShellOriginAttributes of this frame to
|
||||
* the caller. This is used to store any attribute associated with the frame's
|
||||
* docshell, such as the AppId.
|
||||
*/
|
||||
const DocShellOriginAttributes& OriginAttributesRef() const;
|
||||
|
@ -196,10 +196,11 @@ public:
|
|||
return TabContext::SetTabContext(aContext);
|
||||
}
|
||||
|
||||
bool SetTabContext(mozIApplication* aOwnApp,
|
||||
mozIApplication* aAppFrameOwnerApp,
|
||||
const DocShellOriginAttributes& aOriginAttributes,
|
||||
const nsACString& aSignedPkgOriginNoSuffix = EmptyCString())
|
||||
bool
|
||||
SetTabContext(mozIApplication* aOwnApp,
|
||||
mozIApplication* aAppFrameOwnerApp,
|
||||
const DocShellOriginAttributes& aOriginAttributes,
|
||||
const nsACString& aSignedPkgOriginNoSuffix = EmptyCString())
|
||||
{
|
||||
return TabContext::SetTabContext(aOwnApp,
|
||||
aAppFrameOwnerApp,
|
||||
|
|
|
@ -64,16 +64,19 @@ struct ParamTraits<mozilla::dom::AudioChannel>
|
|||
{
|
||||
typedef mozilla::dom::AudioChannel paramType;
|
||||
|
||||
static bool IsLegalValue(const paramType &aValue) {
|
||||
static bool IsLegalValue(const paramType &aValue)
|
||||
{
|
||||
return aValue <= mozilla::dom::AudioChannel::Publicnotification;
|
||||
}
|
||||
|
||||
static void Write(Message* aMsg, const paramType& aValue) {
|
||||
static void Write(Message* aMsg, const paramType& aValue)
|
||||
{
|
||||
MOZ_ASSERT(IsLegalValue(aValue));
|
||||
WriteParam(aMsg, (uint32_t)aValue);
|
||||
}
|
||||
|
||||
static bool Read(const Message* aMsg, void** aIter, paramType* aResult) {
|
||||
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
||||
{
|
||||
uint32_t value;
|
||||
if(!ReadParam(aMsg, aIter, &value) ||
|
||||
!IsLegalValue(paramType(value))) {
|
||||
|
@ -84,8 +87,7 @@ struct ParamTraits<mozilla::dom::AudioChannel>
|
|||
}
|
||||
|
||||
static void Log(const paramType& aParam, std::wstring* aLog)
|
||||
{
|
||||
}
|
||||
{}
|
||||
};
|
||||
|
||||
template <>
|
||||
|
@ -93,15 +95,15 @@ struct ParamTraits<nsEventStatus>
|
|||
: public ContiguousEnumSerializer<nsEventStatus,
|
||||
nsEventStatus_eIgnore,
|
||||
nsEventStatus_eSentinel>
|
||||
{ };
|
||||
{};
|
||||
|
||||
template<>
|
||||
struct ParamTraits<nsSizeMode>
|
||||
: public ContiguousEnumSerializer<nsSizeMode,
|
||||
nsSizeMode_Normal,
|
||||
nsSizeMode_Invalid>
|
||||
{ };
|
||||
{};
|
||||
|
||||
} // namespace IPC
|
||||
|
||||
#endif
|
||||
#endif // TABMESSAGE_UTILS_H
|
||||
|
|
|
@ -438,7 +438,7 @@ TabParent::GetAppType(nsAString& aOut)
|
|||
}
|
||||
|
||||
bool
|
||||
TabParent::IsVisible()
|
||||
TabParent::IsVisible() const
|
||||
{
|
||||
RefPtr<nsFrameLoader> frameLoader = GetFrameLoader();
|
||||
if (!frameLoader) {
|
||||
|
|
1150
dom/ipc/TabParent.h
1150
dom/ipc/TabParent.h
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -51,9 +51,9 @@ public:
|
|||
BlobChild* GetOrCreateActorForBlob(Blob* aBlob);
|
||||
BlobChild* GetOrCreateActorForBlobImpl(BlobImpl* aImpl);
|
||||
|
||||
virtual PBlobChild* SendPBlobConstructor(
|
||||
PBlobChild* aActor,
|
||||
const BlobConstructorParams& aParams) = 0;
|
||||
virtual PBlobChild*
|
||||
SendPBlobConstructor(PBlobChild* aActor,
|
||||
const BlobConstructorParams& aParams) = 0;
|
||||
|
||||
virtual bool
|
||||
SendPBrowserConstructor(PBrowserChild* aActor,
|
||||
|
|
|
@ -55,28 +55,29 @@ public:
|
|||
BlobParent* GetOrCreateActorForBlob(Blob* aBlob);
|
||||
BlobParent* GetOrCreateActorForBlobImpl(BlobImpl* aImpl);
|
||||
|
||||
virtual ContentParentId ChildID() = 0;
|
||||
virtual bool IsForApp() = 0;
|
||||
virtual bool IsForBrowser() = 0;
|
||||
virtual ContentParentId ChildID() const = 0;
|
||||
virtual bool IsForApp() const = 0;
|
||||
virtual bool IsForBrowser() const = 0;
|
||||
|
||||
MOZ_WARN_UNUSED_RESULT
|
||||
virtual PBlobParent* SendPBlobConstructor(
|
||||
PBlobParent* aActor,
|
||||
const BlobConstructorParams& aParams) = 0;
|
||||
MOZ_WARN_UNUSED_RESULT virtual PBlobParent*
|
||||
SendPBlobConstructor(PBlobParent* aActor,
|
||||
const BlobConstructorParams& aParams) = 0;
|
||||
|
||||
MOZ_WARN_UNUSED_RESULT
|
||||
virtual PBrowserParent* SendPBrowserConstructor(
|
||||
PBrowserParent* actor,
|
||||
const TabId& aTabId,
|
||||
const IPCTabContext& context,
|
||||
const uint32_t& chromeFlags,
|
||||
const ContentParentId& aCpId,
|
||||
const bool& aIsForApp,
|
||||
const bool& aIsForBrowser) = 0;
|
||||
MOZ_WARN_UNUSED_RESULT virtual PBrowserParent*
|
||||
SendPBrowserConstructor(PBrowserParent* actor,
|
||||
const TabId& aTabId,
|
||||
const IPCTabContext& context,
|
||||
const uint32_t& chromeFlags,
|
||||
const ContentParentId& aCpId,
|
||||
const bool& aIsForApp,
|
||||
const bool& aIsForBrowser) = 0;
|
||||
|
||||
virtual bool IsContentParent() const { return false; }
|
||||
|
||||
virtual bool IsContentParent() { return false; }
|
||||
ContentParent* AsContentParent();
|
||||
virtual bool IsContentBridgeParent() { return false; }
|
||||
|
||||
virtual bool IsContentBridgeParent() const { return false; }
|
||||
|
||||
ContentBridgeParent* AsContentBridgeParent();
|
||||
|
||||
protected: // methods
|
||||
|
|
Загрузка…
Ссылка в новой задаче