dom/bindings/CallbackInterface.h

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* vim:set ts=2 sw=2 sts=2 et cindent: */
     3 /* This Source Code Form is subject to the terms of the Mozilla Public
     4  * License, v. 2.0. If a copy of the MPL was not distributed with this
     5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     7 /**
     8  * A common base class for representing WebIDL callback interface types in C++.
     9  *
    10  * This class implements common functionality like lifetime management,
    11  * initialization with the callback object, and setup of the call environment.
    12  * Subclasses corresponding to particular callback interface types should
    13  * provide methods that actually do the various necessary calls.
    14  */
    16 #ifndef mozilla_dom_CallbackInterface_h
    17 #define mozilla_dom_CallbackInterface_h
    19 #include "mozilla/dom/CallbackObject.h"
    21 namespace mozilla {
    22 namespace dom {
    24 class CallbackInterface : public CallbackObject
    25 {
    26 public:
    27   explicit CallbackInterface(JS::Handle<JSObject*> aCallback,
    28                              nsIGlobalObject *aIncumbentGlobal)
    29     : CallbackObject(aCallback, aIncumbentGlobal)
    30   {
    31   }
    33 protected:
    34   bool GetCallableProperty(JSContext* cx, const char* aPropName,
    35                            JS::MutableHandle<JS::Value> aCallable);
    37 };
    39 } // namespace dom
    40 } // namespace mozilla
    42 #endif // mozilla_dom_CallbackFunction_h

mercurial