Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/scheduler/child/single_thread_idle_task_runner.h" | 5 #include "components/scheduler/child/single_thread_idle_task_runner.h" |
| 6 | 6 |
| 7 #include "base/location.h" | 7 #include "base/location.h" |
| 8 #include "base/trace_event/blame_context.h" | 8 #include "base/trace_event/blame_context.h" |
| 9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
| 10 | 10 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 77 if (blame_context_) | 77 if (blame_context_) |
| 78 blame_context_->Enter(); | 78 blame_context_->Enter(); |
| 79 idle_task.Run(deadline); | 79 idle_task.Run(deadline); |
| 80 if (blame_context_) | 80 if (blame_context_) |
| 81 blame_context_->Leave(); | 81 blame_context_->Leave(); |
| 82 delegate_->DidProcessIdleTask(); | 82 delegate_->DidProcessIdleTask(); |
| 83 } | 83 } |
| 84 | 84 |
| 85 void SingleThreadIdleTaskRunner::SetBlameContext( | 85 void SingleThreadIdleTaskRunner::SetBlameContext( |
| 86 base::trace_event::BlameContext* blame_context) { | 86 base::trace_event::BlameContext* blame_context) { |
| 87 blame_context_ = blame_context; | 87 blame_context_ = blame_context ? blame_context->weak_ptr() : nullptr; |
|
Primiano Tucci (use gerrit)
2016/06/10 07:50:35
how do you know that here you are on the right thr
Xiaocheng
2016/06/10 08:07:08
Are you implying any potentially risky design?
In
| |
| 88 } | 88 } |
| 89 | 89 |
| 90 } // namespace scheduler | 90 } // namespace scheduler |
| OLD | NEW |