Closed Bug 993194 Opened 10 years ago Closed 10 years ago

Use more smart pointers for node info

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla31

People

(Reporter: mccr8, Assigned: mccr8)

Details

Attachments

(5 files)

Plus a few other minor cleanups.
Comment on attachment 8403355 [details] [diff] [review]
part 5 - Change nsNodeInfoManager::mPrincipal into an nsCOMPtr.

https://tbpl.mozilla.org/?tree=Try&rev=a15f014376d7
Attachment #8403355 - Flags: review?(bugs)
Attachment #8403351 - Flags: review?(bugs) → review+
Comment on attachment 8403355 [details] [diff] [review]
part 5 - Change nsNodeInfoManager::mPrincipal into an nsCOMPtr.

Review of attachment 8403355 [details] [diff] [review]:
-----------------------------------------------------------------

::: content/base/src/nsNodeInfoManager.cpp
@@ +177,5 @@
>    NS_ENSURE_TRUE(mNodeInfoHash, NS_ERROR_OUT_OF_MEMORY);
>  
>    NS_PRECONDITION(!mPrincipal,
>                    "Being inited when we already have a principal?");
> +  nsresult rv = CallCreateInstance<nsIPrincipal>("@mozilla.org/nullprincipal;1",

ITYM mPrincipal = do_CreateInstance("@mozilla.org/nullprincipal;1", &rv);
Attachment #8403352 - Flags: review?(bugs) → review+
Attachment #8403353 - Flags: review?(bugs) → review+
Comment on attachment 8403354 [details] [diff] [review]
part 4 - Make nsNodeInfoManager::mBindingManager into an nsRefPtr.


>+#include "nsAutoPtr.h"                    // for nsRefPtr
Do we actually need this?
nsNodeInfoManager has non-inline ctor/dtor, so I think forward declaration would work.
Either way
Attachment #8403354 - Flags: review?(bugs) → review+
Comment on attachment 8403355 [details] [diff] [review]
part 5 - Change nsNodeInfoManager::mPrincipal into an nsCOMPtr.

r+ with the fix Ms2ger mentioned.
Attachment #8403355 - Flags: review?(bugs) → review+
> Do we actually need this?
Well, I thought I'd need it because a field is nsRefPtr.  I don't think forward declaring it will work, but I can try.
I fixed the create instance thing.  I left the autoptr include because it is needed.

https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?changeset=17822faead4f
Version: 24 Branch → Trunk
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: