xpcom/tests/SizeTest05.cpp

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.

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

mercurial