mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 05:15:45 +00:00
Revert nsAutoPtr usage here at least until we better understand the bloat. Bug 64116, sr=bzbarsky.
This commit is contained in:
parent
52532acd61
commit
d33dc031f2
@ -643,18 +643,17 @@ nsresult
|
||||
DocumentViewerImpl::InitPresentationStuff(PRBool aDoInitialReflow)
|
||||
{
|
||||
// Create the style set...
|
||||
nsAutoPtr<nsStyleSet> styleSet;
|
||||
nsresult rv = CreateStyleSet(mDocument, getter_Transfers(styleSet));
|
||||
nsStyleSet *styleSet;
|
||||
nsresult rv = CreateStyleSet(mDocument, &styleSet);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// Now make the shell for the document
|
||||
rv = mDocument->CreateShell(mPresContext, mViewManager, styleSet,
|
||||
getter_AddRefs(mPresShell));
|
||||
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// The pres shell owns the style set now.
|
||||
styleSet.forget();
|
||||
if (NS_FAILED(rv)) {
|
||||
delete styleSet;
|
||||
return rv;
|
||||
}
|
||||
|
||||
if (aDoInitialReflow) {
|
||||
// Since InitialReflow() will create frames for *all* items
|
||||
@ -1208,17 +1207,18 @@ DocumentViewerImpl::SetDOMDocument(nsIDOMDocument *aDocument)
|
||||
if (mPresContext) {
|
||||
// 3) Create a new style set for the document
|
||||
|
||||
nsAutoPtr<nsStyleSet> styleSet;
|
||||
rv = CreateStyleSet(mDocument, getter_Transfers(styleSet));
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
nsStyleSet *styleSet;
|
||||
rv = CreateStyleSet(mDocument, &styleSet);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
rv = newDoc->CreateShell(mPresContext, mViewManager, styleSet,
|
||||
getter_AddRefs(mPresShell));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
if (NS_FAILED(rv)) {
|
||||
delete styleSet;
|
||||
return rv;
|
||||
}
|
||||
|
||||
// The pres shell owns the style set now.
|
||||
styleSet.forget();
|
||||
|
||||
mPresShell->BeginObservingDocument();
|
||||
|
||||
@ -1614,7 +1614,7 @@ DocumentViewerImpl::CreateStyleSet(nsIDocument* aDocument,
|
||||
NS_WARNING("unable to load UA style sheet");
|
||||
}
|
||||
|
||||
nsAutoPtr<nsStyleSet> styleSet(new nsStyleSet());
|
||||
nsStyleSet *styleSet = new nsStyleSet();
|
||||
if (!styleSet) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@ -1683,7 +1683,6 @@ DocumentViewerImpl::CreateStyleSet(nsIDocument* aDocument,
|
||||
|
||||
styleSet->EndUpdate();
|
||||
*aStyleSet = styleSet;
|
||||
styleSet.forget();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -643,18 +643,17 @@ nsresult
|
||||
DocumentViewerImpl::InitPresentationStuff(PRBool aDoInitialReflow)
|
||||
{
|
||||
// Create the style set...
|
||||
nsAutoPtr<nsStyleSet> styleSet;
|
||||
nsresult rv = CreateStyleSet(mDocument, getter_Transfers(styleSet));
|
||||
nsStyleSet *styleSet;
|
||||
nsresult rv = CreateStyleSet(mDocument, &styleSet);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// Now make the shell for the document
|
||||
rv = mDocument->CreateShell(mPresContext, mViewManager, styleSet,
|
||||
getter_AddRefs(mPresShell));
|
||||
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// The pres shell owns the style set now.
|
||||
styleSet.forget();
|
||||
if (NS_FAILED(rv)) {
|
||||
delete styleSet;
|
||||
return rv;
|
||||
}
|
||||
|
||||
if (aDoInitialReflow) {
|
||||
// Since InitialReflow() will create frames for *all* items
|
||||
@ -1208,17 +1207,18 @@ DocumentViewerImpl::SetDOMDocument(nsIDOMDocument *aDocument)
|
||||
if (mPresContext) {
|
||||
// 3) Create a new style set for the document
|
||||
|
||||
nsAutoPtr<nsStyleSet> styleSet;
|
||||
rv = CreateStyleSet(mDocument, getter_Transfers(styleSet));
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
nsStyleSet *styleSet;
|
||||
rv = CreateStyleSet(mDocument, &styleSet);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
rv = newDoc->CreateShell(mPresContext, mViewManager, styleSet,
|
||||
getter_AddRefs(mPresShell));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
if (NS_FAILED(rv)) {
|
||||
delete styleSet;
|
||||
return rv;
|
||||
}
|
||||
|
||||
// The pres shell owns the style set now.
|
||||
styleSet.forget();
|
||||
|
||||
mPresShell->BeginObservingDocument();
|
||||
|
||||
@ -1614,7 +1614,7 @@ DocumentViewerImpl::CreateStyleSet(nsIDocument* aDocument,
|
||||
NS_WARNING("unable to load UA style sheet");
|
||||
}
|
||||
|
||||
nsAutoPtr<nsStyleSet> styleSet(new nsStyleSet());
|
||||
nsStyleSet *styleSet = new nsStyleSet();
|
||||
if (!styleSet) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@ -1683,7 +1683,6 @@ DocumentViewerImpl::CreateStyleSet(nsIDocument* aDocument,
|
||||
|
||||
styleSet->EndUpdate();
|
||||
*aStyleSet = styleSet;
|
||||
styleSet.forget();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user