Move blink scheduler implementation into a component
[chromium-blink-merge.git] / content / renderer / render_thread_impl.h
blob60d4a49dab7d76000b0798b3703a1b2239906299
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_RENDERER_RENDER_THREAD_IMPL_H_
6 #define CONTENT_RENDERER_RENDER_THREAD_IMPL_H_
8 #include <set>
9 #include <string>
10 #include <vector>
12 #include "base/cancelable_callback.h"
13 #include "base/memory/memory_pressure_listener.h"
14 #include "base/memory/ref_counted.h"
15 #include "base/metrics/user_metrics_action.h"
16 #include "base/observer_list.h"
17 #include "base/strings/string16.h"
18 #include "base/threading/thread_checker.h"
19 #include "base/timer/timer.h"
20 #include "build/build_config.h"
21 #include "content/child/child_thread_impl.h"
22 #include "content/common/content_export.h"
23 #include "content/common/frame_replication_state.h"
24 #include "content/common/gpu/client/gpu_channel_host.h"
25 #include "content/common/gpu/gpu_result_codes.h"
26 #include "content/public/renderer/render_thread.h"
27 #include "content/renderer/gpu/compositor_dependencies.h"
28 #include "net/base/network_change_notifier.h"
29 #include "third_party/WebKit/public/platform/WebConnectionType.h"
30 #include "ui/gfx/native_widget_types.h"
32 #if defined(OS_MACOSX)
33 #include "third_party/WebKit/public/web/mac/WebScrollbarTheme.h"
34 #endif
36 class GrContext;
37 class SkBitmap;
38 struct FrameMsg_NewFrame_WidgetParams;
39 struct ViewMsg_New_Params;
40 struct WorkerProcessMsg_CreateWorker_Params;
42 namespace blink {
43 class WebGamepads;
44 class WebGraphicsContext3D;
45 class WebMediaStreamCenter;
46 class WebMediaStreamCenterClient;
49 namespace base {
50 class MessageLoopProxy;
51 class SingleThreadTaskRunner;
52 class Thread;
55 namespace cc {
56 class ContextProvider;
57 class TaskGraphRunner;
60 namespace cc_blink {
61 class ContextProviderWebContext;
64 namespace IPC {
65 class MessageFilter;
68 namespace media {
69 class AudioHardwareConfig;
70 class GpuVideoAcceleratorFactories;
73 namespace scheduler {
74 class RendererScheduler;
77 namespace v8 {
78 class Extension;
81 namespace content {
83 class AppCacheDispatcher;
84 class AecDumpMessageFilter;
85 class AudioInputMessageFilter;
86 class AudioMessageFilter;
87 class AudioRendererMixerManager;
88 class BrowserPluginManager;
89 class CacheStorageDispatcher;
90 class CompositorForwardingMessageFilter;
91 class ContextProviderCommandBuffer;
92 class DBMessageFilter;
93 class DevToolsAgentFilter;
94 class DomStorageDispatcher;
95 class EmbeddedWorkerDispatcher;
96 class GpuChannelHost;
97 class IndexedDBDispatcher;
98 class InputHandlerManager;
99 class MediaStreamCenter;
100 class MemoryObserver;
101 class MidiMessageFilter;
102 class NetInfoDispatcher;
103 class P2PSocketDispatcher;
104 class PeerConnectionDependencyFactory;
105 class PeerConnectionTracker;
106 class RenderProcessObserver;
107 class RendererBlinkPlatformImpl;
108 class RendererDemuxerAndroid;
109 class ResourceDispatchThrottler;
110 class ResourceSchedulingFilter;
111 class V8SamplingProfiler;
112 class VideoCaptureImplManager;
113 class WebGraphicsContext3DCommandBufferImpl;
114 class WebRTCIdentityService;
116 #if defined(COMPILER_MSVC)
117 // See explanation for other RenderViewHostImpl which is the same issue.
118 #pragma warning(push)
119 #pragma warning(disable: 4250)
120 #endif
122 // The RenderThreadImpl class represents a background thread where RenderView
123 // instances live. The RenderThread supports an API that is used by its
124 // consumer to talk indirectly to the RenderViews and supporting objects.
125 // Likewise, it provides an API for the RenderViews to talk back to the main
126 // process (i.e., their corresponding WebContentsImpl).
128 // Most of the communication occurs in the form of IPC messages. They are
129 // routed to the RenderThread according to the routing IDs of the messages.
130 // The routing IDs correspond to RenderView instances.
131 class CONTENT_EXPORT RenderThreadImpl
132 : public RenderThread,
133 public ChildThreadImpl,
134 public GpuChannelHostFactory,
135 NON_EXPORTED_BASE(public CompositorDependencies) {
136 public:
137 static RenderThreadImpl* current();
139 explicit RenderThreadImpl(const InProcessChildThreadParams& params);
140 explicit RenderThreadImpl(scoped_ptr<base::MessageLoop> main_message_loop);
141 ~RenderThreadImpl() override;
142 void Shutdown() override;
144 // When initializing WebKit, ensure that any schemes needed for the content
145 // module are registered properly. Static to allow sharing with tests.
146 static void RegisterSchemes();
148 // Notify V8 that the date/time configuration of the system might have
149 // changed.
150 static void NotifyTimezoneChange();
152 // RenderThread implementation:
153 bool Send(IPC::Message* msg) override;
154 scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner() override;
155 IPC::SyncChannel* GetChannel() override;
156 std::string GetLocale() override;
157 IPC::SyncMessageFilter* GetSyncMessageFilter() override;
158 scoped_refptr<base::MessageLoopProxy> GetIOMessageLoopProxy() override;
159 void AddRoute(int32 routing_id, IPC::Listener* listener) override;
160 void RemoveRoute(int32 routing_id) override;
161 int GenerateRoutingID() override;
162 void AddFilter(IPC::MessageFilter* filter) override;
163 void RemoveFilter(IPC::MessageFilter* filter) override;
164 void AddObserver(RenderProcessObserver* observer) override;
165 void RemoveObserver(RenderProcessObserver* observer) override;
166 void SetResourceDispatcherDelegate(
167 ResourceDispatcherDelegate* delegate) override;
168 void EnsureWebKitInitialized() override;
169 void RecordAction(const base::UserMetricsAction& action) override;
170 void RecordComputedAction(const std::string& action) override;
171 scoped_ptr<base::SharedMemory> HostAllocateSharedMemoryBuffer(
172 size_t buffer_size) override;
173 cc::SharedBitmapManager* GetSharedBitmapManager() override;
174 void RegisterExtension(v8::Extension* extension) override;
175 void ScheduleIdleHandler(int64 initial_delay_ms) override;
176 void IdleHandler() override;
177 int64 GetIdleNotificationDelayInMs() const override;
178 void SetIdleNotificationDelayInMs(
179 int64 idle_notification_delay_in_ms) override;
180 void UpdateHistograms(int sequence_number) override;
181 int PostTaskToAllWebWorkers(const base::Closure& closure) override;
182 bool ResolveProxy(const GURL& url, std::string* proxy_list) override;
183 base::WaitableEvent* GetShutdownEvent() override;
184 ServiceRegistry* GetServiceRegistry() override;
186 // CompositorDependencies implementation.
187 bool IsImplSidePaintingEnabled() override;
188 bool IsGpuRasterizationForced() override;
189 bool IsGpuRasterizationEnabled() override;
190 int GetGpuRasterizationMSAASampleCount() override;
191 bool IsLcdTextEnabled() override;
192 bool IsDistanceFieldTextEnabled() override;
193 bool IsZeroCopyEnabled() override;
194 bool IsOneCopyEnabled() override;
195 bool IsElasticOverscrollEnabled() override;
196 bool UseSingleThreadScheduler() override;
197 uint32 GetImageTextureTarget() override;
198 scoped_refptr<base::SingleThreadTaskRunner>
199 GetCompositorMainThreadTaskRunner() override;
200 scoped_refptr<base::SingleThreadTaskRunner>
201 GetCompositorImplThreadTaskRunner() override;
202 gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override;
203 scheduler::RendererScheduler* GetRendererScheduler() override;
204 cc::ContextProvider* GetSharedMainThreadContextProvider() override;
205 scoped_ptr<cc::BeginFrameSource> CreateExternalBeginFrameSource(
206 int routing_id) override;
207 cc::TaskGraphRunner* GetTaskGraphRunner() override;
208 bool IsGatherPixelRefsEnabled() override;
210 // Synchronously establish a channel to the GPU plugin if not previously
211 // established or if it has been lost (for example if the GPU plugin crashed).
212 // If there is a pending asynchronous request, it will be completed by the
213 // time this routine returns.
214 GpuChannelHost* EstablishGpuChannelSync(CauseForGpuLaunch);
217 // These methods modify how the next message is sent. Normally, when sending
218 // a synchronous message that runs a nested message loop, we need to suspend
219 // callbacks into WebKit. This involves disabling timers and deferring
220 // resource loads. However, there are exceptions when we need to customize
221 // the behavior.
222 void DoNotSuspendWebKitSharedTimer();
223 void DoNotNotifyWebKitOfModalLoop();
225 // True if we are running layout tests. This currently disables forwarding
226 // various status messages to the console, skips network error pages, and
227 // short circuits size update and focus events.
228 bool layout_test_mode() const {
229 return layout_test_mode_;
231 void set_layout_test_mode(bool layout_test_mode) {
232 layout_test_mode_ = layout_test_mode;
235 RendererBlinkPlatformImpl* blink_platform_impl() const {
236 DCHECK(blink_platform_impl_);
237 return blink_platform_impl_.get();
240 CompositorForwardingMessageFilter* compositor_message_filter() const {
241 return compositor_message_filter_.get();
244 InputHandlerManager* input_handler_manager() const {
245 return input_handler_manager_.get();
248 // Will be null if threaded compositing has not been enabled.
249 scoped_refptr<base::MessageLoopProxy> compositor_message_loop_proxy() const {
250 return compositor_message_loop_proxy_;
253 AppCacheDispatcher* appcache_dispatcher() const {
254 return appcache_dispatcher_.get();
257 DomStorageDispatcher* dom_storage_dispatcher() const {
258 return dom_storage_dispatcher_.get();
261 EmbeddedWorkerDispatcher* embedded_worker_dispatcher() const {
262 return embedded_worker_dispatcher_.get();
265 AudioInputMessageFilter* audio_input_message_filter() {
266 return audio_input_message_filter_.get();
269 AudioMessageFilter* audio_message_filter() {
270 return audio_message_filter_.get();
273 MidiMessageFilter* midi_message_filter() {
274 return midi_message_filter_.get();
277 #if defined(OS_ANDROID)
278 RendererDemuxerAndroid* renderer_demuxer() {
279 return renderer_demuxer_.get();
281 #endif
283 // Creates the embedder implementation of WebMediaStreamCenter.
284 // The resulting object is owned by WebKit and deleted by WebKit at tear-down.
285 blink::WebMediaStreamCenter* CreateMediaStreamCenter(
286 blink::WebMediaStreamCenterClient* client);
288 BrowserPluginManager* browser_plugin_manager() const {
289 return browser_plugin_manager_.get();
292 #if defined(ENABLE_WEBRTC)
293 // Returns a factory used for creating RTC PeerConnection objects.
294 PeerConnectionDependencyFactory* GetPeerConnectionDependencyFactory();
296 PeerConnectionTracker* peer_connection_tracker() {
297 return peer_connection_tracker_.get();
300 // Current P2PSocketDispatcher. Set to NULL if P2P API is disabled.
301 P2PSocketDispatcher* p2p_socket_dispatcher() {
302 return p2p_socket_dispatcher_.get();
304 #endif
306 VideoCaptureImplManager* video_capture_impl_manager() const {
307 return vc_manager_.get();
310 // Get the GPU channel. Returns NULL if the channel is not established or
311 // has been lost.
312 GpuChannelHost* GetGpuChannel();
314 // Returns a MessageLoopProxy instance corresponding to the message loop
315 // of the thread on which file operations should be run. Must be called
316 // on the renderer's main thread.
317 scoped_refptr<base::MessageLoopProxy> GetFileThreadMessageLoopProxy();
319 // Returns a SingleThreadTaskRunner instance corresponding to the message loop
320 // of the thread on which media operations should be run. Must be called
321 // on the renderer's main thread.
322 scoped_refptr<base::SingleThreadTaskRunner> GetMediaThreadTaskRunner();
324 // Causes the idle handler to skip sending idle notifications
325 // on the two next scheduled calls, so idle notifications are
326 // not sent for at least one notification delay.
327 void PostponeIdleNotification();
329 scoped_refptr<media::GpuVideoAcceleratorFactories> GetGpuFactories();
331 scoped_refptr<cc_blink::ContextProviderWebContext>
332 SharedMainThreadContextProvider();
334 // AudioRendererMixerManager instance which manages renderer side mixer
335 // instances shared based on configured audio parameters. Lazily created on
336 // first call.
337 AudioRendererMixerManager* GetAudioRendererMixerManager();
339 // AudioHardwareConfig contains audio hardware configuration for
340 // renderer side clients. Creation requires a synchronous IPC call so it is
341 // lazily created on the first call.
342 media::AudioHardwareConfig* GetAudioHardwareConfig();
344 #if defined(OS_WIN)
345 void PreCacheFontCharacters(const LOGFONT& log_font,
346 const base::string16& str);
347 #endif
349 #if defined(ENABLE_WEBRTC)
350 WebRTCIdentityService* get_webrtc_identity_service() {
351 return webrtc_identity_service_.get();
353 #endif
355 // For producing custom V8 histograms. Custom histograms are produced if all
356 // RenderViews share the same host, and the host is in the pre-specified set
357 // of hosts we want to produce custom diagrams for. The name for a custom
358 // diagram is the name of the corresponding generic diagram plus a
359 // host-specific suffix.
360 class CONTENT_EXPORT HistogramCustomizer {
361 public:
362 HistogramCustomizer();
363 ~HistogramCustomizer();
365 // Called when a top frame of a RenderView navigates. This function updates
366 // RenderThreadImpl's information about whether all RenderViews are
367 // displaying a page from the same host. |host| is the host where a
368 // RenderView navigated, and |view_count| is the number of RenderViews in
369 // this process.
370 void RenderViewNavigatedToHost(const std::string& host, size_t view_count);
372 // Used for customizing some histograms if all RenderViews share the same
373 // host. Returns the current custom histogram name to use for
374 // |histogram_name|, or |histogram_name| if it shouldn't be customized.
375 std::string ConvertToCustomHistogramName(const char* histogram_name) const;
377 private:
378 friend class RenderThreadImplUnittest;
380 // Used for updating the information on which is the common host which all
381 // RenderView's share (if any). If there is no common host, this function is
382 // called with an empty string.
383 void SetCommonHost(const std::string& host);
385 // The current common host of the RenderViews; empty string if there is no
386 // common host.
387 std::string common_host_;
388 // The corresponding suffix.
389 std::string common_host_histogram_suffix_;
390 // Set of histograms for which we want to produce a custom histogram if
391 // possible.
392 std::set<std::string> custom_histograms_;
394 DISALLOW_COPY_AND_ASSIGN(HistogramCustomizer);
397 HistogramCustomizer* histogram_customizer() {
398 return &histogram_customizer_;
401 // Retrieve current gamepad data.
402 void SampleGamepads(blink::WebGamepads* data);
404 // Called by a RenderWidget when it is created or destroyed. This
405 // allows the process to know when there are no visible widgets.
406 void WidgetCreated();
407 // Note: A widget must not be hidden when it is destroyed - ensure that
408 // WidgetRestored is called before WidgetDestroyed for any hidden widget.
409 void WidgetDestroyed();
410 void WidgetHidden();
411 void WidgetRestored();
413 void AddEmbeddedWorkerRoute(int32 routing_id, IPC::Listener* listener);
414 void RemoveEmbeddedWorkerRoute(int32 routing_id);
416 void RegisterPendingRenderFrameConnect(
417 int routing_id,
418 mojo::InterfaceRequest<mojo::ServiceProvider> services,
419 mojo::ServiceProviderPtr exposed_services);
421 protected:
422 virtual void SetResourceDispatchTaskQueue(
423 const scoped_refptr<base::SingleThreadTaskRunner>& resource_task_queue);
425 private:
426 // ChildThread
427 bool OnControlMessageReceived(const IPC::Message& msg) override;
429 // GpuChannelHostFactory implementation:
430 bool IsMainThread() override;
431 base::MessageLoop* GetMainLoop() override;
432 scoped_refptr<base::MessageLoopProxy> GetIOLoopProxy() override;
433 scoped_ptr<base::SharedMemory> AllocateSharedMemory(size_t size) override;
434 CreateCommandBufferResult CreateViewCommandBuffer(
435 int32 surface_id,
436 const GPUCreateCommandBufferConfig& init_params,
437 int32 route_id) override;
439 void Init();
441 void OnCreateNewFrame(int routing_id,
442 int parent_routing_id,
443 int proxy_routing_id,
444 const FrameReplicationState& replicated_state,
445 FrameMsg_NewFrame_WidgetParams params);
446 void OnCreateNewFrameProxy(int routing_id,
447 int parent_routing_id,
448 int render_view_routing_id,
449 const FrameReplicationState& replicated_state);
450 void OnSetZoomLevelForCurrentURL(const std::string& scheme,
451 const std::string& host,
452 double zoom_level);
453 void OnCreateNewView(const ViewMsg_New_Params& params);
454 void OnTransferBitmap(const SkBitmap& bitmap, int resource_id);
455 #if defined(ENABLE_PLUGINS)
456 void OnPurgePluginListCache(bool reload_pages);
457 #endif
458 void OnNetworkTypeChanged(net::NetworkChangeNotifier::ConnectionType type);
459 void OnGetAccessibilityTree();
460 void OnTempCrashWithData(const GURL& data);
461 void OnUpdateTimezone();
462 void OnMemoryPressure(
463 base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level);
464 #if defined(OS_ANDROID)
465 void OnSetWebKitSharedTimersSuspended(bool suspend);
466 #endif
467 #if defined(OS_MACOSX)
468 void OnUpdateScrollbarTheme(float initial_button_delay,
469 float autoscroll_button_delay,
470 bool jump_on_track_click,
471 blink::ScrollerStyle preferred_scroller_style,
472 bool redraw);
473 #endif
474 void OnCreateNewSharedWorker(
475 const WorkerProcessMsg_CreateWorker_Params& params);
476 bool RendererIsHidden() const;
477 void OnRendererHidden();
478 void OnRendererVisible();
480 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> CreateOffscreenContext3d();
482 // These objects live solely on the render thread.
483 scoped_ptr<AppCacheDispatcher> appcache_dispatcher_;
484 scoped_ptr<DomStorageDispatcher> dom_storage_dispatcher_;
485 scoped_ptr<IndexedDBDispatcher> main_thread_indexed_db_dispatcher_;
486 scoped_ptr<scheduler::RendererScheduler> renderer_scheduler_;
487 scoped_ptr<RendererBlinkPlatformImpl> blink_platform_impl_;
488 scoped_ptr<ResourceDispatchThrottler> resource_dispatch_throttler_;
489 scoped_ptr<CacheStorageDispatcher> main_thread_cache_storage_dispatcher_;
490 scoped_ptr<EmbeddedWorkerDispatcher> embedded_worker_dispatcher_;
492 // Used on the render thread and deleted by WebKit at shutdown.
493 blink::WebMediaStreamCenter* media_stream_center_;
495 // Used on the renderer and IPC threads.
496 scoped_refptr<DBMessageFilter> db_message_filter_;
497 scoped_refptr<AudioInputMessageFilter> audio_input_message_filter_;
498 scoped_refptr<AudioMessageFilter> audio_message_filter_;
499 scoped_refptr<MidiMessageFilter> midi_message_filter_;
500 #if defined(OS_ANDROID)
501 scoped_refptr<RendererDemuxerAndroid> renderer_demuxer_;
502 #endif
503 scoped_refptr<DevToolsAgentFilter> devtools_agent_message_filter_;
504 scoped_ptr<V8SamplingProfiler> v8_sampling_profiler_;
506 scoped_ptr<BrowserPluginManager> browser_plugin_manager_;
508 #if defined(ENABLE_WEBRTC)
509 scoped_ptr<PeerConnectionDependencyFactory> peer_connection_factory_;
511 // This is used to communicate to the browser process the status
512 // of all the peer connections created in the renderer.
513 scoped_ptr<PeerConnectionTracker> peer_connection_tracker_;
515 // Dispatches all P2P sockets.
516 scoped_refptr<P2PSocketDispatcher> p2p_socket_dispatcher_;
517 #endif
519 // Used on the render thread.
520 scoped_ptr<VideoCaptureImplManager> vc_manager_;
522 // Used for communicating registering AEC dump consumers with the browser and
523 // receving AEC dump file handles when AEC dump is enabled. An AEC dump is
524 // diagnostic audio data for WebRTC stored locally when enabled by the user in
525 // chrome://webrtc-internals.
526 scoped_refptr<AecDumpMessageFilter> aec_dump_message_filter_;
528 // The count of RenderWidgets running through this thread.
529 int widget_count_;
531 // The count of hidden RenderWidgets running through this thread.
532 int hidden_widget_count_;
534 // The current value of the idle notification timer delay.
535 int64 idle_notification_delay_in_ms_;
537 // The number of idle handler calls that skip sending idle notifications.
538 int idle_notifications_to_skip_;
540 bool suspend_webkit_shared_timer_;
541 bool notify_webkit_of_modal_loop_;
542 bool webkit_shared_timer_suspended_;
544 // The following flag is used to control layout test specific behavior.
545 bool layout_test_mode_;
547 // Timer that periodically calls IdleHandler.
548 base::RepeatingTimer<RenderThreadImpl> idle_timer_;
550 // The channel from the renderer process to the GPU process.
551 scoped_refptr<GpuChannelHost> gpu_channel_;
553 // Cache of variables that are needed on the compositor thread by
554 // GpuChannelHostFactory methods.
555 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_;
557 // The message loop of the renderer main thread.
558 // This message loop should be destructed before the RenderThreadImpl
559 // shuts down Blink.
560 scoped_ptr<base::MessageLoop> main_message_loop_;
562 // A lazily initiated thread on which file operations are run.
563 scoped_ptr<base::Thread> file_thread_;
565 // May be null if overridden by ContentRendererClient.
566 scoped_ptr<base::Thread> compositor_thread_;
568 // Thread for running multimedia operations (e.g., video decoding).
569 scoped_ptr<base::Thread> media_thread_;
571 // Will point to appropriate MessageLoopProxy after initialization,
572 // regardless of whether |compositor_thread_| is overriden.
573 scoped_refptr<base::MessageLoopProxy> compositor_message_loop_proxy_;
575 // Threads used by compositor for rasterization.
576 ScopedVector<base::SimpleThread> compositor_raster_threads_;
578 base::CancelableCallback<void(const IPC::Message&)> main_input_callback_;
579 scoped_refptr<IPC::MessageFilter> input_event_filter_;
580 scoped_ptr<InputHandlerManager> input_handler_manager_;
581 scoped_refptr<CompositorForwardingMessageFilter> compositor_message_filter_;
583 scoped_refptr<cc_blink::ContextProviderWebContext>
584 shared_main_thread_contexts_;
586 ObserverList<RenderProcessObserver> observers_;
588 scoped_refptr<ContextProviderCommandBuffer> gpu_va_context_provider_;
590 scoped_ptr<AudioRendererMixerManager> audio_renderer_mixer_manager_;
591 scoped_ptr<media::AudioHardwareConfig> audio_hardware_config_;
593 HistogramCustomizer histogram_customizer_;
595 scoped_ptr<base::MemoryPressureListener> memory_pressure_listener_;
597 #if defined(ENABLE_WEBRTC)
598 scoped_ptr<WebRTCIdentityService> webrtc_identity_service_;
599 #endif
601 scoped_ptr<MemoryObserver> memory_observer_;
603 scoped_refptr<base::SingleThreadTaskRunner>
604 main_thread_compositor_task_runner_;
606 scoped_refptr<ResourceSchedulingFilter> resource_scheduling_filter_;
608 scoped_ptr<cc::TaskGraphRunner> compositor_task_graph_runner_;
610 // Compositor settings.
611 bool is_gpu_rasterization_enabled_;
612 bool is_gpu_rasterization_forced_;
613 int gpu_rasterization_msaa_sample_count_;
614 bool is_impl_side_painting_enabled_;
615 bool is_lcd_text_enabled_;
616 bool is_distance_field_text_enabled_;
617 bool is_zero_copy_enabled_;
618 bool is_one_copy_enabled_;
619 bool is_elastic_overscroll_enabled_;
620 unsigned use_image_texture_target_;
621 bool is_gather_pixel_refs_enabled_;
623 class PendingRenderFrameConnect
624 : public base::RefCounted<PendingRenderFrameConnect>,
625 public mojo::ErrorHandler {
626 public:
627 PendingRenderFrameConnect(
628 int routing_id,
629 mojo::InterfaceRequest<mojo::ServiceProvider> services,
630 mojo::ServiceProviderPtr exposed_services);
632 mojo::InterfaceRequest<mojo::ServiceProvider>& services() {
633 return services_;
636 mojo::ServiceProviderPtr& exposed_services() { return exposed_services_; }
638 private:
639 friend class base::RefCounted<PendingRenderFrameConnect>;
641 ~PendingRenderFrameConnect() override;
643 void OnConnectionError() override;
645 int routing_id_;
646 mojo::InterfaceRequest<mojo::ServiceProvider> services_;
647 mojo::ServiceProviderPtr exposed_services_;
650 typedef std::map<int, scoped_refptr<PendingRenderFrameConnect>>
651 PendingRenderFrameConnectMap;
652 PendingRenderFrameConnectMap pending_render_frame_connects_;
654 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl);
657 #if defined(COMPILER_MSVC)
658 #pragma warning(pop)
659 #endif
661 } // namespace content
663 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_