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/metrics/user_metrics_action.h" | 13 #include "base/metrics/user_metrics_action.h" |
14 #include "base/observer_list.h" | 14 #include "base/observer_list.h" |
15 #include "base/process/process_handle.h" | |
16 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" |
17 #include "base/threading/thread_checker.h" | 16 #include "base/threading/thread_checker.h" |
18 #include "base/timer/timer.h" | 17 #include "base/timer/timer.h" |
19 #include "build/build_config.h" | 18 #include "build/build_config.h" |
20 #include "content/child/child_thread.h" | 19 #include "content/child/child_thread.h" |
21 #include "content/common/content_export.h" | 20 #include "content/common/content_export.h" |
22 #include "content/common/gpu/client/gpu_channel_host.h" | 21 #include "content/common/gpu/client/gpu_channel_host.h" |
23 #include "content/public/renderer/render_thread.h" | 22 #include "content/public/renderer/render_thread.h" |
24 #include "content/renderer/media/renderer_gpu_video_accelerator_factories.h" | 23 #include "content/renderer/media/renderer_gpu_video_accelerator_factories.h" |
25 #include "ipc/ipc_channel_proxy.h" | 24 #include "ipc/ipc_channel_proxy.h" |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 HistogramCustomizer* histogram_customizer() { | 332 HistogramCustomizer* histogram_customizer() { |
334 return &histogram_customizer_; | 333 return &histogram_customizer_; |
335 } | 334 } |
336 | 335 |
337 void SetFlingCurveParameters(const std::vector<float>& new_touchpad, | 336 void SetFlingCurveParameters(const std::vector<float>& new_touchpad, |
338 const std::vector<float>& new_touchscreen); | 337 const std::vector<float>& new_touchscreen); |
339 | 338 |
340 // Retrieve current gamepad data. | 339 // Retrieve current gamepad data. |
341 void SampleGamepads(blink::WebGamepads* data); | 340 void SampleGamepads(blink::WebGamepads* data); |
342 | 341 |
343 // DO NOT USE THIS METHOD! | |
344 // TODO(kbr): remove: crbug.com/333501 | |
345 base::ProcessId renderer_process_id() const; | |
346 | |
347 // Called by a RenderWidget when it is created or destroyed. This | 342 // Called by a RenderWidget when it is created or destroyed. This |
348 // allows the process to know when there are no visible widgets. | 343 // allows the process to know when there are no visible widgets. |
349 void WidgetCreated(); | 344 void WidgetCreated(); |
350 void WidgetDestroyed(); | 345 void WidgetDestroyed(); |
351 void WidgetHidden(); | 346 void WidgetHidden(); |
352 void WidgetRestored(); | 347 void WidgetRestored(); |
353 | 348 |
354 private: | 349 private: |
355 // ChildThread | 350 // ChildThread |
356 virtual bool OnControlMessageReceived(const IPC::Message& msg) OVERRIDE; | 351 virtual bool OnControlMessageReceived(const IPC::Message& msg) OVERRIDE; |
(...skipping 22 matching lines...) Expand all Loading... |
379 | 374 |
380 void OnSetZoomLevelForCurrentURL(const std::string& scheme, | 375 void OnSetZoomLevelForCurrentURL(const std::string& scheme, |
381 const std::string& host, | 376 const std::string& host, |
382 double zoom_level); | 377 double zoom_level); |
383 void OnCreateNewView(const ViewMsg_New_Params& params); | 378 void OnCreateNewView(const ViewMsg_New_Params& params); |
384 void OnTransferBitmap(const SkBitmap& bitmap, int resource_id); | 379 void OnTransferBitmap(const SkBitmap& bitmap, int resource_id); |
385 void OnPurgePluginListCache(bool reload_pages); | 380 void OnPurgePluginListCache(bool reload_pages); |
386 void OnNetworkStateChanged(bool online); | 381 void OnNetworkStateChanged(bool online); |
387 void OnGetAccessibilityTree(); | 382 void OnGetAccessibilityTree(); |
388 void OnTempCrashWithData(const GURL& data); | 383 void OnTempCrashWithData(const GURL& data); |
389 void OnSetRendererProcessID(base::ProcessId process_id); | |
390 void OnMemoryPressure( | 384 void OnMemoryPressure( |
391 base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level); | 385 base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level); |
392 #if defined(OS_ANDROID) | 386 #if defined(OS_ANDROID) |
393 void OnSetWebKitSharedTimersSuspended(bool suspend); | 387 void OnSetWebKitSharedTimersSuspended(bool suspend); |
394 #endif | 388 #endif |
395 #if defined(OS_MACOSX) | 389 #if defined(OS_MACOSX) |
396 void OnUpdateScrollbarTheme(float initial_button_delay, | 390 void OnUpdateScrollbarTheme(float initial_button_delay, |
397 float autoscroll_button_delay, | 391 float autoscroll_button_delay, |
398 bool jump_on_track_click, | 392 bool jump_on_track_click, |
399 bool redraw); | 393 bool redraw); |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 scoped_ptr<media::AudioHardwareConfig> audio_hardware_config_; | 488 scoped_ptr<media::AudioHardwareConfig> audio_hardware_config_; |
495 | 489 |
496 HistogramCustomizer histogram_customizer_; | 490 HistogramCustomizer histogram_customizer_; |
497 | 491 |
498 scoped_ptr<base::MemoryPressureListener> memory_pressure_listener_; | 492 scoped_ptr<base::MemoryPressureListener> memory_pressure_listener_; |
499 | 493 |
500 scoped_ptr<WebRTCIdentityService> webrtc_identity_service_; | 494 scoped_ptr<WebRTCIdentityService> webrtc_identity_service_; |
501 | 495 |
502 scoped_ptr<GamepadSharedMemoryReader> gamepad_shared_memory_reader_; | 496 scoped_ptr<GamepadSharedMemoryReader> gamepad_shared_memory_reader_; |
503 | 497 |
504 base::ProcessId renderer_process_id_; | |
505 | |
506 // TODO(reveman): Allow AllocateGpuMemoryBuffer to be called from | 498 // TODO(reveman): Allow AllocateGpuMemoryBuffer to be called from |
507 // multiple threads. Current allocation mechanism for IOSurface | 499 // multiple threads. Current allocation mechanism for IOSurface |
508 // backed GpuMemoryBuffers prevent this. crbug.com/325045 | 500 // backed GpuMemoryBuffers prevent this. crbug.com/325045 |
509 base::ThreadChecker allocate_gpu_memory_buffer_thread_checker_; | 501 base::ThreadChecker allocate_gpu_memory_buffer_thread_checker_; |
510 | 502 |
511 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl); | 503 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl); |
512 }; | 504 }; |
513 | 505 |
514 } // namespace content | 506 } // namespace content |
515 | 507 |
516 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ | 508 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ |
OLD | NEW |