Update frame around SAML IdP pages to new GAIA style
[chromium-blink-merge.git] / content / renderer / render_thread_impl.h
blobf897fccb017d9af9008a2dbfaea3c398c3335a83
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 v8 {
74 class Extension;
77 namespace content {
79 class AppCacheDispatcher;
80 class AecDumpMessageFilter;
81 class AudioInputMessageFilter;
82 class AudioMessageFilter;
83 class AudioRendererMixerManager;
84 class BrowserPluginManager;
85 class CacheStorageDispatcher;
86 class CompositorForwardingMessageFilter;
87 class ContextProviderCommandBuffer;
88 class DBMessageFilter;
89 class DevToolsAgentFilter;
90 class DomStorageDispatcher;
91 class EmbeddedWorkerDispatcher;
92 class GpuChannelHost;
93 class IndexedDBDispatcher;
94 class InputHandlerManager;
95 class MediaStreamCenter;
96 class MemoryObserver;
97 class MidiMessageFilter;
98 class NetInfoDispatcher;
99 class P2PSocketDispatcher;
100 class PeerConnectionDependencyFactory;
101 class PeerConnectionTracker;
102 class RenderProcessObserver;
103 class RendererBlinkPlatformImpl;
104 class RendererDemuxerAndroid;
105 class RendererScheduler;
106 class ResourceDispatchThrottler;
107 class ResourceSchedulingFilter;
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)
117 #endif
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) {
133 public:
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
146 // changed.
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 int GetGpuRasterizationMSAASampleCount() override;
188 bool IsLcdTextEnabled() override;
189 bool IsDistanceFieldTextEnabled() override;
190 bool IsZeroCopyEnabled() override;
191 bool IsOneCopyEnabled() override;
192 bool IsElasticOverscrollEnabled() override;
193 bool UseSingleThreadScheduler() override;
194 uint32 GetImageTextureTarget() override;
195 scoped_refptr<base::SingleThreadTaskRunner>
196 GetCompositorMainThreadTaskRunner() override;
197 scoped_refptr<base::SingleThreadTaskRunner>
198 GetCompositorImplThreadTaskRunner() override;
199 gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override;
200 RendererScheduler* GetRendererScheduler() override;
201 cc::ContextProvider* GetSharedMainThreadContextProvider() override;
202 scoped_ptr<cc::BeginFrameSource> CreateExternalBeginFrameSource(
203 int routing_id) override;
204 cc::TaskGraphRunner* GetTaskGraphRunner() override;
205 bool IsGatherPixelRefsEnabled() override;
207 // Synchronously establish a channel to the GPU plugin if not previously
208 // established or if it has been lost (for example if the GPU plugin crashed).
209 // If there is a pending asynchronous request, it will be completed by the
210 // time this routine returns.
211 GpuChannelHost* EstablishGpuChannelSync(CauseForGpuLaunch);
214 // These methods modify how the next message is sent. Normally, when sending
215 // a synchronous message that runs a nested message loop, we need to suspend
216 // callbacks into WebKit. This involves disabling timers and deferring
217 // resource loads. However, there are exceptions when we need to customize
218 // the behavior.
219 void DoNotSuspendWebKitSharedTimer();
220 void DoNotNotifyWebKitOfModalLoop();
222 // True if we are running layout tests. This currently disables forwarding
223 // various status messages to the console, skips network error pages, and
224 // short circuits size update and focus events.
225 bool layout_test_mode() const {
226 return layout_test_mode_;
228 void set_layout_test_mode(bool layout_test_mode) {
229 layout_test_mode_ = layout_test_mode;
232 RendererBlinkPlatformImpl* blink_platform_impl() const {
233 DCHECK(blink_platform_impl_);
234 return blink_platform_impl_.get();
237 CompositorForwardingMessageFilter* compositor_message_filter() const {
238 return compositor_message_filter_.get();
241 InputHandlerManager* input_handler_manager() const {
242 return input_handler_manager_.get();
245 // Will be null if threaded compositing has not been enabled.
246 scoped_refptr<base::MessageLoopProxy> compositor_message_loop_proxy() const {
247 return compositor_message_loop_proxy_;
250 AppCacheDispatcher* appcache_dispatcher() const {
251 return appcache_dispatcher_.get();
254 DomStorageDispatcher* dom_storage_dispatcher() const {
255 return dom_storage_dispatcher_.get();
258 EmbeddedWorkerDispatcher* embedded_worker_dispatcher() const {
259 return embedded_worker_dispatcher_.get();
262 AudioInputMessageFilter* audio_input_message_filter() {
263 return audio_input_message_filter_.get();
266 AudioMessageFilter* audio_message_filter() {
267 return audio_message_filter_.get();
270 MidiMessageFilter* midi_message_filter() {
271 return midi_message_filter_.get();
274 #if defined(OS_ANDROID)
275 RendererDemuxerAndroid* renderer_demuxer() {
276 return renderer_demuxer_.get();
278 #endif
280 // Creates the embedder implementation of WebMediaStreamCenter.
281 // The resulting object is owned by WebKit and deleted by WebKit at tear-down.
282 blink::WebMediaStreamCenter* CreateMediaStreamCenter(
283 blink::WebMediaStreamCenterClient* client);
285 BrowserPluginManager* browser_plugin_manager() const {
286 return browser_plugin_manager_.get();
289 #if defined(ENABLE_WEBRTC)
290 // Returns a factory used for creating RTC PeerConnection objects.
291 PeerConnectionDependencyFactory* GetPeerConnectionDependencyFactory();
293 PeerConnectionTracker* peer_connection_tracker() {
294 return peer_connection_tracker_.get();
297 // Current P2PSocketDispatcher. Set to NULL if P2P API is disabled.
298 P2PSocketDispatcher* p2p_socket_dispatcher() {
299 return p2p_socket_dispatcher_.get();
301 #endif
303 VideoCaptureImplManager* video_capture_impl_manager() const {
304 return vc_manager_.get();
307 // Get the GPU channel. Returns NULL if the channel is not established or
308 // has been lost.
309 GpuChannelHost* GetGpuChannel();
311 // Returns a MessageLoopProxy instance corresponding to the message loop
312 // of the thread on which file operations should be run. Must be called
313 // on the renderer's main thread.
314 scoped_refptr<base::MessageLoopProxy> GetFileThreadMessageLoopProxy();
316 // Returns a SingleThreadTaskRunner instance corresponding to the message loop
317 // of the thread on which media operations should be run. Must be called
318 // on the renderer's main thread.
319 scoped_refptr<base::SingleThreadTaskRunner> GetMediaThreadTaskRunner();
321 // Causes the idle handler to skip sending idle notifications
322 // on the two next scheduled calls, so idle notifications are
323 // not sent for at least one notification delay.
324 void PostponeIdleNotification();
326 scoped_refptr<media::GpuVideoAcceleratorFactories> GetGpuFactories();
328 scoped_refptr<cc_blink::ContextProviderWebContext>
329 SharedMainThreadContextProvider();
331 // AudioRendererMixerManager instance which manages renderer side mixer
332 // instances shared based on configured audio parameters. Lazily created on
333 // first call.
334 AudioRendererMixerManager* GetAudioRendererMixerManager();
336 // AudioHardwareConfig contains audio hardware configuration for
337 // renderer side clients. Creation requires a synchronous IPC call so it is
338 // lazily created on the first call.
339 media::AudioHardwareConfig* GetAudioHardwareConfig();
341 #if defined(OS_WIN)
342 void PreCacheFontCharacters(const LOGFONT& log_font,
343 const base::string16& str);
344 #endif
346 #if defined(ENABLE_WEBRTC)
347 WebRTCIdentityService* get_webrtc_identity_service() {
348 return webrtc_identity_service_.get();
350 #endif
352 // For producing custom V8 histograms. Custom histograms are produced if all
353 // RenderViews share the same host, and the host is in the pre-specified set
354 // of hosts we want to produce custom diagrams for. The name for a custom
355 // diagram is the name of the corresponding generic diagram plus a
356 // host-specific suffix.
357 class CONTENT_EXPORT HistogramCustomizer {
358 public:
359 HistogramCustomizer();
360 ~HistogramCustomizer();
362 // Called when a top frame of a RenderView navigates. This function updates
363 // RenderThreadImpl's information about whether all RenderViews are
364 // displaying a page from the same host. |host| is the host where a
365 // RenderView navigated, and |view_count| is the number of RenderViews in
366 // this process.
367 void RenderViewNavigatedToHost(const std::string& host, size_t view_count);
369 // Used for customizing some histograms if all RenderViews share the same
370 // host. Returns the current custom histogram name to use for
371 // |histogram_name|, or |histogram_name| if it shouldn't be customized.
372 std::string ConvertToCustomHistogramName(const char* histogram_name) const;
374 private:
375 friend class RenderThreadImplUnittest;
377 // Used for updating the information on which is the common host which all
378 // RenderView's share (if any). If there is no common host, this function is
379 // called with an empty string.
380 void SetCommonHost(const std::string& host);
382 // The current common host of the RenderViews; empty string if there is no
383 // common host.
384 std::string common_host_;
385 // The corresponding suffix.
386 std::string common_host_histogram_suffix_;
387 // Set of histograms for which we want to produce a custom histogram if
388 // possible.
389 std::set<std::string> custom_histograms_;
391 DISALLOW_COPY_AND_ASSIGN(HistogramCustomizer);
394 HistogramCustomizer* histogram_customizer() {
395 return &histogram_customizer_;
398 // Retrieve current gamepad data.
399 void SampleGamepads(blink::WebGamepads* data);
401 // Called by a RenderWidget when it is created or destroyed. This
402 // allows the process to know when there are no visible widgets.
403 void WidgetCreated();
404 // Note: A widget must not be hidden when it is destroyed - ensure that
405 // WidgetRestored is called before WidgetDestroyed for any hidden widget.
406 void WidgetDestroyed();
407 void WidgetHidden();
408 void WidgetRestored();
410 void AddEmbeddedWorkerRoute(int32 routing_id, IPC::Listener* listener);
411 void RemoveEmbeddedWorkerRoute(int32 routing_id);
413 void RegisterPendingRenderFrameConnect(
414 int routing_id,
415 mojo::InterfaceRequest<mojo::ServiceProvider> services,
416 mojo::ServiceProviderPtr exposed_services);
418 protected:
419 virtual void SetResourceDispatchTaskQueue(
420 const scoped_refptr<base::SingleThreadTaskRunner>& resource_task_queue);
422 private:
423 // ChildThread
424 bool OnControlMessageReceived(const IPC::Message& msg) override;
426 // GpuChannelHostFactory implementation:
427 bool IsMainThread() override;
428 base::MessageLoop* GetMainLoop() override;
429 scoped_refptr<base::MessageLoopProxy> GetIOLoopProxy() override;
430 scoped_ptr<base::SharedMemory> AllocateSharedMemory(size_t size) override;
431 CreateCommandBufferResult CreateViewCommandBuffer(
432 int32 surface_id,
433 const GPUCreateCommandBufferConfig& init_params,
434 int32 route_id) override;
436 void Init();
438 void OnCreateNewFrame(int routing_id,
439 int parent_routing_id,
440 int proxy_routing_id,
441 const FrameReplicationState& replicated_state,
442 FrameMsg_NewFrame_WidgetParams params);
443 void OnCreateNewFrameProxy(int routing_id,
444 int parent_routing_id,
445 int render_view_routing_id,
446 const FrameReplicationState& replicated_state);
447 void OnSetZoomLevelForCurrentURL(const std::string& scheme,
448 const std::string& host,
449 double zoom_level);
450 void OnCreateNewView(const ViewMsg_New_Params& params);
451 void OnTransferBitmap(const SkBitmap& bitmap, int resource_id);
452 #if defined(ENABLE_PLUGINS)
453 void OnPurgePluginListCache(bool reload_pages);
454 #endif
455 void OnNetworkTypeChanged(net::NetworkChangeNotifier::ConnectionType type);
456 void OnGetAccessibilityTree();
457 void OnTempCrashWithData(const GURL& data);
458 void OnUpdateTimezone();
459 void OnMemoryPressure(
460 base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level);
461 #if defined(OS_ANDROID)
462 void OnSetWebKitSharedTimersSuspended(bool suspend);
463 #endif
464 #if defined(OS_MACOSX)
465 void OnUpdateScrollbarTheme(float initial_button_delay,
466 float autoscroll_button_delay,
467 bool jump_on_track_click,
468 blink::ScrollerStyle preferred_scroller_style,
469 bool redraw);
470 #endif
471 void OnCreateNewSharedWorker(
472 const WorkerProcessMsg_CreateWorker_Params& params);
473 bool RendererIsHidden() const;
474 void OnRendererHidden();
475 void OnRendererVisible();
477 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> CreateOffscreenContext3d();
479 // These objects live solely on the render thread.
480 scoped_ptr<AppCacheDispatcher> appcache_dispatcher_;
481 scoped_ptr<DomStorageDispatcher> dom_storage_dispatcher_;
482 scoped_ptr<IndexedDBDispatcher> main_thread_indexed_db_dispatcher_;
483 scoped_ptr<RendererScheduler> renderer_scheduler_;
484 scoped_ptr<RendererBlinkPlatformImpl> blink_platform_impl_;
485 scoped_ptr<ResourceDispatchThrottler> resource_dispatch_throttler_;
486 scoped_ptr<CacheStorageDispatcher> main_thread_cache_storage_dispatcher_;
487 scoped_ptr<EmbeddedWorkerDispatcher> embedded_worker_dispatcher_;
489 // Used on the render thread and deleted by WebKit at shutdown.
490 blink::WebMediaStreamCenter* media_stream_center_;
492 // Used on the renderer and IPC threads.
493 scoped_refptr<DBMessageFilter> db_message_filter_;
494 scoped_refptr<AudioInputMessageFilter> audio_input_message_filter_;
495 scoped_refptr<AudioMessageFilter> audio_message_filter_;
496 scoped_refptr<MidiMessageFilter> midi_message_filter_;
497 #if defined(OS_ANDROID)
498 scoped_refptr<RendererDemuxerAndroid> renderer_demuxer_;
499 #endif
500 scoped_refptr<DevToolsAgentFilter> devtools_agent_message_filter_;
501 scoped_ptr<V8SamplingProfiler> v8_sampling_profiler_;
503 scoped_ptr<BrowserPluginManager> browser_plugin_manager_;
505 #if defined(ENABLE_WEBRTC)
506 scoped_ptr<PeerConnectionDependencyFactory> peer_connection_factory_;
508 // This is used to communicate to the browser process the status
509 // of all the peer connections created in the renderer.
510 scoped_ptr<PeerConnectionTracker> peer_connection_tracker_;
512 // Dispatches all P2P sockets.
513 scoped_refptr<P2PSocketDispatcher> p2p_socket_dispatcher_;
514 #endif
516 // Used on the render thread.
517 scoped_ptr<VideoCaptureImplManager> vc_manager_;
519 // Used for communicating registering AEC dump consumers with the browser and
520 // receving AEC dump file handles when AEC dump is enabled. An AEC dump is
521 // diagnostic audio data for WebRTC stored locally when enabled by the user in
522 // chrome://webrtc-internals.
523 scoped_refptr<AecDumpMessageFilter> aec_dump_message_filter_;
525 // The count of RenderWidgets running through this thread.
526 int widget_count_;
528 // The count of hidden RenderWidgets running through this thread.
529 int hidden_widget_count_;
531 // The current value of the idle notification timer delay.
532 int64 idle_notification_delay_in_ms_;
534 // The number of idle handler calls that skip sending idle notifications.
535 int idle_notifications_to_skip_;
537 bool suspend_webkit_shared_timer_;
538 bool notify_webkit_of_modal_loop_;
539 bool webkit_shared_timer_suspended_;
541 // The following flag is used to control layout test specific behavior.
542 bool layout_test_mode_;
544 // Timer that periodically calls IdleHandler.
545 base::RepeatingTimer<RenderThreadImpl> idle_timer_;
547 // The channel from the renderer process to the GPU process.
548 scoped_refptr<GpuChannelHost> gpu_channel_;
550 // Cache of variables that are needed on the compositor thread by
551 // GpuChannelHostFactory methods.
552 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_;
554 // The message loop of the renderer main thread.
555 // This message loop should be destructed before the RenderThreadImpl
556 // shuts down Blink.
557 scoped_ptr<base::MessageLoop> main_message_loop_;
559 // A lazily initiated thread on which file operations are run.
560 scoped_ptr<base::Thread> file_thread_;
562 // May be null if overridden by ContentRendererClient.
563 scoped_ptr<base::Thread> compositor_thread_;
565 // Thread for running multimedia operations (e.g., video decoding).
566 scoped_ptr<base::Thread> media_thread_;
568 // Will point to appropriate MessageLoopProxy after initialization,
569 // regardless of whether |compositor_thread_| is overriden.
570 scoped_refptr<base::MessageLoopProxy> compositor_message_loop_proxy_;
572 // Threads used by compositor for rasterization.
573 ScopedVector<base::SimpleThread> compositor_raster_threads_;
575 base::CancelableCallback<void(const IPC::Message&)> main_input_callback_;
576 scoped_refptr<IPC::MessageFilter> input_event_filter_;
577 scoped_ptr<InputHandlerManager> input_handler_manager_;
578 scoped_refptr<CompositorForwardingMessageFilter> compositor_message_filter_;
580 scoped_refptr<cc_blink::ContextProviderWebContext>
581 shared_main_thread_contexts_;
583 ObserverList<RenderProcessObserver> observers_;
585 scoped_refptr<ContextProviderCommandBuffer> gpu_va_context_provider_;
587 scoped_ptr<AudioRendererMixerManager> audio_renderer_mixer_manager_;
588 scoped_ptr<media::AudioHardwareConfig> audio_hardware_config_;
590 HistogramCustomizer histogram_customizer_;
592 scoped_ptr<base::MemoryPressureListener> memory_pressure_listener_;
594 #if defined(ENABLE_WEBRTC)
595 scoped_ptr<WebRTCIdentityService> webrtc_identity_service_;
596 #endif
598 scoped_ptr<MemoryObserver> memory_observer_;
600 scoped_refptr<base::SingleThreadTaskRunner>
601 main_thread_compositor_task_runner_;
603 scoped_refptr<ResourceSchedulingFilter> resource_scheduling_filter_;
605 scoped_ptr<cc::TaskGraphRunner> compositor_task_graph_runner_;
607 // Compositor settings.
608 bool is_gpu_rasterization_enabled_;
609 bool is_gpu_rasterization_forced_;
610 int gpu_rasterization_msaa_sample_count_;
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 {
623 public:
624 PendingRenderFrameConnect(
625 int routing_id,
626 mojo::InterfaceRequest<mojo::ServiceProvider> services,
627 mojo::ServiceProviderPtr exposed_services);
629 mojo::InterfaceRequest<mojo::ServiceProvider>& services() {
630 return services_;
633 mojo::ServiceProviderPtr& exposed_services() { return exposed_services_; }
635 private:
636 friend class base::RefCounted<PendingRenderFrameConnect>;
638 ~PendingRenderFrameConnect() override;
640 void OnConnectionError() override;
642 int routing_id_;
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)
655 #pragma warning(pop)
656 #endif
658 } // namespace content
660 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_