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

Side by Side Diff: mojo/environment/default_task_tracker.cc

Issue 1426843004: Remove the task tracking stuff in the bindings. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « mojo/environment/default_task_tracker.h ('k') | mojo/environment/environment.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 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.
4
5 #include "mojo/environment/default_task_tracker.h"
6
7 #include "base/logging.h"
8 #include "mojo/common/task_tracker.h"
9 #include "mojo/public/cpp/environment/task_tracker.h"
10
11 namespace mojo {
12 namespace internal {
13 namespace {
14
15 bool g_enabled = false;
16
17 TaskTrackingId StartTracking(const char* function_name,
18 const char* file_name,
19 int line_number,
20 const void* program_counter) {
21 if (!g_enabled)
22 return TaskTrackingId(0);
23
24 return common::TaskTracker::StartTracking(function_name, file_name,
25 line_number, program_counter);
26 }
27
28 void EndTracking(const TaskTrackingId id) {
29 if (!g_enabled) {
30 DCHECK_EQ(0, id);
31 return;
32 }
33
34 common::TaskTracker::EndTracking(id);
35 }
36
37 void SetEnabled(bool enabled) {
38 g_enabled = enabled;
39 }
40
41 } // namespace
42
43 const TaskTracker kDefaultTaskTracker = {&StartTracking,
44 &EndTracking,
45 &SetEnabled};
46
47 } // namespace internal
48 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/environment/default_task_tracker.h ('k') | mojo/environment/environment.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698