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

Unified Diff: third_party/WebKit/Source/platform/inspector_protocol/Collections.h

Issue 2044343002: DevTools: update V8Inspector to work with the new v8_inspector API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comment addressed Created 4 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
Index: third_party/WebKit/Source/platform/inspector_protocol/Collections.h
diff --git a/third_party/WebKit/Source/platform/inspector_protocol/Collections.h b/third_party/WebKit/Source/platform/inspector_protocol/Collections.h
index 960c747bae4c65fd4cff74f20b4e7c13395c8bdb..6309284488683e07064463b67b8c87cc9e45666e 100644
--- a/third_party/WebKit/Source/platform/inspector_protocol/Collections.h
+++ b/third_party/WebKit/Source/platform/inspector_protocol/Collections.h
@@ -11,4 +11,13 @@
#include "platform/inspector_protocol/CollectionsWTF.h"
#endif // V8_INSPECTOR_USE_STL
+
+// Macro that returns a compile time constant with the length of an array, but gives an error if passed a non-array.
+template<typename T, size_t Size> char (&ArrayLengthHelperFunction(T (&)[Size]))[Size];
+// GCC needs some help to deduce a 0 length array.
+#if defined(__GNUC__)
+template<typename T> char (&ArrayLengthHelperFunction(T (&)[0]))[0];
+#endif
+#define PROTOCOL_ARRAY_LENGTH(array) sizeof(::ArrayLengthHelperFunction(array))
+
#endif // !defined(Collections_h)

Powered by Google App Engine
This is Rietveld 408576698