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

Unified Diff: content/child/scheduler/task_queue_manager.cc

Issue 1098033002: Remove dependency on cc::TestNowSource from scheduler code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updates Created 5 years, 8 months 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 side-by-side diff with in-line comments
Download patch
Index: content/child/scheduler/task_queue_manager.cc
diff --git a/content/child/scheduler/task_queue_manager.cc b/content/child/scheduler/task_queue_manager.cc
index 440da4c15f467eec235c30381b87710890ad6fab..646c859161c059329e8903d08c14a73cdba8b8df 100644
--- a/content/child/scheduler/task_queue_manager.cc
+++ b/content/child/scheduler/task_queue_manager.cc
@@ -10,9 +10,9 @@
#include "base/bind.h"
#include "base/trace_event/trace_event.h"
#include "base/trace_event/trace_event_argument.h"
-#include "cc/test/test_now_source.h"
#include "content/child/scheduler/nestable_single_thread_task_runner.h"
#include "content/child/scheduler/task_queue_selector.h"
+#include "content/child/scheduler/time_source.h"
namespace {
const int64_t kMaxTimeTicks = std::numeric_limits<int64>::max();
@@ -461,7 +461,7 @@ TaskQueueManager::TaskQueueManager(
task_was_run_bitmap_(0),
pending_dowork_count_(0),
work_batch_size_(1),
- time_source_(nullptr),
+ time_source_(new TimeSource),
disabled_by_default_tracing_category_(
disabled_by_default_tracing_category),
deletion_sentinel_(new DeletionSentinel()),
@@ -703,9 +703,9 @@ void TaskQueueManager::RemoveTaskObserver(
}
void TaskQueueManager::SetTimeSourceForTesting(
- scoped_refptr<cc::TestNowSource> time_source) {
+ scoped_ptr<TimeSource> time_source) {
DCHECK(main_thread_checker_.CalledOnValidThread());
- time_source_ = time_source;
+ time_source_ = time_source.Pass();
}
uint64 TaskQueueManager::GetAndClearTaskWasRunOnQueueBitmap() {
@@ -715,7 +715,7 @@ uint64 TaskQueueManager::GetAndClearTaskWasRunOnQueueBitmap() {
}
base::TimeTicks TaskQueueManager::Now() const {
- return UNLIKELY(time_source_) ? time_source_->Now() : base::TimeTicks::Now();
+ return time_source_->Now();
}
scoped_refptr<base::trace_event::ConvertableToTraceFormat>
« no previous file with comments | « content/child/scheduler/task_queue_manager.h ('k') | content/child/scheduler/task_queue_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698