xpcom/tests/SizeTest04.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.

michael@0 1 // Test04.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 nsCOMPtr 13
michael@0 11 raw 36
michael@0 12
michael@0 13 Macintosh:
michael@0 14 nsCOMPtr 36 bytes (1.0000)
michael@0 15 raw 120 (3.3333) i.e., 333.33% bigger than nsCOMPtr
michael@0 16 */
michael@0 17
michael@0 18 class Test04_Raw
michael@0 19 {
michael@0 20 public:
michael@0 21 Test04_Raw();
michael@0 22 ~Test04_Raw();
michael@0 23
michael@0 24 void /*nsresult*/ SetNode( nsIDOMNode* newNode );
michael@0 25
michael@0 26 private:
michael@0 27 nsIDOMNode* mNode;
michael@0 28 };
michael@0 29
michael@0 30 Test04_Raw::Test04_Raw()
michael@0 31 : mNode(0)
michael@0 32 {
michael@0 33 // nothing else to do here
michael@0 34 }
michael@0 35
michael@0 36 Test04_Raw::~Test04_Raw()
michael@0 37 {
michael@0 38 NS_IF_RELEASE(mNode);
michael@0 39 }
michael@0 40
michael@0 41 void // nsresult
michael@0 42 Test04_Raw::SetNode( nsIDOMNode* newNode )
michael@0 43 // m120, w36
michael@0 44 {
michael@0 45 NS_IF_ADDREF(newNode);
michael@0 46 NS_IF_RELEASE(mNode);
michael@0 47 mNode = newNode;
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 Test04_nsCOMPtr
michael@0 55 {
michael@0 56 public:
michael@0 57 void /*nsresult*/ SetNode( nsIDOMNode* newNode );
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 Test04_nsCOMPtr::SetNode( nsIDOMNode* newNode )
michael@0 65 // m36, w13/13
michael@0 66 {
michael@0 67 mNode = newNode;
michael@0 68 }

mercurial