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 "content/renderer/scheduler/web_scheduler_impl.h" | 5 #include "content/renderer/scheduler/web_scheduler_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/single_thread_task_runner.h" | 8 #include "base/single_thread_task_runner.h" |
9 #include "content/renderer/scheduler/renderer_scheduler.h" | 9 #include "content/renderer/scheduler/renderer_scheduler.h" |
10 #include "third_party/WebKit/public/platform/WebTraceLocation.h" | 10 #include "third_party/WebKit/public/platform/WebTraceLocation.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 blink::WebScheduler::IdleTask* task) { | 38 blink::WebScheduler::IdleTask* task) { |
39 DCHECK(idle_task_runner_); | 39 DCHECK(idle_task_runner_); |
40 scoped_ptr<blink::WebScheduler::IdleTask> scoped_task(task); | 40 scoped_ptr<blink::WebScheduler::IdleTask> scoped_task(task); |
41 tracked_objects::Location location(web_location.functionName(), | 41 tracked_objects::Location location(web_location.functionName(), |
42 web_location.fileName(), -1, nullptr); | 42 web_location.fileName(), -1, nullptr); |
43 idle_task_runner_->PostIdleTask( | 43 idle_task_runner_->PostIdleTask( |
44 location, | 44 location, |
45 base::Bind(&WebSchedulerImpl::runIdleTask, base::Passed(&scoped_task))); | 45 base::Bind(&WebSchedulerImpl::runIdleTask, base::Passed(&scoped_task))); |
46 } | 46 } |
47 | 47 |
| 48 void WebSchedulerImpl::postNonNestableIdleTask( |
| 49 const blink::WebTraceLocation& web_location, |
| 50 blink::WebScheduler::IdleTask* task) { |
| 51 DCHECK(idle_task_runner_); |
| 52 scoped_ptr<blink::WebScheduler::IdleTask> scoped_task(task); |
| 53 tracked_objects::Location location(web_location.functionName(), |
| 54 web_location.fileName(), -1, nullptr); |
| 55 idle_task_runner_->PostNonNestableIdleTask( |
| 56 location, |
| 57 base::Bind(&WebSchedulerImpl::runIdleTask, base::Passed(&scoped_task))); |
| 58 } |
| 59 |
48 void WebSchedulerImpl::postIdleTaskAfterWakeup( | 60 void WebSchedulerImpl::postIdleTaskAfterWakeup( |
49 const blink::WebTraceLocation& web_location, | 61 const blink::WebTraceLocation& web_location, |
50 blink::WebScheduler::IdleTask* task) { | 62 blink::WebScheduler::IdleTask* task) { |
51 DCHECK(idle_task_runner_); | 63 DCHECK(idle_task_runner_); |
52 scoped_ptr<blink::WebScheduler::IdleTask> scoped_task(task); | 64 scoped_ptr<blink::WebScheduler::IdleTask> scoped_task(task); |
53 tracked_objects::Location location(web_location.functionName(), | 65 tracked_objects::Location location(web_location.functionName(), |
54 web_location.fileName(), -1, nullptr); | 66 web_location.fileName(), -1, nullptr); |
55 idle_task_runner_->PostIdleTaskAfterWakeup( | 67 idle_task_runner_->PostIdleTaskAfterWakeup( |
56 location, | 68 location, |
57 base::Bind(&WebSchedulerImpl::runIdleTask, base::Passed(&scoped_task))); | 69 base::Bind(&WebSchedulerImpl::runIdleTask, base::Passed(&scoped_task))); |
(...skipping 10 matching lines...) Expand all Loading... |
68 base::Bind(&WebSchedulerImpl::runTask, base::Passed(&scoped_task))); | 80 base::Bind(&WebSchedulerImpl::runTask, base::Passed(&scoped_task))); |
69 } | 81 } |
70 | 82 |
71 void WebSchedulerImpl::shutdown() { | 83 void WebSchedulerImpl::shutdown() { |
72 idle_task_runner_ = nullptr; | 84 idle_task_runner_ = nullptr; |
73 loading_task_runner_ = nullptr; | 85 loading_task_runner_ = nullptr; |
74 return renderer_scheduler_->Shutdown(); | 86 return renderer_scheduler_->Shutdown(); |
75 } | 87 } |
76 | 88 |
77 } // namespace content | 89 } // namespace content |
OLD | NEW |