1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
3 * You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #ifndef mozilla_ipc_backgroundchildimpl_h__
6 #define mozilla_ipc_backgroundchildimpl_h__
8 #include "mozilla/Attributes.h"
9 #include "mozilla/ipc/PBackgroundChild.h"
11 template <class> class nsAutoPtr
;
16 // Instances of this class should never be created directly. This class is meant
17 // to be inherited in BackgroundImpl.
18 class BackgroundChildImpl
: public PBackgroundChild
23 // Get the ThreadLocal for the current thread if
24 // BackgroundChild::GetOrCreateForCurrentThread() has been called and true was
25 // returned (e.g. a valid PBackgroundChild actor has been created or is in the
26 // process of being created). Otherwise this function returns null.
27 // This functions is implemented in BackgroundImpl.cpp.
29 GetThreadLocalForCurrentThread();
32 BackgroundChildImpl();
33 virtual ~BackgroundChildImpl();
36 ActorDestroy(ActorDestroyReason aWhy
) MOZ_OVERRIDE
;
38 virtual PBackgroundTestChild
*
39 AllocPBackgroundTestChild(const nsCString
& aTestArg
) MOZ_OVERRIDE
;
42 DeallocPBackgroundTestChild(PBackgroundTestChild
* aActor
) MOZ_OVERRIDE
;
45 class BackgroundChildImpl::ThreadLocal
47 friend class nsAutoPtr
<ThreadLocal
>;
49 // Add any members needed here.
55 // Only destroyed by nsAutoPtr<ThreadLocal>.
60 } // namespace mozilla
62 #endif // mozilla_ipc_backgroundchildimpl_h__