Sat, 03 Jan 2015 20:18:00 +0100
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.
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
3 * You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #ifndef DOM_CAMERA_CAMERAPREVIEWMEDIASTREAM_H
6 #define DOM_CAMERA_CAMERAPREVIEWMEDIASTREAM_H
8 #include "VideoFrameContainer.h"
9 #include "MediaStreamGraph.h"
10 #include "mozilla/Mutex.h"
12 namespace mozilla {
14 class CameraPreviewFrameCallback {
15 public:
16 virtual void OnNewFrame(const gfxIntSize& aIntrinsicSize, layers::Image* aImage) = 0;
17 };
19 /**
20 * This is a stream for camere preview.
21 *
22 * XXX It is a temporary fix of SourceMediaStream.
23 * A camera preview requests no delay and no buffering stream.
24 * But the SourceMediaStream do not support it.
25 */
26 class CameraPreviewMediaStream : public MediaStream
27 {
28 typedef mozilla::layers::Image Image;
30 public:
31 CameraPreviewMediaStream(DOMMediaStream* aWrapper);
33 virtual void AddAudioOutput(void* aKey) MOZ_OVERRIDE;
34 virtual void SetAudioOutputVolume(void* aKey, float aVolume) MOZ_OVERRIDE;
35 virtual void RemoveAudioOutput(void* aKey) MOZ_OVERRIDE;
36 virtual void AddVideoOutput(VideoFrameContainer* aContainer) MOZ_OVERRIDE;
37 virtual void RemoveVideoOutput(VideoFrameContainer* aContainer) MOZ_OVERRIDE;
38 virtual void ChangeExplicitBlockerCount(int32_t aDelta) MOZ_OVERRIDE;
39 virtual void AddListener(MediaStreamListener* aListener) MOZ_OVERRIDE;
40 virtual void RemoveListener(MediaStreamListener* aListener) MOZ_OVERRIDE;
41 virtual void Destroy();
43 // Call these on any thread.
44 void SetCurrentFrame(const gfxIntSize& aIntrinsicSize, Image* aImage);
45 void ClearCurrentFrame();
47 void SetFrameCallback(CameraPreviewFrameCallback* aCallback) {
48 mFrameCallback = aCallback;
49 }
51 protected:
52 // mMutex protects all the class' fields.
53 // This class is not registered to MediaStreamGraph.
54 // It needs to protect all the fields.
55 Mutex mMutex;
56 CameraPreviewFrameCallback* mFrameCallback;
57 };
59 }
61 #endif // DOM_CAMERA_CAMERAPREVIEWMEDIASTREAM_H