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.
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | #ifndef nsContentPermissionHelper_h |
michael@0 | 6 | #define nsContentPermissionHelper_h |
michael@0 | 7 | |
michael@0 | 8 | #include "nsIContentPermissionPrompt.h" |
michael@0 | 9 | #include "nsTArray.h" |
michael@0 | 10 | #include "nsIMutableArray.h" |
michael@0 | 11 | |
michael@0 | 12 | class nsContentPermissionRequestProxy; |
michael@0 | 13 | |
michael@0 | 14 | // Forward declare IPC::Principal here which is defined in |
michael@0 | 15 | // PermissionMessageUtils.h. Include this file will transitively includes |
michael@0 | 16 | // "windows.h" and it defines |
michael@0 | 17 | // #define CreateEvent CreateEventW |
michael@0 | 18 | // #define LoadImage LoadImageW |
michael@0 | 19 | // That will mess up windows build. |
michael@0 | 20 | namespace IPC { |
michael@0 | 21 | class Principal; |
michael@0 | 22 | } |
michael@0 | 23 | |
michael@0 | 24 | namespace mozilla { |
michael@0 | 25 | namespace dom { |
michael@0 | 26 | |
michael@0 | 27 | class Element; |
michael@0 | 28 | class PermissionRequest; |
michael@0 | 29 | class ContentPermissionRequestParent; |
michael@0 | 30 | class PContentPermissionRequestParent; |
michael@0 | 31 | |
michael@0 | 32 | class ContentPermissionType : public nsIContentPermissionType |
michael@0 | 33 | { |
michael@0 | 34 | public: |
michael@0 | 35 | NS_DECL_ISUPPORTS |
michael@0 | 36 | NS_DECL_NSICONTENTPERMISSIONTYPE |
michael@0 | 37 | |
michael@0 | 38 | ContentPermissionType(const nsACString& aType, |
michael@0 | 39 | const nsACString& aAccess, |
michael@0 | 40 | const nsTArray<nsString>& aOptions); |
michael@0 | 41 | virtual ~ContentPermissionType(); |
michael@0 | 42 | |
michael@0 | 43 | protected: |
michael@0 | 44 | nsCString mType; |
michael@0 | 45 | nsCString mAccess; |
michael@0 | 46 | nsTArray<nsString> mOptions; |
michael@0 | 47 | }; |
michael@0 | 48 | |
michael@0 | 49 | uint32_t ConvertPermissionRequestToArray(nsTArray<PermissionRequest>& aSrcArray, |
michael@0 | 50 | nsIMutableArray* aDesArray); |
michael@0 | 51 | |
michael@0 | 52 | nsresult CreatePermissionArray(const nsACString& aType, |
michael@0 | 53 | const nsACString& aAccess, |
michael@0 | 54 | const nsTArray<nsString>& aOptions, |
michael@0 | 55 | nsIArray** aTypesArray); |
michael@0 | 56 | |
michael@0 | 57 | PContentPermissionRequestParent* |
michael@0 | 58 | CreateContentPermissionRequestParent(const nsTArray<PermissionRequest>& aRequests, |
michael@0 | 59 | Element* element, |
michael@0 | 60 | const IPC::Principal& principal); |
michael@0 | 61 | |
michael@0 | 62 | } // namespace dom |
michael@0 | 63 | } // namespace mozilla |
michael@0 | 64 | |
michael@0 | 65 | class nsContentPermissionRequestProxy : public nsIContentPermissionRequest |
michael@0 | 66 | { |
michael@0 | 67 | public: |
michael@0 | 68 | NS_DECL_ISUPPORTS |
michael@0 | 69 | NS_DECL_NSICONTENTPERMISSIONREQUEST |
michael@0 | 70 | |
michael@0 | 71 | nsContentPermissionRequestProxy(); |
michael@0 | 72 | virtual ~nsContentPermissionRequestProxy(); |
michael@0 | 73 | |
michael@0 | 74 | nsresult Init(const nsTArray<mozilla::dom::PermissionRequest>& requests, |
michael@0 | 75 | mozilla::dom::ContentPermissionRequestParent* parent); |
michael@0 | 76 | void OnParentDestroyed(); |
michael@0 | 77 | |
michael@0 | 78 | private: |
michael@0 | 79 | // Non-owning pointer to the ContentPermissionRequestParent object which owns this proxy. |
michael@0 | 80 | mozilla::dom::ContentPermissionRequestParent* mParent; |
michael@0 | 81 | nsTArray<mozilla::dom::PermissionRequest> mPermissionRequests; |
michael@0 | 82 | }; |
michael@0 | 83 | |
michael@0 | 84 | #endif // nsContentPermissionHelper_h |