Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1144)

Unified Diff: Source/platform/TracedValue.h

Issue 356013002: Add an assert that TracedValue builder closes only most recently opened container (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/TracedValue.h
diff --git a/Source/platform/TracedValue.h b/Source/platform/TracedValue.h
index 23f3ae5f81be8e323ad688f505a6b345026eda9c..7f751054ea92aa7eb122d661a48432df1af53eb5 100644
--- a/Source/platform/TracedValue.h
+++ b/Source/platform/TracedValue.h
@@ -50,6 +50,7 @@ class TracedDictionary : public TracedValueBase {
public:
OwnerType& endDictionary()
{
+ ASSERT(m_stack.size() == nestingLevel);
endCurrentDictionary();
return *reinterpret_cast<OwnerType*>(this);
}
@@ -85,6 +86,8 @@ public:
return *this;
}
+ static const size_t nestingLevel = OwnerType::nestingLevel + 1;
+
private:
TracedDictionary();
~TracedDictionary();
@@ -106,6 +109,7 @@ public:
}
OwnerType& endArray()
{
+ ASSERT(m_stack.size() == nestingLevel);
endCurrentArray();
return *reinterpret_cast<OwnerType*>(this);
}
@@ -131,6 +135,8 @@ public:
return *this;
}
+ static const size_t nestingLevel = OwnerType::nestingLevel + 1;
+
private:
TracedArray();
~TracedArray();
@@ -165,6 +171,8 @@ public:
return *this;
}
PassRefPtr<TraceEvent::ConvertableToTraceFormat> finish();
+
+ static const size_t nestingLevel = 1;
};
} // namespace WebCore
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698