зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1751217 Part 2: Change nsDeviceContext::GetDepth to eliminate the outparam. r=emilio
This function always succeeds so there's no reason to maintain an nsresult. Differential Revision: https://phabricator.services.mozilla.com/D141407
This commit is contained in:
Родитель
99d39f2636
Коммит
66f5f1c938
|
@ -63,9 +63,7 @@ int32_t nsScreen::GetPixelDepth(ErrorResult& aRv) {
|
|||
return -1;
|
||||
}
|
||||
|
||||
uint32_t depth;
|
||||
context->GetDepth(depth);
|
||||
return depth;
|
||||
return context->GetDepth();
|
||||
}
|
||||
|
||||
nsPIDOMWindowOuter* nsScreen::GetOuter() const {
|
||||
|
|
|
@ -211,7 +211,7 @@ already_AddRefed<gfxContext> nsDeviceContext::CreateRenderingContextCommon(
|
|||
return pContext.forget();
|
||||
}
|
||||
|
||||
nsresult nsDeviceContext::GetDepth(uint32_t& aDepth) {
|
||||
uint32_t nsDeviceContext::GetDepth() {
|
||||
nsCOMPtr<nsIScreen> screen;
|
||||
FindScreen(getter_AddRefs(screen));
|
||||
if (!screen) {
|
||||
|
@ -219,9 +219,9 @@ nsresult nsDeviceContext::GetDepth(uint32_t& aDepth) {
|
|||
screenManager.GetPrimaryScreen(getter_AddRefs(screen));
|
||||
MOZ_ASSERT(screen);
|
||||
}
|
||||
screen->GetColorDepth(reinterpret_cast<int32_t*>(&aDepth));
|
||||
|
||||
return NS_OK;
|
||||
int32_t depth = 0;
|
||||
screen->GetColorDepth(&depth);
|
||||
return uint32_t(depth);
|
||||
}
|
||||
|
||||
nsresult nsDeviceContext::GetDeviceSurfaceDimensions(nscoord& aWidth,
|
||||
|
|
|
@ -110,7 +110,7 @@ class nsDeviceContext final {
|
|||
/**
|
||||
* Return the bit depth of the device.
|
||||
*/
|
||||
nsresult GetDepth(uint32_t& aDepth);
|
||||
uint32_t GetDepth();
|
||||
|
||||
/**
|
||||
* Get the size of the displayable area of the output device
|
||||
|
|
|
@ -157,7 +157,7 @@ uint32_t Gecko_MediaFeatures_GetColorDepth(const Document* aDocument) {
|
|||
|
||||
if (!nsContentUtils::ShouldResistFingerprinting(aDocument)) {
|
||||
if (nsDeviceContext* dx = GetDeviceContextFor(aDocument)) {
|
||||
dx->GetDepth(depth);
|
||||
depth = dx->GetDepth();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче