| 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 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 mojo::InterfaceRequest<mojom::StoragePartitionService> request); | 349 mojo::InterfaceRequest<mojom::StoragePartitionService> request); |
| 350 | 350 |
| 351 // Control message handlers. | 351 // Control message handlers. |
| 352 void OnShutdownRequest(); | 352 void OnShutdownRequest(); |
| 353 void SuddenTerminationChanged(bool enabled); | 353 void SuddenTerminationChanged(bool enabled); |
| 354 void OnUserMetricsRecordAction(const std::string& action); | 354 void OnUserMetricsRecordAction(const std::string& action); |
| 355 void OnCloseACK(int old_route_id); | 355 void OnCloseACK(int old_route_id); |
| 356 | 356 |
| 357 // Generates a command line to be used to spawn a renderer and appends the | 357 // Generates a command line to be used to spawn a renderer and appends the |
| 358 // results to |*command_line|. | 358 // results to |*command_line|. |
| 359 void AppendRendererCommandLine(base::CommandLine* command_line) const; | 359 void AppendRendererCommandLine(base::CommandLine* command_line); |
| 360 | 360 |
| 361 // Copies applicable command line switches from the given |browser_cmd| line | 361 // Copies applicable command line switches from the given |browser_cmd| line |
| 362 // flags to the output |renderer_cmd| line flags. Not all switches will be | 362 // flags to the output |renderer_cmd| line flags. Not all switches will be |
| 363 // copied over. | 363 // copied over. |
| 364 void PropagateBrowserCommandLineToRenderer( | 364 void PropagateBrowserCommandLineToRenderer( |
| 365 const base::CommandLine& browser_cmd, | 365 const base::CommandLine& browser_cmd, |
| 366 base::CommandLine* renderer_cmd) const; | 366 base::CommandLine* renderer_cmd); |
| 367 | 367 |
| 368 // Inspects the current object state and sets/removes background priority if | 368 // Inspects the current object state and sets/removes background priority if |
| 369 // appropriate. Should be called after any of the involved data members | 369 // appropriate. Should be called after any of the involved data members |
| 370 // change. | 370 // change. |
| 371 void UpdateProcessPriority(); | 371 void UpdateProcessPriority(); |
| 372 | 372 |
| 373 // Creates a PersistentMemoryAllocator and shares it with the renderer | 373 // Creates a PersistentMemoryAllocator and shares it with the renderer |
| 374 // process for it to store histograms from that process. The allocator is | 374 // process for it to store histograms from that process. The allocator is |
| 375 // available for extraction by a SubprocesMetricsProvider in order to | 375 // available for extraction by a SubprocesMetricsProvider in order to |
| 376 // report those histograms to UMA. | 376 // report those histograms to UMA. |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 580 // for UMA. | 580 // for UMA. |
| 581 size_t max_worker_count_; | 581 size_t max_worker_count_; |
| 582 | 582 |
| 583 // Context shared for each mojom::PermissionService instance created for this | 583 // Context shared for each mojom::PermissionService instance created for this |
| 584 // RPH. | 584 // RPH. |
| 585 std::unique_ptr<PermissionServiceContext> permission_service_context_; | 585 std::unique_ptr<PermissionServiceContext> permission_service_context_; |
| 586 | 586 |
| 587 // The memory allocator, if any, in which the renderer will write its metrics. | 587 // The memory allocator, if any, in which the renderer will write its metrics. |
| 588 std::unique_ptr<base::SharedPersistentMemoryAllocator> metrics_allocator_; | 588 std::unique_ptr<base::SharedPersistentMemoryAllocator> metrics_allocator_; |
| 589 | 589 |
| 590 // Anonymous shared memory segment to share with subprocess containing list of |
| 591 // field trials (represented as a string). |
| 592 // TODO(lawrencewu): Eventually remove this and use single shared memory |
| 593 // object across processes. |
| 594 std::unique_ptr<base::SharedMemory> field_trial_state_; |
| 595 |
| 590 bool channel_connected_; | 596 bool channel_connected_; |
| 591 bool sent_render_process_ready_; | 597 bool sent_render_process_ready_; |
| 592 | 598 |
| 593 #if defined(OS_ANDROID) | 599 #if defined(OS_ANDROID) |
| 594 // UI thread is the source of sync IPCs and all shutdown signals. | 600 // UI thread is the source of sync IPCs and all shutdown signals. |
| 595 // Therefore a proper shutdown event to unblock the UI thread is not | 601 // Therefore a proper shutdown event to unblock the UI thread is not |
| 596 // possible without massive refactoring shutdown code. | 602 // possible without massive refactoring shutdown code. |
| 597 // Luckily Android never performs a clean shutdown. So explicitly | 603 // Luckily Android never performs a clean shutdown. So explicitly |
| 598 // ignore this problem. | 604 // ignore this problem. |
| 599 base::WaitableEvent never_signaled_; | 605 base::WaitableEvent never_signaled_; |
| 600 #endif | 606 #endif |
| 601 | 607 |
| 602 scoped_refptr<ResourceMessageFilter> resource_message_filter_; | 608 scoped_refptr<ResourceMessageFilter> resource_message_filter_; |
| 603 | 609 |
| 604 mojom::RouteProviderAssociatedPtr remote_route_provider_; | 610 mojom::RouteProviderAssociatedPtr remote_route_provider_; |
| 605 | 611 |
| 606 // A WeakPtrFactory which is reset every time Cleanup() runs. Used to vend | 612 // A WeakPtrFactory which is reset every time Cleanup() runs. Used to vend |
| 607 // WeakPtrs which are invalidated any time the RPHI is recycled. | 613 // WeakPtrs which are invalidated any time the RPHI is recycled. |
| 608 std::unique_ptr<base::WeakPtrFactory<RenderProcessHostImpl>> | 614 std::unique_ptr<base::WeakPtrFactory<RenderProcessHostImpl>> |
| 609 instance_weak_factory_; | 615 instance_weak_factory_; |
| 610 | 616 |
| 611 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; | 617 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; |
| 612 | 618 |
| 613 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); | 619 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); |
| 614 }; | 620 }; |
| 615 | 621 |
| 616 } // namespace content | 622 } // namespace content |
| 617 | 623 |
| 618 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ | 624 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ |
| OLD | NEW |