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

Unified Diff: third_party/grpc/src/core/surface/api_trace.h

Issue 1932353002: Initial checkin of gRPC to third_party/ Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « third_party/grpc/src/core/surface/alarm.c ('k') | third_party/grpc/src/core/surface/api_trace.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/grpc/src/core/surface/api_trace.h
diff --git a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestEventTarget.h b/third_party/grpc/src/core/surface/api_trace.h
similarity index 53%
copy from third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestEventTarget.h
copy to third_party/grpc/src/core/surface/api_trace.h
index ad1abfb8035c5e3b57ef88f7b52aaf228381d56b..82bbf3b62b3a2231cc7602b249f4d48fada7ad8a 100644
--- a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestEventTarget.h
+++ b/third_party/grpc/src/core/surface/api_trace.h
@@ -1,5 +1,7 @@
/*
- * Copyright (C) 2013 Samsung Electronics. All rights reserved.
+ *
+ * Copyright 2015, Google Inc.
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -26,28 +28,38 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
*/
-#ifndef XMLHttpRequestEventTarget_h
-#define XMLHttpRequestEventTarget_h
+#ifndef GRPC_INTERNAL_CORE_SURFACE_API_TRACE_H
+#define GRPC_INTERNAL_CORE_SURFACE_API_TRACE_H
-#include "bindings/core/v8/ScriptWrappable.h"
-#include "core/events/EventTarget.h"
+#include "src/core/debug/trace.h"
+#include <grpc/support/log.h>
-namespace blink {
+extern int grpc_api_trace;
-class XMLHttpRequestEventTarget : public EventTargetWithInlineData {
- DEFINE_WRAPPERTYPEINFO();
-public:
- DEFINE_ATTRIBUTE_EVENT_LISTENER(abort);
- DEFINE_ATTRIBUTE_EVENT_LISTENER(error);
- DEFINE_ATTRIBUTE_EVENT_LISTENER(load);
- DEFINE_ATTRIBUTE_EVENT_LISTENER(loadend);
- DEFINE_ATTRIBUTE_EVENT_LISTENER(loadstart);
- DEFINE_ATTRIBUTE_EVENT_LISTENER(progress);
- DEFINE_ATTRIBUTE_EVENT_LISTENER(timeout);
-};
+/* Provide unwrapping macros because we're in C89 and variadic macros weren't
+ introduced until C99... */
+#define GRPC_API_TRACE_UNWRAP0()
+#define GRPC_API_TRACE_UNWRAP1(a) , a
+#define GRPC_API_TRACE_UNWRAP2(a, b) , a, b
+#define GRPC_API_TRACE_UNWRAP3(a, b, c) , a, b, c
+#define GRPC_API_TRACE_UNWRAP4(a, b, c, d) , a, b, c, d
+#define GRPC_API_TRACE_UNWRAP5(a, b, c, d, e) , a, b, c, d, e
+#define GRPC_API_TRACE_UNWRAP6(a, b, c, d, e, f) , a, b, c, d, e, f
+#define GRPC_API_TRACE_UNWRAP7(a, b, c, d, e, f, g) , a, b, c, d, e, f, g
+#define GRPC_API_TRACE_UNWRAP8(a, b, c, d, e, f, g, h) , a, b, c, d, e, f, g, h
+#define GRPC_API_TRACE_UNWRAP9(a, b, c, d, e, f, g, h, i) \
+ , a, b, c, d, e, f, g, h, i
+#define GRPC_API_TRACE_UNWRAP10(a, b, c, d, e, f, g, h, i, j) \
+ , a, b, c, d, e, f, g, h, i, j
-} // namespace blink
+/* Due to the limitations of C89's preprocessor, the arity of the var-arg list
+ 'nargs' must be specified. */
+#define GRPC_API_TRACE(fmt, nargs, args) \
+ if (grpc_api_trace) { \
+ gpr_log(GPR_INFO, fmt GRPC_API_TRACE_UNWRAP##nargs args); \
+ }
-#endif // XMLHttpRequestEventTarget_h
+#endif /* GRPC_INTERNAL_CORE_SURFACE_API_TRACE_H */
« no previous file with comments | « third_party/grpc/src/core/surface/alarm.c ('k') | third_party/grpc/src/core/surface/api_trace.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698