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.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef mozilla_dom_NotifyPaintEvent_h_
7 #define mozilla_dom_NotifyPaintEvent_h_
9 #include "mozilla/Attributes.h"
10 #include "mozilla/dom/Event.h"
11 #include "mozilla/dom/NotifyPaintEventBinding.h"
12 #include "nsIDOMNotifyPaintEvent.h"
13 #include "nsPresContext.h"
15 namespace mozilla {
16 namespace dom {
18 class DOMRect;
19 class DOMRectList;
20 class PaintRequestList;
22 class NotifyPaintEvent : public Event,
23 public nsIDOMNotifyPaintEvent
24 {
26 public:
27 NotifyPaintEvent(EventTarget* aOwner,
28 nsPresContext* aPresContext,
29 WidgetEvent* aEvent,
30 uint32_t aEventType,
31 nsInvalidateRequestList* aInvalidateRequests);
33 NS_DECL_ISUPPORTS_INHERITED
35 NS_DECL_NSIDOMNOTIFYPAINTEVENT
37 // Forward to base class
38 NS_FORWARD_TO_EVENT_NO_SERIALIZATION_NO_DUPLICATION
39 NS_IMETHOD DuplicatePrivateData() MOZ_OVERRIDE
40 {
41 return Event::DuplicatePrivateData();
42 }
43 NS_IMETHOD_(void) Serialize(IPC::Message* aMsg, bool aSerializeInterfaceType) MOZ_OVERRIDE;
44 NS_IMETHOD_(bool) Deserialize(const IPC::Message* aMsg, void** aIter) MOZ_OVERRIDE;
46 virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE
47 {
48 return NotifyPaintEventBinding::Wrap(aCx, this);
49 }
51 already_AddRefed<DOMRectList> ClientRects();
53 already_AddRefed<DOMRect> BoundingClientRect();
55 already_AddRefed<PaintRequestList> PaintRequests();
56 private:
57 nsRegion GetRegion();
59 nsTArray<nsInvalidateRequestList::Request> mInvalidateRequests;
60 };
62 } // namespace dom
63 } // namespace mozilla
65 #endif // mozilla_dom_NotifyPaintEvent_h_