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 "media/base/audio_hardware_config.h"
29 #include "net/base/network_change_notifier.h"
30 #include "third_party/WebKit/public/platform/WebConnectionType.h"
31 #include "ui/gfx/native_widget_types.h"
33 #if defined(OS_MACOSX)
34 #include "third_party/WebKit/public/web/mac/WebScrollbarTheme.h"
39 struct FrameMsg_NewFrame_WidgetParams
;
40 struct ViewMsg_New_Params
;
41 struct WorkerProcessMsg_CreateWorker_Params
;
45 class WebGraphicsContext3D
;
46 class WebMediaStreamCenter
;
47 class WebMediaStreamCenterClient
;
51 class MessageLoopProxy
;
52 class SingleThreadTaskRunner
;
57 class ContextProvider
;
58 class TaskGraphRunner
;
62 class ContextProviderWebContext
;
70 class GpuVideoAcceleratorFactories
;
79 class AppCacheDispatcher
;
80 class AecDumpMessageFilter
;
81 class AudioInputMessageFilter
;
82 class AudioMessageFilter
;
83 class AudioRendererMixerManager
;
84 class BrowserPluginManager
;
85 class CompositorForwardingMessageFilter
;
86 class ContextProviderCommandBuffer
;
87 class DBMessageFilter
;
88 class DevToolsAgentFilter
;
89 class DomStorageDispatcher
;
90 class EmbeddedWorkerDispatcher
;
92 class IndexedDBDispatcher
;
93 class InputHandlerManager
;
94 class MediaStreamCenter
;
96 class MidiMessageFilter
;
97 class NetInfoDispatcher
;
98 class P2PSocketDispatcher
;
99 class PeerConnectionDependencyFactory
;
100 class PeerConnectionTracker
;
101 class RenderProcessObserver
;
102 class RendererBlinkPlatformImpl
;
103 class RendererDemuxerAndroid
;
104 class RendererScheduler
;
105 class ResourceDispatchThrottler
;
106 class ResourceSchedulingFilter
;
107 class ServiceWorkerCacheStorageDispatcher
;
108 class V8SamplingProfiler
;
109 class VideoCaptureImplManager
;
110 class WebGraphicsContext3DCommandBufferImpl
;
111 class WebRTCIdentityService
;
113 #if defined(COMPILER_MSVC)
114 // See explanation for other RenderViewHostImpl which is the same issue.
115 #pragma warning(push)
116 #pragma warning(disable: 4250)
119 // The RenderThreadImpl class represents a background thread where RenderView
120 // instances live. The RenderThread supports an API that is used by its
121 // consumer to talk indirectly to the RenderViews and supporting objects.
122 // Likewise, it provides an API for the RenderViews to talk back to the main
123 // process (i.e., their corresponding WebContentsImpl).
125 // Most of the communication occurs in the form of IPC messages. They are
126 // routed to the RenderThread according to the routing IDs of the messages.
127 // The routing IDs correspond to RenderView instances.
128 class CONTENT_EXPORT RenderThreadImpl
129 : public RenderThread
,
130 public ChildThreadImpl
,
131 public GpuChannelHostFactory
,
132 NON_EXPORTED_BASE(public CompositorDependencies
) {
134 static RenderThreadImpl
* current();
136 explicit RenderThreadImpl(const InProcessChildThreadParams
& params
);
137 explicit RenderThreadImpl(scoped_ptr
<base::MessageLoop
> main_message_loop
);
138 ~RenderThreadImpl() override
;
139 void Shutdown() override
;
141 // When initializing WebKit, ensure that any schemes needed for the content
142 // module are registered properly. Static to allow sharing with tests.
143 static void RegisterSchemes();
145 // Notify V8 that the date/time configuration of the system might have
147 static void NotifyTimezoneChange();
149 // RenderThread implementation:
150 bool Send(IPC::Message
* msg
) override
;
151 scoped_refptr
<base::SingleThreadTaskRunner
> GetTaskRunner() override
;
152 IPC::SyncChannel
* GetChannel() override
;
153 std::string
GetLocale() override
;
154 IPC::SyncMessageFilter
* GetSyncMessageFilter() override
;
155 scoped_refptr
<base::MessageLoopProxy
> GetIOMessageLoopProxy() override
;
156 void AddRoute(int32 routing_id
, IPC::Listener
* listener
) override
;
157 void RemoveRoute(int32 routing_id
) override
;
158 int GenerateRoutingID() override
;
159 void AddFilter(IPC::MessageFilter
* filter
) override
;
160 void RemoveFilter(IPC::MessageFilter
* filter
) override
;
161 void AddObserver(RenderProcessObserver
* observer
) override
;
162 void RemoveObserver(RenderProcessObserver
* observer
) override
;
163 void SetResourceDispatcherDelegate(
164 ResourceDispatcherDelegate
* delegate
) override
;
165 void EnsureWebKitInitialized() override
;
166 void RecordAction(const base::UserMetricsAction
& action
) override
;
167 void RecordComputedAction(const std::string
& action
) override
;
168 scoped_ptr
<base::SharedMemory
> HostAllocateSharedMemoryBuffer(
169 size_t buffer_size
) override
;
170 cc::SharedBitmapManager
* GetSharedBitmapManager() override
;
171 void RegisterExtension(v8::Extension
* extension
) override
;
172 void ScheduleIdleHandler(int64 initial_delay_ms
) override
;
173 void IdleHandler() override
;
174 int64
GetIdleNotificationDelayInMs() const override
;
175 void SetIdleNotificationDelayInMs(
176 int64 idle_notification_delay_in_ms
) override
;
177 void UpdateHistograms(int sequence_number
) override
;
178 int PostTaskToAllWebWorkers(const base::Closure
& closure
) override
;
179 bool ResolveProxy(const GURL
& url
, std::string
* proxy_list
) override
;
180 base::WaitableEvent
* GetShutdownEvent() override
;
181 ServiceRegistry
* GetServiceRegistry() override
;
183 // CompositorDependencies implementation.
184 bool IsImplSidePaintingEnabled() override
;
185 bool IsGpuRasterizationForced() override
;
186 bool IsGpuRasterizationEnabled() override
;
187 bool IsThreadedGpuRasterizationEnabled() override
;
188 int GetGpuRasterizationMSAASampleCount() override
;
189 bool IsLcdTextEnabled() override
;
190 bool IsDistanceFieldTextEnabled() override
;
191 bool IsZeroCopyEnabled() override
;
192 bool IsOneCopyEnabled() override
;
193 bool IsElasticOverscrollEnabled() override
;
194 bool UseSingleThreadScheduler() override
;
195 uint32
GetImageTextureTarget() override
;
196 scoped_refptr
<base::SingleThreadTaskRunner
>
197 GetCompositorMainThreadTaskRunner() override
;
198 scoped_refptr
<base::SingleThreadTaskRunner
>
199 GetCompositorImplThreadTaskRunner() override
;
200 gpu::GpuMemoryBufferManager
* GetGpuMemoryBufferManager() override
;
201 RendererScheduler
* GetRendererScheduler() override
;
202 cc::ContextProvider
* GetSharedMainThreadContextProvider() override
;
203 scoped_ptr
<cc::BeginFrameSource
> CreateExternalBeginFrameSource(
204 int routing_id
) override
;
205 cc::TaskGraphRunner
* GetTaskGraphRunner() override
;
206 bool IsGatherPixelRefsEnabled() override
;
208 // Synchronously establish a channel to the GPU plugin if not previously
209 // established or if it has been lost (for example if the GPU plugin crashed).
210 // If there is a pending asynchronous request, it will be completed by the
211 // time this routine returns.
212 GpuChannelHost
* EstablishGpuChannelSync(CauseForGpuLaunch
);
215 // These methods modify how the next message is sent. Normally, when sending
216 // a synchronous message that runs a nested message loop, we need to suspend
217 // callbacks into WebKit. This involves disabling timers and deferring
218 // resource loads. However, there are exceptions when we need to customize
220 void DoNotSuspendWebKitSharedTimer();
221 void DoNotNotifyWebKitOfModalLoop();
223 // True if we are running layout tests. This currently disables forwarding
224 // various status messages to the console, skips network error pages, and
225 // short circuits size update and focus events.
226 bool layout_test_mode() const {
227 return layout_test_mode_
;
229 void set_layout_test_mode(bool layout_test_mode
) {
230 layout_test_mode_
= layout_test_mode
;
233 RendererBlinkPlatformImpl
* blink_platform_impl() const {
234 DCHECK(blink_platform_impl_
);
235 return blink_platform_impl_
.get();
238 CompositorForwardingMessageFilter
* compositor_message_filter() const {
239 return compositor_message_filter_
.get();
242 InputHandlerManager
* input_handler_manager() const {
243 return input_handler_manager_
.get();
246 // Will be null if threaded compositing has not been enabled.
247 scoped_refptr
<base::MessageLoopProxy
> compositor_message_loop_proxy() const {
248 return compositor_message_loop_proxy_
;
251 AppCacheDispatcher
* appcache_dispatcher() const {
252 return appcache_dispatcher_
.get();
255 DomStorageDispatcher
* dom_storage_dispatcher() const {
256 return dom_storage_dispatcher_
.get();
259 EmbeddedWorkerDispatcher
* embedded_worker_dispatcher() const {
260 return embedded_worker_dispatcher_
.get();
263 AudioInputMessageFilter
* audio_input_message_filter() {
264 return audio_input_message_filter_
.get();
267 AudioMessageFilter
* audio_message_filter() {
268 return audio_message_filter_
.get();
271 MidiMessageFilter
* midi_message_filter() {
272 return midi_message_filter_
.get();
275 #if defined(OS_ANDROID)
276 RendererDemuxerAndroid
* renderer_demuxer() {
277 return renderer_demuxer_
.get();
281 // Creates the embedder implementation of WebMediaStreamCenter.
282 // The resulting object is owned by WebKit and deleted by WebKit at tear-down.
283 blink::WebMediaStreamCenter
* CreateMediaStreamCenter(
284 blink::WebMediaStreamCenterClient
* client
);
286 BrowserPluginManager
* browser_plugin_manager() const {
287 return browser_plugin_manager_
.get();
290 #if defined(ENABLE_WEBRTC)
291 // Returns a factory used for creating RTC PeerConnection objects.
292 PeerConnectionDependencyFactory
* GetPeerConnectionDependencyFactory();
294 PeerConnectionTracker
* peer_connection_tracker() {
295 return peer_connection_tracker_
.get();
298 // Current P2PSocketDispatcher. Set to NULL if P2P API is disabled.
299 P2PSocketDispatcher
* p2p_socket_dispatcher() {
300 return p2p_socket_dispatcher_
.get();
304 VideoCaptureImplManager
* video_capture_impl_manager() const {
305 return vc_manager_
.get();
308 // Get the GPU channel. Returns NULL if the channel is not established or
310 GpuChannelHost
* GetGpuChannel();
312 // Returns a MessageLoopProxy instance corresponding to the message loop
313 // of the thread on which file operations should be run. Must be called
314 // on the renderer's main thread.
315 scoped_refptr
<base::MessageLoopProxy
> GetFileThreadMessageLoopProxy();
317 // Returns a SingleThreadTaskRunner instance corresponding to the message loop
318 // of the thread on which media operations should be run. Must be called
319 // on the renderer's main thread.
320 scoped_refptr
<base::SingleThreadTaskRunner
> GetMediaThreadTaskRunner();
322 // Causes the idle handler to skip sending idle notifications
323 // on the two next scheduled calls, so idle notifications are
324 // not sent for at least one notification delay.
325 void PostponeIdleNotification();
327 scoped_refptr
<media::GpuVideoAcceleratorFactories
> GetGpuFactories();
329 scoped_refptr
<cc_blink::ContextProviderWebContext
>
330 SharedMainThreadContextProvider();
332 // AudioRendererMixerManager instance which manages renderer side mixer
333 // instances shared based on configured audio parameters. Lazily created on
335 AudioRendererMixerManager
* GetAudioRendererMixerManager();
337 // AudioHardwareConfig contains audio hardware configuration for
338 // renderer side clients. Creation requires a synchronous IPC call so it is
339 // lazily created on the first call.
340 media::AudioHardwareConfig
* GetAudioHardwareConfig();
343 void PreCacheFontCharacters(const LOGFONT
& log_font
,
344 const base::string16
& str
);
347 #if defined(ENABLE_WEBRTC)
348 WebRTCIdentityService
* get_webrtc_identity_service() {
349 return webrtc_identity_service_
.get();
353 // For producing custom V8 histograms. Custom histograms are produced if all
354 // RenderViews share the same host, and the host is in the pre-specified set
355 // of hosts we want to produce custom diagrams for. The name for a custom
356 // diagram is the name of the corresponding generic diagram plus a
357 // host-specific suffix.
358 class CONTENT_EXPORT HistogramCustomizer
{
360 HistogramCustomizer();
361 ~HistogramCustomizer();
363 // Called when a top frame of a RenderView navigates. This function updates
364 // RenderThreadImpl's information about whether all RenderViews are
365 // displaying a page from the same host. |host| is the host where a
366 // RenderView navigated, and |view_count| is the number of RenderViews in
368 void RenderViewNavigatedToHost(const std::string
& host
, size_t view_count
);
370 // Used for customizing some histograms if all RenderViews share the same
371 // host. Returns the current custom histogram name to use for
372 // |histogram_name|, or |histogram_name| if it shouldn't be customized.
373 std::string
ConvertToCustomHistogramName(const char* histogram_name
) const;
376 friend class RenderThreadImplUnittest
;
378 // Used for updating the information on which is the common host which all
379 // RenderView's share (if any). If there is no common host, this function is
380 // called with an empty string.
381 void SetCommonHost(const std::string
& host
);
383 // The current common host of the RenderViews; empty string if there is no
385 std::string common_host_
;
386 // The corresponding suffix.
387 std::string common_host_histogram_suffix_
;
388 // Set of histograms for which we want to produce a custom histogram if
390 std::set
<std::string
> custom_histograms_
;
392 DISALLOW_COPY_AND_ASSIGN(HistogramCustomizer
);
395 HistogramCustomizer
* histogram_customizer() {
396 return &histogram_customizer_
;
399 // Retrieve current gamepad data.
400 void SampleGamepads(blink::WebGamepads
* data
);
402 // Called by a RenderWidget when it is created or destroyed. This
403 // allows the process to know when there are no visible widgets.
404 void WidgetCreated();
405 void WidgetDestroyed();
407 void WidgetRestored();
409 void AddEmbeddedWorkerRoute(int32 routing_id
, IPC::Listener
* listener
);
410 void RemoveEmbeddedWorkerRoute(int32 routing_id
);
412 void RegisterPendingRenderFrameConnect(
414 mojo::InterfaceRequest
<mojo::ServiceProvider
> services
,
415 mojo::ServiceProviderPtr exposed_services
);
418 virtual void SetResourceDispatchTaskQueue(
419 const scoped_refptr
<base::SingleThreadTaskRunner
>& resource_task_queue
);
423 bool OnControlMessageReceived(const IPC::Message
& msg
) override
;
425 // GpuChannelHostFactory implementation:
426 bool IsMainThread() override
;
427 base::MessageLoop
* GetMainLoop() override
;
428 scoped_refptr
<base::MessageLoopProxy
> GetIOLoopProxy() override
;
429 scoped_ptr
<base::SharedMemory
> AllocateSharedMemory(size_t size
) override
;
430 CreateCommandBufferResult
CreateViewCommandBuffer(
432 const GPUCreateCommandBufferConfig
& init_params
,
433 int32 route_id
) override
;
437 void OnCreateNewFrame(int routing_id
,
438 int parent_routing_id
,
439 int proxy_routing_id
,
440 const FrameReplicationState
& replicated_state
,
441 FrameMsg_NewFrame_WidgetParams params
);
442 void OnCreateNewFrameProxy(int routing_id
,
443 int parent_routing_id
,
444 int render_view_routing_id
,
445 const FrameReplicationState
& replicated_state
);
446 void OnSetZoomLevelForCurrentURL(const std::string
& scheme
,
447 const std::string
& host
,
449 void OnCreateNewView(const ViewMsg_New_Params
& params
);
450 void OnTransferBitmap(const SkBitmap
& bitmap
, int resource_id
);
451 #if defined(ENABLE_PLUGINS)
452 void OnPurgePluginListCache(bool reload_pages
);
454 void OnNetworkTypeChanged(net::NetworkChangeNotifier::ConnectionType type
);
455 void OnGetAccessibilityTree();
456 void OnSetAudioHardwareConfig(const media::AudioParameters
& input
,
457 const media::AudioParameters
& output
);
458 void OnTempCrashWithData(const GURL
& data
);
459 void OnUpdateTimezone();
460 void OnMemoryPressure(
461 base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level
);
462 #if defined(OS_ANDROID)
463 void OnSetWebKitSharedTimersSuspended(bool suspend
);
465 #if defined(OS_MACOSX)
466 void OnUpdateScrollbarTheme(float initial_button_delay
,
467 float autoscroll_button_delay
,
468 bool jump_on_track_click
,
469 blink::ScrollerStyle preferred_scroller_style
,
472 void OnCreateNewSharedWorker(
473 const WorkerProcessMsg_CreateWorker_Params
& params
);
475 scoped_ptr
<WebGraphicsContext3DCommandBufferImpl
> CreateOffscreenContext3d();
477 // These objects live solely on the render thread.
478 scoped_ptr
<AppCacheDispatcher
> appcache_dispatcher_
;
479 scoped_ptr
<DomStorageDispatcher
> dom_storage_dispatcher_
;
480 scoped_ptr
<IndexedDBDispatcher
> main_thread_indexed_db_dispatcher_
;
481 scoped_ptr
<RendererScheduler
> renderer_scheduler_
;
482 scoped_ptr
<RendererBlinkPlatformImpl
> blink_platform_impl_
;
483 scoped_ptr
<ResourceDispatchThrottler
> resource_dispatch_throttler_
;
484 scoped_ptr
<ServiceWorkerCacheStorageDispatcher
>
485 main_thread_cache_storage_dispatcher_
;
486 scoped_ptr
<EmbeddedWorkerDispatcher
> embedded_worker_dispatcher_
;
488 // Used on the render thread and deleted by WebKit at shutdown.
489 blink::WebMediaStreamCenter
* media_stream_center_
;
491 // Used on the renderer and IPC threads.
492 scoped_refptr
<DBMessageFilter
> db_message_filter_
;
493 scoped_refptr
<AudioInputMessageFilter
> audio_input_message_filter_
;
494 scoped_refptr
<AudioMessageFilter
> audio_message_filter_
;
495 scoped_refptr
<MidiMessageFilter
> midi_message_filter_
;
496 #if defined(OS_ANDROID)
497 scoped_refptr
<RendererDemuxerAndroid
> renderer_demuxer_
;
499 scoped_refptr
<DevToolsAgentFilter
> devtools_agent_message_filter_
;
500 scoped_ptr
<V8SamplingProfiler
> v8_sampling_profiler_
;
502 scoped_ptr
<BrowserPluginManager
> browser_plugin_manager_
;
504 #if defined(ENABLE_WEBRTC)
505 scoped_ptr
<PeerConnectionDependencyFactory
> peer_connection_factory_
;
507 // This is used to communicate to the browser process the status
508 // of all the peer connections created in the renderer.
509 scoped_ptr
<PeerConnectionTracker
> peer_connection_tracker_
;
511 // Dispatches all P2P sockets.
512 scoped_refptr
<P2PSocketDispatcher
> p2p_socket_dispatcher_
;
515 // Used on the render thread.
516 scoped_ptr
<VideoCaptureImplManager
> vc_manager_
;
518 // Used for communicating registering AEC dump consumers with the browser and
519 // receving AEC dump file handles when AEC dump is enabled. An AEC dump is
520 // diagnostic audio data for WebRTC stored locally when enabled by the user in
521 // chrome://webrtc-internals.
522 scoped_refptr
<AecDumpMessageFilter
> aec_dump_message_filter_
;
524 // The count of RenderWidgets running through this thread.
527 // The count of hidden RenderWidgets running through this thread.
528 int hidden_widget_count_
;
530 // The current value of the idle notification timer delay.
531 int64 idle_notification_delay_in_ms_
;
533 // The number of idle handler calls that skip sending idle notifications.
534 int idle_notifications_to_skip_
;
536 bool suspend_webkit_shared_timer_
;
537 bool notify_webkit_of_modal_loop_
;
538 bool webkit_shared_timer_suspended_
;
540 // The following flag is used to control layout test specific behavior.
541 bool layout_test_mode_
;
543 // Timer that periodically calls IdleHandler.
544 base::RepeatingTimer
<RenderThreadImpl
> idle_timer_
;
546 // The channel from the renderer process to the GPU process.
547 scoped_refptr
<GpuChannelHost
> gpu_channel_
;
549 // Cache of variables that are needed on the compositor thread by
550 // GpuChannelHostFactory methods.
551 scoped_refptr
<base::MessageLoopProxy
> io_message_loop_proxy_
;
553 // The message loop of the renderer main thread.
554 // This message loop should be destructed before the RenderThreadImpl
556 scoped_ptr
<base::MessageLoop
> main_message_loop_
;
558 // A lazily initiated thread on which file operations are run.
559 scoped_ptr
<base::Thread
> file_thread_
;
561 // May be null if overridden by ContentRendererClient.
562 scoped_ptr
<base::Thread
> compositor_thread_
;
564 // Thread for running multimedia operations (e.g., video decoding).
565 scoped_ptr
<base::Thread
> media_thread_
;
567 // Will point to appropriate MessageLoopProxy after initialization,
568 // regardless of whether |compositor_thread_| is overriden.
569 scoped_refptr
<base::MessageLoopProxy
> compositor_message_loop_proxy_
;
571 // Threads used by compositor for rasterization.
572 ScopedVector
<base::SimpleThread
> compositor_raster_threads_
;
574 base::CancelableCallback
<void(const IPC::Message
&)> main_input_callback_
;
575 scoped_refptr
<IPC::MessageFilter
> input_event_filter_
;
576 scoped_ptr
<InputHandlerManager
> input_handler_manager_
;
577 scoped_refptr
<CompositorForwardingMessageFilter
> compositor_message_filter_
;
579 scoped_refptr
<cc_blink::ContextProviderWebContext
>
580 shared_main_thread_contexts_
;
582 ObserverList
<RenderProcessObserver
> observers_
;
584 scoped_refptr
<ContextProviderCommandBuffer
> gpu_va_context_provider_
;
586 scoped_ptr
<AudioRendererMixerManager
> audio_renderer_mixer_manager_
;
587 media::AudioHardwareConfig audio_hardware_config_
;
589 HistogramCustomizer histogram_customizer_
;
591 scoped_ptr
<base::MemoryPressureListener
> memory_pressure_listener_
;
593 #if defined(ENABLE_WEBRTC)
594 scoped_ptr
<WebRTCIdentityService
> webrtc_identity_service_
;
597 scoped_ptr
<MemoryObserver
> memory_observer_
;
599 scoped_refptr
<base::SingleThreadTaskRunner
>
600 main_thread_compositor_task_runner_
;
602 scoped_refptr
<ResourceSchedulingFilter
> resource_scheduling_filter_
;
604 scoped_ptr
<cc::TaskGraphRunner
> compositor_task_graph_runner_
;
606 // Compositor settings.
607 bool is_gpu_rasterization_enabled_
;
608 bool is_gpu_rasterization_forced_
;
609 int gpu_rasterization_msaa_sample_count_
;
610 bool is_threaded_gpu_rasterization_enabled_
;
611 bool is_impl_side_painting_enabled_
;
612 bool is_lcd_text_enabled_
;
613 bool is_distance_field_text_enabled_
;
614 bool is_zero_copy_enabled_
;
615 bool is_one_copy_enabled_
;
616 bool is_elastic_overscroll_enabled_
;
617 unsigned use_image_texture_target_
;
618 bool is_gather_pixel_refs_enabled_
;
620 class PendingRenderFrameConnect
621 : public base::RefCounted
<PendingRenderFrameConnect
>,
622 public mojo::ErrorHandler
{
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() override
;
640 void OnConnectionError() override
;
643 mojo::InterfaceRequest
<mojo::ServiceProvider
> services_
;
644 mojo::ServiceProviderPtr exposed_services_
;
647 typedef std::map
<int, scoped_refptr
<PendingRenderFrameConnect
>>
648 PendingRenderFrameConnectMap
;
649 PendingRenderFrameConnectMap pending_render_frame_connects_
;
651 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl
);
654 #if defined(COMPILER_MSVC)
658 } // namespace content
660 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_