OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ |
6 #define CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ | 6 #define CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/memory/memory_pressure_listener.h" | 12 #include "base/memory/memory_pressure_listener.h" |
13 #include "base/observer_list.h" | 13 #include "base/observer_list.h" |
| 14 #include "base/process/process_handle.h" |
14 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" |
15 #include "base/timer/timer.h" | 16 #include "base/timer/timer.h" |
16 #include "build/build_config.h" | 17 #include "build/build_config.h" |
17 #include "content/child/child_thread.h" | 18 #include "content/child/child_thread.h" |
18 #include "content/common/content_export.h" | 19 #include "content/common/content_export.h" |
19 #include "content/common/gpu/client/gpu_channel_host.h" | 20 #include "content/common/gpu/client/gpu_channel_host.h" |
20 #include "content/common/gpu/gpu_process_launch_causes.h" | 21 #include "content/common/gpu/gpu_process_launch_causes.h" |
21 #include "content/public/renderer/render_thread.h" | 22 #include "content/public/renderer/render_thread.h" |
22 #include "content/renderer/media/renderer_gpu_video_accelerator_factories.h" | 23 #include "content/renderer/media/renderer_gpu_video_accelerator_factories.h" |
23 #include "ipc/ipc_channel_proxy.h" | 24 #include "ipc/ipc_channel_proxy.h" |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 HistogramCustomizer* histogram_customizer() { | 337 HistogramCustomizer* histogram_customizer() { |
337 return &histogram_customizer_; | 338 return &histogram_customizer_; |
338 } | 339 } |
339 | 340 |
340 void SetFlingCurveParameters(const std::vector<float>& new_touchpad, | 341 void SetFlingCurveParameters(const std::vector<float>& new_touchpad, |
341 const std::vector<float>& new_touchscreen); | 342 const std::vector<float>& new_touchscreen); |
342 | 343 |
343 // Retrieve current gamepad data. | 344 // Retrieve current gamepad data. |
344 void SampleGamepads(WebKit::WebGamepads* data); | 345 void SampleGamepads(WebKit::WebGamepads* data); |
345 | 346 |
| 347 // Get the browser process's notion of the renderer process's ID. |
| 348 // This is the first argument to RenderWidgetHost::FromID. Ideally |
| 349 // this would be available on all platforms via base::Process. |
| 350 base::ProcessId renderer_process_id() const; |
| 351 |
346 private: | 352 private: |
347 // ChildThread | 353 // ChildThread |
348 virtual bool OnControlMessageReceived(const IPC::Message& msg) OVERRIDE; | 354 virtual bool OnControlMessageReceived(const IPC::Message& msg) OVERRIDE; |
349 | 355 |
350 // GpuChannelHostFactory implementation: | 356 // GpuChannelHostFactory implementation: |
351 virtual bool IsMainThread() OVERRIDE; | 357 virtual bool IsMainThread() OVERRIDE; |
352 virtual base::MessageLoop* GetMainLoop() OVERRIDE; | 358 virtual base::MessageLoop* GetMainLoop() OVERRIDE; |
353 virtual scoped_refptr<base::MessageLoopProxy> GetIOLoopProxy() OVERRIDE; | 359 virtual scoped_refptr<base::MessageLoopProxy> GetIOLoopProxy() OVERRIDE; |
354 virtual base::WaitableEvent* GetShutDownEvent() OVERRIDE; | 360 virtual base::WaitableEvent* GetShutDownEvent() OVERRIDE; |
355 virtual scoped_ptr<base::SharedMemory> AllocateSharedMemory( | 361 virtual scoped_ptr<base::SharedMemory> AllocateSharedMemory( |
(...skipping 11 matching lines...) Expand all Loading... |
367 | 373 |
368 void OnSetZoomLevelForCurrentURL(const std::string& scheme, | 374 void OnSetZoomLevelForCurrentURL(const std::string& scheme, |
369 const std::string& host, | 375 const std::string& host, |
370 double zoom_level); | 376 double zoom_level); |
371 void OnCreateNewView(const ViewMsg_New_Params& params); | 377 void OnCreateNewView(const ViewMsg_New_Params& params); |
372 void OnTransferBitmap(const SkBitmap& bitmap, int resource_id); | 378 void OnTransferBitmap(const SkBitmap& bitmap, int resource_id); |
373 void OnPurgePluginListCache(bool reload_pages); | 379 void OnPurgePluginListCache(bool reload_pages); |
374 void OnNetworkStateChanged(bool online); | 380 void OnNetworkStateChanged(bool online); |
375 void OnGetAccessibilityTree(); | 381 void OnGetAccessibilityTree(); |
376 void OnTempCrashWithData(const GURL& data); | 382 void OnTempCrashWithData(const GURL& data); |
| 383 void OnSetRendererProcessID(base::ProcessId process_id); |
377 void OnSetWebKitSharedTimersSuspended(bool suspend); | 384 void OnSetWebKitSharedTimersSuspended(bool suspend); |
378 void OnMemoryPressure( | 385 void OnMemoryPressure( |
379 base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level); | 386 base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level); |
380 | 387 |
381 void IdleHandlerInForegroundTab(); | 388 void IdleHandlerInForegroundTab(); |
382 | 389 |
383 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> CreateOffscreenContext3d(); | 390 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> CreateOffscreenContext3d(); |
384 | 391 |
385 // These objects live solely on the render thread. | 392 // These objects live solely on the render thread. |
386 scoped_ptr<AppCacheDispatcher> appcache_dispatcher_; | 393 scoped_ptr<AppCacheDispatcher> appcache_dispatcher_; |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 scoped_ptr<media::AudioHardwareConfig> audio_hardware_config_; | 486 scoped_ptr<media::AudioHardwareConfig> audio_hardware_config_; |
480 | 487 |
481 HistogramCustomizer histogram_customizer_; | 488 HistogramCustomizer histogram_customizer_; |
482 | 489 |
483 scoped_ptr<base::MemoryPressureListener> memory_pressure_listener_; | 490 scoped_ptr<base::MemoryPressureListener> memory_pressure_listener_; |
484 | 491 |
485 scoped_ptr<WebRTCIdentityService> webrtc_identity_service_; | 492 scoped_ptr<WebRTCIdentityService> webrtc_identity_service_; |
486 | 493 |
487 scoped_ptr<GamepadSharedMemoryReader> gamepad_shared_memory_reader_; | 494 scoped_ptr<GamepadSharedMemoryReader> gamepad_shared_memory_reader_; |
488 | 495 |
| 496 base::ProcessId renderer_process_id_; |
| 497 |
489 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl); | 498 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl); |
490 }; | 499 }; |
491 | 500 |
492 } // namespace content | 501 } // namespace content |
493 | 502 |
494 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ | 503 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ |
OLD | NEW |