summaryrefslogtreecommitdiffstats
path: root/mojo/public/cpp/environment/lib/scoped_task_tracking.h
blob: 4a8fb4f3de817dfe45812deef7380e0779cab57d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef MOJO_PUBLIC_CPP_ENVIRONMENT_LIB_SCOPED_TASK_TRACKING_H_
#define MOJO_PUBLIC_CPP_ENVIRONMENT_LIB_SCOPED_TASK_TRACKING_H_

#include "base/macros.h"
#include "mojo/public/cpp/environment/task_tracker.h"

namespace mojo {
namespace internal {

// An RAII wrapper for |TaskTrackingId|.
class ScopedTaskTracking {
 public:
  ScopedTaskTracking(const char* function_name,
                     const char* file_name,
                     int line,
                     const void* program_counter);
  ScopedTaskTracking(const char* function_name,
                     const char* file_name,
                     int line);
  ~ScopedTaskTracking();

 private:
  TaskTrackingId id_;
  DISALLOW_COPY_AND_ASSIGN(ScopedTaskTracking);
};

}  // namespace internal
}  // namespace mojo

#endif  // MOJO_PUBLIC_CPP_ENVIRONMENT_LIB_SCOPED_TASK_TRACKING_H_