mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-21 09:15:35 +00:00
Bug 1217662 - part 4 - move {LayerManager,Layer}::RemoveUserData out-of-line; r=mattwoodrow
Having these out-of-line means that we don't have to have LayerUserData's destructor in scope for the destruction of the local nsAutoPtr. This change will enable us to forward-declare LayerUserData in Layers.h and thereby encourage people to use the correct header for LayerUserData.
This commit is contained in:
parent
e826816d24
commit
6ce5981d38
@ -211,6 +211,13 @@ LayerManager::LayerUserDataDestroy(void* data)
|
||||
delete static_cast<LayerUserData*>(data);
|
||||
}
|
||||
|
||||
nsAutoPtr<LayerUserData>
|
||||
LayerManager::RemoveUserData(void* aKey)
|
||||
{
|
||||
nsAutoPtr<LayerUserData> d(static_cast<LayerUserData*>(mUserData.Remove(static_cast<gfx::UserDataKey*>(aKey))));
|
||||
return d;
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
// Layer
|
||||
|
||||
@ -2064,6 +2071,13 @@ Layer::IsBackfaceHidden()
|
||||
return false;
|
||||
}
|
||||
|
||||
nsAutoPtr<LayerUserData>
|
||||
Layer::RemoveUserData(void* aKey)
|
||||
{
|
||||
nsAutoPtr<LayerUserData> d(static_cast<LayerUserData*>(mUserData.Remove(static_cast<gfx::UserDataKey*>(aKey))));
|
||||
return d;
|
||||
}
|
||||
|
||||
void
|
||||
PaintedLayer::PrintInfo(std::stringstream& aStream, const char* aPrefix)
|
||||
{
|
||||
|
@ -502,11 +502,8 @@ public:
|
||||
/**
|
||||
* This can be used anytime. Ownership passes to the caller!
|
||||
*/
|
||||
nsAutoPtr<LayerUserData> RemoveUserData(void* aKey)
|
||||
{
|
||||
nsAutoPtr<LayerUserData> d(static_cast<LayerUserData*>(mUserData.Remove(static_cast<gfx::UserDataKey*>(aKey))));
|
||||
return d;
|
||||
}
|
||||
nsAutoPtr<LayerUserData> RemoveUserData(void* aKey);
|
||||
|
||||
/**
|
||||
* This getter can be used anytime.
|
||||
*/
|
||||
@ -1384,11 +1381,7 @@ public:
|
||||
/**
|
||||
* This can be used anytime. Ownership passes to the caller!
|
||||
*/
|
||||
nsAutoPtr<LayerUserData> RemoveUserData(void* aKey)
|
||||
{
|
||||
nsAutoPtr<LayerUserData> d(static_cast<LayerUserData*>(mUserData.Remove(static_cast<gfx::UserDataKey*>(aKey))));
|
||||
return d;
|
||||
}
|
||||
nsAutoPtr<LayerUserData> RemoveUserData(void* aKey);
|
||||
/**
|
||||
* This getter can be used anytime.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user