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_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <queue> | 9 #include <queue> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/observer_list.h" | 13 #include "base/observer_list.h" |
14 #include "base/process/process.h" | 14 #include "base/process/process.h" |
15 #include "base/timer/timer.h" | 15 #include "base/timer/timer.h" |
16 #include "content/browser/child_process_launcher.h" | 16 #include "content/browser/child_process_launcher.h" |
17 #include "content/browser/dom_storage/session_storage_namespace_impl.h" | 17 #include "content/browser/dom_storage/session_storage_namespace_impl.h" |
18 #include "content/browser/power_monitor_message_broadcaster.h" | 18 #include "content/browser/power_monitor_message_broadcaster.h" |
19 #include "content/common/content_export.h" | 19 #include "content/common/content_export.h" |
20 #include "content/common/mojo/service_registry_impl.h" | 20 #include "content/common/mojo/service_registry_impl.h" |
21 #include "content/public/browser/gpu_data_manager_observer.h" | 21 #include "content/public/browser/gpu_data_manager_observer.h" |
22 #include "content/public/browser/render_process_host.h" | 22 #include "content/public/browser/render_process_host.h" |
23 #include "ipc/ipc_channel_proxy.h" | 23 #include "ipc/ipc_channel_proxy.h" |
24 #include "ipc/ipc_platform_file.h" | 24 #include "ipc/ipc_platform_file.h" |
25 #include "mojo/public/cpp/bindings/interface_ptr.h" | 25 #include "mojo/public/cpp/bindings/interface_ptr.h" |
26 #include "ui/gfx/gpu_memory_buffer.h" | 26 #include "ui/gfx/gpu_memory_buffer.h" |
27 | 27 |
28 #if defined(OS_MACOSX) | |
29 #include <IOSurface/IOSurfaceAPI.h> | |
30 #include "base/mac/scoped_cftyperef.h" | |
31 #endif | |
32 | |
33 namespace base { | 28 namespace base { |
34 class CommandLine; | 29 class CommandLine; |
35 class MessageLoop; | 30 class MessageLoop; |
36 } | 31 } |
37 | 32 |
38 namespace gfx { | 33 namespace gfx { |
39 class Size; | 34 class Size; |
40 struct GpuMemoryBufferHandle; | |
41 } | 35 } |
42 | 36 |
43 namespace content { | 37 namespace content { |
44 class AudioRendererHost; | 38 class AudioRendererHost; |
45 class BrowserDemuxerAndroid; | 39 class BrowserDemuxerAndroid; |
46 class GpuMessageFilter; | 40 class GpuMessageFilter; |
47 class MessagePortMessageFilter; | 41 class MessagePortMessageFilter; |
48 class MojoApplicationHost; | 42 class MojoApplicationHost; |
49 #if defined(ENABLE_WEBRTC) | 43 #if defined(ENABLE_WEBRTC) |
50 class P2PSocketDispatcherHost; | 44 class P2PSocketDispatcherHost; |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 void OnUnregisterAecDumpConsumer(int id); | 312 void OnUnregisterAecDumpConsumer(int id); |
319 void RegisterAecDumpConsumerOnUIThread(int id); | 313 void RegisterAecDumpConsumerOnUIThread(int id); |
320 void UnregisterAecDumpConsumerOnUIThread(int id); | 314 void UnregisterAecDumpConsumerOnUIThread(int id); |
321 void EnableAecDumpForId(const base::FilePath& file, int id); | 315 void EnableAecDumpForId(const base::FilePath& file, int id); |
322 // Sends |file_for_transit| to the render process. | 316 // Sends |file_for_transit| to the render process. |
323 void SendAecDumpFileToRenderer(int id, | 317 void SendAecDumpFileToRenderer(int id, |
324 IPC::PlatformFileForTransit file_for_transit); | 318 IPC::PlatformFileForTransit file_for_transit); |
325 void SendDisableAecDumpToRenderer(); | 319 void SendDisableAecDumpToRenderer(); |
326 #endif | 320 #endif |
327 | 321 |
328 // GpuMemoryBuffer allocation handler. | |
329 void OnAllocateGpuMemoryBuffer(uint32 width, | |
330 uint32 height, | |
331 uint32 internalformat, | |
332 uint32 usage, | |
333 IPC::Message* reply); | |
334 void GpuMemoryBufferAllocated(IPC::Message* reply, | |
335 const gfx::GpuMemoryBufferHandle& handle); | |
336 void OnDeletedGpuMemoryBuffer(gfx::GpuMemoryBufferType type, | |
337 const gfx::GpuMemoryBufferId& id); | |
338 | |
339 scoped_ptr<MojoApplicationHost> mojo_application_host_; | 322 scoped_ptr<MojoApplicationHost> mojo_application_host_; |
340 bool mojo_activation_required_; | 323 bool mojo_activation_required_; |
341 | 324 |
342 // The registered IPC listener objects. When this list is empty, we should | 325 // The registered IPC listener objects. When this list is empty, we should |
343 // delete ourselves. | 326 // delete ourselves. |
344 IDMap<IPC::Listener> listeners_; | 327 IDMap<IPC::Listener> listeners_; |
345 | 328 |
346 // The count of currently visible widgets. Since the host can be a container | 329 // The count of currently visible widgets. Since the host can be a container |
347 // for multiple widgets, it uses this count to determine when it should be | 330 // for multiple widgets, it uses this count to determine when it should be |
348 // backgrounded. | 331 // backgrounded. |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 WebRtcStopRtpDumpCallback stop_rtp_dump_callback_; | 431 WebRtcStopRtpDumpCallback stop_rtp_dump_callback_; |
449 #endif | 432 #endif |
450 | 433 |
451 int worker_ref_count_; | 434 int worker_ref_count_; |
452 | 435 |
453 // Records the time when the process starts surviving for workers for UMA. | 436 // Records the time when the process starts surviving for workers for UMA. |
454 base::TimeTicks survive_for_worker_start_time_; | 437 base::TimeTicks survive_for_worker_start_time_; |
455 | 438 |
456 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; | 439 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; |
457 | 440 |
458 #if defined(OS_MACOSX) | |
459 base::ScopedCFTypeRef<IOSurfaceRef> last_io_surface_; | |
460 #endif | |
461 | |
462 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); | 441 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); |
463 }; | 442 }; |
464 | 443 |
465 } // namespace content | 444 } // namespace content |
466 | 445 |
467 #endif // CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ | 446 #endif // CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ |
OLD | NEW |