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

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

Issue 2080623002: Revert "Remove OwnPtr from Blink." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 19 matching lines...) Expand all
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>
41 40
42 namespace blink { 41 namespace blink {
43 42
44 class TestingPlatformMockWebTaskRunner; 43 class TestingPlatformMockWebTaskRunner;
45 class TestingPlatformMockWebThread; 44 class TestingPlatformMockWebThread;
46 class WebCompositorSupport; 45 class WebCompositorSupport;
47 class WebThread; 46 class WebThread;
48 47
49 class TestingCompositorSupport : public WebCompositorSupport { 48 class TestingCompositorSupport : public WebCompositorSupport {
50 }; 49 };
(...skipping 17 matching lines...) Expand all
68 void postNonNestableIdleTask(const WebTraceLocation&, WebThread::IdleTask*) override { } 67 void postNonNestableIdleTask(const WebTraceLocation&, WebThread::IdleTask*) override { }
69 void postIdleTaskAfterWakeup(const WebTraceLocation&, WebThread::IdleTask*) override { } 68 void postIdleTaskAfterWakeup(const WebTraceLocation&, WebThread::IdleTask*) override { }
70 std::unique_ptr<WebViewScheduler> createWebViewScheduler(blink::WebView*) ov erride { return nullptr; } 69 std::unique_ptr<WebViewScheduler> createWebViewScheduler(blink::WebView*) ov erride { return nullptr; }
71 void suspendTimerQueue() override { } 70 void suspendTimerQueue() override { }
72 void resumeTimerQueue() override { } 71 void resumeTimerQueue() override { }
73 void addPendingNavigation(WebScheduler::NavigatingFrameType) override { } 72 void addPendingNavigation(WebScheduler::NavigatingFrameType) override { }
74 void removePendingNavigation(WebScheduler::NavigatingFrameType) override { } 73 void removePendingNavigation(WebScheduler::NavigatingFrameType) override { }
75 void onNavigationStarted() override { } 74 void onNavigationStarted() override { }
76 75
77 private: 76 private:
78 WTF::Deque<std::unique_ptr<WebTaskRunner::Task>> m_tasks; 77 WTF::Deque<OwnPtr<WebTaskRunner::Task>> m_tasks;
79 std::unique_ptr<TestingPlatformMockWebTaskRunner> m_mockWebTaskRunner; 78 OwnPtr<TestingPlatformMockWebTaskRunner> m_mockWebTaskRunner;
80 }; 79 };
81 80
82 class TestingPlatformSupport : public Platform { 81 class TestingPlatformSupport : public Platform {
83 WTF_MAKE_NONCOPYABLE(TestingPlatformSupport); 82 WTF_MAKE_NONCOPYABLE(TestingPlatformSupport);
84 public: 83 public:
85 struct Config { 84 struct Config {
86 WebCompositorSupport* compositorSupport = nullptr; 85 WebCompositorSupport* compositorSupport = nullptr;
87 }; 86 };
88 87
89 TestingPlatformSupport(); 88 TestingPlatformSupport();
(...skipping 16 matching lines...) Expand all
106 public: 105 public:
107 TestingPlatformSupportWithMockScheduler(); 106 TestingPlatformSupportWithMockScheduler();
108 explicit TestingPlatformSupportWithMockScheduler(const Config&); 107 explicit TestingPlatformSupportWithMockScheduler(const Config&);
109 ~TestingPlatformSupportWithMockScheduler() override; 108 ~TestingPlatformSupportWithMockScheduler() override;
110 109
111 // Platform: 110 // Platform:
112 WebThread* currentThread() override; 111 WebThread* currentThread() override;
113 TestingPlatformMockScheduler* mockWebScheduler(); 112 TestingPlatformMockScheduler* mockWebScheduler();
114 113
115 protected: 114 protected:
116 std::unique_ptr<TestingPlatformMockWebThread> m_mockWebThread; 115 OwnPtr<TestingPlatformMockWebThread> m_mockWebThread;
117 }; 116 };
118 117
119 } // namespace blink 118 } // namespace blink
120 119
121 #endif // TestingPlatformSupport_h 120 #endif // TestingPlatformSupport_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698