1 // Copyright (c) 2012 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 #include "base/debug/trace_event.h"
7 namespace trace_event_internal
{
9 void TraceEndOnScopeClose::Initialize(const unsigned char* category_enabled
,
11 data_
.category_enabled
= category_enabled
;
16 void TraceEndOnScopeClose::AddEventIfEnabled() {
17 // Only called when p_data_ is non-null.
18 if (*p_data_
->category_enabled
) {
19 TRACE_EVENT_API_ADD_TRACE_EVENT(
20 TRACE_EVENT_PHASE_END
,
21 p_data_
->category_enabled
,
22 p_data_
->name
, kNoEventId
,
23 kZeroNumArgs
, NULL
, NULL
, NULL
,
24 TRACE_EVENT_FLAG_NONE
);
28 } // namespace trace_event_internal