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

Side by Side Diff: content/renderer/renderer_blink_platform_impl.h

Issue 664963002: content: Add RendererScheduler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: RendererSchedulerSelector -> RendererTaskQueueSelector Created 6 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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_RENDERER_RENDERER_BLINK_PLATFORM_IMPL_H_ 5 #ifndef CONTENT_RENDERER_RENDERER_BLINK_PLATFORM_IMPL_H_
6 #define CONTENT_RENDERER_RENDERER_BLINK_PLATFORM_IMPL_H_ 6 #define CONTENT_RENDERER_RENDERER_BLINK_PLATFORM_IMPL_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/id_map.h" 9 #include "base/id_map.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 25 matching lines...) Expand all
36 } 36 }
37 37
38 namespace content { 38 namespace content {
39 class BatteryStatusDispatcher; 39 class BatteryStatusDispatcher;
40 class DeviceLightEventPump; 40 class DeviceLightEventPump;
41 class DeviceMotionEventPump; 41 class DeviceMotionEventPump;
42 class DeviceOrientationEventPump; 42 class DeviceOrientationEventPump;
43 class PlatformEventObserverBase; 43 class PlatformEventObserverBase;
44 class QuotaMessageFilter; 44 class QuotaMessageFilter;
45 class RendererClipboardClient; 45 class RendererClipboardClient;
46 class RendererScheduler;
46 class RenderView; 47 class RenderView;
47 class ThreadSafeSender; 48 class ThreadSafeSender;
48 class WebClipboardImpl; 49 class WebClipboardImpl;
49 class WebDatabaseObserverImpl; 50 class WebDatabaseObserverImpl;
50 class WebFileSystemImpl; 51 class WebFileSystemImpl;
52 class WebSchedulerImpl;
51 53
52 class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { 54 class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
53 public: 55 public:
54 RendererBlinkPlatformImpl(); 56 RendererBlinkPlatformImpl();
55 virtual ~RendererBlinkPlatformImpl(); 57 virtual ~RendererBlinkPlatformImpl();
56 58
57 void set_plugin_refresh_allowed(bool plugin_refresh_allowed) { 59 void set_plugin_refresh_allowed(bool plugin_refresh_allowed) {
58 plugin_refresh_allowed_ = plugin_refresh_allowed; 60 plugin_refresh_allowed_ = plugin_refresh_allowed;
59 } 61 }
60 // Platform methods: 62 // Platform methods:
63 virtual void callOnMainThread(void (*func)(void*), void* context);
61 virtual blink::WebClipboard* clipboard(); 64 virtual blink::WebClipboard* clipboard();
62 virtual blink::WebMimeRegistry* mimeRegistry(); 65 virtual blink::WebMimeRegistry* mimeRegistry();
63 virtual blink::WebFileUtilities* fileUtilities(); 66 virtual blink::WebFileUtilities* fileUtilities();
64 virtual blink::WebSandboxSupport* sandboxSupport(); 67 virtual blink::WebSandboxSupport* sandboxSupport();
65 virtual blink::WebCookieJar* cookieJar(); 68 virtual blink::WebCookieJar* cookieJar();
66 virtual blink::WebThemeEngine* themeEngine(); 69 virtual blink::WebThemeEngine* themeEngine();
67 virtual blink::WebSpeechSynthesizer* createSpeechSynthesizer( 70 virtual blink::WebSpeechSynthesizer* createSpeechSynthesizer(
68 blink::WebSpeechSynthesizerClient* client); 71 blink::WebSpeechSynthesizerClient* client);
69 virtual bool sandboxEnabled(); 72 virtual bool sandboxEnabled();
70 virtual unsigned long long visitedLinkHash( 73 virtual unsigned long long visitedLinkHash(
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 const blink::WebString& host, const blink::WebString& languages); 141 const blink::WebString& host, const blink::WebString& languages);
139 virtual void startListening(blink::WebPlatformEventType, 142 virtual void startListening(blink::WebPlatformEventType,
140 blink::WebPlatformEventListener*); 143 blink::WebPlatformEventListener*);
141 virtual void stopListening(blink::WebPlatformEventType); 144 virtual void stopListening(blink::WebPlatformEventType);
142 virtual void queryStorageUsageAndQuota( 145 virtual void queryStorageUsageAndQuota(
143 const blink::WebURL& storage_partition, 146 const blink::WebURL& storage_partition,
144 blink::WebStorageQuotaType, 147 blink::WebStorageQuotaType,
145 blink::WebStorageQuotaCallbacks); 148 blink::WebStorageQuotaCallbacks);
146 virtual void vibrate(unsigned int milliseconds); 149 virtual void vibrate(unsigned int milliseconds);
147 virtual void cancelVibration(); 150 virtual void cancelVibration();
151 virtual blink::WebScheduler* scheduler();
148 152
149 // Set the PlatformEventObserverBase in |platform_event_observers_| associated 153 // Set the PlatformEventObserverBase in |platform_event_observers_| associated
150 // with |type| to |observer|. If there was already an observer associated to 154 // with |type| to |observer|. If there was already an observer associated to
151 // the given |type|, it will be replaced. 155 // the given |type|, it will be replaced.
152 // Note that |observer| will be owned by this object after the call. 156 // Note that |observer| will be owned by this object after the call.
153 void SetPlatformEventObserverForTesting( 157 void SetPlatformEventObserverForTesting(
154 blink::WebPlatformEventType type, 158 blink::WebPlatformEventType type,
155 scoped_ptr<PlatformEventObserverBase> observer); 159 scoped_ptr<PlatformEventObserverBase> observer);
156 160
157 // Disables the WebSandboxSupport implementation for testing. 161 // Disables the WebSandboxSupport implementation for testing.
(...skipping 16 matching lines...) Expand all
174 const blink::WebDeviceOrientationData& data); 178 const blink::WebDeviceOrientationData& data);
175 179
176 // Notifies blink::WebBatteryStatusListener that battery status has changed. 180 // Notifies blink::WebBatteryStatusListener that battery status has changed.
177 void MockBatteryStatusChangedForTesting( 181 void MockBatteryStatusChangedForTesting(
178 const blink::WebBatteryStatus& status); 182 const blink::WebBatteryStatus& status);
179 183
180 WebDatabaseObserverImpl* web_database_observer_impl() { 184 WebDatabaseObserverImpl* web_database_observer_impl() {
181 return web_database_observer_impl_.get(); 185 return web_database_observer_impl_.get();
182 } 186 }
183 187
188 RendererScheduler* renderer_scheduler() { return renderer_scheduler_.get(); }
189
184 private: 190 private:
185 bool CheckPreparsedJsCachingEnabled() const; 191 bool CheckPreparsedJsCachingEnabled() const;
186 192
187 // Factory that takes a type and return PlatformEventObserverBase that matches 193 // Factory that takes a type and return PlatformEventObserverBase that matches
188 // it. 194 // it.
189 static PlatformEventObserverBase* CreatePlatformEventObserverFromType( 195 static PlatformEventObserverBase* CreatePlatformEventObserverFromType(
190 blink::WebPlatformEventType type); 196 blink::WebPlatformEventType type);
191 197
192 // Use the data previously set via SetMockDevice...DataForTesting() and send 198 // Use the data previously set via SetMockDevice...DataForTesting() and send
193 // them to the registered listener. 199 // them to the registered listener.
194 void SendFakeDeviceEventDataForTesting(blink::WebPlatformEventType type); 200 void SendFakeDeviceEventDataForTesting(blink::WebPlatformEventType type);
195 201
202 scoped_ptr<RendererScheduler> renderer_scheduler_;
203 scoped_ptr<WebSchedulerImpl> web_scheduler_;
204
196 scoped_ptr<RendererClipboardClient> clipboard_client_; 205 scoped_ptr<RendererClipboardClient> clipboard_client_;
197 scoped_ptr<WebClipboardImpl> clipboard_; 206 scoped_ptr<WebClipboardImpl> clipboard_;
198 207
199 class FileUtilities; 208 class FileUtilities;
200 scoped_ptr<FileUtilities> file_utilities_; 209 scoped_ptr<FileUtilities> file_utilities_;
201 210
202 class MimeRegistry; 211 class MimeRegistry;
203 scoped_ptr<MimeRegistry> mime_registry_; 212 scoped_ptr<MimeRegistry> mime_registry_;
204 213
205 class SandboxSupport; 214 class SandboxSupport;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 scoped_ptr<BatteryStatusDispatcher> battery_status_dispatcher_; 247 scoped_ptr<BatteryStatusDispatcher> battery_status_dispatcher_;
239 248
240 IDMap<PlatformEventObserverBase, IDMapOwnPointer> platform_event_observers_; 249 IDMap<PlatformEventObserverBase, IDMapOwnPointer> platform_event_observers_;
241 250
242 DISALLOW_COPY_AND_ASSIGN(RendererBlinkPlatformImpl); 251 DISALLOW_COPY_AND_ASSIGN(RendererBlinkPlatformImpl);
243 }; 252 };
244 253
245 } // namespace content 254 } // namespace content
246 255
247 #endif // CONTENT_RENDERER_RENDERER_BLINK_PLATFORM_IMPL_H_ 256 #endif // CONTENT_RENDERER_RENDERER_BLINK_PLATFORM_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698