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

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

Issue 2516493002: requestIdleCallback: Yield for high priority work (Closed)
Patch Set: Added a test Created 4 years, 1 month 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 51
52 namespace cc_blink { 52 namespace cc_blink {
53 class WebCompositorSupportImpl; 53 class WebCompositorSupportImpl;
54 } // namespace cc_blink 54 } // namespace cc_blink
55 55
56 namespace blink { 56 namespace blink {
57 namespace scheduler { 57 namespace scheduler {
58 class RendererScheduler; 58 class RendererScheduler;
59 class RendererSchedulerImpl; 59 class RendererSchedulerImpl;
60 } 60 }
61 class TestingPlatformMockWebTaskRunner;
62 class WebCompositorSupport; 61 class WebCompositorSupport;
63 class WebThread; 62 class WebThread;
64 63
65 class TestingCompositorSupport : public WebCompositorSupport { 64 class TestingCompositorSupport : public WebCompositorSupport {
66 std::unique_ptr<WebLayer> createLayer() override; 65 std::unique_ptr<WebLayer> createLayer() override;
67 std::unique_ptr<WebLayer> createLayerFromCCLayer(cc::Layer*) override; 66 std::unique_ptr<WebLayer> createLayerFromCCLayer(cc::Layer*) override;
68 std::unique_ptr<WebContentLayer> createContentLayer( 67 std::unique_ptr<WebContentLayer> createContentLayer(
69 WebContentLayerClient*) override; 68 WebContentLayerClient*) override;
70 std::unique_ptr<WebExternalTextureLayer> createExternalTextureLayer( 69 std::unique_ptr<WebExternalTextureLayer> createExternalTextureLayer(
71 cc::TextureLayerClient*) override; 70 cc::TextureLayerClient*) override;
(...skipping 13 matching lines...) Expand all
85 WTF_MAKE_NONCOPYABLE(TestingPlatformMockScheduler); 84 WTF_MAKE_NONCOPYABLE(TestingPlatformMockScheduler);
86 85
87 public: 86 public:
88 TestingPlatformMockScheduler(); 87 TestingPlatformMockScheduler();
89 ~TestingPlatformMockScheduler() override; 88 ~TestingPlatformMockScheduler() override;
90 89
91 void runSingleTask(); 90 void runSingleTask();
92 void runAllTasks(); 91 void runAllTasks();
93 92
94 // WebScheduler implementation: 93 // WebScheduler implementation:
95 WebTaskRunner* loadingTaskRunner() override; 94 WebTaskRunner* loadingTaskRunner() override { return nullptr; }
96 WebTaskRunner* timerTaskRunner() override; 95 WebTaskRunner* timerTaskRunner() override { return nullptr; }
97 void shutdown() override {} 96 void shutdown() override {}
98 bool shouldYieldForHighPriorityWork() override { return false; } 97 bool shouldYieldForHighPriorityWork() override { return false; }
99 bool canExceedIdleDeadlineIfRequired() override { return false; } 98 bool canExceedIdleDeadlineIfRequired() override { return false; }
100 void postIdleTask(const WebTraceLocation&, WebThread::IdleTask*) override {} 99 void postIdleTask(const WebTraceLocation&, WebThread::IdleTask*) override {}
101 void postNonNestableIdleTask(const WebTraceLocation&, 100 void postNonNestableIdleTask(const WebTraceLocation&,
102 WebThread::IdleTask*) override {} 101 WebThread::IdleTask*) override {}
103 std::unique_ptr<WebViewScheduler> createWebViewScheduler( 102 std::unique_ptr<WebViewScheduler> createWebViewScheduler(
104 InterventionReporter*, 103 InterventionReporter*,
105 WebViewScheduler::WebViewSchedulerSettings*) override { 104 WebViewScheduler::WebViewSchedulerSettings*) override {
106 return nullptr; 105 return nullptr;
107 } 106 }
108 void suspendTimerQueue() override {} 107 void suspendTimerQueue() override {}
109 void resumeTimerQueue() override {} 108 void resumeTimerQueue() override {}
110 void addPendingNavigation(WebScheduler::NavigatingFrameType) override {} 109 void addPendingNavigation(WebScheduler::NavigatingFrameType) override {}
111 void removePendingNavigation(WebScheduler::NavigatingFrameType) override {} 110 void removePendingNavigation(WebScheduler::NavigatingFrameType) override {}
112 void onNavigationStarted() override {} 111 void onNavigationStarted() override {}
113 112
114 private: 113 private:
115 WTF::Deque<std::unique_ptr<WebTaskRunner::Task>> m_tasks; 114 WTF::Deque<std::unique_ptr<WebTaskRunner::Task>> m_tasks;
116 std::unique_ptr<TestingPlatformMockWebTaskRunner> m_mockWebTaskRunner;
117 }; 115 };
118 116
119 class TestingPlatformSupport : public Platform { 117 class TestingPlatformSupport : public Platform {
120 WTF_MAKE_NONCOPYABLE(TestingPlatformSupport); 118 WTF_MAKE_NONCOPYABLE(TestingPlatformSupport);
121 119
122 public: 120 public:
123 struct Config { 121 struct Config {
124 WebCompositorSupport* compositorSupport = nullptr; 122 WebCompositorSupport* compositorSupport = nullptr;
125 }; 123 };
126 124
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 m_discardableMemoryAllocator; 208 m_discardableMemoryAllocator;
211 std::unique_ptr<DummyPlatform> m_platform; 209 std::unique_ptr<DummyPlatform> m_platform;
212 std::unique_ptr<cc_blink::WebCompositorSupportImpl> m_compositorSupport; 210 std::unique_ptr<cc_blink::WebCompositorSupportImpl> m_compositorSupport;
213 TestingPlatformSupport::Config m_testingPlatformConfig; 211 TestingPlatformSupport::Config m_testingPlatformConfig;
214 std::unique_ptr<TestingPlatformSupport> m_testingPlatformSupport; 212 std::unique_ptr<TestingPlatformSupport> m_testingPlatformSupport;
215 }; 213 };
216 214
217 } // namespace blink 215 } // namespace blink
218 216
219 #endif // TestingPlatformSupport_h 217 #endif // TestingPlatformSupport_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698