Backed out 3 changesets (bug 1765832) for causing build bustages on Transferable.cpp

Backed out changeset c7c5a5208d60 (bug 1765832)
Backed out changeset 05a53421e1d8 (bug 1765832)
Backed out changeset 87cf3ec70aab (bug 1765832)
This commit is contained in:
criss 2022-05-18 16:28:24 +03:00
Родитель 9153fef79a
Коммит 441a887295
13 изменённых файлов: 16 добавлений и 103 удалений

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

@ -12,7 +12,6 @@ CHECK(ExplicitImplicitChecker, "implicit-constructor")
CHECK(ExplicitOperatorBoolChecker, "explicit-operator-bool")
CHECK(JSHandleRootedTypedefChecker, "js-handle-rooted-typedef")
CHECK(KungFuDeathGripChecker, "kungfu-death-grip")
CHECK(KnownLiveChecker, "known-live")
#ifdef TARGET_IS_WINDOWS
CHECK(LoadLibraryUsageChecker, "load-library-usage")
CHECK(FopenUsageChecker, "fopen-usage")

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

@ -17,7 +17,6 @@
#endif
#include "JSHandleRootedTypedefChecker.h"
#include "KungFuDeathGripChecker.h"
#include "KnownLiveChecker.h"
#include "MustOverrideChecker.h"
#include "MustReturnFromCallerChecker.h"
#include "NaNExprChecker.h"

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

@ -1,35 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "KnownLiveChecker.h"
#include "CustomMatchers.h"
void KnownLiveChecker::registerMatchers(MatchFinder *AstMatcher) {
// Note that this cannot catch mutations after pass-by-reference, and thus no
// error for cycle collection macros.
auto KnownLiveLHS = hasLHS(memberExpr(hasKnownLiveAnnotation()).bind("lhs"));
auto ForGeneralFunctions = forFunction(
functionDecl(unless(anyOf(cxxConstructorDecl(), cxxDestructorDecl())))
.bind("func"));
auto Matcher =
allOf(isAssignmentOperator(), KnownLiveLHS, ForGeneralFunctions);
AstMatcher->addMatcher(binaryOperator(Matcher), this);
AstMatcher->addMatcher(cxxOperatorCallExpr(Matcher), this);
}
void KnownLiveChecker::check(const MatchFinder::MatchResult &Result) {
const char *Error = "MOZ_KNOWN_LIVE members can only be modified by "
"constructors and destructors";
if (const MemberExpr *Expr = Result.Nodes.getNodeAs<MemberExpr>("lhs")) {
diag(Expr->getBeginLoc(), Error, DiagnosticIDs::Error);
}
if (const CXXOperatorCallExpr *Expr =
Result.Nodes.getNodeAs<CXXOperatorCallExpr>("lhs")) {
diag(Expr->getBeginLoc(), Error, DiagnosticIDs::Error);
}
}

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

@ -1,18 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef BUILD_CLANG_PLUGIN_KNOWNLIVECHECKER_H_
#define BUILD_CLANG_PLUGIN_KNOWNLIVECHECKER_H_
#include "plugin.h"
class KnownLiveChecker : public BaseCheck {
public:
KnownLiveChecker(StringRef CheckName, ContextType *Context = nullptr)
: BaseCheck(CheckName, Context) {}
void registerMatchers(MatchFinder *AstMatcher) override;
void check(const MatchFinder::MatchResult &Result) override;
};
#endif

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

