| 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 */
|
|
|