/work/obj-fuzz/dist/include/mozilla/dom/TimeoutHandler.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 | | /* vim: set ts=8 sts=2 et sw=2 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 | | |
7 | | #ifndef mozilla_dom_timeout_handler_h |
8 | | #define mozilla_dom_timeout_handler_h |
9 | | |
10 | | #include "nsCOMPtr.h" |
11 | | #include "nsISupports.h" |
12 | | #include "nsITimeoutHandler.h" |
13 | | #include "nsCycleCollectionParticipant.h" |
14 | | #include "nsString.h" |
15 | | |
16 | | namespace mozilla { |
17 | | namespace dom { |
18 | | |
19 | | /** |
20 | | * Utility class for implementing nsITimeoutHandlers, designed to be subclassed. |
21 | | */ |
22 | | class TimeoutHandler : public nsITimeoutHandler |
23 | | { |
24 | | public: |
25 | | // TimeoutHandler doesn't actually contain cycles, but subclasses |
26 | | // probably will. |
27 | | NS_DECL_CYCLE_COLLECTING_ISUPPORTS |
28 | | NS_DECL_CYCLE_COLLECTION_CLASS(TimeoutHandler) |
29 | | |
30 | | virtual nsresult Call() override; |
31 | | virtual void GetLocation(const char** aFileName, uint32_t* aLineNo, |
32 | | uint32_t* aColumn) override; |
33 | 0 | virtual void MarkForCC() override {} |
34 | | protected: |
35 | 0 | TimeoutHandler() : mFileName(""), mLineNo(0), mColumn(0) {} |
36 | | explicit TimeoutHandler(JSContext *aCx); |
37 | | |
38 | 0 | virtual ~TimeoutHandler() {} |
39 | | private: |
40 | | TimeoutHandler(const TimeoutHandler&) = delete; |
41 | | TimeoutHandler& operator=(const TimeoutHandler&) = delete; |
42 | | TimeoutHandler& operator=(const TimeoutHandler&&) = delete; |
43 | | |
44 | | nsCString mFileName; |
45 | | uint32_t mLineNo; |
46 | | uint32_t mColumn; |
47 | | }; |
48 | | |
49 | | } // namespace dom |
50 | | } // namespace mozilla |
51 | | |
52 | | #endif // mozilla_dom_timeout_handler_h |