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/callback_forward.h" |
13 #include "base/id_map.h" | 14 #include "base/id_map.h" |
14 #include "base/memory/ptr_util.h" | 15 #include "base/memory/ptr_util.h" |
15 #include "base/process/kill.h" | 16 #include "base/process/kill.h" |
16 #include "base/process/process_handle.h" | 17 #include "base/process/process_handle.h" |
17 #include "base/supports_user_data.h" | 18 #include "base/supports_user_data.h" |
18 #include "content/common/content_export.h" | 19 #include "content/common/content_export.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" |
| 22 #include "mojo/public/cpp/bindings/interface_request.h" |
21 #include "ui/gfx/native_widget_types.h" | 23 #include "ui/gfx/native_widget_types.h" |
22 | 24 |
23 class GURL; | 25 class GURL; |
24 | 26 |
25 namespace base { | 27 namespace base { |
26 class SharedPersistentMemoryAllocator; | 28 class SharedPersistentMemoryAllocator; |
27 class TimeDelta; | 29 class TimeDelta; |
28 } | 30 } |
29 | 31 |
30 namespace media { | 32 namespace media { |
31 class AudioOutputController; | 33 class AudioOutputController; |
32 class MediaKeys; | 34 class MediaKeys; |
33 } | 35 } |
34 | 36 |
35 namespace service_manager { | 37 namespace service_manager { |
36 class Connection; | 38 class Connection; |
37 class InterfaceProvider; | 39 class InterfaceProvider; |
38 } | 40 } |
39 | 41 |
40 namespace content { | 42 namespace content { |
41 class BrowserContext; | 43 class BrowserContext; |
42 class BrowserMessageFilter; | 44 class BrowserMessageFilter; |
43 class RenderProcessHostObserver; | 45 class RenderProcessHostObserver; |
44 class RenderWidgetHost; | 46 class RenderWidgetHost; |
45 class StoragePartition; | 47 class StoragePartition; |
46 struct GlobalRequestID; | 48 struct GlobalRequestID; |
47 | 49 |
48 namespace mojom { | 50 namespace mojom { |
49 class Renderer; | 51 class Renderer; |
| 52 class URLLoaderFactory; |
50 } | 53 } |
51 | 54 |
52 // Interface that represents the browser side of the browser <-> renderer | 55 // Interface that represents the browser side of the browser <-> renderer |
53 // communication channel. There will generally be one RenderProcessHost per | 56 // communication channel. There will generally be one RenderProcessHost per |
54 // renderer process. | 57 // renderer process. |
55 class CONTENT_EXPORT RenderProcessHost : public IPC::Sender, | 58 class CONTENT_EXPORT RenderProcessHost : public IPC::Sender, |
56 public IPC::Listener, | 59 public IPC::Listener, |
57 public base::SupportsUserData { | 60 public base::SupportsUserData { |
58 public: | 61 public: |
59 typedef IDMap<RenderProcessHost>::iterator iterator; | 62 typedef IDMap<RenderProcessHost>::iterator iterator; |
| 63 using MojoURLLoaderFactoryGetter = |
| 64 base::Callback<void(mojo::InterfaceRequest<mojom::URLLoaderFactory>)>; |
60 | 65 |
61 // Details for RENDERER_PROCESS_CLOSED notifications. | 66 // Details for RENDERER_PROCESS_CLOSED notifications. |
62 struct RendererClosedDetails { | 67 struct RendererClosedDetails { |
63 RendererClosedDetails(base::TerminationStatus status, | 68 RendererClosedDetails(base::TerminationStatus status, |
64 int exit_code) { | 69 int exit_code) { |
65 this->status = status; | 70 this->status = status; |
66 this->exit_code = exit_code; | 71 this->exit_code = exit_code; |
67 } | 72 } |
68 base::TerminationStatus status; | 73 base::TerminationStatus status; |
69 int exit_code; | 74 int exit_code; |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 virtual bool IsWorkerRefCountDisabled() = 0; | 329 virtual bool IsWorkerRefCountDisabled() = 0; |
325 | 330 |
326 // Purges and suspends the renderer process. | 331 // Purges and suspends the renderer process. |
327 virtual void PurgeAndSuspend() = 0; | 332 virtual void PurgeAndSuspend() = 0; |
328 | 333 |
329 // Acquires the |mojom::Renderer| interface to the render process. This is for | 334 // Acquires the |mojom::Renderer| interface to the render process. This is for |
330 // internal use only, and is only exposed here to support | 335 // internal use only, and is only exposed here to support |
331 // MockRenderProcessHost usage in tests. | 336 // MockRenderProcessHost usage in tests. |
332 virtual mojom::Renderer* GetRendererInterface() = 0; | 337 virtual mojom::Renderer* GetRendererInterface() = 0; |
333 | 338 |
| 339 // Creates a MojoURLLoaderFactoryGetter associated with the process. |
| 340 virtual MojoURLLoaderFactoryGetter CreateURLLoaderFactoryGetter() = 0; |
| 341 |
334 // Returns the current number of active views in this process. Excludes | 342 // Returns the current number of active views in this process. Excludes |
335 // any RenderViewHosts that are swapped out. | 343 // any RenderViewHosts that are swapped out. |
336 size_t GetActiveViewCount(); | 344 size_t GetActiveViewCount(); |
337 | 345 |
338 // Static management functions ----------------------------------------------- | 346 // Static management functions ----------------------------------------------- |
339 | 347 |
340 // Flag to run the renderer in process. This is primarily | 348 // Flag to run the renderer in process. This is primarily |
341 // for debugging purposes. When running "in process", the | 349 // for debugging purposes. When running "in process", the |
342 // browser maintains a single RenderProcessHost which communicates | 350 // browser maintains a single RenderProcessHost which communicates |
343 // to a RenderProcess which is instantiated in the same process | 351 // to a RenderProcess which is instantiated in the same process |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 static void SetMaxRendererProcessCount(size_t count); | 394 static void SetMaxRendererProcessCount(size_t count); |
387 | 395 |
388 // Returns the current maximum number of renderer process hosts kept by the | 396 // Returns the current maximum number of renderer process hosts kept by the |
389 // content module. | 397 // content module. |
390 static size_t GetMaxRendererProcessCount(); | 398 static size_t GetMaxRendererProcessCount(); |
391 }; | 399 }; |
392 | 400 |
393 } // namespace content. | 401 } // namespace content. |
394 | 402 |
395 #endif // CONTENT_PUBLIC_BROWSER_RENDER_PROCESS_HOST_H_ | 403 #endif // CONTENT_PUBLIC_BROWSER_RENDER_PROCESS_HOST_H_ |
OLD | NEW |