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 |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 mojo::InterfaceRequest<mojom::StoragePartitionService> request); | 329 mojo::InterfaceRequest<mojom::StoragePartitionService> request); |
330 | 330 |
331 // Control message handlers. | 331 // Control message handlers. |
332 void OnShutdownRequest(); | 332 void OnShutdownRequest(); |
333 void SuddenTerminationChanged(bool enabled); | 333 void SuddenTerminationChanged(bool enabled); |
334 void OnUserMetricsRecordAction(const std::string& action); | 334 void OnUserMetricsRecordAction(const std::string& action); |
335 void OnCloseACK(int old_route_id); | 335 void OnCloseACK(int old_route_id); |
336 | 336 |
337 // Generates a command line to be used to spawn a renderer and appends the | 337 // Generates a command line to be used to spawn a renderer and appends the |
338 // results to |*command_line|. | 338 // results to |*command_line|. |
339 void AppendRendererCommandLine(base::CommandLine* command_line) const; | 339 void AppendRendererCommandLine(base::CommandLine* command_line); |
340 | 340 |
341 // Copies applicable command line switches from the given |browser_cmd| line | 341 // Copies applicable command line switches from the given |browser_cmd| line |
342 // flags to the output |renderer_cmd| line flags. Not all switches will be | 342 // flags to the output |renderer_cmd| line flags. Not all switches will be |
343 // copied over. | 343 // copied over. |
344 void PropagateBrowserCommandLineToRenderer( | 344 void PropagateBrowserCommandLineToRenderer( |
345 const base::CommandLine& browser_cmd, | 345 const base::CommandLine& browser_cmd, |
346 base::CommandLine* renderer_cmd) const; | 346 base::CommandLine* renderer_cmd); |
347 | 347 |
348 // Inspects the current object state and sets/removes background priority if | 348 // Inspects the current object state and sets/removes background priority if |
349 // appropriate. Should be called after any of the involved data members | 349 // appropriate. Should be called after any of the involved data members |
350 // change. | 350 // change. |
351 void UpdateProcessPriority(); | 351 void UpdateProcessPriority(); |
352 | 352 |
353 // Creates a PersistentMemoryAllocator and shares it with the renderer | 353 // Creates a PersistentMemoryAllocator and shares it with the renderer |
354 // process for it to store histograms from that process. The allocator is | 354 // process for it to store histograms from that process. The allocator is |
355 // available for extraction by a SubprocesMetricsProvider in order to | 355 // available for extraction by a SubprocesMetricsProvider in order to |
356 // report those histograms to UMA. | 356 // report those histograms to UMA. |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 // for UMA. | 551 // for UMA. |
552 size_t max_worker_count_; | 552 size_t max_worker_count_; |
553 | 553 |
554 // Context shared for each mojom::PermissionService instance created for this | 554 // Context shared for each mojom::PermissionService instance created for this |
555 // RPH. | 555 // RPH. |
556 std::unique_ptr<PermissionServiceContext> permission_service_context_; | 556 std::unique_ptr<PermissionServiceContext> permission_service_context_; |
557 | 557 |
558 // The memory allocator, if any, in which the renderer will write its metrics. | 558 // The memory allocator, if any, in which the renderer will write its metrics. |
559 std::unique_ptr<base::SharedPersistentMemoryAllocator> metrics_allocator_; | 559 std::unique_ptr<base::SharedPersistentMemoryAllocator> metrics_allocator_; |
560 | 560 |
| 561 // Anonymous shared memory segment to share with subprocess containing list of |
| 562 // field trials (represented as a string). |
| 563 // TODO(crbug.com/653874): Eventually remove this and use single shared memory |
| 564 // object across processes. |
| 565 std::unique_ptr<base::SharedMemory> field_trial_state_; |
| 566 |
561 bool channel_connected_; | 567 bool channel_connected_; |
562 bool sent_render_process_ready_; | 568 bool sent_render_process_ready_; |
563 | 569 |
564 #if defined(OS_ANDROID) | 570 #if defined(OS_ANDROID) |
565 // UI thread is the source of sync IPCs and all shutdown signals. | 571 // UI thread is the source of sync IPCs and all shutdown signals. |
566 // Therefore a proper shutdown event to unblock the UI thread is not | 572 // Therefore a proper shutdown event to unblock the UI thread is not |
567 // possible without massive refactoring shutdown code. | 573 // possible without massive refactoring shutdown code. |
568 // Luckily Android never performs a clean shutdown. So explicitly | 574 // Luckily Android never performs a clean shutdown. So explicitly |
569 // ignore this problem. | 575 // ignore this problem. |
570 base::WaitableEvent never_signaled_; | 576 base::WaitableEvent never_signaled_; |
571 #endif | 577 #endif |
572 | 578 |
573 scoped_refptr<ResourceMessageFilter> resource_message_filter_; | 579 scoped_refptr<ResourceMessageFilter> resource_message_filter_; |
574 | 580 |
575 mojom::RouteProviderAssociatedPtr remote_route_provider_; | 581 mojom::RouteProviderAssociatedPtr remote_route_provider_; |
576 | 582 |
577 // A WeakPtrFactory which is reset every time Cleanup() runs. Used to vend | 583 // A WeakPtrFactory which is reset every time Cleanup() runs. Used to vend |
578 // WeakPtrs which are invalidated any time the RPHI is recycled. | 584 // WeakPtrs which are invalidated any time the RPHI is recycled. |
579 std::unique_ptr<base::WeakPtrFactory<RenderProcessHostImpl>> | 585 std::unique_ptr<base::WeakPtrFactory<RenderProcessHostImpl>> |
580 instance_weak_factory_; | 586 instance_weak_factory_; |
581 | 587 |
582 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; | 588 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; |
583 | 589 |
584 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); | 590 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); |
585 }; | 591 }; |
586 | 592 |
587 } // namespace content | 593 } // namespace content |
588 | 594 |
589 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ | 595 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ |
OLD | NEW |