mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-06 14:44:26 +00:00
Bug 1102052 - Crash for PBackground protocol errors, r=mrbkap.
This commit is contained in:
parent
08f987df9c
commit
44622b4efd
@ -5,6 +5,7 @@
|
||||
#include "BackgroundChildImpl.h"
|
||||
|
||||
#include "FileDescriptorSetChild.h"
|
||||
#include "mozilla/Assertions.h"
|
||||
#include "mozilla/dom/PBlobChild.h"
|
||||
#include "mozilla/dom/indexedDB/PBackgroundIDBFactoryChild.h"
|
||||
#include "mozilla/dom/ipc/BlobChild.h"
|
||||
@ -80,6 +81,39 @@ BackgroundChildImpl::~BackgroundChildImpl()
|
||||
MOZ_COUNT_DTOR(mozilla::ipc::BackgroundChildImpl);
|
||||
}
|
||||
|
||||
void
|
||||
BackgroundChildImpl::ProcessingError(Result aWhat)
|
||||
{
|
||||
// May happen on any thread!
|
||||
|
||||
nsAutoCString abortMessage;
|
||||
|
||||
switch (aWhat) {
|
||||
|
||||
#define HANDLE_CASE(_result) \
|
||||
case _result: \
|
||||
abortMessage.AssignLiteral(#_result); \
|
||||
break
|
||||
|
||||
HANDLE_CASE(MsgDropped);
|
||||
HANDLE_CASE(MsgNotKnown);
|
||||
HANDLE_CASE(MsgNotAllowed);
|
||||
HANDLE_CASE(MsgPayloadError);
|
||||
HANDLE_CASE(MsgProcessingError);
|
||||
HANDLE_CASE(MsgRouteError);
|
||||
HANDLE_CASE(MsgValueError);
|
||||
|
||||
#undef HANDLE_CASE
|
||||
|
||||
default:
|
||||
MOZ_CRASH("Unknown error code!");
|
||||
}
|
||||
|
||||
// This is just MOZ_CRASH() un-inlined so that we can pass the result code as
|
||||
// a string. MOZ_CRASH() only supports string literals at the moment.
|
||||
MOZ_ReportCrash(abortMessage.get(), __FILE__, __LINE__); MOZ_REALLY_CRASH();
|
||||
}
|
||||
|
||||
void
|
||||
BackgroundChildImpl::ActorDestroy(ActorDestroyReason aWhy)
|
||||
{
|
||||
|
@ -40,6 +40,9 @@ protected:
|
||||
BackgroundChildImpl();
|
||||
virtual ~BackgroundChildImpl();
|
||||
|
||||
virtual void
|
||||
ProcessingError(Result aWhat) MOZ_OVERRIDE;
|
||||
|
||||
virtual void
|
||||
ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user