dom/telephony/TelephonyCallGroup.h

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

michael@0 1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* vim: set ts=8 sts=2 et sw=2 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
michael@0 7 #ifndef mozilla_dom_telephony_telephonycallgroup_h__
michael@0 8 #define mozilla_dom_telephony_telephonycallgroup_h__
michael@0 9
michael@0 10 #include "mozilla/dom/telephony/TelephonyCommon.h"
michael@0 11
michael@0 12 namespace mozilla {
michael@0 13 namespace dom {
michael@0 14
michael@0 15 class TelephonyCallGroup MOZ_FINAL : public DOMEventTargetHelper
michael@0 16 {
michael@0 17 nsRefPtr<Telephony> mTelephony;
michael@0 18
michael@0 19 nsTArray<nsRefPtr<TelephonyCall> > mCalls;
michael@0 20
michael@0 21 nsRefPtr<CallsList> mCallsList;
michael@0 22
michael@0 23 nsString mState;
michael@0 24
michael@0 25 uint16_t mCallState;
michael@0 26
michael@0 27 public:
michael@0 28 NS_DECL_ISUPPORTS_INHERITED
michael@0 29 NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(TelephonyCallGroup,
michael@0 30 DOMEventTargetHelper)
michael@0 31
michael@0 32 nsPIDOMWindow*
michael@0 33 GetParentObject() const
michael@0 34 {
michael@0 35 return GetOwner();
michael@0 36 }
michael@0 37
michael@0 38 // WrapperCache
michael@0 39 virtual JSObject*
michael@0 40 WrapObject(JSContext* aCx) MOZ_OVERRIDE;
michael@0 41
michael@0 42 // WebIDL interface
michael@0 43 already_AddRefed<CallsList>
michael@0 44 Calls() const;
michael@0 45
michael@0 46 void
michael@0 47 Add(TelephonyCall& aCall, ErrorResult& aRv);
michael@0 48
michael@0 49 void
michael@0 50 Add(TelephonyCall& aCall, TelephonyCall& aSecondCall, ErrorResult& aRv);
michael@0 51
michael@0 52 void
michael@0 53 Remove(TelephonyCall& aCall, ErrorResult& aRv);
michael@0 54
michael@0 55 void
michael@0 56 Hold(ErrorResult& aRv);
michael@0 57
michael@0 58 void
michael@0 59 Resume(ErrorResult& aRv);
michael@0 60
michael@0 61 void
michael@0 62 GetState(nsString& aState) const
michael@0 63 {
michael@0 64 aState = mState;
michael@0 65 }
michael@0 66
michael@0 67 IMPL_EVENT_HANDLER(statechange)
michael@0 68 IMPL_EVENT_HANDLER(connected)
michael@0 69 IMPL_EVENT_HANDLER(holding)
michael@0 70 IMPL_EVENT_HANDLER(held)
michael@0 71 IMPL_EVENT_HANDLER(resuming)
michael@0 72 IMPL_EVENT_HANDLER(callschanged)
michael@0 73 IMPL_EVENT_HANDLER(error)
michael@0 74
michael@0 75 static already_AddRefed<TelephonyCallGroup>
michael@0 76 Create(Telephony* aTelephony);
michael@0 77
michael@0 78 void
michael@0 79 AddCall(TelephonyCall* aCall);
michael@0 80
michael@0 81 void
michael@0 82 RemoveCall(TelephonyCall* aCall);
michael@0 83
michael@0 84 already_AddRefed<TelephonyCall>
michael@0 85 GetCall(uint32_t aServiceId, uint32_t aCallIndex);
michael@0 86
michael@0 87 const nsTArray<nsRefPtr<TelephonyCall> >&
michael@0 88 CallsArray() const
michael@0 89 {
michael@0 90 return mCalls;
michael@0 91 }
michael@0 92
michael@0 93 void
michael@0 94 ChangeState(uint16_t aCallState);
michael@0 95
michael@0 96 uint16_t
michael@0 97 CallState() const
michael@0 98 {
michael@0 99 return mCallState;
michael@0 100 }
michael@0 101
michael@0 102 nsresult
michael@0 103 NotifyError(const nsAString& aName, const nsAString& aMessage);
michael@0 104
michael@0 105 private:
michael@0 106 TelephonyCallGroup(nsPIDOMWindow* aOwner);
michael@0 107 ~TelephonyCallGroup();
michael@0 108
michael@0 109 nsresult
michael@0 110 NotifyCallsChanged(TelephonyCall* aCall);
michael@0 111
michael@0 112 nsresult
michael@0 113 DispatchCallEvent(const nsAString& aType,
michael@0 114 TelephonyCall* aCall);
michael@0 115
michael@0 116 bool CanConference(const TelephonyCall& aCall, TelephonyCall* aSecondCall);
michael@0 117 };
michael@0 118
michael@0 119 } // namespace dom
michael@0 120 } // namespace mozilla
michael@0 121
michael@0 122 #endif // mozilla_dom_telephony_telephonycallgroup_h__

mercurial