зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1525720, part 4 - Assert in DrawSnapshot if not the chrome process. r=mattwoodrow
This API is only intended to be used in the chrome process and this commit makes this explicit to simplify a later refactoring. Differential Revision: https://phabricator.services.mozilla.com/D31434 --HG-- extra : rebase_source : 79f143fb7fce889284b23fb65580f8e8dab83df7 extra : histedit_source : 823209f777fcb0e3e6579ac1afc0d6bf8e566051
This commit is contained in:
Родитель
5592e0d298
Коммит
edf885fc82
|
@ -3235,6 +3235,12 @@ void nsFrameLoader::Print(uint64_t aOuterWindowID,
|
||||||
already_AddRefed<mozilla::dom::Promise> nsFrameLoader::DrawSnapshot(
|
already_AddRefed<mozilla::dom::Promise> nsFrameLoader::DrawSnapshot(
|
||||||
double aX, double aY, double aW, double aH, double aScale,
|
double aX, double aY, double aW, double aH, double aScale,
|
||||||
const nsAString& aBackgroundColor, mozilla::ErrorResult& aRv) {
|
const nsAString& aBackgroundColor, mozilla::ErrorResult& aRv) {
|
||||||
|
MOZ_ASSERT(XRE_IsParentProcess());
|
||||||
|
if (!XRE_IsParentProcess()) {
|
||||||
|
aRv = NS_ERROR_FAILURE;
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
RefPtr<nsIGlobalObject> global = GetOwnerContent()->GetOwnerGlobal();
|
RefPtr<nsIGlobalObject> global = GetOwnerContent()->GetOwnerGlobal();
|
||||||
RefPtr<Promise> promise = Promise::Create(global, aRv);
|
RefPtr<Promise> promise = Promise::Create(global, aRv);
|
||||||
if (NS_WARN_IF(aRv.Failed())) {
|
if (NS_WARN_IF(aRv.Failed())) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче