Commit c23bfaa3 authored by keishi's avatar keishi Committed by Commit bot

Remove checks added to DocumentOrderList for crbug.com/699269 diagnosis

Removing as the CHECKs were not triggered and bug was resolved.

BUG=699269

Review-Url: https://codereview.chromium.org/2850133003
Cr-Commit-Position: refs/heads/master@{#468311}
parent 660e8283
...@@ -34,8 +34,6 @@ ...@@ -34,8 +34,6 @@
namespace blink { namespace blink {
void DocumentOrderedList::Add(Node* node) { void DocumentOrderedList::Add(Node* node) {
// TODO(keishi): CHECK() added for crbug.com/699269 diagnosis.
CHECK(!mutation_forbidden_);
if (nodes_.IsEmpty()) { if (nodes_.IsEmpty()) {
nodes_.insert(node); nodes_.insert(node);
return; return;
...@@ -62,8 +60,6 @@ void DocumentOrderedList::Add(Node* node) { ...@@ -62,8 +60,6 @@ void DocumentOrderedList::Add(Node* node) {
} }
void DocumentOrderedList::Remove(const Node* node) { void DocumentOrderedList::Remove(const Node* node) {
// TODO(keishi): CHECK() added for crbug.com/699269 diagnosis.
CHECK(!mutation_forbidden_);
nodes_.erase(const_cast<Node*>(node)); nodes_.erase(const_cast<Node*>(node));
} }
......
...@@ -42,32 +42,12 @@ class DocumentOrderedList final { ...@@ -42,32 +42,12 @@ class DocumentOrderedList final {
DISALLOW_NEW(); DISALLOW_NEW();
public: public:
DocumentOrderedList() : mutation_forbidden_(false) {} DocumentOrderedList() {}
// Forbids changes to DocumentOrderedList. Used to check if we are
// unintentionally changing DocumentOrderedList while iterating. Added for
// crbug.com/699269 diagnosis.
class MutationForbiddenScope final {
STACK_ALLOCATED();
public:
explicit MutationForbiddenScope(DocumentOrderedList* list) : list_(list) {
list_->mutation_forbidden_ = true;
}
~MutationForbiddenScope() { list_->mutation_forbidden_ = false; }
private:
DocumentOrderedList* list_;
};
void Add(Node*); void Add(Node*);
void Remove(const Node*); void Remove(const Node*);
bool IsEmpty() const { return nodes_.IsEmpty(); } bool IsEmpty() const { return nodes_.IsEmpty(); }
void Clear() { void Clear() { nodes_.clear(); }
// TODO(keishi): CHECK() added for crbug.com/699269 diagnosis.
CHECK(!mutation_forbidden_);
nodes_.clear();
}
size_t size() const { return nodes_.size(); } size_t size() const { return nodes_.size(); }
using iterator = HeapListHashSet<Member<Node>, 32>::iterator; using iterator = HeapListHashSet<Member<Node>, 32>::iterator;
...@@ -87,7 +67,6 @@ class DocumentOrderedList final { ...@@ -87,7 +67,6 @@ class DocumentOrderedList final {
private: private:
HeapListHashSet<Member<Node>, 32> nodes_; HeapListHashSet<Member<Node>, 32> nodes_;
bool mutation_forbidden_;
}; };
} // namespace blink } // namespace blink
......
...@@ -48,8 +48,6 @@ DocumentStyleSheetCollection::DocumentStyleSheetCollection( ...@@ -48,8 +48,6 @@ DocumentStyleSheetCollection::DocumentStyleSheetCollection(
void DocumentStyleSheetCollection::CollectStyleSheetsFromCandidates( void DocumentStyleSheetCollection::CollectStyleSheetsFromCandidates(
StyleEngine& master_engine, StyleEngine& master_engine,
DocumentStyleSheetCollector& collector) { DocumentStyleSheetCollector& collector) {
DocumentOrderedList::MutationForbiddenScope mutation_forbidden_(
&style_sheet_candidate_nodes_);
// TODO(keishi) Check added for crbug.com/699269 diagnosis. Remove once done. // TODO(keishi) Check added for crbug.com/699269 diagnosis. Remove once done.
CHECK(HeapObjectHeader::FromPayload(this)->IsValid()); CHECK(HeapObjectHeader::FromPayload(this)->IsValid());
CHECK(ThreadState::Current()->IsOnThreadHeap(this)); CHECK(ThreadState::Current()->IsOnThreadHeap(this));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment