| 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_RENDER_PROCESS_HOST_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include <map> | 11 #include <map> |
| 12 #include <memory> | 12 #include <memory> |
| 13 #include <queue> | 13 #include <queue> |
| 14 #include <string> | 14 #include <string> |
| 15 | 15 |
| 16 #include "base/macros.h" | 16 #include "base/macros.h" |
| 17 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
| 18 #include "base/observer_list.h" | 18 #include "base/observer_list.h" |
| 19 #include "base/process/process.h" | 19 #include "base/process/process.h" |
| 20 #include "base/single_thread_task_runner.h" | 20 #include "base/single_thread_task_runner.h" |
| 21 #include "base/synchronization/waitable_event.h" | 21 #include "base/synchronization/waitable_event.h" |
| 22 #include "build/build_config.h" | 22 #include "build/build_config.h" |
| 23 #include "content/browser/child_process_launcher.h" | 23 #include "content/browser/child_process_launcher.h" |
| 24 #include "content/browser/dom_storage/session_storage_namespace_impl.h" | 24 #include "content/browser/dom_storage/session_storage_namespace_impl.h" |
| 25 #include "content/browser/power_monitor_message_broadcaster.h" | 25 #include "content/browser/power_monitor_message_broadcaster.h" |
| 26 #include "content/browser/webrtc/webrtc_eventlog_host.h" | 26 #include "content/browser/webrtc/webrtc_eventlog_host.h" |
| 27 #include "content/common/associated_interfaces.mojom.h" | 27 #include "content/common/associated_interfaces.mojom.h" |
| 28 #include "content/common/content_export.h" | 28 #include "content/common/content_export.h" |
| 29 #include "content/common/renderer.mojom.h" |
| 29 #include "content/public/browser/render_process_host.h" | 30 #include "content/public/browser/render_process_host.h" |
| 30 #include "content/public/common/mojo_shell_connection.h" | 31 #include "content/public/common/mojo_shell_connection.h" |
| 31 #include "ipc/ipc_channel_proxy.h" | 32 #include "ipc/ipc_channel_proxy.h" |
| 32 #include "ipc/ipc_platform_file.h" | 33 #include "ipc/ipc_platform_file.h" |
| 33 #include "mojo/public/cpp/bindings/associated_binding.h" | 34 #include "mojo/public/cpp/bindings/associated_binding.h" |
| 34 #include "mojo/public/cpp/bindings/associated_binding_set.h" | 35 #include "mojo/public/cpp/bindings/associated_binding_set.h" |
| 35 #include "mojo/public/cpp/bindings/interface_ptr.h" | 36 #include "mojo/public/cpp/bindings/interface_ptr.h" |
| 36 #include "services/shell/public/cpp/interface_registry.h" | 37 #include "services/shell/public/cpp/interface_registry.h" |
| 37 #include "services/shell/public/interfaces/service.mojom.h" | 38 #include "services/shell/public/interfaces/service.mojom.h" |
| 38 #include "ui/gfx/gpu_memory_buffer.h" | 39 #include "ui/gfx/gpu_memory_buffer.h" |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 bool IsProcessBackgrounded() const override; | 180 bool IsProcessBackgrounded() const override; |
| 180 void IncrementServiceWorkerRefCount() override; | 181 void IncrementServiceWorkerRefCount() override; |
| 181 void DecrementServiceWorkerRefCount() override; | 182 void DecrementServiceWorkerRefCount() override; |
| 182 void IncrementSharedWorkerRefCount() override; | 183 void IncrementSharedWorkerRefCount() override; |
| 183 void DecrementSharedWorkerRefCount() override; | 184 void DecrementSharedWorkerRefCount() override; |
| 184 void ForceReleaseWorkerRefCounts() override; | 185 void ForceReleaseWorkerRefCounts() override; |
| 185 bool IsWorkerRefCountDisabled() override; | 186 bool IsWorkerRefCountDisabled() override; |
| 186 void PurgeAndSuspend() override; | 187 void PurgeAndSuspend() override; |
| 187 | 188 |
| 188 mojom::RouteProvider* GetRemoteRouteProvider(); | 189 mojom::RouteProvider* GetRemoteRouteProvider(); |
| 190 mojom::Renderer* GetRendererInterface(); |
| 189 | 191 |
| 190 // IPC::Sender via RenderProcessHost. | 192 // IPC::Sender via RenderProcessHost. |
| 191 bool Send(IPC::Message* msg) override; | 193 bool Send(IPC::Message* msg) override; |
| 192 | 194 |
| 193 // IPC::Listener via RenderProcessHost. | 195 // IPC::Listener via RenderProcessHost. |
| 194 bool OnMessageReceived(const IPC::Message& msg) override; | 196 bool OnMessageReceived(const IPC::Message& msg) override; |
| 195 void OnChannelConnected(int32_t peer_pid) override; | 197 void OnChannelConnected(int32_t peer_pid) override; |
| 196 void OnChannelError() override; | 198 void OnChannelError() override; |
| 197 void OnBadMessageReceived(const IPC::Message& message) override; | 199 void OnBadMessageReceived(const IPC::Message& message) override; |
| 198 | 200 |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 595 // Therefore a proper shutdown event to unblock the UI thread is not | 597 // Therefore a proper shutdown event to unblock the UI thread is not |
| 596 // possible without massive refactoring shutdown code. | 598 // possible without massive refactoring shutdown code. |
| 597 // Luckily Android never performs a clean shutdown. So explicitly | 599 // Luckily Android never performs a clean shutdown. So explicitly |
| 598 // ignore this problem. | 600 // ignore this problem. |
| 599 base::WaitableEvent never_signaled_; | 601 base::WaitableEvent never_signaled_; |
| 600 #endif | 602 #endif |
| 601 | 603 |
| 602 scoped_refptr<ResourceMessageFilter> resource_message_filter_; | 604 scoped_refptr<ResourceMessageFilter> resource_message_filter_; |
| 603 | 605 |
| 604 mojom::RouteProviderAssociatedPtr remote_route_provider_; | 606 mojom::RouteProviderAssociatedPtr remote_route_provider_; |
| 607 mojom::RendererAssociatedPtr renderer_interface_; |
| 605 | 608 |
| 606 // A WeakPtrFactory which is reset every time Cleanup() runs. Used to vend | 609 // A WeakPtrFactory which is reset every time Cleanup() runs. Used to vend |
| 607 // WeakPtrs which are invalidated any time the RPHI is recycled. | 610 // WeakPtrs which are invalidated any time the RPHI is recycled. |
| 608 std::unique_ptr<base::WeakPtrFactory<RenderProcessHostImpl>> | 611 std::unique_ptr<base::WeakPtrFactory<RenderProcessHostImpl>> |
| 609 instance_weak_factory_; | 612 instance_weak_factory_; |
| 610 | 613 |
| 611 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; | 614 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; |
| 612 | 615 |
| 613 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); | 616 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); |
| 614 }; | 617 }; |
| 615 | 618 |
| 616 } // namespace content | 619 } // namespace content |
| 617 | 620 |
| 618 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ | 621 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ |
| OLD | NEW |