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 | // Test05.cpp |
michael@0 | 2 | |
michael@0 | 3 | #include "nsIDOMNode.h" |
michael@0 | 4 | #include "nsCOMPtr.h" |
michael@0 | 5 | |
michael@0 | 6 | NS_DEF_PTR(nsIDOMNode); |
michael@0 | 7 | |
michael@0 | 8 | /* |
michael@0 | 9 | Windows: |
michael@0 | 10 | raw, nsCOMPtr 21 bytes |
michael@0 | 11 | |
michael@0 | 12 | Macintosh: |
michael@0 | 13 | Raw, nsCOMPtr 64 bytes |
michael@0 | 14 | */ |
michael@0 | 15 | |
michael@0 | 16 | class Test05_Raw |
michael@0 | 17 | { |
michael@0 | 18 | public: |
michael@0 | 19 | Test05_Raw(); |
michael@0 | 20 | ~Test05_Raw(); |
michael@0 | 21 | |
michael@0 | 22 | void /*nsresult*/ GetNode( nsIDOMNode** aNode ); |
michael@0 | 23 | |
michael@0 | 24 | private: |
michael@0 | 25 | nsIDOMNode* mNode; |
michael@0 | 26 | }; |
michael@0 | 27 | |
michael@0 | 28 | Test05_Raw::Test05_Raw() |
michael@0 | 29 | : mNode(0) |
michael@0 | 30 | { |
michael@0 | 31 | // nothing else to do here |
michael@0 | 32 | } |
michael@0 | 33 | |
michael@0 | 34 | Test05_Raw::~Test05_Raw() |
michael@0 | 35 | { |
michael@0 | 36 | NS_IF_RELEASE(mNode); |
michael@0 | 37 | } |
michael@0 | 38 | |
michael@0 | 39 | void // nsresult |
michael@0 | 40 | Test05_Raw::GetNode( nsIDOMNode** aNode ) |
michael@0 | 41 | // m64, w21 |
michael@0 | 42 | { |
michael@0 | 43 | // if ( !aNode ) |
michael@0 | 44 | // return NS_ERROR_NULL_POINTER; |
michael@0 | 45 | |
michael@0 | 46 | *aNode = mNode; |
michael@0 | 47 | NS_IF_ADDREF(*aNode); |
michael@0 | 48 | |
michael@0 | 49 | // return NS_OK; |
michael@0 | 50 | } |
michael@0 | 51 | |
michael@0 | 52 | |
michael@0 | 53 | |
michael@0 | 54 | class Test05_nsCOMPtr |
michael@0 | 55 | { |
michael@0 | 56 | public: |
michael@0 | 57 | void /*nsresult*/ GetNode( nsIDOMNode** aNode ); |
michael@0 | 58 | |
michael@0 | 59 | private: |
michael@0 | 60 | nsCOMPtr<nsIDOMNode> mNode; |
michael@0 | 61 | }; |
michael@0 | 62 | |
michael@0 | 63 | void // nsresult |
michael@0 | 64 | Test05_nsCOMPtr::GetNode( nsIDOMNode** aNode ) |
michael@0 | 65 | // m64, w21 |
michael@0 | 66 | { |
michael@0 | 67 | // if ( !aNode ) |
michael@0 | 68 | // return NS_ERROR_NULL_POINTER; |
michael@0 | 69 | |
michael@0 | 70 | *aNode = mNode; |
michael@0 | 71 | NS_IF_ADDREF(*aNode); |
michael@0 | 72 | |
michael@0 | 73 | // return NS_OK; |
michael@0 | 74 | } |