blob: bc1002be57d447121e9332c1d5531cd6dfaaa4bc [file] [log] [blame]
[email protected]d3d6325d2012-01-03 21:17:361// Copyright (c) 2012 The Chromium Authors. All rights reserved.
license.botbf09a502008-08-24 00:55:552// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
initial.commit09911bf2008-07-26 23:55:294
[email protected]f1a29a02011-10-06 23:08:445#ifndef CONTENT_RENDERER_RENDER_THREAD_IMPL_H_
6#define CONTENT_RENDERER_RENDER_THREAD_IMPL_H_
initial.commit09911bf2008-07-26 23:55:297
[email protected]6779aa12011-03-29 17:32:248#include <set>
[email protected]b68d5ed2009-04-16 02:41:289#include <string>
[email protected]1bc83062009-02-06 00:16:3710#include <vector>
11
[email protected]5071cb22013-07-10 02:19:0612#include "base/memory/memory_pressure_listener.h"
[email protected]e6e30ac2014-01-13 21:24:3913#include "base/metrics/user_metrics_action.h"
[email protected]1223d6ef2011-03-28 16:47:5014#include "base/observer_list.h"
[email protected]21aa99682013-06-11 07:17:0115#include "base/strings/string16.h"
[email protected]88105162013-12-05 01:02:1216#include "base/threading/thread_checker.h"
[email protected]abb522162013-06-28 01:54:1617#include "base/timer/timer.h"
[email protected]037fce02009-01-22 01:42:1518#include "build/build_config.h"
[email protected]10208ea2013-06-06 20:08:0319#include "content/child/child_thread.h"
[email protected]8d128d62011-09-13 22:11:5720#include "content/common/content_export.h"
[email protected]c26ad882012-02-07 06:41:2021#include "content/common/gpu/client/gpu_channel_host.h"
[email protected]a2c351d2014-07-14 23:42:3922#include "content/common/gpu/gpu_result_codes.h"
[email protected]526476902011-10-06 20:34:0623#include "content/public/renderer/render_thread.h"
[email protected]d7ff5fb2014-05-29 19:50:2524#include "net/base/network_change_notifier.h"
25#include "third_party/WebKit/public/platform/WebConnectionType.h"
[email protected]08397d52011-02-05 01:53:3826#include "ui/gfx/native_widget_types.h"
initial.commit09911bf2008-07-26 23:55:2927
[email protected]291857a2014-01-23 17:49:1128#if defined(OS_MACOSX)
29#include "third_party/WebKit/public/web/mac/WebScrollbarTheme.h"
30#endif
31
[email protected]c29b7ff2013-03-06 03:51:0432class GrContext;
[email protected]39008c02009-02-11 23:59:2533class SkBitmap;
[email protected]9a292e22012-10-22 15:19:3134struct ViewMsg_New_Params;
[email protected]0ec90d522014-03-12 16:28:1935struct WorkerProcessMsg_CreateWorker_Params;
[email protected]46f36a492010-07-28 19:36:4136
[email protected]180ef242013-11-07 06:50:4637namespace blink {
[email protected]ca998e5e2013-08-06 14:59:0938class WebGamepads;
[email protected]c29b7ff2013-03-06 03:51:0439class WebGraphicsContext3D;
[email protected]d8cd8372012-03-09 10:49:5140class WebMediaStreamCenter;
41class WebMediaStreamCenterClient;
[email protected]b7c7bcf2009-10-03 07:07:3442}
43
[email protected]64ffa0442011-10-03 22:08:3644namespace base {
45class MessageLoopProxy;
skyostil457b0a12014-09-09 10:12:0746class SingleThreadTaskRunner;
[email protected]64ffa0442011-10-03 22:08:3647class Thread;
48}
49
[email protected]c29b7ff2013-03-06 03:51:0450namespace cc {
51class ContextProvider;
52}
53
[email protected]1842fe22012-08-13 23:24:3554namespace IPC {
55class ForwardingMessageFilter;
[email protected]74122042014-04-25 00:07:3056class MessageFilter;
[email protected]1842fe22012-08-13 23:24:3557}
58
[email protected]563d665f2013-02-01 04:42:3959namespace media {
60class AudioHardwareConfig;
[email protected]2329bfc72014-02-28 02:03:2161class GpuVideoAcceleratorFactories;
[email protected]563d665f2013-02-01 04:42:3962}
63
[email protected]e9ff79c2012-10-19 21:31:2664namespace v8 {
65class Extension;
66}
67
[email protected]c29b7ff2013-03-06 03:51:0468namespace webkit {
69namespace gpu {
[email protected]9cdd7152014-01-14 14:20:4370class ContextProviderWebContext;
[email protected]c29b7ff2013-03-06 03:51:0471class GrContextForWebGraphicsContext3D;
72}
73}
74
[email protected]64ffa0442011-10-03 22:08:3675namespace content {
[email protected]e9ff79c2012-10-19 21:31:2676
[email protected]eb398192012-10-22 20:16:1977class AppCacheDispatcher;
[email protected]da9f30a2014-06-18 19:39:0478class AecDumpMessageFilter;
[email protected]9a292e22012-10-22 15:19:3179class AudioInputMessageFilter;
80class AudioMessageFilter;
[email protected]3958e972012-07-17 00:25:4181class AudioRendererMixerManager;
[email protected]a45c46e2013-03-07 01:04:4682class ContextProviderCommandBuffer;
[email protected]3827e9702012-10-23 06:19:2883class DBMessageFilter;
[email protected]e9ff79c2012-10-19 21:31:2684class DevToolsAgentFilter;
85class DomStorageDispatcher;
[email protected]7670d4332013-11-29 04:35:0086class EmbeddedWorkerDispatcher;
[email protected]eb398192012-10-22 20:16:1987class GpuChannelHost;
88class IndexedDBDispatcher;
[email protected]b0255682013-06-07 21:24:0889class InputEventFilter;
[email protected]ea5f70a2013-03-07 12:30:3690class InputHandlerManager;
[email protected]d8cd8372012-03-09 10:49:5191class MediaStreamCenter;
[email protected]fdeac262014-07-10 12:52:5192class MemoryObserver;
[email protected]0107d8a2014-05-16 10:20:3493class PeerConnectionDependencyFactory;
[email protected]6e068ea2014-02-04 07:05:4794class MidiMessageFilter;
[email protected]d7ff5fb2014-05-29 19:50:2595class NetInfoDispatcher;
[email protected]4761cf12012-09-12 10:37:5596class P2PSocketDispatcher;
[email protected]af089972013-01-10 04:04:4097class PeerConnectionTracker;
[email protected]64ffa0442011-10-03 22:08:3698class RenderProcessObserver;
tfarina556a7232014-10-05 01:02:0999class RendererBlinkPlatformImpl;
100class RendererDemuxerAndroid;
[email protected]9a292e22012-10-22 15:19:31101class VideoCaptureImplManager;
[email protected]eb398192012-10-22 20:16:19102class WebGraphicsContext3DCommandBufferImpl;
[email protected]921480f62013-07-20 03:42:57103class WebRTCIdentityService;
[email protected]cb25aa12012-08-07 19:13:43104
[email protected]f1a29a02011-10-06 23:08:44105// The RenderThreadImpl class represents a background thread where RenderView
initial.commit09911bf2008-07-26 23:55:29106// instances live. The RenderThread supports an API that is used by its
107// consumer to talk indirectly to the RenderViews and supporting objects.
108// Likewise, it provides an API for the RenderViews to talk back to the main
[email protected]770005b2012-04-16 15:58:13109// process (i.e., their corresponding WebContentsImpl).
initial.commit09911bf2008-07-26 23:55:29110//
111// Most of the communication occurs in the form of IPC messages. They are
112// routed to the RenderThread according to the routing IDs of the messages.
113// The routing IDs correspond to RenderView instances.
[email protected]e9ff79c2012-10-19 21:31:26114class CONTENT_EXPORT RenderThreadImpl : public RenderThread,
[email protected]b3e83de2012-02-07 03:33:28115 public ChildThread,
116 public GpuChannelHostFactory {
initial.commit09911bf2008-07-26 23:55:29117 public:
[email protected]f1a29a02011-10-06 23:08:44118 static RenderThreadImpl* current();
[email protected]526476902011-10-06 20:34:06119
[email protected]f1a29a02011-10-06 23:08:44120 RenderThreadImpl();
[email protected]8930d472009-02-21 08:05:28121 // Constructor that's used when running in single process mode.
[email protected]f1a29a02011-10-06 23:08:44122 explicit RenderThreadImpl(const std::string& channel_name);
dcheng6d18e402014-10-21 12:32:52123 ~RenderThreadImpl() override;
124 void Shutdown() override;
initial.commit09911bf2008-07-26 23:55:29125
[email protected]58436a12012-03-21 17:10:26126 // When initializing WebKit, ensure that any schemes needed for the content
127 // module are registered properly. Static to allow sharing with tests.
128 static void RegisterSchemes();
129
[email protected]df9accd2014-03-13 18:18:30130 // Notify V8 that the date/time configuration of the system might have
131 // changed.
132 static void NotifyTimezoneChange();
133
[email protected]e9ff79c2012-10-19 21:31:26134 // RenderThread implementation:
dcheng6d18e402014-10-21 12:32:52135 bool Send(IPC::Message* msg) override;
136 base::MessageLoop* GetMessageLoop() override;
137 IPC::SyncChannel* GetChannel() override;
138 std::string GetLocale() override;
139 IPC::SyncMessageFilter* GetSyncMessageFilter() override;
140 scoped_refptr<base::MessageLoopProxy> GetIOMessageLoopProxy() override;
141 void AddRoute(int32 routing_id, IPC::Listener* listener) override;
142 void RemoveRoute(int32 routing_id) override;
143 int GenerateRoutingID() override;
144 void AddFilter(IPC::MessageFilter* filter) override;
145 void RemoveFilter(IPC::MessageFilter* filter) override;
146 void AddObserver(RenderProcessObserver* observer) override;
147 void RemoveObserver(RenderProcessObserver* observer) override;
148 void SetResourceDispatcherDelegate(
mohan.reddyee0b42a2014-10-08 04:53:14149 ResourceDispatcherDelegate* delegate) override;
dcheng6d18e402014-10-21 12:32:52150 void EnsureWebKitInitialized() override;
151 void RecordAction(const base::UserMetricsAction& action) override;
152 void RecordComputedAction(const std::string& action) override;
153 scoped_ptr<base::SharedMemory> HostAllocateSharedMemoryBuffer(
mohan.reddyee0b42a2014-10-08 04:53:14154 size_t buffer_size) override;
dcheng6d18e402014-10-21 12:32:52155 void RegisterExtension(v8::Extension* extension) override;
156 void ScheduleIdleHandler(int64 initial_delay_ms) override;
157 void IdleHandler() override;
158 int64 GetIdleNotificationDelayInMs() const override;
159 void SetIdleNotificationDelayInMs(
mohan.reddyee0b42a2014-10-08 04:53:14160 int64 idle_notification_delay_in_ms) override;
dcheng6d18e402014-10-21 12:32:52161 void UpdateHistograms(int sequence_number) override;
162 int PostTaskToAllWebWorkers(const base::Closure& closure) override;
163 bool ResolveProxy(const GURL& url, std::string* proxy_list) override;
164 base::WaitableEvent* GetShutdownEvent() override;
[email protected]526476902011-10-06 20:34:06165#if defined(OS_WIN)
mohan.reddyee0b42a2014-10-08 04:53:14166 virtual void PreCacheFont(const LOGFONT& log_font) override;
167 virtual void ReleaseCachedFonts() override;
[email protected]526476902011-10-06 20:34:06168#endif
dcheng6d18e402014-10-21 12:32:52169 ServiceRegistry* GetServiceRegistry() override;
[email protected]1223d6ef2011-03-28 16:47:50170
[email protected]b3e83de2012-02-07 03:33:28171 // Synchronously establish a channel to the GPU plugin if not previously
172 // established or if it has been lost (for example if the GPU plugin crashed).
173 // If there is a pending asynchronous request, it will be completed by the
174 // time this routine returns.
[email protected]96ab016c2013-10-23 00:50:29175 GpuChannelHost* EstablishGpuChannelSync(CauseForGpuLaunch);
[email protected]b3e83de2012-02-07 03:33:28176
177
[email protected]c1f50aa2010-02-18 03:46:57178 // These methods modify how the next message is sent. Normally, when sending
179 // a synchronous message that runs a nested message loop, we need to suspend
180 // callbacks into WebKit. This involves disabling timers and deferring
181 // resource loads. However, there are exceptions when we need to customize
182 // the behavior.
183 void DoNotSuspendWebKitSharedTimer();
184 void DoNotNotifyWebKitOfModalLoop();
185
[email protected]70dee7e2013-05-29 18:28:30186 // True if we are running layout tests. This currently disables forwarding
187 // various status messages to the console, skips network error pages, and
188 // short circuits size update and focus events.
189 bool layout_test_mode() const {
190 return layout_test_mode_;
[email protected]233567d2013-02-27 20:22:02191 }
[email protected]70dee7e2013-05-29 18:28:30192 void set_layout_test_mode(bool layout_test_mode) {
193 layout_test_mode_ = layout_test_mode;
[email protected]ac7f5a02013-03-16 16:14:41194 }
195
tfarina556a7232014-10-05 01:02:09196 RendererBlinkPlatformImpl* blink_platform_impl() const {
197 DCHECK(blink_platform_impl_);
198 return blink_platform_impl_.get();
[email protected]078780b2014-06-20 16:57:06199 }
200
skyostil457b0a12014-09-09 10:12:07201 scoped_refptr<base::SingleThreadTaskRunner>
202 main_thread_compositor_task_runner() const {
203 return main_thread_compositor_task_runner_;
204 }
205
[email protected]1842fe22012-08-13 23:24:35206 IPC::ForwardingMessageFilter* compositor_output_surface_filter() const {
207 return compositor_output_surface_filter_.get();
208 }
209
[email protected]ea5f70a2013-03-07 12:30:36210 InputHandlerManager* input_handler_manager() const {
211 return input_handler_manager_.get();
212 }
213
[email protected]f3150172011-10-22 02:28:45214 // Will be NULL if threaded compositing has not been enabled.
[email protected]ea5f70a2013-03-07 12:30:36215 scoped_refptr<base::MessageLoopProxy> compositor_message_loop_proxy() const {
216 return compositor_message_loop_proxy_;
[email protected]a9fb30aa2011-10-06 06:58:46217 }
218
[email protected]a23530d2014-03-11 06:04:14219 bool is_gpu_rasterization_enabled() const {
220 return is_gpu_rasterization_enabled_;
221 }
222
223 bool is_gpu_rasterization_forced() const {
224 return is_gpu_rasterization_forced_;
225 }
226
227 bool is_impl_side_painting_enabled() const {
228 return is_impl_side_painting_enabled_;
229 }
230
231 bool is_lcd_text_enabled() const { return is_lcd_text_enabled_; }
232
[email protected]b242b142014-05-07 14:48:49233 bool is_distance_field_text_enabled() const {
234 return is_distance_field_text_enabled_;
235 }
236
[email protected]2cccfef2014-05-01 06:05:16237 bool is_zero_copy_enabled() const { return is_zero_copy_enabled_; }
238
239 bool is_one_copy_enabled() const { return is_one_copy_enabled_; }
[email protected]a23530d2014-03-11 06:04:14240
[email protected]f430b5712009-08-21 21:46:31241 AppCacheDispatcher* appcache_dispatcher() const {
242 return appcache_dispatcher_.get();
243 }
244
[email protected]19b49512012-05-30 19:22:09245 DomStorageDispatcher* dom_storage_dispatcher() const {
246 return dom_storage_dispatcher_.get();
247 }
248
[email protected]7670d4332013-11-29 04:35:00249 EmbeddedWorkerDispatcher* embedded_worker_dispatcher() const {
250 return embedded_worker_dispatcher_.get();
251 }
252
[email protected]f7eb0a392011-07-12 10:19:51253 AudioInputMessageFilter* audio_input_message_filter() {
254 return audio_input_message_filter_.get();
255 }
256
257 AudioMessageFilter* audio_message_filter() {
258 return audio_message_filter_.get();
259 }
260
[email protected]6e068ea2014-02-04 07:05:47261 MidiMessageFilter* midi_message_filter() {
[email protected]a9875152013-06-22 04:03:03262 return midi_message_filter_.get();
263 }
[email protected]6ee10bd2012-09-13 09:01:53264
[email protected]6ca6a082013-09-22 20:10:05265#if defined(OS_ANDROID)
266 RendererDemuxerAndroid* renderer_demuxer() {
267 return renderer_demuxer_.get();
268 }
269#endif
270
[email protected]d8cd8372012-03-09 10:49:51271 // Creates the embedder implementation of WebMediaStreamCenter.
272 // The resulting object is owned by WebKit and deleted by WebKit at tear-down.
[email protected]180ef242013-11-07 06:50:46273 blink::WebMediaStreamCenter* CreateMediaStreamCenter(
274 blink::WebMediaStreamCenterClient* client);
[email protected]d8cd8372012-03-09 10:49:51275
[email protected]22fe91d2014-08-12 17:07:12276#if defined(ENABLE_WEBRTC)
[email protected]6ee10bd2012-09-13 09:01:53277 // Returns a factory used for creating RTC PeerConnection objects.
[email protected]0107d8a2014-05-16 10:20:34278 PeerConnectionDependencyFactory* GetPeerConnectionDependencyFactory();
[email protected]6ee10bd2012-09-13 09:01:53279
[email protected]af089972013-01-10 04:04:40280 PeerConnectionTracker* peer_connection_tracker() {
281 return peer_connection_tracker_.get();
282 }
283
[email protected]4761cf12012-09-12 10:37:55284 // Current P2PSocketDispatcher. Set to NULL if P2P API is disabled.
[email protected]e9ff79c2012-10-19 21:31:26285 P2PSocketDispatcher* p2p_socket_dispatcher() {
[email protected]4761cf12012-09-12 10:37:55286 return p2p_socket_dispatcher_.get();
287 }
[email protected]22fe91d2014-08-12 17:07:12288#endif
[email protected]4761cf12012-09-12 10:37:55289
[email protected]80b161a2011-06-27 17:42:11290 VideoCaptureImplManager* video_capture_impl_manager() const {
291 return vc_manager_.get();
292 }
293
[email protected]6217d392010-03-25 22:08:35294 // Get the GPU channel. Returns NULL if the channel is not established or
295 // has been lost.
296 GpuChannelHost* GetGpuChannel();
297
[email protected]c6a7b862010-08-20 22:19:38298 // Returns a MessageLoopProxy instance corresponding to the message loop
299 // of the thread on which file operations should be run. Must be called
300 // on the renderer's main thread.
301 scoped_refptr<base::MessageLoopProxy> GetFileThreadMessageLoopProxy();
302
acolwellb4034942014-08-28 15:42:43303 // Returns a SingleThreadTaskRunner instance corresponding to the message loop
[email protected]c1330c82013-06-06 02:23:25304 // of the thread on which media operations should be run. Must be called
305 // on the renderer's main thread.
acolwellb4034942014-08-28 15:42:43306 scoped_refptr<base::SingleThreadTaskRunner> GetMediaThreadTaskRunner();
[email protected]c1330c82013-06-06 02:23:25307
[email protected]1784b2f2011-11-24 10:53:48308 // Causes the idle handler to skip sending idle notifications
309 // on the two next scheduled calls, so idle notifications are
310 // not sent for at least one notification delay.
311 void PostponeIdleNotification();
312
[email protected]2329bfc72014-02-28 02:03:21313 scoped_refptr<media::GpuVideoAcceleratorFactories> GetGpuFactories();
[email protected]3bb8bb32013-07-11 13:13:03314
[email protected]9cdd7152014-01-14 14:20:43315 scoped_refptr<webkit::gpu::ContextProviderWebContext>
316 SharedMainThreadContextProvider();
[email protected]c29b7ff2013-03-06 03:51:04317
[email protected]3958e972012-07-17 00:25:41318 // AudioRendererMixerManager instance which manages renderer side mixer
319 // instances shared based on configured audio parameters. Lazily created on
320 // first call.
[email protected]e9ff79c2012-10-19 21:31:26321 AudioRendererMixerManager* GetAudioRendererMixerManager();
[email protected]3958e972012-07-17 00:25:41322
[email protected]563d665f2013-02-01 04:42:39323 // AudioHardwareConfig contains audio hardware configuration for
324 // renderer side clients. Creation requires a synchronous IPC call so it is
325 // lazily created on the first call.
326 media::AudioHardwareConfig* GetAudioHardwareConfig();
327
[email protected]feb32372012-11-21 01:14:56328#if defined(OS_WIN)
[email protected]fcf75d42013-12-03 20:11:26329 void PreCacheFontCharacters(const LOGFONT& log_font,
330 const base::string16& str);
[email protected]feb32372012-11-21 01:14:56331#endif
332
[email protected]921480f62013-07-20 03:42:57333#if defined(ENABLE_WEBRTC)
334 WebRTCIdentityService* get_webrtc_identity_service() {
335 return webrtc_identity_service_.get();
336 }
337#endif
338
[email protected]b2d98762012-09-03 17:04:06339 // For producing custom V8 histograms. Custom histograms are produced if all
340 // RenderViews share the same host, and the host is in the pre-specified set
341 // of hosts we want to produce custom diagrams for. The name for a custom
342 // diagram is the name of the corresponding generic diagram plus a
343 // host-specific suffix.
344 class CONTENT_EXPORT HistogramCustomizer {
345 public:
346 HistogramCustomizer();
347 ~HistogramCustomizer();
348
349 // Called when a top frame of a RenderView navigates. This function updates
350 // RenderThreadImpl's information about whether all RenderViews are
351 // displaying a page from the same host. |host| is the host where a
352 // RenderView navigated, and |view_count| is the number of RenderViews in
353 // this process.
354 void RenderViewNavigatedToHost(const std::string& host, size_t view_count);
355
356 // Used for customizing some histograms if all RenderViews share the same
357 // host. Returns the current custom histogram name to use for
358 // |histogram_name|, or |histogram_name| if it shouldn't be customized.
359 std::string ConvertToCustomHistogramName(const char* histogram_name) const;
360
361 private:
362 friend class RenderThreadImplUnittest;
363
364 // Used for updating the information on which is the common host which all
365 // RenderView's share (if any). If there is no common host, this function is
366 // called with an empty string.
367 void SetCommonHost(const std::string& host);
368
369 // The current common host of the RenderViews; empty string if there is no
370 // common host.
371 std::string common_host_;
372 // The corresponding suffix.
373 std::string common_host_histogram_suffix_;
374 // Set of histograms for which we want to produce a custom histogram if
375 // possible.
376 std::set<std::string> custom_histograms_;
377
378 DISALLOW_COPY_AND_ASSIGN(HistogramCustomizer);
379 };
380
381 HistogramCustomizer* histogram_customizer() {
382 return &histogram_customizer_;
383 }
384
[email protected]ca998e5e2013-08-06 14:59:09385 // Retrieve current gamepad data.
[email protected]180ef242013-11-07 06:50:46386 void SampleGamepads(blink::WebGamepads* data);
[email protected]ca998e5e2013-08-06 14:59:09387
[email protected]b2db9272014-01-10 17:42:00388 // Called by a RenderWidget when it is created or destroyed. This
389 // allows the process to know when there are no visible widgets.
390 void WidgetCreated();
391 void WidgetDestroyed();
392 void WidgetHidden();
393 void WidgetRestored();
394
[email protected]a620b132014-04-30 22:39:17395 void AddEmbeddedWorkerRoute(int32 routing_id, IPC::Listener* listener);
396 void RemoveEmbeddedWorkerRoute(int32 routing_id);
[email protected]48e52e42014-03-20 06:58:07397
[email protected]c52a1412014-06-25 06:09:25398 void RegisterPendingRenderFrameConnect(int routing_id,
399 mojo::ScopedMessagePipeHandle handle);
400
[email protected]8930d472009-02-21 08:05:28401 private:
[email protected]57cf97882013-06-26 20:39:01402 // ChildThread
dcheng6d18e402014-10-21 12:32:52403 bool OnControlMessageReceived(const IPC::Message& msg) override;
initial.commit09911bf2008-07-26 23:55:29404
[email protected]57cf97882013-06-26 20:39:01405 // GpuChannelHostFactory implementation:
dcheng6d18e402014-10-21 12:32:52406 bool IsMainThread() override;
407 base::MessageLoop* GetMainLoop() override;
408 scoped_refptr<base::MessageLoopProxy> GetIOLoopProxy() override;
409 scoped_ptr<base::SharedMemory> AllocateSharedMemory(size_t size) override;
410 CreateCommandBufferResult CreateViewCommandBuffer(
[email protected]57cf97882013-06-26 20:39:01411 int32 surface_id,
[email protected]0d78ec0e2014-04-08 23:35:23412 const GPUCreateCommandBufferConfig& init_params,
mohan.reddyee0b42a2014-10-08 04:53:14413 int32 route_id) override;
[email protected]57cf97882013-06-26 20:39:01414
[email protected]42f1d7822009-07-23 18:17:55415 void Init();
initial.commit09911bf2008-07-26 23:55:29416
[email protected]82307f6b2014-08-07 03:30:12417 void OnCreateNewFrame(int routing_id, int parent_routing_id);
418 void OnCreateNewFrameProxy(int routing_id,
419 int parent_routing_id,
420 int render_view_routing_id);
[email protected]367c5c1d2013-03-11 18:59:02421 void OnSetZoomLevelForCurrentURL(const std::string& scheme,
422 const std::string& host,
423 double zoom_level);
[email protected]4e6419c2010-01-15 04:50:34424 void OnCreateNewView(const ViewMsg_New_Params& params);
initial.commit09911bf2008-07-26 23:55:29425 void OnTransferBitmap(const SkBitmap& bitmap, int resource_id);
thestigc4cac8f2014-09-04 21:17:50426#if defined(ENABLE_PLUGINS)
[email protected]b78e168b2009-09-21 22:05:45427 void OnPurgePluginListCache(bool reload_pages);
thestigc4cac8f2014-09-04 21:17:50428#endif
[email protected]8c2a34b2014-06-10 16:27:27429 void OnNetworkTypeChanged(net::NetworkChangeNotifier::ConnectionType type);
[email protected]b3df5a42010-05-11 14:31:09430 void OnGetAccessibilityTree();
[email protected]b69934e2011-10-29 02:51:52431 void OnTempCrashWithData(const GURL& data);
[email protected]df9accd2014-03-13 18:18:30432 void OnUpdateTimezone();
[email protected]5071cb22013-07-10 02:19:06433 void OnMemoryPressure(
434 base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level);
[email protected]b0988b22013-11-08 08:25:58435#if defined(OS_ANDROID)
436 void OnSetWebKitSharedTimersSuspended(bool suspend);
437#endif
438#if defined(OS_MACOSX)
439 void OnUpdateScrollbarTheme(float initial_button_delay,
440 float autoscroll_button_delay,
441 bool jump_on_track_click,
[email protected]291857a2014-01-23 17:49:11442 blink::ScrollerStyle preferred_scroller_style,
[email protected]b0988b22013-11-08 08:25:58443 bool redraw);
444#endif
[email protected]0ec90d522014-03-12 16:28:19445 void OnCreateNewSharedWorker(
446 const WorkerProcessMsg_CreateWorker_Params& params);
[email protected]b3df5a42010-05-11 14:31:09447
[email protected]c29b7ff2013-03-06 03:51:04448 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> CreateOffscreenContext3d();
449
initial.commit09911bf2008-07-26 23:55:29450 // These objects live solely on the render thread.
[email protected]f430b5712009-08-21 21:46:31451 scoped_ptr<AppCacheDispatcher> appcache_dispatcher_;
[email protected]1910fe82012-05-10 00:04:10452 scoped_ptr<DomStorageDispatcher> dom_storage_dispatcher_;
[email protected]31bfae72011-12-16 02:04:38453 scoped_ptr<IndexedDBDispatcher> main_thread_indexed_db_dispatcher_;
tfarina556a7232014-10-05 01:02:09454 scoped_ptr<RendererBlinkPlatformImpl> blink_platform_impl_;
[email protected]7670d4332013-11-29 04:35:00455 scoped_ptr<EmbeddedWorkerDispatcher> embedded_worker_dispatcher_;
[email protected]9291ed12009-07-23 17:33:22456
[email protected]d8cd8372012-03-09 10:49:51457 // Used on the render thread and deleted by WebKit at shutdown.
[email protected]180ef242013-11-07 06:50:46458 blink::WebMediaStreamCenter* media_stream_center_;
[email protected]d8cd8372012-03-09 10:49:51459
[email protected]e2b2d4a2009-10-24 03:32:59460 // Used on the renderer and IPC threads.
[email protected]017022b2009-07-27 23:06:34461 scoped_refptr<DBMessageFilter> db_message_filter_;
[email protected]f7eb0a392011-07-12 10:19:51462 scoped_refptr<AudioInputMessageFilter> audio_input_message_filter_;
463 scoped_refptr<AudioMessageFilter> audio_message_filter_;
[email protected]6e068ea2014-02-04 07:05:47464 scoped_refptr<MidiMessageFilter> midi_message_filter_;
[email protected]6ca6a082013-09-22 20:10:05465#if defined(OS_ANDROID)
466 scoped_refptr<RendererDemuxerAndroid> renderer_demuxer_;
467#endif
[email protected]82622452011-07-22 09:57:20468 scoped_refptr<DevToolsAgentFilter> devtools_agent_message_filter_;
[email protected]017022b2009-07-27 23:06:34469
[email protected]22fe91d2014-08-12 17:07:12470#if defined(ENABLE_WEBRTC)
[email protected]83e0a482014-05-22 18:07:18471 scoped_ptr<PeerConnectionDependencyFactory> peer_connection_factory_;
[email protected]6ee10bd2012-09-13 09:01:53472
[email protected]af089972013-01-10 04:04:40473 // This is used to communicate to the browser process the status
474 // of all the peer connections created in the renderer.
475 scoped_ptr<PeerConnectionTracker> peer_connection_tracker_;
476
[email protected]4761cf12012-09-12 10:37:55477 // Dispatches all P2P sockets.
[email protected]e9ff79c2012-10-19 21:31:26478 scoped_refptr<P2PSocketDispatcher> p2p_socket_dispatcher_;
[email protected]22fe91d2014-08-12 17:07:12479#endif
[email protected]4761cf12012-09-12 10:37:55480
[email protected]45048072014-01-14 13:51:29481 // Used on the render thread.
482 scoped_ptr<VideoCaptureImplManager> vc_manager_;
[email protected]80b161a2011-06-27 17:42:11483
[email protected]da9f30a2014-06-18 19:39:04484 // Used for communicating registering AEC dump consumers with the browser and
485 // receving AEC dump file handles when AEC dump is enabled. An AEC dump is
486 // diagnostic audio data for WebRTC stored locally when enabled by the user in
487 // chrome://webrtc-internals.
488 scoped_refptr<AecDumpMessageFilter> aec_dump_message_filter_;
489
[email protected]bee16aab2009-08-26 15:55:03490 // The count of RenderWidgets running through this thread.
491 int widget_count_;
492
493 // The count of hidden RenderWidgets running through this thread.
494 int hidden_widget_count_;
495
496 // The current value of the idle notification timer delay.
[email protected]6593ae12011-11-14 12:09:44497 int64 idle_notification_delay_in_ms_;
[email protected]bee16aab2009-08-26 15:55:03498
[email protected]1784b2f2011-11-24 10:53:48499 // The number of idle handler calls that skip sending idle notifications.
500 int idle_notifications_to_skip_;
501
[email protected]80fc08c52010-03-09 07:43:50502 bool suspend_webkit_shared_timer_;
503 bool notify_webkit_of_modal_loop_;
[email protected]26e82322014-01-20 14:18:22504 bool webkit_shared_timer_suspended_;
[email protected]c1f50aa2010-02-18 03:46:57505
[email protected]70dee7e2013-05-29 18:28:30506 // The following flag is used to control layout test specific behavior.
507 bool layout_test_mode_;
[email protected]233567d2013-02-27 20:22:02508
[email protected]71d6d852009-12-07 22:12:36509 // Timer that periodically calls IdleHandler.
[email protected]f1a29a02011-10-06 23:08:44510 base::RepeatingTimer<RenderThreadImpl> idle_timer_;
[email protected]71d6d852009-12-07 22:12:36511
[email protected]6217d392010-03-25 22:08:35512 // The channel from the renderer process to the GPU process.
513 scoped_refptr<GpuChannelHost> gpu_channel_;
514
[email protected]57cf97882013-06-26 20:39:01515 // Cache of variables that are needed on the compositor thread by
516 // GpuChannelHostFactory methods.
517 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_;
[email protected]57cf97882013-06-26 20:39:01518
[email protected]c6a7b862010-08-20 22:19:38519 // A lazily initiated thread on which file operations are run.
520 scoped_ptr<base::Thread> file_thread_;
521
[email protected]ea5f70a2013-03-07 12:30:36522 // May be null if overridden by ContentRendererClient.
523 scoped_ptr<base::Thread> compositor_thread_;
524
[email protected]c1330c82013-06-06 02:23:25525 // Thread for running multimedia operations (e.g., video decoding).
526 scoped_ptr<base::Thread> media_thread_;
527
[email protected]ea5f70a2013-03-07 12:30:36528 // Will point to appropriate MessageLoopProxy after initialization,
529 // regardless of whether |compositor_thread_| is overriden.
530 scoped_refptr<base::MessageLoopProxy> compositor_message_loop_proxy_;
531
[email protected]b0255682013-06-07 21:24:08532 // May be null if unused by the |input_handler_manager_|.
533 scoped_refptr<InputEventFilter> input_event_filter_;
[email protected]ea5f70a2013-03-07 12:30:36534 scoped_ptr<InputHandlerManager> input_handler_manager_;
[email protected]1842fe22012-08-13 23:24:35535 scoped_refptr<IPC::ForwardingMessageFilter> compositor_output_surface_filter_;
536
[email protected]807567a2014-08-11 19:48:41537 scoped_refptr<webkit::gpu::ContextProviderWebContext>
538 shared_main_thread_contexts_;
[email protected]c29b7ff2013-03-06 03:51:04539
[email protected]e9ff79c2012-10-19 21:31:26540 ObserverList<RenderProcessObserver> observers_;
[email protected]1223d6ef2011-03-28 16:47:50541
[email protected]93274ae2013-09-19 00:53:55542 scoped_refptr<ContextProviderCommandBuffer> gpu_va_context_provider_;
[email protected]3b2afc32012-06-18 21:31:16543
[email protected]e9ff79c2012-10-19 21:31:26544 scoped_ptr<AudioRendererMixerManager> audio_renderer_mixer_manager_;
[email protected]563d665f2013-02-01 04:42:39545 scoped_ptr<media::AudioHardwareConfig> audio_hardware_config_;
[email protected]3958e972012-07-17 00:25:41546
[email protected]b2d98762012-09-03 17:04:06547 HistogramCustomizer histogram_customizer_;
548
[email protected]5071cb22013-07-10 02:19:06549 scoped_ptr<base::MemoryPressureListener> memory_pressure_listener_;
550
[email protected]22fe91d2014-08-12 17:07:12551#if defined(ENABLE_WEBRTC)
[email protected]921480f62013-07-20 03:42:57552 scoped_ptr<WebRTCIdentityService> webrtc_identity_service_;
[email protected]22fe91d2014-08-12 17:07:12553#endif
[email protected]921480f62013-07-20 03:42:57554
[email protected]fdeac262014-07-10 12:52:51555 scoped_ptr<MemoryObserver> memory_observer_;
556
skyostil457b0a12014-09-09 10:12:07557 scoped_refptr<base::SingleThreadTaskRunner>
558 main_thread_compositor_task_runner_;
skyostil457b0a12014-09-09 10:12:07559
[email protected]a23530d2014-03-11 06:04:14560 // Compositor settings
561 bool is_gpu_rasterization_enabled_;
562 bool is_gpu_rasterization_forced_;
563 bool is_impl_side_painting_enabled_;
564 bool is_lcd_text_enabled_;
[email protected]b242b142014-05-07 14:48:49565 bool is_distance_field_text_enabled_;
[email protected]2cccfef2014-05-01 06:05:16566 bool is_zero_copy_enabled_;
567 bool is_one_copy_enabled_;
[email protected]a23530d2014-03-11 06:04:14568
[email protected]c52a1412014-06-25 06:09:25569 std::map<int, mojo::MessagePipeHandle> pending_render_frame_connects_;
570
[email protected]f1a29a02011-10-06 23:08:44571 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl);
initial.commit09911bf2008-07-26 23:55:29572};
573
[email protected]e9ff79c2012-10-19 21:31:26574} // namespace content
575
[email protected]f1a29a02011-10-06 23:08:44576#endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_