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

Side by Side Diff: third_party/WebKit/Source/platform/Timer.cpp

Issue 2959613002: Rename TaskRunner::RunsTasksOnCurrentThread() in //third_party (Closed)
Patch Set: Remove comments Created 3 years, 5 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2009 Google Inc. All rights reserved. 3 * Copyright (C) 2009 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 DCHECK(IsActive()); 81 DCHECK(IsActive());
82 double current = TimerMonotonicallyIncreasingTime(); 82 double current = TimerMonotonicallyIncreasingTime();
83 if (next_fire_time_ < current) 83 if (next_fire_time_ < current)
84 return 0; 84 return 0;
85 return next_fire_time_ - current; 85 return next_fire_time_ - current;
86 } 86 }
87 87
88 void TimerBase::MoveToNewTaskRunner(RefPtr<WebTaskRunner> task_runner) { 88 void TimerBase::MoveToNewTaskRunner(RefPtr<WebTaskRunner> task_runner) {
89 #if DCHECK_IS_ON() 89 #if DCHECK_IS_ON()
90 DCHECK_EQ(thread_, CurrentThread()); 90 DCHECK_EQ(thread_, CurrentThread());
91 DCHECK(task_runner->RunsTasksOnCurrentThread()); 91 DCHECK(task_runner->RunsTasksInCurrentSequence());
92 #endif 92 #endif
93 // If the underlying task runner stays the same, ignore it. 93 // If the underlying task runner stays the same, ignore it.
94 if (web_task_runner_->ToSingleThreadTaskRunner() == 94 if (web_task_runner_->ToSingleThreadTaskRunner() ==
95 task_runner->ToSingleThreadTaskRunner()) { 95 task_runner->ToSingleThreadTaskRunner()) {
96 return; 96 return;
97 } 97 }
98 98
99 bool active = IsActive(); 99 bool active = IsActive();
100 weak_ptr_factory_.RevokeAll(); 100 weak_ptr_factory_.RevokeAll();
101 web_task_runner_ = std::move(task_runner); 101 web_task_runner_ = std::move(task_runner);
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 const TimerBase* b) const { 178 const TimerBase* b) const {
179 return a->next_fire_time_ < b->next_fire_time_; 179 return a->next_fire_time_ < b->next_fire_time_;
180 } 180 }
181 181
182 // static 182 // static
183 double TimerBase::TimerMonotonicallyIncreasingTime() const { 183 double TimerBase::TimerMonotonicallyIncreasingTime() const {
184 return TimerTaskRunner()->MonotonicallyIncreasingVirtualTimeSeconds(); 184 return TimerTaskRunner()->MonotonicallyIncreasingVirtualTimeSeconds();
185 } 185 }
186 186
187 } // namespace blink 187 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/SubresourceFilter.cpp ('k') | third_party/WebKit/Source/platform/WebTaskRunner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698