@ -19,7 +19,6 @@ HOST_SOURCES += [
"ExplicitImplicitChecker.cpp",
"ExplicitOperatorBoolChecker.cpp",
"JSHandleRootedTypedefChecker.cpp",
"KnownLiveChecker.cpp",
"KungFuDeathGripChecker.cpp",
"MozCheckAction.cpp",
"MustOverrideChecker.cpp",

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

@ -1,33 +0,0 @@
#include <mozilla/RefPtr.h>
#define MOZ_KNOWN_LIVE __attribute__((annotate("moz_known_live")))
class Foo {
// dummy refcounting
public:
uint32_t AddRef() { return 0; }
uint32_t Release() { return 0; }
private:
~Foo() = default;
};
class Bar {
MOZ_KNOWN_LIVE RefPtr<Foo> mFoo;
Bar() : mFoo(new Foo()) {}
~Bar() { mFoo = nullptr; }
void Baz() {
mFoo = nullptr; // expected-error {{MOZ_KNOWN_LIVE members can only be modified by constructors and destructors}}
}
};
class Bar2 {
MOZ_KNOWN_LIVE Foo *mFoo;
Bar2() : mFoo(new Foo()) {}
~Bar2() { mFoo = nullptr; }
void Baz() {
mFoo = nullptr; // expected-error {{MOZ_KNOWN_LIVE members can only be modified by constructors and destructors}}
}
};

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

@ -18,7 +18,6 @@ SOURCES += [
"TestHeapClass.cpp",
"TestInheritTypeAnnotationsFromTemplateArgs.cpp",
"TestJSHandleRootedTypedef.cpp",
"TestKnownLive.cpp",
"TestKungFuDeathGrip.cpp",
"TestMultipleAnnotations.cpp",
"TestMustOverride.cpp",

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

@ -145,7 +145,7 @@ class ReadableStream final : public nsISupports, public nsWrapperCache {
// Internal Slots:
private:
RefPtr<ReadableStreamController> mController;
MOZ_KNOWN_LIVE RefPtr<ReadableStreamController> mController;
bool mDisturbed = false;
RefPtr<ReadableStreamGenericReader> mReader;
ReaderState mState = ReaderState::Readable;

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

@ -90,9 +90,9 @@ class TransformStream final : public nsISupports, public nsWrapperCache {
// MOZ_KNOWN_LIVE for slots that will never be reassigned
bool mBackpressure = false;
RefPtr<Promise> mBackpressureChangePromise;
RefPtr<TransformStreamDefaultController> mController;
RefPtr<ReadableStream> mReadable;
RefPtr<WritableStream> mWritable;
MOZ_KNOWN_LIVE RefPtr<TransformStreamDefaultController> mController;
MOZ_KNOWN_LIVE RefPtr<ReadableStream> mReadable;
MOZ_KNOWN_LIVE RefPtr<WritableStream> mWritable;
};
MOZ_CAN_RUN_SCRIPT void TransformStreamErrorWritableAndUnblockWrite(

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

@ -154,11 +154,7 @@ void TransformStreamDefaultController::Error(JSContext* aCx,
// https://streams.spec.whatwg.org/#transform-stream-default-controller-error
// Perform ! TransformStreamError(controller.[[stream]], e).
// mStream is set in initialization step and only modified in cycle
// collection.
// TODO: Move mStream initialization to a method/constructor and make it
// MOZ_KNOWN_LIVE again. (See bug 1769854)
TransformStreamError(aCx, MOZ_KnownLive(mStream), aError, aRv);
TransformStreamError(aCx, mStream, aError, aRv);
}
// https://streams.spec.whatwg.org/#ts-default-controller-terminate

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

@ -54,7 +54,7 @@ class TransformStreamDefaultController final : public nsISupports,
nsCOMPtr<nsIGlobalObject> mGlobal;
// Internal slots
RefPtr<TransformStream> mStream;
MOZ_KNOWN_LIVE RefPtr<TransformStream> mStream;
RefPtr<TransformerAlgorithms> mTransformerAlgorithms;
};

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

@ -169,7 +169,7 @@ class WritableStream : public nsISupports, public nsWrapperCache {
private:
bool mBackpressure = false;
RefPtr<Promise> mCloseRequest;
RefPtr<WritableStreamDefaultController> mController;
MOZ_KNOWN_LIVE RefPtr<WritableStreamDefaultController> mController;
RefPtr<Promise> mInFlightWriteRequest;
RefPtr<Promise> mInFlightCloseRequest;

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

@ -51,8 +51,8 @@ using EmptyCheckOption = HTMLEditUtils::EmptyCheckOption;
*/
class MOZ_STACK_CLASS AutoSelectionSetterAfterTableEdit final {
private:
const RefPtr<HTMLEditor> mHTMLEditor;
const RefPtr<Element> mTable;
MOZ_KNOWN_LIVE RefPtr<HTMLEditor> mHTMLEditor;
MOZ_KNOWN_LIVE RefPtr<Element> mTable;
int32_t mCol, mRow, mDirection, mSelected;
public:
@ -72,6 +72,13 @@ class MOZ_STACK_CLASS AutoSelectionSetterAfterTableEdit final {
mSelected);
}
}
// This is needed to abort the caret reset in the destructor
// when one method yields control to another
void CancelSetCaret() {
mHTMLEditor = nullptr;
mTable = nullptr;
}
};
/******************************************************************************