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

Side by Side Diff: third_party/WebKit/Source/platform/testing/TestingPlatformSupport.cpp

Issue 1646583002: [Reland] Per WebViewScheduler virtual time (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove some unneeded changes Created 4 years, 10 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) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 TestingPlatformMockWebThread() : m_mockWebScheduler(adoptPtr(new TestingPlat formMockScheduler)) { } 171 TestingPlatformMockWebThread() : m_mockWebScheduler(adoptPtr(new TestingPlat formMockScheduler)) { }
172 ~TestingPlatformMockWebThread() override { } 172 ~TestingPlatformMockWebThread() override { }
173 173
174 WebTaskRunner* taskRunner() override 174 WebTaskRunner* taskRunner() override
175 { 175 {
176 return m_mockWebScheduler->timerTaskRunner(); 176 return m_mockWebScheduler->timerTaskRunner();
177 } 177 }
178 178
179 bool isCurrentThread() const override 179 bool isCurrentThread() const override
180 { 180 {
181 ASSERT_NOT_REACHED();
182 return true; 181 return true;
183 } 182 }
184 183
185 WebScheduler* scheduler() const override 184 WebScheduler* scheduler() const override
186 { 185 {
187 return m_mockWebScheduler.get(); 186 return m_mockWebScheduler.get();
188 } 187 }
189 188
190 TestingPlatformMockScheduler* mockWebScheduler() 189 TestingPlatformMockScheduler* mockWebScheduler()
191 { 190 {
192 return m_mockWebScheduler.get(); 191 return m_mockWebScheduler.get();
193 } 192 }
194 193
194 double virtualTimeSeconds() override
195 {
196 ASSERT_NOT_REACHED();
197 return 0.0;
198 }
199
200 double monotonicallyIncreasingVirtualTimeSeconds() override
201 {
202 ASSERT_NOT_REACHED();
203 return 0.0;
204 }
205
195 private: 206 private:
196 OwnPtr<TestingPlatformMockScheduler> m_mockWebScheduler; 207 OwnPtr<TestingPlatformMockScheduler> m_mockWebScheduler;
197 }; 208 };
198 209
199 // TestingPlatformSupportWithMockScheduler definition: 210 // TestingPlatformSupportWithMockScheduler definition:
200 211
201 TestingPlatformSupportWithMockScheduler::TestingPlatformSupportWithMockScheduler () 212 TestingPlatformSupportWithMockScheduler::TestingPlatformSupportWithMockScheduler ()
202 : m_mockWebThread(adoptPtr(new TestingPlatformMockWebThread())) { } 213 : m_mockWebThread(adoptPtr(new TestingPlatformMockWebThread())) { }
203 214
204 TestingPlatformSupportWithMockScheduler::TestingPlatformSupportWithMockScheduler (const Config& config) 215 TestingPlatformSupportWithMockScheduler::TestingPlatformSupportWithMockScheduler (const Config& config)
205 : TestingPlatformSupport(config) 216 : TestingPlatformSupport(config)
206 , m_mockWebThread(adoptPtr(new TestingPlatformMockWebThread())) { } 217 , m_mockWebThread(adoptPtr(new TestingPlatformMockWebThread())) { }
207 218
208 TestingPlatformSupportWithMockScheduler::~TestingPlatformSupportWithMockSchedule r() { } 219 TestingPlatformSupportWithMockScheduler::~TestingPlatformSupportWithMockSchedule r() { }
209 220
210 WebThread* TestingPlatformSupportWithMockScheduler::currentThread() 221 WebThread* TestingPlatformSupportWithMockScheduler::currentThread()
211 { 222 {
212 return m_mockWebThread.get(); 223 return m_mockWebThread.get();
213 } 224 }
214 225
215 TestingPlatformMockScheduler* TestingPlatformSupportWithMockScheduler::mockWebSc heduler() 226 TestingPlatformMockScheduler* TestingPlatformSupportWithMockScheduler::mockWebSc heduler()
216 { 227 {
217 return m_mockWebThread->mockWebScheduler(); 228 return m_mockWebThread->mockWebScheduler();
218 } 229 }
219 230
220 } // namespace blink 231 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698