Bug 1309868 part 5 - Use const pointer in C++ side for immutable borrowed reference. r=manishearth,heycam

MozReview-Commit-ID: 3aSOgckBtS7

--HG--
extra : source : 75117a5bef6ed1bd81864059f45429838686b2c7
This commit is contained in:
Xidorn Quan 2016-10-18 15:29:03 +11:00
Родитель be6a724c94
Коммит 2e8b536eff
2 изменённых файлов: 6 добавлений и 6 удалений

Просмотреть файл

@ -133,7 +133,7 @@ Gecko_MaybeCreateStyleChildrenIterator(RawGeckoNodeBorrowed aNode)
return nullptr;
}
Element* el = aNode->AsElement();
const Element* el = aNode->AsElement();
return StyleChildrenIterator::IsNeeded(el) ? new StyleChildrenIterator(el)
: nullptr;
}
@ -224,13 +224,13 @@ Gecko_GetNodeFlags(RawGeckoNodeBorrowed aNode)
void
Gecko_SetNodeFlags(RawGeckoNodeBorrowed aNode, uint32_t aFlags)
{
aNode->SetFlags(aFlags);
const_cast<nsINode*>(aNode)->SetFlags(aFlags);
}
void
Gecko_UnsetNodeFlags(RawGeckoNodeBorrowed aNode, uint32_t aFlags)
{
aNode->UnsetFlags(aFlags);
const_cast<nsINode*>(aNode)->UnsetFlags(aFlags);
}
nsStyleContext*
@ -279,7 +279,7 @@ Gecko_StoreStyleDifference(RawGeckoNodeBorrowed aNode, nsChangeHint aChangeHintT
MOZ_ASSERT(aNode->IsDirtyForServo(),
"Change hint stored in a not-dirty node");
Element* aElement = aNode->AsElement();
const Element* aElement = aNode->AsElement();
nsIFrame* primaryFrame = aElement->GetPrimaryFrame();
if (!primaryFrame) {
// If there's no primary frame, that means that either this content is

Просмотреть файл

@ -75,8 +75,8 @@ using mozilla::dom::StyleChildrenIterator;
// The "Arc" types are Servo-managed Arc<ServoType>s, which are passed
// over FFI as Strong<T> (which is nullable).
// Note that T != ServoType, rather T is ArcInner<ServoType>
#define DECL_BORROWED_REF_TYPE_FOR(type_) typedef type_* type_##Borrowed;
#define DECL_NULLABLE_BORROWED_REF_TYPE_FOR(type_) typedef type_* type_##BorrowedOrNull;
#define DECL_BORROWED_REF_TYPE_FOR(type_) typedef type_ const* type_##Borrowed;
#define DECL_NULLABLE_BORROWED_REF_TYPE_FOR(type_) typedef type_ const* type_##BorrowedOrNull;
#define DECL_BORROWED_MUT_REF_TYPE_FOR(type_) typedef type_* type_##BorrowedMut;
#define DECL_NULLABLE_BORROWED_MUT_REF_TYPE_FOR(type_) typedef type_* type_##BorrowedMutOrNull;