Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* vim: set ts=2 sw=2 et tw=80: */ |
michael@0 | 3 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 4 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 5 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 6 | #ifndef nsIScriptTimeoutHandler_h___ |
michael@0 | 7 | #define nsIScriptTimeoutHandler_h___ |
michael@0 | 8 | |
michael@0 | 9 | #include "nsTArray.h" |
michael@0 | 10 | #include "js/TypeDecls.h" |
michael@0 | 11 | |
michael@0 | 12 | namespace mozilla { |
michael@0 | 13 | namespace dom { |
michael@0 | 14 | class Function; |
michael@0 | 15 | } // namespace dom |
michael@0 | 16 | } // namespace mozilla |
michael@0 | 17 | |
michael@0 | 18 | #define NS_ISCRIPTTIMEOUTHANDLER_IID \ |
michael@0 | 19 | { 0x53c8e80e, 0xcc78, 0x48bc, \ |
michael@0 | 20 | { 0xba, 0x63, 0x0c, 0xb9, 0xdb, 0xf7, 0x06, 0x34 } } |
michael@0 | 21 | |
michael@0 | 22 | /** |
michael@0 | 23 | * Abstraction of the script objects etc required to do timeouts in a |
michael@0 | 24 | * language agnostic way. |
michael@0 | 25 | */ |
michael@0 | 26 | |
michael@0 | 27 | class nsIScriptTimeoutHandler : public nsISupports |
michael@0 | 28 | { |
michael@0 | 29 | public: |
michael@0 | 30 | NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISCRIPTTIMEOUTHANDLER_IID) |
michael@0 | 31 | |
michael@0 | 32 | // Get the Function to call. If this returns nullptr, GetHandlerText() will |
michael@0 | 33 | // be called to get the string. |
michael@0 | 34 | virtual mozilla::dom::Function *GetCallback() = 0; |
michael@0 | 35 | |
michael@0 | 36 | // Get the handler text of not a compiled object. |
michael@0 | 37 | virtual const char16_t *GetHandlerText() = 0; |
michael@0 | 38 | |
michael@0 | 39 | // Get the location of the script. |
michael@0 | 40 | // Note: The memory pointed to by aFileName is owned by the |
michael@0 | 41 | // nsIScriptTimeoutHandler and should not be freed by the caller. |
michael@0 | 42 | virtual void GetLocation(const char **aFileName, uint32_t *aLineNo) = 0; |
michael@0 | 43 | |
michael@0 | 44 | // If we have a Function, get the arguments for passing to it. |
michael@0 | 45 | virtual const nsTArray<JS::Value>& GetArgs() = 0; |
michael@0 | 46 | }; |
michael@0 | 47 | |
michael@0 | 48 | NS_DEFINE_STATIC_IID_ACCESSOR(nsIScriptTimeoutHandler, |
michael@0 | 49 | NS_ISCRIPTTIMEOUTHANDLER_IID) |
michael@0 | 50 | |
michael@0 | 51 | #endif // nsIScriptTimeoutHandler_h___ |