OLD | NEW |
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 19 matching lines...) Expand all Loading... |
30 | 30 |
31 #ifndef TestingPlatformSupport_h | 31 #ifndef TestingPlatformSupport_h |
32 #define TestingPlatformSupport_h | 32 #define TestingPlatformSupport_h |
33 | 33 |
34 #include "platform/PlatformExport.h" | 34 #include "platform/PlatformExport.h" |
35 #include "public/platform/Platform.h" | 35 #include "public/platform/Platform.h" |
36 #include "public/platform/WebCompositorSupport.h" | 36 #include "public/platform/WebCompositorSupport.h" |
37 #include "public/platform/WebScheduler.h" | 37 #include "public/platform/WebScheduler.h" |
38 #include "public/platform/WebThread.h" | 38 #include "public/platform/WebThread.h" |
39 #include "wtf/Vector.h" | 39 #include "wtf/Vector.h" |
| 40 #include <memory> |
40 | 41 |
41 namespace blink { | 42 namespace blink { |
42 | 43 |
43 class TestingPlatformMockWebTaskRunner; | 44 class TestingPlatformMockWebTaskRunner; |
44 class TestingPlatformMockWebThread; | 45 class TestingPlatformMockWebThread; |
45 class WebCompositorSupport; | 46 class WebCompositorSupport; |
46 class WebThread; | 47 class WebThread; |
47 | 48 |
48 class TestingCompositorSupport : public WebCompositorSupport { | 49 class TestingCompositorSupport : public WebCompositorSupport { |
49 }; | 50 }; |
(...skipping 17 matching lines...) Expand all Loading... |
67 void postNonNestableIdleTask(const WebTraceLocation&, WebThread::IdleTask*)
override { } | 68 void postNonNestableIdleTask(const WebTraceLocation&, WebThread::IdleTask*)
override { } |
68 void postIdleTaskAfterWakeup(const WebTraceLocation&, WebThread::IdleTask*)
override { } | 69 void postIdleTaskAfterWakeup(const WebTraceLocation&, WebThread::IdleTask*)
override { } |
69 std::unique_ptr<WebViewScheduler> createWebViewScheduler(blink::WebView*) ov
erride { return nullptr; } | 70 std::unique_ptr<WebViewScheduler> createWebViewScheduler(blink::WebView*) ov
erride { return nullptr; } |
70 void suspendTimerQueue() override { } | 71 void suspendTimerQueue() override { } |
71 void resumeTimerQueue() override { } | 72 void resumeTimerQueue() override { } |
72 void addPendingNavigation(WebScheduler::NavigatingFrameType) override { } | 73 void addPendingNavigation(WebScheduler::NavigatingFrameType) override { } |
73 void removePendingNavigation(WebScheduler::NavigatingFrameType) override { } | 74 void removePendingNavigation(WebScheduler::NavigatingFrameType) override { } |
74 void onNavigationStarted() override { } | 75 void onNavigationStarted() override { } |
75 | 76 |
76 private: | 77 private: |
77 WTF::Deque<OwnPtr<WebTaskRunner::Task>> m_tasks; | 78 WTF::Deque<std::unique_ptr<WebTaskRunner::Task>> m_tasks; |
78 OwnPtr<TestingPlatformMockWebTaskRunner> m_mockWebTaskRunner; | 79 std::unique_ptr<TestingPlatformMockWebTaskRunner> m_mockWebTaskRunner; |
79 }; | 80 }; |
80 | 81 |
81 class TestingPlatformSupport : public Platform { | 82 class TestingPlatformSupport : public Platform { |
82 WTF_MAKE_NONCOPYABLE(TestingPlatformSupport); | 83 WTF_MAKE_NONCOPYABLE(TestingPlatformSupport); |
83 public: | 84 public: |
84 struct Config { | 85 struct Config { |
85 WebCompositorSupport* compositorSupport = nullptr; | 86 WebCompositorSupport* compositorSupport = nullptr; |
86 }; | 87 }; |
87 | 88 |
88 TestingPlatformSupport(); | 89 TestingPlatformSupport(); |
(...skipping 16 matching lines...) Expand all Loading... |
105 public: | 106 public: |
106 TestingPlatformSupportWithMockScheduler(); | 107 TestingPlatformSupportWithMockScheduler(); |
107 explicit TestingPlatformSupportWithMockScheduler(const Config&); | 108 explicit TestingPlatformSupportWithMockScheduler(const Config&); |
108 ~TestingPlatformSupportWithMockScheduler() override; | 109 ~TestingPlatformSupportWithMockScheduler() override; |
109 | 110 |
110 // Platform: | 111 // Platform: |
111 WebThread* currentThread() override; | 112 WebThread* currentThread() override; |
112 TestingPlatformMockScheduler* mockWebScheduler(); | 113 TestingPlatformMockScheduler* mockWebScheduler(); |
113 | 114 |
114 protected: | 115 protected: |
115 OwnPtr<TestingPlatformMockWebThread> m_mockWebThread; | 116 std::unique_ptr<TestingPlatformMockWebThread> m_mockWebThread; |
116 }; | 117 }; |
117 | 118 |
118 } // namespace blink | 119 } // namespace blink |
119 | 120 |
120 #endif // TestingPlatformSupport_h | 121 #endif // TestingPlatformSupport_h |
OLD | NEW |