diff options
Diffstat (limited to 'dom/ipc')
-rw-r--r-- | dom/ipc/ContentChild.cpp | 39 | ||||
-rw-r--r-- | dom/ipc/ContentParent.cpp | 71 | ||||
-rw-r--r-- | dom/ipc/ContentProcess.cpp | 9 | ||||
-rw-r--r-- | dom/ipc/CrashReporterParent.cpp | 83 | ||||
-rw-r--r-- | dom/ipc/CrashReporterParent.h | 236 | ||||
-rw-r--r-- | dom/ipc/PBrowser.ipdl | 20 | ||||
-rw-r--r-- | dom/ipc/PDocumentRenderer.ipdl | 25 | ||||
-rw-r--r-- | dom/ipc/ProcessHangMonitor.cpp | 36 | ||||
-rw-r--r-- | dom/ipc/TabChild.cpp | 59 | ||||
-rw-r--r-- | dom/ipc/TabChild.h | 21 | ||||
-rw-r--r-- | dom/ipc/TabMessageUtils.h | 8 | ||||
-rw-r--r-- | dom/ipc/TabParent.cpp | 19 | ||||
-rw-r--r-- | dom/ipc/TabParent.h | 11 | ||||
-rw-r--r-- | dom/ipc/moz.build | 1 |
14 files changed, 2 insertions, 636 deletions
diff --git a/dom/ipc/ContentChild.cpp b/dom/ipc/ContentChild.cpp index ca4acf114..75678ca96 100644 --- a/dom/ipc/ContentChild.cpp +++ b/dom/ipc/ContentChild.cpp @@ -585,11 +585,6 @@ ContentChild::Init(MessageLoop* aIOLoop, SendBackUpXResources(FileDescriptor(xSocketFd)); #endif -#ifdef MOZ_CRASHREPORTER - SendPCrashReporterConstructor(CrashReporter::CurrentThreadId(), - XRE_GetProcessType()); -#endif - SendGetProcessAttributes(&mID, &mIsForApp, &mIsForBrowser); InitProcessAttributes(); @@ -1439,18 +1434,6 @@ ContentChild::RecvSetProcessSandbox(const MaybeFileDesc& aBroker) sandboxEnabled = StartMacOSContentSandbox(); #endif -#if defined(MOZ_CRASHREPORTER) - CrashReporter::AnnotateCrashReport( - NS_LITERAL_CSTRING("ContentSandboxEnabled"), - sandboxEnabled? NS_LITERAL_CSTRING("1") : NS_LITERAL_CSTRING("0")); -#if defined(XP_LINUX) && !defined(OS_ANDROID) - nsAutoCString flagsString; - flagsString.AppendInt(SandboxInfo::Get().AsInteger()); - - CrashReporter::AnnotateCrashReport( - NS_LITERAL_CSTRING("ContentSandboxCapabilities"), flagsString); -#endif /* XP_LINUX && !OS_ANDROID */ -#endif /* MOZ_CRASHREPORTER */ #endif /* MOZ_CONTENT_SANDBOX */ return true; @@ -1740,11 +1723,7 @@ PCrashReporterChild* ContentChild::AllocPCrashReporterChild(const mozilla::dom::NativeThreadId& id, const uint32_t& processType) { -#ifdef MOZ_CRASHREPORTER - return new CrashReporterChild(); -#else return nullptr; -#endif } bool @@ -2159,16 +2138,6 @@ ContentChild::ProcessingError(Result aCode, const char* aReason) NS_RUNTIMEABORT("not reached"); } -#if defined(MOZ_CRASHREPORTER) && !defined(MOZ_B2G) - if (PCrashReporterChild* c = LoneManagedOrNullAsserts(ManagedPCrashReporterChild())) { - CrashReporterChild* crashReporter = - static_cast<CrashReporterChild*>(c); - nsDependentCString reason(aReason); - crashReporter->SendAnnotateCrashReport( - NS_LITERAL_CSTRING("ipc_channel_error"), - reason); - } -#endif NS_RUNTIMEABORT("Content child abort due to IPC error"); } @@ -2872,10 +2841,6 @@ ContentChild::RecvShutdown() // to wait for that event loop to finish. Otherwise we could prematurely // terminate an "unload" or "pagehide" event handler (which might be doing a // sync XHR, for example). -#if defined(MOZ_CRASHREPORTER) - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("IPCShutdownState"), - NS_LITERAL_CSTRING("RecvShutdown")); -#endif nsCOMPtr<nsIThread> thread; nsresult rv = NS_GetMainThread(getter_AddRefs(thread)); if (NS_SUCCEEDED(rv) && thread) { @@ -2923,10 +2888,6 @@ ContentChild::RecvShutdown() // parent closes. StartForceKillTimer(); -#if defined(MOZ_CRASHREPORTER) - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("IPCShutdownState"), - NS_LITERAL_CSTRING("SendFinishShutdown")); -#endif // Ignore errors here. If this fails, the parent will kill us after a // timeout. Unused << SendFinishShutdown(); diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp index ff40db8d7..73621df22 100644 --- a/dom/ipc/ContentParent.cpp +++ b/dom/ipc/ContentParent.cpp @@ -249,10 +249,6 @@ using namespace mozilla::system; #include "mozilla/widget/AudioSession.h" #endif -#ifdef MOZ_CRASHREPORTER -#include "nsThread.h" -#endif - #ifdef ACCESSIBILITY #include "nsAccessibilityService.h" #endif @@ -273,9 +269,6 @@ using base::KillProcess; using mozilla::ProfileGatherer; #endif -#ifdef MOZ_CRASHREPORTER -using namespace CrashReporter; -#endif using namespace mozilla::dom::power; using namespace mozilla::media; using namespace mozilla::embedding; @@ -1847,36 +1840,6 @@ ContentParent::ActorDestroy(ActorDestroyReason why) NS_LITERAL_CSTRING("content"), 1); props->SetPropertyAsBool(NS_LITERAL_STRING("abnormal"), true); - -#ifdef MOZ_CRASHREPORTER - // There's a window in which child processes can crash - // after IPC is established, but before a crash reporter - // is created. - if (PCrashReporterParent* p = LoneManagedOrNullAsserts(ManagedPCrashReporterParent())) { - CrashReporterParent* crashReporter = - static_cast<CrashReporterParent*>(p); - - // If we're an app process, always stomp the latest URI - // loaded in the child process with our manifest URL. We - // would rather associate the crashes with apps than - // random child windows loaded in them. - // - // XXX would be nice if we could get both ... - if (!mAppManifestURL.IsEmpty()) { - crashReporter->AnnotateCrashReport(NS_LITERAL_CSTRING("URL"), - NS_ConvertUTF16toUTF8(mAppManifestURL)); - } - - // if mCreatedPairedMinidumps is true, we've already generated - // parent/child dumps for dekstop crashes. - if (!mCreatedPairedMinidumps) { - crashReporter->GenerateCrashReport(this, nullptr); - } - - nsAutoString dumpID(crashReporter->ChildDumpID()); - props->SetPropertyAsAString(NS_LITERAL_STRING("dumpID"), dumpID); - } -#endif } nsAutoString cpId; cpId.AppendInt(static_cast<uint64_t>(this->ChildID())); @@ -3090,33 +3053,6 @@ ContentParent::KillHard(const char* aReason) mCalledKillHard = true; mForceKillTimer = nullptr; -#if defined(MOZ_CRASHREPORTER) && !defined(MOZ_B2G) - // We're about to kill the child process associated with this content. - // Something has gone wrong to get us here, so we generate a minidump - // of the parent and child for submission to the crash server. - if (PCrashReporterParent* p = LoneManagedOrNullAsserts(ManagedPCrashReporterParent())) { - CrashReporterParent* crashReporter = - static_cast<CrashReporterParent*>(p); - // GeneratePairedMinidump creates two minidumps for us - the main - // one is for the content process we're about to kill, and the other - // one is for the main browser process. That second one is the extra - // minidump tagging along, so we have to tell the crash reporter that - // it exists and is being appended. - nsAutoCString additionalDumps("browser"); - crashReporter->AnnotateCrashReport( - NS_LITERAL_CSTRING("additional_minidumps"), - additionalDumps); - nsDependentCString reason(aReason); - crashReporter->AnnotateCrashReport( - NS_LITERAL_CSTRING("ipc_channel_error"), - reason); - - // Generate the report and insert into the queue for submittal. - mCreatedPairedMinidumps = crashReporter->GenerateCompleteMinidump(this); - - Telemetry::Accumulate(Telemetry::SUBPROCESS_KILL_HARD, reason, 1); - } -#endif ProcessHandle otherProcessHandle; if (!base::OpenProcessHandle(OtherPid(), &otherProcessHandle)) { NS_ERROR("Failed to open child process when attempting kill."); @@ -3168,11 +3104,7 @@ PCrashReporterParent* ContentParent::AllocPCrashReporterParent(const NativeThreadId& tid, const uint32_t& processType) { -#ifdef MOZ_CRASHREPORTER - return new CrashReporterParent(); -#else return nullptr; -#endif } bool @@ -5001,9 +4933,6 @@ ContentParent::RecvNotifyPushSubscriptionModifiedObservers(const nsCString& aSco bool ContentParent::RecvNotifyLowMemory() { -#ifdef MOZ_CRASHREPORTER - nsThread::SaveMemoryReportNearOOM(nsThread::ShouldSaveMemoryReport::kForceReport); -#endif return true; } diff --git a/dom/ipc/ContentProcess.cpp b/dom/ipc/ContentProcess.cpp index 66125f332..2413d8808 100644 --- a/dom/ipc/ContentProcess.cpp +++ b/dom/ipc/ContentProcess.cpp @@ -8,10 +8,6 @@ #include "ContentProcess.h" -#if defined(XP_WIN) && defined(MOZ_CONTENT_SANDBOX) -#include "mozilla/WindowsVersion.h" -#endif - #if defined(XP_MACOSX) && defined(MOZ_CONTENT_SANDBOX) #include <stdlib.h> #endif @@ -33,9 +29,8 @@ static bool IsSandboxTempDirRequired() { // On Windows, a sandbox-writable temp directory is only used - // for Vista or later with sandbox pref level >= 1. - return (IsVistaOrLater() && - (Preferences::GetInt("security.sandbox.content.level") >= 1)); + // when sandbox pref level >= 1. + return Preferences::GetInt("security.sandbox.content.level") >= 1; } static void diff --git a/dom/ipc/CrashReporterParent.cpp b/dom/ipc/CrashReporterParent.cpp index fc627387f..677b29670 100644 --- a/dom/ipc/CrashReporterParent.cpp +++ b/dom/ipc/CrashReporterParent.cpp @@ -13,13 +13,6 @@ #include "mozilla/Telemetry.h" -#ifdef MOZ_CRASHREPORTER -#include "nsExceptionHandler.h" -#include "nsICrashService.h" -#include "mozilla/SyncRunnable.h" -#include "nsThreadUtils.h" -#endif - namespace mozilla { namespace dom { @@ -29,9 +22,6 @@ void CrashReporterParent::AnnotateCrashReport(const nsCString& key, const nsCString& data) { -#ifdef MOZ_CRASHREPORTER - mNotes.Put(key, data); -#endif } void @@ -49,9 +39,6 @@ CrashReporterParent::RecvAppendAppNotes(const nsCString& data) CrashReporterParent::CrashReporterParent() : -#ifdef MOZ_CRASHREPORTER - mNotes(4), -#endif mStartTime(::time(nullptr)) , mInitialized(false) { @@ -72,75 +59,5 @@ CrashReporterParent::SetChildData(const NativeThreadId& tid, mProcessType = GeckoProcessType(processType); } -#ifdef MOZ_CRASHREPORTER -bool -CrashReporterParent::GenerateCrashReportForMinidump(nsIFile* minidump, - const AnnotationTable* processNotes) -{ - if (!CrashReporter::GetIDFromMinidump(minidump, mChildDumpID)) { - return false; - } - - bool result = GenerateChildData(processNotes); - FinalizeChildData(); - return result; -} - -bool -CrashReporterParent::GenerateChildData(const AnnotationTable* processNotes) -{ - MOZ_ASSERT(mInitialized); - - 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); - - char startTime[32]; - SprintfLiteral(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); - } - - // 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; -} - -void -CrashReporterParent::FinalizeChildData() -{ - MOZ_ASSERT(mInitialized); - - CrashReporterHost::NotifyCrashService(mProcessType, mChildDumpID, &mNotes); - mNotes.Clear(); -} -#endif - } // namespace dom } // namespace mozilla diff --git a/dom/ipc/CrashReporterParent.h b/dom/ipc/CrashReporterParent.h index 25824f279..71896c5c1 100644 --- a/dom/ipc/CrashReporterParent.h +++ b/dom/ipc/CrashReporterParent.h @@ -10,122 +10,16 @@ #include "mozilla/dom/PCrashReporterParent.h" #include "mozilla/dom/TabMessageUtils.h" #include "nsIFile.h" -#ifdef MOZ_CRASHREPORTER -#include "nsExceptionHandler.h" -#include "nsDataHashtable.h" -#endif namespace mozilla { namespace dom { class CrashReporterParent : public PCrashReporterParent { -#ifdef MOZ_CRASHREPORTER - typedef CrashReporter::AnnotationTable AnnotationTable; -#endif public: CrashReporterParent(); virtual ~CrashReporterParent(); -#ifdef MOZ_CRASHREPORTER - - /* - * Attempt to create a bare-bones crash report, along with extra process- - * specific annotations present in the given AnnotationTable. Calls - * GenerateChildData and FinalizeChildData. - * - * @returns true if successful, false otherwise. - */ - template<class Toplevel> - bool - GenerateCrashReport(Toplevel* t, const AnnotationTable* processNotes); - - /* - * Attempt to generate a parent/child pair of minidumps from the given - * toplevel actor. This calls CrashReporter::CreateMinidumpsAndPair to - * generate the minidumps. Crash reporter annotations set prior to this - * call will be saved via PairedDumpCallbackExtra into an .extra file - * under the proper crash id. AnnotateCrashReport annotations are not - * set in this call and the report is not finalized. - * - * @returns true if successful, false otherwise. - */ - template<class Toplevel> - bool - GeneratePairedMinidump(Toplevel* t); - - /* - * Attempts to take a minidump of the current process and pair that with - * a named minidump handed in by the caller. - * - * @param aTopLevel - top level actor this reporter is associated with. - * @param aMinidump - the minidump to associate with. - * @param aPairName - the name of the additional minidump. - * @returns true if successful, false otherwise. - */ - template<class Toplevel> - bool - GenerateMinidumpAndPair(Toplevel* aTopLevel, nsIFile* aMinidump, - const nsACString& aPairName); - - /** - * Apply child process annotations to an existing paired mindump generated - * with GeneratePairedMinidump. - * - * Be careful about calling generate apis immediately after this call, - * see FinalizeChildData. - * - * @param processNotes (optional) - Additional notes to append. Annotations - * stored in mNotes will also be applied. processNotes can be null. - * @returns true if successful, false otherwise. - */ - bool - GenerateChildData(const AnnotationTable* processNotes); - - /** - * Handles main thread finalization tasks after a report has been - * generated. Does the following: - * - register the finished report with the crash service manager - * - records telemetry related data about crashes - * - * Be careful about calling generate apis immediately after this call, - * if this api is called on a non-main thread it will fire off a runnable - * to complete its work async. - */ - void - FinalizeChildData(); - - /* - * Attempt to generate a full paired dump complete with any child - * annoations, and finalizes the report. Note this call is only valid - * on the main thread. Calling on a background thread will fail. - * - * @returns true if successful, false otherwise. - */ - template<class Toplevel> - bool - GenerateCompleteMinidump(Toplevel* t); - - /** - * Submits a raw minidump handed in, calls GenerateChildData and - * FinalizeChildData. Used by content plugins and gmp. - * - * @returns true if successful, false otherwise. - */ - bool - GenerateCrashReportForMinidump(nsIFile* minidump, - const AnnotationTable* processNotes); - - /* - * Instantiate a new crash reporter actor from a given parent that manages - * the protocol. - * - * @returns true if successful, false otherwise. - */ - template<class Toplevel> - static bool CreateCrashReporter(Toplevel* actor); -#endif // MOZ_CRASHREPORTER - /* * Initialize this reporter with data from the child process. */ @@ -160,14 +54,6 @@ public: virtual bool RecvAppendAppNotes(const nsCString& aData) override; -#ifdef MOZ_CRASHREPORTER - void - NotifyCrashService(); -#endif - -#ifdef MOZ_CRASHREPORTER - AnnotationTable mNotes; -#endif nsCString mAppNotes; nsString mChildDumpID; // stores the child main thread id @@ -178,128 +64,6 @@ public: bool mInitialized; }; -#ifdef MOZ_CRASHREPORTER -template<class Toplevel> -inline bool -CrashReporterParent::GeneratePairedMinidump(Toplevel* t) -{ - mozilla::ipc::ScopedProcessHandle child; -#ifdef XP_MACOSX - child = t->Process()->GetChildTask(); -#else - if (!base::OpenPrivilegedProcessHandle(t->OtherPid(), &child.rwget())) { - NS_WARNING("Failed to open child process handle."); - return false; - } -#endif - nsCOMPtr<nsIFile> childDump; - if (CrashReporter::CreateMinidumpsAndPair(child, - mMainThread, - NS_LITERAL_CSTRING("browser"), - nullptr, // pair with a dump of this process and thread - getter_AddRefs(childDump)) && - CrashReporter::GetIDFromMinidump(childDump, mChildDumpID)) { - return true; - } - return false; -} - -template<class Toplevel> -inline bool -CrashReporterParent::GenerateMinidumpAndPair(Toplevel* aTopLevel, - nsIFile* aMinidumpToPair, - const nsACString& aPairName) -{ - mozilla::ipc::ScopedProcessHandle childHandle; -#ifdef XP_MACOSX - childHandle = aTopLevel->Process()->GetChildTask(); -#else - if (!base::OpenPrivilegedProcessHandle(aTopLevel->OtherPid(), - &childHandle.rwget())) { - NS_WARNING("Failed to open child process handle."); - return false; - } -#endif - nsCOMPtr<nsIFile> targetDump; - if (CrashReporter::CreateMinidumpsAndPair(childHandle, - mMainThread, // child thread id - aPairName, - aMinidumpToPair, - getter_AddRefs(targetDump)) && - CrashReporter::GetIDFromMinidump(targetDump, mChildDumpID)) { - return true; - } - return false; -} - -template<class Toplevel> -inline bool -CrashReporterParent::GenerateCrashReport(Toplevel* t, - const AnnotationTable* processNotes) -{ - nsCOMPtr<nsIFile> crashDump; - if (t->TakeMinidump(getter_AddRefs(crashDump), nullptr) && - CrashReporter::GetIDFromMinidump(crashDump, mChildDumpID)) { - bool result = GenerateChildData(processNotes); - FinalizeChildData(); - return result; - } - return false; -} - -template<class Toplevel> -inline bool -CrashReporterParent::GenerateCompleteMinidump(Toplevel* t) -{ - mozilla::ipc::ScopedProcessHandle child; - if (!NS_IsMainThread()) { - NS_WARNING("GenerateCompleteMinidump can't be called on non-main thread."); - return false; - } - -#ifdef XP_MACOSX - child = t->Process()->GetChildTask(); -#else - if (!base::OpenPrivilegedProcessHandle(t->OtherPid(), &child.rwget())) { - NS_WARNING("Failed to open child process handle."); - return false; - } -#endif - nsCOMPtr<nsIFile> childDump; - if (CrashReporter::CreateMinidumpsAndPair(child, - mMainThread, - NS_LITERAL_CSTRING("browser"), - nullptr, // pair with a dump of this process and thread - getter_AddRefs(childDump)) && - CrashReporter::GetIDFromMinidump(childDump, mChildDumpID)) { - bool result = GenerateChildData(nullptr); - FinalizeChildData(); - return result; - } - return false; -} - -template<class Toplevel> -/* static */ bool -CrashReporterParent::CreateCrashReporter(Toplevel* actor) -{ -#ifdef MOZ_CRASHREPORTER - NativeThreadId id; - uint32_t processType; - PCrashReporterParent* p = - actor->CallPCrashReporterConstructor(&id, &processType); - if (p) { - static_cast<CrashReporterParent*>(p)->SetChildData(id, processType); - } else { - NS_ERROR("Error creating crash reporter actor"); - } - return !!p; -#endif - return false; -} - -#endif - } // namespace dom } // namespace mozilla diff --git a/dom/ipc/PBrowser.ipdl b/dom/ipc/PBrowser.ipdl index 249657c26..9dfccbc5c 100644 --- a/dom/ipc/PBrowser.ipdl +++ b/dom/ipc/PBrowser.ipdl @@ -11,7 +11,6 @@ include protocol PContent; include protocol PContentBridge; include protocol PDatePicker; include protocol PDocAccessible; -include protocol PDocumentRenderer; include protocol PFilePicker; include protocol PIndexedDBPermissionRequest; include protocol PRenderFrame; @@ -119,7 +118,6 @@ nested(upto inside_cpow) sync protocol PBrowser manages PColorPicker; manages PDatePicker; manages PDocAccessible; - manages PDocumentRenderer; manages PFilePicker; manages PIndexedDBPermissionRequest; manages PRenderFrame; @@ -739,24 +737,6 @@ child: async LoadRemoteScript(nsString aURL, bool aRunInGlobalScope); /** - * Create a asynchronous request to render whatever document is - * loaded in the child when this message arrives. When the - * request finishes, PDocumentRenderer:__delete__ is sent back to - * this side to notify completion. - * - * |documentRect| is the area of the remote document to draw, - * transformed by |transform|. The rendered area will have the - * default background color |bgcolor|. |renderFlags| are the - * nsIPresShell::RenderDocument() flags to use on the remote side, - * and if true, |flushLayout| will do just that before rendering - * the document. The rendered image will be of size |renderSize|. - */ - async PDocumentRenderer(nsRect documentRect, Matrix transform, - nsString bgcolor, - uint32_t renderFlags, bool flushLayout, - IntSize renderSize); - - /** * Sent by the chrome process when it no longer wants this remote * <browser>. The child side cleans up in response, then * finalizing its death by sending back __delete__() to the diff --git a/dom/ipc/PDocumentRenderer.ipdl b/dom/ipc/PDocumentRenderer.ipdl deleted file mode 100644 index bdaed45d7..000000000 --- a/dom/ipc/PDocumentRenderer.ipdl +++ /dev/null @@ -1,25 +0,0 @@ -/* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * 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/. */ - -include protocol PBrowser; - -include "mozilla/GfxMessageUtils.h"; - -using nsIntSize from "nsSize.h"; - -namespace mozilla { -namespace ipc { - -protocol PDocumentRenderer -{ - manager PBrowser; - -parent: - // Returns the width and height, in pixels, of the returned ARGB32 data. - async __delete__(nsIntSize renderedSize, nsCString data); -}; - -} // namespace ipc -} // namespace mozilla diff --git a/dom/ipc/ProcessHangMonitor.cpp b/dom/ipc/ProcessHangMonitor.cpp index b574be61f..d46a1f5d5 100644 --- a/dom/ipc/ProcessHangMonitor.cpp +++ b/dom/ipc/ProcessHangMonitor.cpp @@ -27,9 +27,6 @@ #include "nsITabParent.h" #include "nsPluginHost.h" #include "nsThreadUtils.h" -#ifdef MOZ_CRASHREPORTER -#include "nsExceptionHandler.h" -#endif #include "base/task.h" #include "base/thread.h" @@ -556,16 +553,6 @@ HangMonitorParent::HangMonitorParent(ProcessHangMonitor* aMonitor) HangMonitorParent::~HangMonitorParent() { -#ifdef MOZ_CRASHREPORTER - MutexAutoLock lock(mBrowserCrashDumpHashLock); - - for (auto iter = mBrowserCrashDumpIds.Iter(); !iter.Done(); iter.Next()) { - nsString crashId = iter.UserData(); - if (!crashId.IsEmpty()) { - CrashReporter::DeleteMinidumpFilesForID(crashId); - } - } -#endif } void @@ -698,24 +685,6 @@ bool HangMonitorParent::TakeBrowserMinidump(const PluginHangData& aPhd, nsString& aCrashId) { -#ifdef MOZ_CRASHREPORTER - MutexAutoLock lock(mBrowserCrashDumpHashLock); - if (!mBrowserCrashDumpIds.Get(aPhd.pluginId(), &aCrashId)) { - nsCOMPtr<nsIFile> browserDump; - if (CrashReporter::TakeMinidump(getter_AddRefs(browserDump), true)) { - if (!CrashReporter::GetIDFromMinidump(browserDump, aCrashId) - || aCrashId.IsEmpty()) { - browserDump->Remove(false); - NS_WARNING("Failed to generate timely browser stack, " - "this is bad for plugin hang analysis!"); - } else { - mBrowserCrashDumpIds.Put(aPhd.pluginId(), aCrashId); - return true; - } - } - } -#endif // MOZ_CRASHREPORTER - return false; } @@ -840,11 +809,6 @@ HangMonitorParent::CleanupPluginHang(uint32_t aPluginId, bool aRemoveFiles) return; } mBrowserCrashDumpIds.Remove(aPluginId); -#ifdef MOZ_CRASHREPORTER - if (aRemoveFiles && !crashId.IsEmpty()) { - CrashReporter::DeleteMinidumpFilesForID(crashId); - } -#endif } void diff --git a/dom/ipc/TabChild.cpp b/dom/ipc/TabChild.cpp index eaf4a32ed..c8a0c6e3f 100644 --- a/dom/ipc/TabChild.cpp +++ b/dom/ipc/TabChild.cpp @@ -22,7 +22,6 @@ #include "mozilla/dom/indexedDB/PIndexedDBPermissionRequestChild.h" #include "mozilla/plugins/PluginWidgetChild.h" #include "mozilla/IMEStateManager.h" -#include "mozilla/ipc/DocumentRendererChild.h" #include "mozilla/ipc/URIUtils.h" #include "mozilla/layers/APZChild.h" #include "mozilla/layers/APZCCallbackHelper.h" @@ -53,9 +52,6 @@ #include "nsEmbedCID.h" #include "nsGlobalWindow.h" #include <algorithm> -#ifdef MOZ_CRASHREPORTER -#include "nsExceptionHandler.h" -#endif #include "nsFilePickerProxy.h" #include "mozilla/dom/Element.h" #include "nsGlobalWindow.h" @@ -1262,10 +1258,6 @@ TabChild::RecvLoadURL(const nsCString& aURI, NS_WARNING("WebNavigation()->LoadURI failed. Eating exception, what else can I do?"); } -#ifdef MOZ_CRASHREPORTER - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("URL"), aURI); -#endif - return true; } @@ -2006,57 +1998,6 @@ TabChild::DeallocPDocAccessibleChild(a11y::PDocAccessibleChild* aChild) return true; } -PDocumentRendererChild* -TabChild::AllocPDocumentRendererChild(const nsRect& documentRect, - const mozilla::gfx::Matrix& transform, - const nsString& bgcolor, - const uint32_t& renderFlags, - const bool& flushLayout, - const nsIntSize& renderSize) -{ - return new DocumentRendererChild(); -} - -bool -TabChild::DeallocPDocumentRendererChild(PDocumentRendererChild* actor) -{ - delete actor; - return true; -} - -bool -TabChild::RecvPDocumentRendererConstructor(PDocumentRendererChild* actor, - const nsRect& documentRect, - const mozilla::gfx::Matrix& transform, - const nsString& bgcolor, - const uint32_t& renderFlags, - const bool& flushLayout, - const nsIntSize& renderSize) -{ - DocumentRendererChild *render = static_cast<DocumentRendererChild *>(actor); - - nsCOMPtr<nsIWebBrowser> browser = do_QueryInterface(WebNavigation()); - if (!browser) - return true; // silently ignore - nsCOMPtr<mozIDOMWindowProxy> window; - if (NS_FAILED(browser->GetContentDOMWindow(getter_AddRefs(window))) || - !window) - { - return true; // silently ignore - } - - nsCString data; - bool ret = render->RenderDocument(nsPIDOMWindowOuter::From(window), - documentRect, transform, - bgcolor, - renderFlags, flushLayout, - renderSize, data); - if (!ret) - return true; // silently ignore - - return PDocumentRendererChild::Send__delete__(actor, renderSize, data); -} - PColorPickerChild* TabChild::AllocPColorPickerChild(const nsString&, const nsString&) { diff --git a/dom/ipc/TabChild.h b/dom/ipc/TabChild.h index b23c7c19e..2232ffeaf 100644 --- a/dom/ipc/TabChild.h +++ b/dom/ipc/TabChild.h @@ -445,27 +445,6 @@ public: 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; diff --git a/dom/ipc/TabMessageUtils.h b/dom/ipc/TabMessageUtils.h index cdb76099d..2933173d7 100644 --- a/dom/ipc/TabMessageUtils.h +++ b/dom/ipc/TabMessageUtils.h @@ -13,10 +13,6 @@ #include "nsPIDOMWindow.h" #include "nsCOMPtr.h" -#ifdef MOZ_CRASHREPORTER -#include "nsExceptionHandler.h" -#endif - namespace mozilla { namespace dom { struct RemoteDOMEvent @@ -28,12 +24,8 @@ struct RemoteDOMEvent bool ReadRemoteEvent(const IPC::Message* aMsg, PickleIterator* aIter, mozilla::dom::RemoteDOMEvent* aResult); -#ifdef MOZ_CRASHREPORTER -typedef CrashReporter::ThreadId NativeThreadId; -#else // unused in this case typedef int32_t NativeThreadId; -#endif } // namespace dom } // namespace mozilla diff --git a/dom/ipc/TabParent.cpp b/dom/ipc/TabParent.cpp index 0df4c1253..8e98de3ce 100644 --- a/dom/ipc/TabParent.cpp +++ b/dom/ipc/TabParent.cpp @@ -28,7 +28,6 @@ #include "mozilla/gfx/GPUProcessManager.h" #include "mozilla/Hal.h" #include "mozilla/IMEStateManager.h" -#include "mozilla/ipc/DocumentRendererParent.h" #include "mozilla/jsipc/CrossProcessObjectWrappers.h" #include "mozilla/layers/AsyncDragMetrics.h" #include "mozilla/layers/InputAPZContext.h" @@ -957,24 +956,6 @@ TabParent::GetTopLevelDocAccessible() const return nullptr; } -PDocumentRendererParent* -TabParent::AllocPDocumentRendererParent(const nsRect& documentRect, - const gfx::Matrix& transform, - const nsString& bgcolor, - const uint32_t& renderFlags, - const bool& flushLayout, - const nsIntSize& renderSize) -{ - return new DocumentRendererParent(); -} - -bool -TabParent::DeallocPDocumentRendererParent(PDocumentRendererParent* actor) -{ - delete actor; - return true; -} - PFilePickerParent* TabParent::AllocPFilePickerParent(const nsString& aTitle, const int16_t& aMode) { diff --git a/dom/ipc/TabParent.h b/dom/ipc/TabParent.h index 43afb0538..09bb999f3 100644 --- a/dom/ipc/TabParent.h +++ b/dom/ipc/TabParent.h @@ -473,17 +473,6 @@ public: const ScrollableLayerGuid& aGuid, uint64_t aInputBlockId); - virtual PDocumentRendererParent* - AllocPDocumentRendererParent(const nsRect& documentRect, - const gfx::Matrix& transform, - const nsString& bgcolor, - const uint32_t& renderFlags, - const bool& flushLayout, - const nsIntSize& renderSize) override; - - virtual bool - DeallocPDocumentRendererParent(PDocumentRendererParent* actor) override; - virtual PFilePickerParent* AllocPFilePickerParent(const nsString& aTitle, const int16_t& aMode) override; diff --git a/dom/ipc/moz.build b/dom/ipc/moz.build index 153bd3aae..ff3880bc2 100644 --- a/dom/ipc/moz.build +++ b/dom/ipc/moz.build @@ -96,7 +96,6 @@ IPDL_SOURCES += [ 'PCrashReporter.ipdl', 'PCycleCollectWithLogs.ipdl', 'PDatePicker.ipdl', - 'PDocumentRenderer.ipdl', 'PFilePicker.ipdl', 'PMemoryReportRequest.ipdl', 'PPluginWidget.ipdl', |