dom/base/nsIScriptTimeoutHandler.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* vim: set ts=2 sw=2 et tw=80: */
     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/. */
     6 #ifndef nsIScriptTimeoutHandler_h___
     7 #define nsIScriptTimeoutHandler_h___
     9 #include "nsTArray.h"
    10 #include "js/TypeDecls.h"
    12 namespace mozilla {
    13 namespace dom {
    14 class Function;
    15 } // namespace dom
    16 } // namespace mozilla
    18 #define NS_ISCRIPTTIMEOUTHANDLER_IID \
    19 { 0x53c8e80e, 0xcc78, 0x48bc, \
    20  { 0xba, 0x63, 0x0c, 0xb9, 0xdb, 0xf7, 0x06, 0x34 } }
    22 /**
    23  * Abstraction of the script objects etc required to do timeouts in a
    24  * language agnostic way.
    25  */
    27 class nsIScriptTimeoutHandler : public nsISupports
    28 {
    29 public:
    30   NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISCRIPTTIMEOUTHANDLER_IID)
    32   // Get the Function to call.  If this returns nullptr, GetHandlerText() will
    33   // be called to get the string.
    34   virtual mozilla::dom::Function *GetCallback() = 0;
    36   // Get the handler text of not a compiled object.
    37   virtual const char16_t *GetHandlerText() = 0;
    39   // Get the location of the script.
    40   // Note: The memory pointed to by aFileName is owned by the
    41   // nsIScriptTimeoutHandler and should not be freed by the caller.
    42   virtual void GetLocation(const char **aFileName, uint32_t *aLineNo) = 0;
    44   // If we have a Function, get the arguments for passing to it.
    45   virtual const nsTArray<JS::Value>& GetArgs() = 0;
    46 };
    48 NS_DEFINE_STATIC_IID_ACCESSOR(nsIScriptTimeoutHandler,
    49                               NS_ISCRIPTTIMEOUTHANDLER_IID)
    51 #endif // nsIScriptTimeoutHandler_h___

mercurial