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_
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"
38 struct FrameMsg_NewFrame_Params
;
39 struct ViewMsg_New_Params
;
40 struct ViewMsg_UpdateScrollbarTheme_Params
;
41 struct WorkerProcessMsg_CreateWorker_Params
;
45 class WebGraphicsContext3D
;
46 class WebMediaStreamCenter
;
47 class WebMediaStreamCenterClient
;
51 class SingleThreadTaskRunner
;
56 class ContextProvider
;
57 class TaskGraphRunner
;
61 class ContextProviderWebContext
;
69 class AudioHardwareConfig
;
70 class GpuVideoAcceleratorFactories
;
74 class RendererScheduler
;
83 class AppCacheDispatcher
;
84 class AecDumpMessageFilter
;
85 class AudioInputMessageFilter
;
86 class AudioMessageFilter
;
87 class AudioRendererMixerManager
;
88 class BluetoothMessageFilter
;
89 class BrowserPluginManager
;
90 class CacheStorageDispatcher
;
91 class CompositorForwardingMessageFilter
;
92 class ContextProviderCommandBuffer
;
93 class DBMessageFilter
;
94 class DevToolsAgentFilter
;
95 class DomStorageDispatcher
;
96 class EmbeddedWorkerDispatcher
;
98 class IndexedDBDispatcher
;
99 class InputHandlerManager
;
100 class MediaStreamCenter
;
101 class MemoryObserver
;
102 class MidiMessageFilter
;
103 class NetInfoDispatcher
;
104 class P2PSocketDispatcher
;
105 class PeerConnectionDependencyFactory
;
106 class PeerConnectionTracker
;
107 class RasterWorkerPool
;
108 class RenderProcessObserver
;
109 class RendererBlinkPlatformImpl
;
110 class RendererDemuxerAndroid
;
111 class ResourceDispatchThrottler
;
112 class ResourceSchedulingFilter
;
113 class V8SamplingProfiler
;
114 class VideoCaptureImplManager
;
115 class WebGraphicsContext3DCommandBufferImpl
;
116 class WebRTCIdentityService
;
118 #if defined(COMPILER_MSVC)
119 // See explanation for other RenderViewHostImpl which is the same issue.
120 #pragma warning(push)
121 #pragma warning(disable: 4250)
124 // The RenderThreadImpl class represents a background thread where RenderView
125 // instances live. The RenderThread supports an API that is used by its
126 // consumer to talk indirectly to the RenderViews and supporting objects.
127 // Likewise, it provides an API for the RenderViews to talk back to the main
128 // process (i.e., their corresponding WebContentsImpl).
130 // Most of the communication occurs in the form of IPC messages. They are
131 // routed to the RenderThread according to the routing IDs of the messages.
132 // The routing IDs correspond to RenderView instances.
133 class CONTENT_EXPORT RenderThreadImpl
134 : public RenderThread
,
135 public ChildThreadImpl
,
136 public GpuChannelHostFactory
,
137 NON_EXPORTED_BASE(public CompositorDependencies
) {
139 static RenderThreadImpl
* Create(const InProcessChildThreadParams
& params
);
140 static RenderThreadImpl
* Create(
141 scoped_ptr
<base::MessageLoop
> main_message_loop
,
142 scoped_ptr
<scheduler::RendererScheduler
> renderer_scheduler
);
143 static RenderThreadImpl
* current();
145 ~RenderThreadImpl() override
;
146 void Shutdown() override
;
148 // When initializing WebKit, ensure that any schemes needed for the content
149 // module are registered properly. Static to allow sharing with tests.
150 static void RegisterSchemes();
152 // Notify V8 that the date/time configuration of the system might have
154 static void NotifyTimezoneChange();
156 // RenderThread implementation:
157 bool Send(IPC::Message
* msg
) override
;
158 IPC::SyncChannel
* GetChannel() override
;
159 std::string
GetLocale() override
;
160 IPC::SyncMessageFilter
* GetSyncMessageFilter() override
;
161 scoped_refptr
<base::SingleThreadTaskRunner
> GetIOMessageLoopProxy() override
;
162 void AddRoute(int32 routing_id
, IPC::Listener
* listener
) override
;
163 void RemoveRoute(int32 routing_id
) override
;
164 int GenerateRoutingID() override
;
165 void AddFilter(IPC::MessageFilter
* filter
) override
;
166 void RemoveFilter(IPC::MessageFilter
* filter
) override
;
167 void AddObserver(RenderProcessObserver
* observer
) override
;
168 void RemoveObserver(RenderProcessObserver
* observer
) override
;
169 void SetResourceDispatcherDelegate(
170 ResourceDispatcherDelegate
* delegate
) override
;
171 void EnsureWebKitInitialized() override
;
172 void RecordAction(const base::UserMetricsAction
& action
) override
;
173 void RecordComputedAction(const std::string
& action
) override
;
174 scoped_ptr
<base::SharedMemory
> HostAllocateSharedMemoryBuffer(
175 size_t buffer_size
) override
;
176 cc::SharedBitmapManager
* GetSharedBitmapManager() override
;
177 void RegisterExtension(v8::Extension
* extension
) override
;
178 void ScheduleIdleHandler(int64 initial_delay_ms
) override
;
179 void IdleHandler() override
;
180 int64
GetIdleNotificationDelayInMs() const override
;
181 void SetIdleNotificationDelayInMs(
182 int64 idle_notification_delay_in_ms
) override
;
183 void UpdateHistograms(int sequence_number
) override
;
184 int PostTaskToAllWebWorkers(const base::Closure
& closure
) override
;
185 bool ResolveProxy(const GURL
& url
, std::string
* proxy_list
) override
;
186 base::WaitableEvent
* GetShutdownEvent() override
;
187 ServiceRegistry
* GetServiceRegistry() override
;
189 // CompositorDependencies implementation.
190 bool IsGpuRasterizationForced() override
;
191 bool IsGpuRasterizationEnabled() override
;
192 int GetGpuRasterizationMSAASampleCount() override
;
193 bool IsLcdTextEnabled() override
;
194 bool IsDistanceFieldTextEnabled() override
;
195 bool IsZeroCopyEnabled() override
;
196 bool IsOneCopyEnabled() override
;
197 bool IsElasticOverscrollEnabled() override
;
198 uint32
GetImageTextureTarget() override
;
199 scoped_refptr
<base::SingleThreadTaskRunner
>
200 GetCompositorMainThreadTaskRunner() override
;
201 scoped_refptr
<base::SingleThreadTaskRunner
>
202 GetCompositorImplThreadTaskRunner() override
;
203 gpu::GpuMemoryBufferManager
* GetGpuMemoryBufferManager() override
;
204 scheduler::RendererScheduler
* GetRendererScheduler() override
;
205 cc::ContextProvider
* GetSharedMainThreadContextProvider() override
;
206 scoped_ptr
<cc::BeginFrameSource
> CreateExternalBeginFrameSource(
207 int routing_id
) override
;
208 cc::TaskGraphRunner
* GetTaskGraphRunner() override
;
209 bool IsGatherPixelRefsEnabled() override
;
211 // Synchronously establish a channel to the GPU plugin if not previously
212 // established or if it has been lost (for example if the GPU plugin crashed).
213 // If there is a pending asynchronous request, it will be completed by the
214 // time this routine returns.
215 GpuChannelHost
* EstablishGpuChannelSync(CauseForGpuLaunch
);
218 // This method modifies how the next message is sent. Normally, when sending
219 // a synchronous message that runs a nested message loop, we need to suspend
220 // callbacks into WebKit. This involves disabling timers and deferring
221 // resource loads. However, there are exceptions when we need to customize
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::SingleThreadTaskRunner
> compositor_task_runner() const {
250 return compositor_task_runner_
;
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();
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();
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
312 GpuChannelHost
* GetGpuChannel();
314 // Returns a SingleThreadTaskRunner 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::SingleThreadTaskRunner
> 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 // A SequencedTaskRunner instance that runs tasks on the raster worker pool.
325 base::SequencedTaskRunner
* GetWorkerSequencedTaskRunner();
327 // Causes the idle handler to skip sending idle notifications
328 // on the two next scheduled calls, so idle notifications are
329 // not sent for at least one notification delay.
330 void PostponeIdleNotification();
332 scoped_refptr
<media::GpuVideoAcceleratorFactories
> GetGpuFactories();
334 scoped_refptr
<cc_blink::ContextProviderWebContext
>
335 SharedMainThreadContextProvider();
337 // AudioRendererMixerManager instance which manages renderer side mixer
338 // instances shared based on configured audio parameters. Lazily created on
340 AudioRendererMixerManager
* GetAudioRendererMixerManager();
342 // AudioHardwareConfig contains audio hardware configuration for
343 // renderer side clients. Creation requires a synchronous IPC call so it is
344 // lazily created on the first call.
345 media::AudioHardwareConfig
* GetAudioHardwareConfig();
348 void PreCacheFontCharacters(const LOGFONT
& log_font
,
349 const base::string16
& str
);
352 #if defined(ENABLE_WEBRTC)
353 WebRTCIdentityService
* get_webrtc_identity_service() {
354 return webrtc_identity_service_
.get();
358 // For producing custom V8 histograms. Custom histograms are produced if all
359 // RenderViews share the same host, and the host is in the pre-specified set
360 // of hosts we want to produce custom diagrams for. The name for a custom
361 // diagram is the name of the corresponding generic diagram plus a
362 // host-specific suffix.
363 class CONTENT_EXPORT HistogramCustomizer
{
365 HistogramCustomizer();
366 ~HistogramCustomizer();
368 // Called when a top frame of a RenderView navigates. This function updates
369 // RenderThreadImpl's information about whether all RenderViews are
370 // displaying a page from the same host. |host| is the host where a
371 // RenderView navigated, and |view_count| is the number of RenderViews in
373 void RenderViewNavigatedToHost(const std::string
& host
, size_t view_count
);
375 // Used for customizing some histograms if all RenderViews share the same
376 // host. Returns the current custom histogram name to use for
377 // |histogram_name|, or |histogram_name| if it shouldn't be customized.
378 std::string
ConvertToCustomHistogramName(const char* histogram_name
) const;
381 friend class RenderThreadImplUnittest
;
383 // Used for updating the information on which is the common host which all
384 // RenderView's share (if any). If there is no common host, this function is
385 // called with an empty string.
386 void SetCommonHost(const std::string
& host
);
388 // The current common host of the RenderViews; empty string if there is no
390 std::string common_host_
;
391 // The corresponding suffix.
392 std::string common_host_histogram_suffix_
;
393 // Set of histograms for which we want to produce a custom histogram if
395 std::set
<std::string
> custom_histograms_
;
397 DISALLOW_COPY_AND_ASSIGN(HistogramCustomizer
);
400 HistogramCustomizer
* histogram_customizer() {
401 return &histogram_customizer_
;
404 // Retrieve current gamepad data.
405 void SampleGamepads(blink::WebGamepads
* data
);
407 // Called by a RenderWidget when it is created or destroyed. This
408 // allows the process to know when there are no visible widgets.
409 void WidgetCreated();
410 // Note: A widget must not be hidden when it is destroyed - ensure that
411 // WidgetRestored is called before WidgetDestroyed for any hidden widget.
412 void WidgetDestroyed();
414 void WidgetRestored();
416 void AddEmbeddedWorkerRoute(int32 routing_id
, IPC::Listener
* listener
);
417 void RemoveEmbeddedWorkerRoute(int32 routing_id
);
419 void RegisterPendingRenderFrameConnect(
421 mojo::InterfaceRequest
<mojo::ServiceProvider
> services
,
422 mojo::ServiceProviderPtr exposed_services
);
425 RenderThreadImpl(const InProcessChildThreadParams
& params
,
426 scoped_ptr
<scheduler::RendererScheduler
> scheduler
);
427 RenderThreadImpl(scoped_ptr
<base::MessageLoop
> main_message_loop
,
428 scoped_ptr
<scheduler::RendererScheduler
> scheduler
);
429 virtual void SetResourceDispatchTaskQueue(
430 const scoped_refptr
<base::SingleThreadTaskRunner
>& resource_task_queue
);
434 bool OnControlMessageReceived(const IPC::Message
& msg
) override
;
436 // GpuChannelHostFactory implementation:
437 bool IsMainThread() override
;
438 scoped_refptr
<base::SingleThreadTaskRunner
> GetIOThreadTaskRunner() override
;
439 scoped_ptr
<base::SharedMemory
> AllocateSharedMemory(size_t size
) override
;
440 CreateCommandBufferResult
CreateViewCommandBuffer(
442 const GPUCreateCommandBufferConfig
& init_params
,
443 int32 route_id
) override
;
447 void OnCreateNewFrame(FrameMsg_NewFrame_Params params
);
448 void OnCreateNewFrameProxy(int routing_id
,
449 int parent_routing_id
,
450 int render_view_routing_id
,
451 const FrameReplicationState
& replicated_state
);
452 void OnSetZoomLevelForCurrentURL(const std::string
& scheme
,
453 const std::string
& host
,
455 void OnCreateNewView(const ViewMsg_New_Params
& params
);
456 void OnTransferBitmap(const SkBitmap
& bitmap
, int resource_id
);
457 #if defined(ENABLE_PLUGINS)
458 void OnPurgePluginListCache(bool reload_pages
);
460 void OnNetworkTypeChanged(net::NetworkChangeNotifier::ConnectionType type
);
461 void OnGetAccessibilityTree();
462 void OnUpdateTimezone(const std::string
& zoneId
);
463 void OnMemoryPressure(
464 base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level
);
465 #if defined(OS_ANDROID)
466 void OnSetWebKitSharedTimersSuspended(bool suspend
);
468 #if defined(OS_MACOSX)
469 void OnUpdateScrollbarTheme(
470 const ViewMsg_UpdateScrollbarTheme_Params
& params
);
472 void OnCreateNewSharedWorker(
473 const WorkerProcessMsg_CreateWorker_Params
& params
);
474 bool RendererIsHidden() const;
475 void OnRendererHidden();
476 void OnRendererVisible();
478 void ReleaseFreeMemory();
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_
;
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_
;
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.
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 notify_webkit_of_modal_loop_
;
541 bool webkit_shared_timer_suspended_
;
543 // The following flag is used to control layout test specific behavior.
544 bool layout_test_mode_
;
546 // Timer that periodically calls IdleHandler.
547 base::RepeatingTimer
<RenderThreadImpl
> idle_timer_
;
549 // The channel from the renderer process to the GPU process.
550 scoped_refptr
<GpuChannelHost
> gpu_channel_
;
552 // Cache of variables that are needed on the compositor thread by
553 // GpuChannelHostFactory methods.
554 scoped_refptr
<base::SingleThreadTaskRunner
> io_thread_task_runner_
;
556 // The message loop of the renderer main thread.
557 // This message loop should be destructed before the RenderThreadImpl
559 scoped_ptr
<base::MessageLoop
> main_message_loop_
;
561 // A lazily initiated thread on which file operations are run.
562 scoped_ptr
<base::Thread
> file_thread_
;
564 // May be null if overridden by ContentRendererClient.
565 scoped_ptr
<base::Thread
> compositor_thread_
;
567 // Thread for running multimedia operations (e.g., video decoding).
568 scoped_ptr
<base::Thread
> media_thread_
;
570 // Will point to appropriate task runner after initialization,
571 // regardless of whether |compositor_thread_| is overriden.
572 scoped_refptr
<base::SingleThreadTaskRunner
> compositor_task_runner_
;
574 // Pool of workers used for raster operations (e.g., tile rasterization).
575 scoped_refptr
<RasterWorkerPool
> raster_worker_pool_
;
577 base::CancelableCallback
<void(const IPC::Message
&)> main_input_callback_
;
578 scoped_refptr
<IPC::MessageFilter
> input_event_filter_
;
579 scoped_ptr
<InputHandlerManager
> input_handler_manager_
;
580 scoped_refptr
<CompositorForwardingMessageFilter
> compositor_message_filter_
;
582 scoped_refptr
<BluetoothMessageFilter
> bluetooth_message_filter_
;
584 scoped_refptr
<cc_blink::ContextProviderWebContext
>
585 shared_main_thread_contexts_
;
587 base::ObserverList
<RenderProcessObserver
> observers_
;
589 scoped_refptr
<ContextProviderCommandBuffer
> gpu_va_context_provider_
;
591 scoped_ptr
<AudioRendererMixerManager
> audio_renderer_mixer_manager_
;
592 scoped_ptr
<media::AudioHardwareConfig
> audio_hardware_config_
;
594 HistogramCustomizer histogram_customizer_
;
596 scoped_ptr
<base::MemoryPressureListener
> memory_pressure_listener_
;
598 #if defined(ENABLE_WEBRTC)
599 scoped_ptr
<WebRTCIdentityService
> webrtc_identity_service_
;
602 scoped_ptr
<MemoryObserver
> memory_observer_
;
604 scoped_refptr
<base::SingleThreadTaskRunner
>
605 main_thread_compositor_task_runner_
;
607 scoped_refptr
<ResourceSchedulingFilter
> resource_scheduling_filter_
;
609 // Compositor settings.
610 bool is_gpu_rasterization_enabled_
;
611 bool is_gpu_rasterization_forced_
;
612 int gpu_rasterization_msaa_sample_count_
;
613 bool is_lcd_text_enabled_
;
614 bool is_distance_field_text_enabled_
;
615 bool is_zero_copy_enabled_
;
616 bool is_one_copy_enabled_
;
617 bool is_elastic_overscroll_enabled_
;
618 unsigned use_image_texture_target_
;
619 bool is_gather_pixel_refs_enabled_
;
621 class PendingRenderFrameConnect
622 : public base::RefCounted
<PendingRenderFrameConnect
> {
624 PendingRenderFrameConnect(
626 mojo::InterfaceRequest
<mojo::ServiceProvider
> services
,
627 mojo::ServiceProviderPtr exposed_services
);
629 mojo::InterfaceRequest
<mojo::ServiceProvider
>& services() {
633 mojo::ServiceProviderPtr
& exposed_services() { return exposed_services_
; }
636 friend class base::RefCounted
<PendingRenderFrameConnect
>;
638 ~PendingRenderFrameConnect();
640 // Mojo error handler.
641 void OnConnectionError();
644 mojo::InterfaceRequest
<mojo::ServiceProvider
> services_
;
645 mojo::ServiceProviderPtr exposed_services_
;
648 typedef std::map
<int, scoped_refptr
<PendingRenderFrameConnect
>>
649 PendingRenderFrameConnectMap
;
650 PendingRenderFrameConnectMap pending_render_frame_connects_
;
652 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl
);
655 #if defined(COMPILER_MSVC)
659 } // namespace content
661 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_