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/callback_forward.h" |
| 13 #include "base/id_map.h" |
12 #include "base/memory/memory_pressure_listener.h" | 14 #include "base/memory/memory_pressure_listener.h" |
13 #include "base/observer_list.h" | 15 #include "base/observer_list.h" |
| 16 #include "base/platform_file.h" |
14 #include "base/strings/string16.h" | 17 #include "base/strings/string16.h" |
15 #include "base/timer/timer.h" | 18 #include "base/timer/timer.h" |
16 #include "build/build_config.h" | 19 #include "build/build_config.h" |
17 #include "content/child/child_thread.h" | 20 #include "content/child/child_thread.h" |
18 #include "content/common/content_export.h" | 21 #include "content/common/content_export.h" |
19 #include "content/common/gpu/client/gpu_channel_host.h" | 22 #include "content/common/gpu/client/gpu_channel_host.h" |
20 #include "content/common/gpu/gpu_process_launch_causes.h" | 23 #include "content/common/gpu/gpu_process_launch_causes.h" |
21 #include "content/public/renderer/render_thread.h" | 24 #include "content/public/renderer/render_thread.h" |
22 #include "content/renderer/media/renderer_gpu_video_decoder_factories.h" | 25 #include "content/renderer/media/renderer_gpu_video_decoder_factories.h" |
23 #include "ipc/ipc_channel_proxy.h" | 26 #include "ipc/ipc_channel_proxy.h" |
| 27 #include "ipc/ipc_platform_file.h" |
24 #include "ui/gfx/native_widget_types.h" | 28 #include "ui/gfx/native_widget_types.h" |
25 | 29 |
26 class GrContext; | 30 class GrContext; |
27 class SkBitmap; | 31 class SkBitmap; |
28 struct ViewMsg_New_Params; | 32 struct ViewMsg_New_Params; |
29 | 33 |
30 namespace WebKit { | 34 namespace WebKit { |
31 class WebGraphicsContext3D; | 35 class WebGraphicsContext3D; |
32 class WebMediaStreamCenter; | 36 class WebMediaStreamCenter; |
33 class WebMediaStreamCenterClient; | 37 class WebMediaStreamCenterClient; |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 DISALLOW_COPY_AND_ASSIGN(HistogramCustomizer); | 342 DISALLOW_COPY_AND_ASSIGN(HistogramCustomizer); |
339 }; | 343 }; |
340 | 344 |
341 HistogramCustomizer* histogram_customizer() { | 345 HistogramCustomizer* histogram_customizer() { |
342 return &histogram_customizer_; | 346 return &histogram_customizer_; |
343 } | 347 } |
344 | 348 |
345 void SetFlingCurveParameters(const std::vector<float>& new_touchpad, | 349 void SetFlingCurveParameters(const std::vector<float>& new_touchpad, |
346 const std::vector<float>& new_touchscreen); | 350 const std::vector<float>& new_touchscreen); |
347 | 351 |
| 352 // Sends an async IPC to open a local file. |
| 353 typedef base::Callback<void (base::PlatformFileError, base::PassPlatformFile)> |
| 354 AsyncOpenFileCallback; |
| 355 void AsyncOpenFile(const base::FilePath& path, |
| 356 int flags, |
| 357 const AsyncOpenFileCallback& callback); |
| 358 |
348 private: | 359 private: |
349 // ChildThread | 360 // ChildThread |
350 virtual bool OnControlMessageReceived(const IPC::Message& msg) OVERRIDE; | 361 virtual bool OnControlMessageReceived(const IPC::Message& msg) OVERRIDE; |
351 | 362 |
352 // GpuChannelHostFactory implementation: | 363 // GpuChannelHostFactory implementation: |
353 virtual bool IsMainThread() OVERRIDE; | 364 virtual bool IsMainThread() OVERRIDE; |
354 virtual base::MessageLoop* GetMainLoop() OVERRIDE; | 365 virtual base::MessageLoop* GetMainLoop() OVERRIDE; |
355 virtual scoped_refptr<base::MessageLoopProxy> GetIOLoopProxy() OVERRIDE; | 366 virtual scoped_refptr<base::MessageLoopProxy> GetIOLoopProxy() OVERRIDE; |
356 virtual base::WaitableEvent* GetShutDownEvent() OVERRIDE; | 367 virtual base::WaitableEvent* GetShutDownEvent() OVERRIDE; |
357 virtual scoped_ptr<base::SharedMemory> AllocateSharedMemory( | 368 virtual scoped_ptr<base::SharedMemory> AllocateSharedMemory( |
(...skipping 12 matching lines...) Expand all Loading... |
370 void OnSetZoomLevelForCurrentURL(const std::string& scheme, | 381 void OnSetZoomLevelForCurrentURL(const std::string& scheme, |
371 const std::string& host, | 382 const std::string& host, |
372 double zoom_level); | 383 double zoom_level); |
373 void OnCreateNewView(const ViewMsg_New_Params& params); | 384 void OnCreateNewView(const ViewMsg_New_Params& params); |
374 void OnTransferBitmap(const SkBitmap& bitmap, int resource_id); | 385 void OnTransferBitmap(const SkBitmap& bitmap, int resource_id); |
375 void OnPurgePluginListCache(bool reload_pages); | 386 void OnPurgePluginListCache(bool reload_pages); |
376 void OnNetworkStateChanged(bool online); | 387 void OnNetworkStateChanged(bool online); |
377 void OnGetAccessibilityTree(); | 388 void OnGetAccessibilityTree(); |
378 void OnTempCrashWithData(const GURL& data); | 389 void OnTempCrashWithData(const GURL& data); |
379 void OnSetWebKitSharedTimersSuspended(bool suspend); | 390 void OnSetWebKitSharedTimersSuspended(bool suspend); |
| 391 void OnAsyncFileOpened(base::PlatformFileError error_code, |
| 392 IPC::PlatformFileForTransit file_for_transit, |
| 393 int message_id); |
380 void OnMemoryPressure( | 394 void OnMemoryPressure( |
381 base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level); | 395 base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level); |
382 | 396 |
383 void IdleHandlerInForegroundTab(); | 397 void IdleHandlerInForegroundTab(); |
384 | 398 |
385 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> CreateOffscreenContext3d(); | 399 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> CreateOffscreenContext3d(); |
386 | 400 |
387 // These objects live solely on the render thread. | 401 // These objects live solely on the render thread. |
388 scoped_ptr<AppCacheDispatcher> appcache_dispatcher_; | 402 scoped_ptr<AppCacheDispatcher> appcache_dispatcher_; |
389 scoped_ptr<DomStorageDispatcher> dom_storage_dispatcher_; | 403 scoped_ptr<DomStorageDispatcher> dom_storage_dispatcher_; |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 | 495 |
482 scoped_ptr<AudioRendererMixerManager> audio_renderer_mixer_manager_; | 496 scoped_ptr<AudioRendererMixerManager> audio_renderer_mixer_manager_; |
483 scoped_ptr<media::AudioHardwareConfig> audio_hardware_config_; | 497 scoped_ptr<media::AudioHardwareConfig> audio_hardware_config_; |
484 | 498 |
485 HistogramCustomizer histogram_customizer_; | 499 HistogramCustomizer histogram_customizer_; |
486 | 500 |
487 scoped_ptr<base::MemoryPressureListener> memory_pressure_listener_; | 501 scoped_ptr<base::MemoryPressureListener> memory_pressure_listener_; |
488 | 502 |
489 scoped_ptr<WebRTCIdentityService> webrtc_identity_service_; | 503 scoped_ptr<WebRTCIdentityService> webrtc_identity_service_; |
490 | 504 |
| 505 IDMap<AsyncOpenFileCallback> pending_async_open_files_; |
| 506 |
491 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl); | 507 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl); |
492 }; | 508 }; |
493 | 509 |
494 } // namespace content | 510 } // namespace content |
495 | 511 |
496 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ | 512 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ |
OLD | NEW |