1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef ANDROID_WEBVIEW_COMMON_DEVTOOLS_INSTRUMENTATION_H_
6 #define ANDROID_WEBVIEW_COMMON_DEVTOOLS_INSTRUMENTATION_H_
8 #include "base/debug/trace_event.h"
10 namespace android_webview
{
11 namespace devtools_instrumentation
{
14 const char kCategory
[] = "Java,devtools,disabled-by-default-devtools.timeline";
15 const char kEmbedderCallback
[] = "EmbedderCallback";
16 const char kCallbackNameArgument
[] = "callbackName";
17 } // namespace internal
19 class ScopedEmbedderCallbackTask
{
21 ScopedEmbedderCallbackTask(const char* callback_name
) {
22 TRACE_EVENT_BEGIN1(internal::kCategory
,
23 internal::kEmbedderCallback
,
24 internal::kCallbackNameArgument
,
27 ~ScopedEmbedderCallbackTask() {
28 TRACE_EVENT_END0(internal::kCategory
,
29 internal::kEmbedderCallback
);
33 DISALLOW_COPY_AND_ASSIGN(ScopedEmbedderCallbackTask
);
36 } // namespace devtools_instrumentation
37 } // namespace android_webview
39 #endif // ANDROID_WEBVIEW_COMMON_DEVTOOLS_INSTRUMENTATION_H_