2012-12-03 18:38:25 -08:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* 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/. */
|
|
|
|
|
|
|
|
#ifndef mozilla_dom_CellBroadcast_h__
|
|
|
|
#define mozilla_dom_CellBroadcast_h__
|
|
|
|
|
2013-08-26 20:38:37 -07:00
|
|
|
#include "mozilla/Attributes.h"
|
2014-03-31 23:13:50 -07:00
|
|
|
#include "mozilla/DOMEventTargetHelper.h"
|
2013-08-26 20:38:37 -07:00
|
|
|
#include "mozilla/ErrorResult.h"
|
2014-08-13 03:28:34 -07:00
|
|
|
#include "nsICellBroadcastService.h"
|
2013-08-27 19:59:14 -07:00
|
|
|
#include "js/TypeDecls.h"
|
2012-12-03 18:38:25 -08:00
|
|
|
|
|
|
|
class nsPIDOMWindow;
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2014-08-19 18:01:49 -07:00
|
|
|
class CellBroadcast MOZ_FINAL : public DOMEventTargetHelper,
|
|
|
|
private nsICellBroadcastListener
|
2012-12-03 18:38:25 -08:00
|
|
|
{
|
2012-12-03 18:40:47 -08:00
|
|
|
/**
|
2014-08-19 18:01:49 -07:00
|
|
|
* Class CellBroadcast doesn't actually expose nsICellBroadcastListener.
|
2013-03-06 01:53:15 -08:00
|
|
|
* Instead, it owns an nsICellBroadcastListener derived instance mListener
|
2014-08-13 03:28:34 -07:00
|
|
|
* and passes it to nsICellBroadcastService. The onreceived events are first
|
2013-03-06 01:53:15 -08:00
|
|
|
* delivered to mListener and then forwarded to its owner, CellBroadcast. See
|
|
|
|
* also bug 775997 comment #51.
|
2012-12-03 18:40:47 -08:00
|
|
|
*/
|
2013-03-06 01:53:15 -08:00
|
|
|
class Listener;
|
2012-12-03 18:40:47 -08:00
|
|
|
|
2014-08-19 18:01:49 -07:00
|
|
|
// MOZ_FINAL suppresses -Werror,-Wdelete-non-virtual-dtor
|
|
|
|
~CellBroadcast();
|
|
|
|
|
2013-03-06 01:53:15 -08:00
|
|
|
public:
|
2014-08-19 18:01:49 -07:00
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
2013-03-06 01:53:15 -08:00
|
|
|
NS_DECL_NSICELLBROADCASTLISTENER
|
2012-12-03 18:38:25 -08:00
|
|
|
|
2014-03-31 23:13:50 -07:00
|
|
|
NS_REALLY_FORWARD_NSIDOMEVENTTARGET(DOMEventTargetHelper)
|
2012-12-03 18:38:25 -08:00
|
|
|
|
2013-08-26 20:38:37 -07:00
|
|
|
static already_AddRefed<CellBroadcast>
|
|
|
|
Create(nsPIDOMWindow* aOwner, ErrorResult& aRv);
|
|
|
|
|
2015-01-06 15:35:02 -08:00
|
|
|
CellBroadcast() = delete;
|
2012-12-03 18:40:47 -08:00
|
|
|
CellBroadcast(nsPIDOMWindow *aWindow,
|
2014-08-13 03:28:34 -07:00
|
|
|
nsICellBroadcastService* aService);
|
2012-12-03 18:40:47 -08:00
|
|
|
|
2013-08-26 20:38:37 -07:00
|
|
|
nsPIDOMWindow*
|
|
|
|
GetParentObject() const { return GetOwner(); }
|
|
|
|
|
|
|
|
virtual JSObject*
|
Bug 1117172 part 3. Change the wrappercached WrapObject methods to allow passing in aGivenProto. r=peterv
The only manual changes here are to BindingUtils.h, BindingUtils.cpp,
Codegen.py, Element.cpp, IDBFileRequest.cpp, IDBObjectStore.cpp,
dom/workers/Navigator.cpp, WorkerPrivate.cpp, DeviceStorageRequestChild.cpp,
Notification.cpp, nsGlobalWindow.cpp, MessagePort.cpp, nsJSEnvironment.cpp,
Sandbox.cpp, XPCConvert.cpp, ExportHelpers.cpp, and DataStoreService.cpp. The
rest of this diff was generated by running the following commands:
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObject\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(Binding(?:_workers)?::Wrap\((?:aCx|cx|aContext|aCtx|js), [^,)]+)\)/\1, aGivenProto)/g'
2015-03-19 07:13:33 -07:00
|
|
|
WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
|
2013-08-26 20:38:37 -07:00
|
|
|
|
|
|
|
IMPL_EVENT_HANDLER(received)
|
|
|
|
|
2012-12-03 18:40:47 -08:00
|
|
|
private:
|
2013-03-06 01:53:15 -08:00
|
|
|
nsRefPtr<Listener> mListener;
|
2012-12-03 18:38:25 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2013-08-26 20:38:37 -07:00
|
|
|
#endif /* mozilla_dom_CellBroadcast_h__ */
|