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 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * vim: sw=2 ts=8 et :
3 */
4 /* This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
8 #include <d3d10_1.h>
9 #include <dxgi.h>
11 #include "mozilla/gfx/Point.h"
12 #include "mozilla/layers/LayerManagerComposite.h"
13 #include "mozilla/layers/PLayerTransaction.h"
14 #include "ShadowLayers.h"
16 using namespace mozilla::gl;
18 namespace mozilla {
19 namespace layers {
22 /*static*/ void
23 ShadowLayerForwarder::PlatformSyncBeforeUpdate()
24 {
25 }
27 /*static*/ bool
28 LayerManagerComposite::SupportsDirectTexturing()
29 {
30 return true;
31 }
33 /*static*/ void
34 LayerManagerComposite::PlatformSyncBeforeReplyUpdate()
35 {
36 }
38 bool
39 GetDescriptor(ID3D10Texture2D* aTexture, SurfaceDescriptorD3D10* aDescr)
40 {
41 NS_ABORT_IF_FALSE(aTexture && aDescr, "Params must be nonnull");
43 HRESULT hr;
44 IDXGIResource* dr = nullptr;
45 hr = aTexture->QueryInterface(__uuidof(IDXGIResource), (void**)&dr);
46 if (!SUCCEEDED(hr) || !dr)
47 return false;
49 hr = dr->GetSharedHandle(reinterpret_cast<HANDLE*>(&aDescr->handle()));
50 return !!SUCCEEDED(hr);
51 }
53 already_AddRefed<ID3D10Texture2D>
54 OpenForeign(ID3D10Device* aDevice, const SurfaceDescriptorD3D10& aDescr)
55 {
56 HRESULT hr;
57 ID3D10Texture2D* tex = nullptr;
58 hr = aDevice->OpenSharedResource(reinterpret_cast<HANDLE>(aDescr.handle()),
59 __uuidof(ID3D10Texture2D),
60 (void**)&tex);
61 if (!SUCCEEDED(hr) || !tex)
62 return nullptr;
64 return nsRefPtr<ID3D10Texture2D>(tex).forget();
65 }
67 } // namespace layers
68 } // namespace mozilla