Tue, 06 Jan 2015 21:39:09 +0100
Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #ifndef mozilla_dom_NotifyPaintEvent_h_ |
michael@0 | 7 | #define mozilla_dom_NotifyPaintEvent_h_ |
michael@0 | 8 | |
michael@0 | 9 | #include "mozilla/Attributes.h" |
michael@0 | 10 | #include "mozilla/dom/Event.h" |
michael@0 | 11 | #include "mozilla/dom/NotifyPaintEventBinding.h" |
michael@0 | 12 | #include "nsIDOMNotifyPaintEvent.h" |
michael@0 | 13 | #include "nsPresContext.h" |
michael@0 | 14 | |
michael@0 | 15 | namespace mozilla { |
michael@0 | 16 | namespace dom { |
michael@0 | 17 | |
michael@0 | 18 | class DOMRect; |
michael@0 | 19 | class DOMRectList; |
michael@0 | 20 | class PaintRequestList; |
michael@0 | 21 | |
michael@0 | 22 | class NotifyPaintEvent : public Event, |
michael@0 | 23 | public nsIDOMNotifyPaintEvent |
michael@0 | 24 | { |
michael@0 | 25 | |
michael@0 | 26 | public: |
michael@0 | 27 | NotifyPaintEvent(EventTarget* aOwner, |
michael@0 | 28 | nsPresContext* aPresContext, |
michael@0 | 29 | WidgetEvent* aEvent, |
michael@0 | 30 | uint32_t aEventType, |
michael@0 | 31 | nsInvalidateRequestList* aInvalidateRequests); |
michael@0 | 32 | |
michael@0 | 33 | NS_DECL_ISUPPORTS_INHERITED |
michael@0 | 34 | |
michael@0 | 35 | NS_DECL_NSIDOMNOTIFYPAINTEVENT |
michael@0 | 36 | |
michael@0 | 37 | // Forward to base class |
michael@0 | 38 | NS_FORWARD_TO_EVENT_NO_SERIALIZATION_NO_DUPLICATION |
michael@0 | 39 | NS_IMETHOD DuplicatePrivateData() MOZ_OVERRIDE |
michael@0 | 40 | { |
michael@0 | 41 | return Event::DuplicatePrivateData(); |
michael@0 | 42 | } |
michael@0 | 43 | NS_IMETHOD_(void) Serialize(IPC::Message* aMsg, bool aSerializeInterfaceType) MOZ_OVERRIDE; |
michael@0 | 44 | NS_IMETHOD_(bool) Deserialize(const IPC::Message* aMsg, void** aIter) MOZ_OVERRIDE; |
michael@0 | 45 | |
michael@0 | 46 | virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE |
michael@0 | 47 | { |
michael@0 | 48 | return NotifyPaintEventBinding::Wrap(aCx, this); |
michael@0 | 49 | } |
michael@0 | 50 | |
michael@0 | 51 | already_AddRefed<DOMRectList> ClientRects(); |
michael@0 | 52 | |
michael@0 | 53 | already_AddRefed<DOMRect> BoundingClientRect(); |
michael@0 | 54 | |
michael@0 | 55 | already_AddRefed<PaintRequestList> PaintRequests(); |
michael@0 | 56 | private: |
michael@0 | 57 | nsRegion GetRegion(); |
michael@0 | 58 | |
michael@0 | 59 | nsTArray<nsInvalidateRequestList::Request> mInvalidateRequests; |
michael@0 | 60 | }; |
michael@0 | 61 | |
michael@0 | 62 | } // namespace dom |
michael@0 | 63 | } // namespace mozilla |
michael@0 | 64 | |
michael@0 | 65 | #endif // mozilla_dom_NotifyPaintEvent_h_ |