| 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_PUBLIC_BROWSER_RENDER_PROCESS_HOST_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_RENDER_PROCESS_HOST_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_RENDER_PROCESS_HOST_H_ | 6 #define CONTENT_PUBLIC_BROWSER_RENDER_PROCESS_HOST_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include <list> | 11 #include <list> |
| 12 | 12 |
| 13 #include "base/id_map.h" | 13 #include "base/id_map.h" |
| 14 #include "base/memory/ptr_util.h" | 14 #include "base/memory/ptr_util.h" |
| 15 #include "base/process/kill.h" | 15 #include "base/process/kill.h" |
| 16 #include "base/process/process_handle.h" | 16 #include "base/process/process_handle.h" |
| 17 #include "base/supports_user_data.h" | 17 #include "base/supports_user_data.h" |
| 18 #include "content/common/content_export.h" | 18 #include "content/common/content_export.h" |
| 19 #include "content/public/common/routed_interface.mojom.h" |
| 19 #include "ipc/ipc_channel_proxy.h" | 20 #include "ipc/ipc_channel_proxy.h" |
| 20 #include "ipc/ipc_sender.h" | 21 #include "ipc/ipc_sender.h" |
| 21 #include "ui/gfx/native_widget_types.h" | 22 #include "ui/gfx/native_widget_types.h" |
| 22 | 23 |
| 23 class GURL; | 24 class GURL; |
| 24 | 25 |
| 25 namespace base { | 26 namespace base { |
| 26 class SharedPersistentMemoryAllocator; | 27 class SharedPersistentMemoryAllocator; |
| 27 class TimeDelta; | 28 class TimeDelta; |
| 28 } | 29 } |
| 29 | 30 |
| 30 namespace media { | 31 namespace media { |
| 31 class AudioOutputController; | 32 class AudioOutputController; |
| 32 class MediaKeys; | 33 class MediaKeys; |
| 33 } | 34 } |
| 34 | 35 |
| 36 namespace mojo { |
| 37 class AssociatedGroup; |
| 38 } |
| 39 |
| 35 namespace shell { | 40 namespace shell { |
| 36 class Connection; | 41 class Connection; |
| 37 class InterfaceProvider; | 42 class InterfaceProvider; |
| 38 } | 43 } |
| 39 | 44 |
| 40 namespace content { | 45 namespace content { |
| 41 class BrowserContext; | 46 class BrowserContext; |
| 42 class BrowserMessageFilter; | 47 class BrowserMessageFilter; |
| 43 class RenderProcessHostObserver; | 48 class RenderProcessHostObserver; |
| 44 class RenderWidgetHost; | 49 class RenderWidgetHost; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 // Gets the next available routing id. | 83 // Gets the next available routing id. |
| 79 virtual int GetNextRoutingID() = 0; | 84 virtual int GetNextRoutingID() = 0; |
| 80 | 85 |
| 81 // These methods add or remove listener for a specific message routing ID. | 86 // These methods add or remove listener for a specific message routing ID. |
| 82 // Used for refcounting, each holder of this object must AddRoute and | 87 // Used for refcounting, each holder of this object must AddRoute and |
| 83 // RemoveRoute. This object should be allocated on the heap; when no | 88 // RemoveRoute. This object should be allocated on the heap; when no |
| 84 // listeners own it any more, it will delete itself. | 89 // listeners own it any more, it will delete itself. |
| 85 virtual void AddRoute(int32_t routing_id, IPC::Listener* listener) = 0; | 90 virtual void AddRoute(int32_t routing_id, IPC::Listener* listener) = 0; |
| 86 virtual void RemoveRoute(int32_t routing_id) = 0; | 91 virtual void RemoveRoute(int32_t routing_id) = 0; |
| 87 | 92 |
| 93 // Adds a mojom::RoutedInterfaceProvider for a specific message routing ID. |
| 94 // |provider| must live at least until RemoveRoute() is called on |
| 95 // |routing_id|. |
| 96 virtual void AddRoutedInterfaces( |
| 97 int32_t routing_id, |
| 98 mojom::RoutedInterfaceProvider* provider) = 0; |
| 99 virtual mojo::AssociatedGroup* GetRoutedInterfaceGroup() = 0; |
| 100 |
| 88 // Add and remove observers for lifecycle events. The order in which | 101 // Add and remove observers for lifecycle events. The order in which |
| 89 // notifications are sent to observers is undefined. Observers must be sure to | 102 // notifications are sent to observers is undefined. Observers must be sure to |
| 90 // remove the observer before they go away. | 103 // remove the observer before they go away. |
| 91 virtual void AddObserver(RenderProcessHostObserver* observer) = 0; | 104 virtual void AddObserver(RenderProcessHostObserver* observer) = 0; |
| 92 virtual void RemoveObserver(RenderProcessHostObserver* observer) = 0; | 105 virtual void RemoveObserver(RenderProcessHostObserver* observer) = 0; |
| 93 | 106 |
| 94 // Called when a received message cannot be decoded. Terminates the renderer. | 107 // Called when a received message cannot be decoded. Terminates the renderer. |
| 95 // Most callers should not call this directly, but instead should call | 108 // Most callers should not call this directly, but instead should call |
| 96 // bad_message::BadMessageReceived() or an equivalent method outside of the | 109 // bad_message::BadMessageReceived() or an equivalent method outside of the |
| 97 // content module. | 110 // content module. |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 virtual void ResumeDeferredNavigation(const GlobalRequestID& request_id) = 0; | 272 virtual void ResumeDeferredNavigation(const GlobalRequestID& request_id) = 0; |
| 260 | 273 |
| 261 // Notifies the renderer that the timezone configuration of the system might | 274 // Notifies the renderer that the timezone configuration of the system might |
| 262 // have changed. | 275 // have changed. |
| 263 virtual void NotifyTimezoneChange(const std::string& zone_id) = 0; | 276 virtual void NotifyTimezoneChange(const std::string& zone_id) = 0; |
| 264 | 277 |
| 265 // Returns the shell::InterfaceProvider the browser process can use to bind | 278 // Returns the shell::InterfaceProvider the browser process can use to bind |
| 266 // interfaces exposed to it from the renderer. | 279 // interfaces exposed to it from the renderer. |
| 267 virtual shell::InterfaceProvider* GetRemoteInterfaces() = 0; | 280 virtual shell::InterfaceProvider* GetRemoteInterfaces() = 0; |
| 268 | 281 |
| 282 // Returns the mojom::RouteProvider the browser process can use to connect |
| 283 // to routed interfaces in the renderer. |
| 284 virtual mojom::RouteProvider* GetRemoteRouteProvider() = 0; |
| 285 |
| 269 // Extracts any persistent-memory-allocator used for renderer metrics. | 286 // Extracts any persistent-memory-allocator used for renderer metrics. |
| 270 // Ownership is passed to the caller. To support sharing of histogram data | 287 // Ownership is passed to the caller. To support sharing of histogram data |
| 271 // between the Renderer and the Browser, the allocator is created when the | 288 // between the Renderer and the Browser, the allocator is created when the |
| 272 // process is created and later retrieved by the SubprocessMetricsProvider | 289 // process is created and later retrieved by the SubprocessMetricsProvider |
| 273 // for management. | 290 // for management. |
| 274 virtual std::unique_ptr<base::SharedPersistentMemoryAllocator> | 291 virtual std::unique_ptr<base::SharedPersistentMemoryAllocator> |
| 275 TakeMetricsAllocator() = 0; | 292 TakeMetricsAllocator() = 0; |
| 276 | 293 |
| 277 // PlzNavigate | 294 // PlzNavigate |
| 278 // Returns the time the first call to Init completed successfully (after a new | 295 // Returns the time the first call to Init completed successfully (after a new |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 static void SetMaxRendererProcessCount(size_t count); | 381 static void SetMaxRendererProcessCount(size_t count); |
| 365 | 382 |
| 366 // Returns the current maximum number of renderer process hosts kept by the | 383 // Returns the current maximum number of renderer process hosts kept by the |
| 367 // content module. | 384 // content module. |
| 368 static size_t GetMaxRendererProcessCount(); | 385 static size_t GetMaxRendererProcessCount(); |
| 369 }; | 386 }; |
| 370 | 387 |
| 371 } // namespace content. | 388 } // namespace content. |
| 372 | 389 |
| 373 #endif // CONTENT_PUBLIC_BROWSER_RENDER_PROCESS_HOST_H_ | 390 #endif // CONTENT_PUBLIC_BROWSER_RENDER_PROCESS_HOST_H_ |
| OLD | NEW |